Save This Page
Home » jcommon-1.0.13 » org.jfree » chart » title » [javadoc | source]
org.jfree.chart.title
abstract public class: Title [javadoc | source]
java.lang.Object
   org.jfree.chart.block.AbstractBlock
      org.jfree.chart.title.Title

All Implemented Interfaces:
    Cloneable, Serializable, Block

Direct Known Subclasses:
    TextTitle, ImageTitle, CompositeTitle, ShortTextTitle, PaintScaleLegend, LegendTitle, DateTitle

The base class for all chart titles. A chart can have multiple titles, appearing at the top, bottom, left or right of the chart.

Concrete implementations of this class will render text and images, and hence do the actual work of drawing titles.
Field Summary
public static final  RectangleEdge DEFAULT_POSITION    The default title position. 
public static final  HorizontalAlignment DEFAULT_HORIZONTAL_ALIGNMENT    The default horizontal alignment. 
public static final  VerticalAlignment DEFAULT_VERTICAL_ALIGNMENT    The default vertical alignment. 
public static final  RectangleInsets DEFAULT_PADDING    Default title padding. 
Constructor:
 protected Title() 
 protected Title(RectangleEdge position,
    HorizontalAlignment horizontalAlignment,
    VerticalAlignment verticalAlignment) 
    Creates a new title, using default attributes where necessary.
    Parameters:
    position - the position of the title (null not permitted).
    horizontalAlignment - the horizontal alignment of the title (null not permitted).
    verticalAlignment - the vertical alignment of the title (null not permitted).
 protected Title(RectangleEdge position,
    HorizontalAlignment horizontalAlignment,
    VerticalAlignment verticalAlignment,
    RectangleInsets padding) 
    Creates a new title.
    Parameters:
    position - the position of the title (null not permitted).
    horizontalAlignment - the horizontal alignment of the title (LEFT, CENTER or RIGHT, null not permitted).
    verticalAlignment - the vertical alignment of the title (TOP, MIDDLE or BOTTOM, null not permitted).
    padding - the amount of space to leave around the outside of the title (null not permitted).
Method from org.jfree.chart.title.Title Summary:
addChangeListener,   clone,   draw,   equals,   getHorizontalAlignment,   getNotify,   getPosition,   getVerticalAlignment,   hashCode,   notifyListeners,   removeChangeListener,   setHorizontalAlignment,   setNotify,   setPosition,   setVerticalAlignment
Methods from org.jfree.chart.block.AbstractBlock:
arrange,   arrange,   calculateTotalHeight,   calculateTotalWidth,   clone,   drawBorder,   equals,   getBorder,   getBounds,   getContentXOffset,   getContentYOffset,   getFrame,   getHeight,   getID,   getMargin,   getPadding,   getWidth,   setBorder,   setBorder,   setBounds,   setFrame,   setHeight,   setID,   setMargin,   setMargin,   setPadding,   setPadding,   setWidth,   toContentConstraint,   trimBorder,   trimMargin,   trimPadding,   trimToContentHeight,   trimToContentWidth
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jfree.chart.title.Title Detail:
 public  void addChangeListener(TitleChangeListener listener) 
    Registers an object for notification of changes to the title.
 public Object clone() throws CloneNotSupportedException 
    Returns a clone of the title.

    One situation when this is useful is when editing the title properties - you can edit a clone, and then it is easier to cancel the changes if necessary.

 abstract public  void draw(Graphics2D g2,
    Rectangle2D area)
    Draws the title on a Java 2D graphics device (such as the screen or a printer).
 public boolean equals(Object obj) 
    Tests an object for equality with this title.
 public HorizontalAlignment getHorizontalAlignment() 
    Returns the horizontal alignment of the title.
 public boolean getNotify() 
    Returns the flag that indicates whether or not the notification mechanism is enabled.
 public RectangleEdge getPosition() 
    Returns the position of the title.
 public VerticalAlignment getVerticalAlignment() 
    Returns the vertical alignment of the title.
 public int hashCode() 
    Returns a hashcode for the title.
 protected  void notifyListeners(TitleChangeEvent event) 
    Notifies all registered listeners that the chart title has changed in some way.
 public  void removeChangeListener(TitleChangeListener listener) 
    Unregisters an object for notification of changes to the chart title.
 public  void setHorizontalAlignment(HorizontalAlignment alignment) 
    Sets the horizontal alignment for the title and sends a TitleChangeEvent to all registered listeners.
 public  void setNotify(boolean flag) 
    Sets the flag that indicates whether or not the notification mechanism is enabled. There are certain situations (such as cloning) where you want to turn notification off temporarily.
 public  void setPosition(RectangleEdge position) 
    Sets the position for the title and sends a TitleChangeEvent to all registered listeners.
 public  void setVerticalAlignment(VerticalAlignment alignment) 
    Sets the vertical alignment for the title, and notifies any registered listeners of the change.