|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jfree.data.Series
Base class representing a data series. Subclasses are left to implement the actual data structures.
The series has two properties ("Name" and "Description") for which you can register a PropertyChangeListener.
You can also register a SeriesChangeListener to receive notification of changes to the series data.
Constructor Summary | |
protected |
Series(java.lang.String name)
Constructs a series. |
protected |
Series(java.lang.String name,
java.lang.String description)
Constructs a series. |
Method Summary | |
void |
addChangeListener(SeriesChangeListener listener)
Registers an object with this series, to receive notification whenever the series changes. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a property change listener to the series. |
java.lang.Object |
clone()
Returns a clone of the series. |
protected void |
firePropertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
Fires a property change event. |
void |
fireSeriesChanged()
General method for signalling to registered listeners that the series has been changed. |
java.lang.String |
getDescription()
Returns a description of the series. |
java.lang.String |
getName()
Returns the name of the series. |
protected void |
notifyListeners(SeriesChangeEvent event)
Sends a change event to all registered listeners. |
void |
removeChangeListener(SeriesChangeListener listener)
Deregisters an object, so that it not longer receives notification whenever the series changes. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a property change listener from the series. |
void |
setDescription(java.lang.String description)
Sets the description of the series. |
void |
setName(java.lang.String name)
Sets the name of the series. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected Series(java.lang.String name)
name
- The series name.protected Series(java.lang.String name, java.lang.String description)
name
- the series name.description
- the series description (null
permitted).Method Detail |
public java.lang.String getName()
public void setName(java.lang.String name)
name
- the name.public java.lang.String getDescription()
null
).public void setDescription(java.lang.String description)
description
- the description (null
permitted).public java.lang.Object clone()
Notes: 1. No need to clone the name or description, since String object is immutable. 2. We set the listener list to empty, since the listeners did not register with the clone. 3. Same applies to the PropertyChangeSupport instance.
clone
in class java.lang.Object
public void addChangeListener(SeriesChangeListener listener)
Objects being registered must implement the SeriesChangeListener interface.
listener
- The object to register.public void removeChangeListener(SeriesChangeListener listener)
Call this method when an object no longer needs to be notified of changes to the series.
listener
- The object to deregister.public void fireSeriesChanged()
protected void notifyListeners(SeriesChangeEvent event)
event
- Contains information about the event that triggered the notification.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener.protected void firePropertyChange(java.lang.String property, java.lang.Object oldValue, java.lang.Object newValue)
property
- the property key.oldValue
- the old value.newValue
- the new value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |