Package info.monitorenter.gui.chart
Class IAxis.AxisTitle
- java.lang.Object
-
- info.monitorenter.gui.chart.IAxis.AxisTitle
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Enclosing interface:
- IAxis<T extends IAxisScalePolicy>
public static final class IAxis.AxisTitle extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableRepresents a title of an axis.- Since:
- 3.0.0
- Version:
- $Revision: 1.39 $
- Author:
- Achim Westermann
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROPERTY_TITLEConstant for aof the title font.PropertyChangeEventstatic java.lang.StringPROPERTY_TITLECOLORConstant for aof the title font.PropertyChangeEventstatic java.lang.StringPROPERTY_TITLEFONTConstant for aof the title font.PropertyChangeEventstatic java.lang.StringPROPERTY_TITLEPAINTERConstant for aof the title font.PropertyChangeEvent
-
Constructor Summary
Constructors Constructor Description AxisTitle(java.lang.String title)Creates an instance with the given title backed by a.AxisTitlePainterDefaultAxisTitle(java.lang.String title, IAxisTitlePainter painter)Creates an instance with the given title backed by the given painter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)Add a listener for the given property.protected java.lang.Objectclone()intgetHeight(IAxis<?> axis, java.awt.Graphics2D g2d)Returns the height of this axis title in px with respect to the current title of the given axis.java.beans.PropertyChangeListener[]getPropertyChangeListeners(java.lang.String propertyName)Returns an array of all the listeners that were added to the this instance withaddPropertyChangeListener(String, PropertyChangeListener).java.lang.StringgetTitle()Returns the title ornullif there was no title configured before.java.awt.ColorgetTitleColor()Returns the color used for painting the title.java.awt.FontgetTitleFont()Returns the optional font used for painting the title or null if not configured.IAxisTitlePaintergetTitlePainter()Returns the titlePainter.intgetWidth(IAxis<?> axis, java.awt.Graphics2D g2d)Returns the width of this axis title in px with respect to the current title of the given axis.voidremovePropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener listener)Remove a PropertyChangeListener for a specific property.java.lang.StringsetTitle(java.lang.String title)Sets the title ornullif there should be no title.voidsetTitleColor(java.awt.Color color)Sets the title color to use.voidsetTitleFont(java.awt.Font font)Sets the optional title font to use.IAxisTitlePaintersetTitlePainter(IAxisTitlePainter titlePainter)Sets the titlePainter.
-
-
-
Field Detail
-
PROPERTY_TITLE
public static final java.lang.String PROPERTY_TITLE
Constant for aof the title font.PropertyChangeEvent- See Also:
- Constant Field Values
-
PROPERTY_TITLECOLOR
public static final java.lang.String PROPERTY_TITLECOLOR
Constant for aof the title font.PropertyChangeEvent- See Also:
- Constant Field Values
-
PROPERTY_TITLEFONT
public static final java.lang.String PROPERTY_TITLEFONT
Constant for aof the title font.PropertyChangeEvent- See Also:
- Constant Field Values
-
PROPERTY_TITLEPAINTER
public static final java.lang.String PROPERTY_TITLEPAINTER
Constant for aof the title font.PropertyChangeEvent- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AxisTitle
public AxisTitle(java.lang.String title)
Creates an instance with the given title backed by a.AxisTitlePainterDefault- Parameters:
title- the title to use.
-
AxisTitle
public AxisTitle(java.lang.String title, IAxisTitlePainter painter)Creates an instance with the given title backed by the given painter.- Parameters:
title- the title to use.painter- the painter to use.
-
-
Method Detail
-
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)Add a listener for the given property.The following
types should be fired to listeners:PropertyChangeEvent
getPropertyName()getSource()getOldValue()getNewValue()PROPERTY_TITLEthat changedIAxis.AxisTitle, the old value.String, the new value.StringPROPERTY_TITLEFONTthat changedIAxis.AxisTitle, the old value.Font, the new value.FontPROPERTY_TITLEPAINTERthat changedIAxis.AxisTitle, the old value.IAxisTitlePainter, the new value.IAxisTitlePainterPROPERTY_TITLECOLORthat changedIAxis.AxisTitle, the old value.Color, the new value.Color- Parameters:
propertyName- the property to be informed about changes.listener- the listener that will be informed.
-
clone
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException- See Also:
Object.clone()
-
getHeight
public int getHeight(IAxis<?> axis, java.awt.Graphics2D g2d)
Returns the height of this axis title in px with respect to the current title of the given axis.- Parameters:
axis- the instance this title painter is working for.g2d- needed for size informations (e.g. font widths).- Returns:
- the height of this axis title in px with respect to the current title of the given axis.
-
getPropertyChangeListeners
public java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String propertyName)
Returns an array of all the listeners that were added to the this instance withaddPropertyChangeListener(String, PropertyChangeListener).- Parameters:
propertyName- The name of the property being listened to.- Returns:
- an array of all the listeners that were added to the this
instance with
addPropertyChangeListener(String, PropertyChangeListener). - See Also:
PropertyChangeSupport.getPropertyChangeListeners(java.lang.String)
-
getTitle
public final java.lang.String getTitle()
Returns the title ornullif there was no title configured before.- Returns:
- the title or
nullif there was no title configured before.
-
getTitleColor
public java.awt.Color getTitleColor()
Returns the color used for painting the title.Default is
.Color.BLACK- Returns:
- the color used for painting the title.
-
getTitleFont
public java.awt.Font getTitleFont()
Returns the optional font used for painting the title or null if not configured.- Returns:
- the font used for painting the title or null if not configured.
-
getTitlePainter
public final IAxisTitlePainter getTitlePainter()
Returns the titlePainter.- Returns:
- the titlePainter
-
getWidth
public int getWidth(IAxis<?> axis, java.awt.Graphics2D g2d)
Returns the width of this axis title in px with respect to the current title of the given axis.- Parameters:
axis- the instance this title painter is working for.g2d- needed for size informations (e.g. font widths).- Returns:
- the width of this axis title in px with respect to the current title of the given axis.
-
removePropertyChangeListener
public void removePropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener listener)Remove a PropertyChangeListener for a specific property. Iflistenerwas added more than once to the same event source for the specified property, it will be notified one less time after being removed. IfpropertyNameis null, no exception is thrown and no action is taken. Iflisteneris null, or was never added for the specified property, no exception is thrown and no action is taken.- Parameters:
property- The name of the property that was listened on.listener- The PropertyChangeListener to be removed.- See Also:
PropertyChangeSupport.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)
-
setTitle
public final java.lang.String setTitle(java.lang.String title)
Sets the title ornullif there should be no title.- Parameters:
title- the title ornullif no title should be used.- Returns:
- the previous title or null if there was none before.
-
setTitleColor
public void setTitleColor(java.awt.Color color)
Sets the title color to use.Default is
.Color.BLACK- Parameters:
color- the color to use for the title.
-
setTitleFont
public void setTitleFont(java.awt.Font font)
Sets the optional title font to use.- Parameters:
font- the font to use for the title.
-
setTitlePainter
public final IAxisTitlePainter setTitlePainter(IAxisTitlePainter titlePainter)
Sets the titlePainter.- Parameters:
titlePainter- the titlePainter to set.- Returns:
- the previous title painter or null if there was none before.
-
-