com.ijchart.xychart.title
Class LegendTitle

java.lang.Object
  extended by com.ijchart.xychart.title.AbstractTitle
      extended by com.ijchart.xychart.title.LegendTitle
All Implemented Interfaces:
ITitle, java.io.Serializable, java.lang.Cloneable

public class LegendTitle
extends AbstractTitle
implements java.lang.Cloneable, java.io.Serializable

Title: IJChart

Description: a chart library for the Java(tm) platform.

A chart title that displays a legend for the data in the chart.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ijchart.xychart.title.AbstractTitle
DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_PAINT, DEFAULT_BORDER_VISIBLE, DEFAULT_FILL_BACKGROUND, DEFAULT_HORIZONTAL_ALIGNMENT, DEFAULT_NOTIFY, DEFAULT_PADDING, DEFAULT_TITLE_POSITION, DEFAULT_VERTICAL_ALIGNMENT
 
Constructor Summary
LegendTitle(java.util.Collection renders)
           Constructor.
 
Method Summary
 java.lang.Object clone()
           Creates and returns a copy of this object.
 Rectangle draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D chartArea, ChartShapeCollection shapeCollection)
           Draw the title on chart area(chartArea).All title shape is stored in shapeCollection.
 boolean equals(java.lang.Object obj)
           Indicates whether some other object is "equal to" this one.
 java.util.Collection getRenders()
           Returns the collection of renders.
 int hashCode()
           Returns a hash code value for the object.
 void setRenders(java.util.Collection renders)
           Sets the collection of renders,and sends a TitleChangeEvent to all registered listeners.
 void setToolTipText(java.lang.String tooltip)
           .
 void setURLText(java.lang.String url)
           Sets the URL text to the specified text and sends a TitleChangeEvent to all registered listeners.
 
Methods inherited from class com.ijchart.xychart.title.AbstractTitle
addChangeListener, fireTitleChanged, getBackgroundAlpha, getBackgroundPaint, getBorderPaint, getBorderStroke, getHorizontalAlignment, getNotify, getPadding, getPosition, getToolTipText, getURLText, getVerticalAlignment, hasListener, isBorderVisible, isFillBackground, notifyListeners, removeAllChangeListener, removeChangeListener, setBackgroundAlpha, setBackgroundPaint, setBorderPaint, setBorderStroke, setBorderVisible, setFillBackground, setHorizontalAlignment, setNotify, setPadding, setPosition, setVerticalAlignment
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LegendTitle

public LegendTitle(java.util.Collection renders)
Constructor.

Parameters:
renders - Collection The collection of renders,all elements in this collection is AbstractRender (null not permitted).
Method Detail

getRenders

public java.util.Collection getRenders()
Returns the collection of renders.

Returns:
Collection The collection of renders (never null).

setRenders

public void setRenders(java.util.Collection renders)
Sets the collection of renders,and sends a TitleChangeEvent to all registered listeners.

Parameters:
renders - Collection The collection of renders,all elements in this collection is AbstractRender (null not permitted).

setToolTipText

public void setToolTipText(java.lang.String tooltip)
.

Overrides:
setToolTipText in class AbstractTitle
Parameters:
tooltip - String The text (null permitted).

setURLText

public void setURLText(java.lang.String url)
Sets the URL text to the specified text and sends a TitleChangeEvent to all registered listeners.

Overrides:
setURLText in class AbstractTitle
Parameters:
url - String The URL string (null permitted).

draw

public Rectangle draw(java.awt.Graphics2D g2,
                      java.awt.geom.Rectangle2D chartArea,
                      ChartShapeCollection shapeCollection)
Draw the title on chart area(chartArea).All title shape is stored in shapeCollection.

Specified by:
draw in interface ITitle
Parameters:
g2 - Graphics2D The graphics device (null not permitted).
chartArea - Rectangle2D The area within which the chart should be drawn.
shapeCollection - ChartShapeCollection Collects information about the plot (null permitted).
Returns:
Rectangle The area within which the title should be drawn.

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class AbstractTitle
Returns:
int A hash code value for this object.

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class AbstractTitle
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.

Overrides:
clone in class AbstractTitle
Returns:
object a clone of this instance.
Throws:
java.lang.CloneNotSupportedException - if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.