|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iglu.polka.GraphData2D
A collection of data for a two-dimensional graph. Describes how the data should be drawn and stores the data itself. This class is synchronized across methods that change or access the data points.
Field Summary | |
private java.awt.Color |
color
The color of this line on the graph |
private java.util.LinkedList |
dataChangeListeners
The data to be drawn. |
private boolean |
drawIcons
Size of the icon. |
private boolean |
drawLabels
Should the point labels be drawn. |
private boolean |
drawLines
Should lines be drawn between the points. |
private java.awt.Font |
labelFont
What font to use. |
private java.util.Hashtable |
labels
The labels to draw. |
private java.util.TreeSet |
points
The points on the graph. |
Constructor Summary | |
GraphData2D()
Creates new GraphData2D |
Method Summary | |
void |
addDataChangeListener(DataChangeListener dcl)
Add a listener to fire when the line is changed. |
void |
addPoint(double x,
double y)
Add a point |
void |
addPoint(double x,
double y,
java.lang.String label)
Add a point |
void |
addPoint(java.awt.geom.Point2D.Double point)
Add a point to the graph. |
void |
addPoint(java.awt.geom.Point2D.Double point,
java.lang.String label)
Add a point and associate it with the given label. |
void |
clearAllPoints()
Clears all points in the line, but keeps all line drawing information. |
void |
clearDataChangeListeners()
|
OrderedPoint2D |
closestPoint(double x,
double y)
returns the closest point according to the virtual (not screen) coordinates |
void |
fireDataChange()
Call the listeners because the data was changed. |
java.awt.Color |
getColor()
The color of the line |
boolean |
getDrawIcons()
Should the icons be drawn? |
boolean |
getDrawLabels()
Should the line labels be drawn? |
boolean |
getDrawLines()
Should lines be drawn between the points? |
java.lang.String |
getLabelFor(OrderedPoint2D point)
Get a label for the given point. |
java.util.Iterator |
pointIterator()
Get an iterator over the points. |
void |
setColor(java.awt.Color c)
The color of the line |
void |
setDrawIcons(boolean drawIcons)
Should the icons be drawn. |
void |
setDrawLabels(boolean drawLabels)
Sets whether the labels are drawn. |
void |
setDrawLines(boolean drawLines)
Sets whether the lines are drawn. |
void |
setLableFont(java.awt.Font newFont)
Set the font to use to draw labels. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.LinkedList dataChangeListeners
private boolean drawLines
private java.util.Hashtable labels
private java.awt.Font labelFont
private boolean drawLabels
private boolean drawIcons
private java.util.TreeSet points
private java.awt.Color color
Constructor Detail |
public GraphData2D()
Method Detail |
public void setLableFont(java.awt.Font newFont)
newFont
- public void addPoint(java.awt.geom.Point2D.Double point)
point
- public void addPoint(java.awt.geom.Point2D.Double point, java.lang.String label)
point
- label
- public void addPoint(double x, double y)
public void addPoint(double x, double y, java.lang.String label)
public void clearAllPoints()
public void setColor(java.awt.Color c)
c
- a Color
valuepublic java.awt.Color getColor()
Color
valuepublic void setDrawLines(boolean drawLines)
drawLines
- public boolean getDrawLines()
public void setDrawIcons(boolean drawIcons)
public boolean getDrawIcons()
public void setDrawLabels(boolean drawLabels)
public boolean getDrawLabels()
public java.util.Iterator pointIterator()
public java.lang.String getLabelFor(OrderedPoint2D point)
point
- public OrderedPoint2D closestPoint(double x, double y)
public void addDataChangeListener(DataChangeListener dcl)
dcl
- public void clearDataChangeListeners()
public void fireDataChange()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |