JIDE 3.5.15

com.jidesoft.chart.model
Class ChartPoint

java.lang.Object
  extended by com.jidesoft.chart.model.ChartPoint
All Implemented Interfaces:
Chartable, Highlightable, Nameable, Named, Comparable<Chartable>
Direct Known Subclasses:
ChartPoint3D, ModelMorpher.TransitionPoint, TransposingChartPoint

public class ChartPoint
extends Object
implements Chartable, Nameable, Highlightable

A chart point in user/domain coordinates. A ChartPoint can have a highlight associated with it. A highlight is a semantic tag that may be interpreted by a view component and may affect the rendering.

Author:
swhite@catalysoft.com

Constructor Summary
ChartPoint()
          Creates a ChartPoint with x and y coordinates of 0.
ChartPoint(ChartPoint source)
          A copy constructor that creates a new ChartPoint instance from an existing ChartPoint.
ChartPoint(double x, double y)
          Creates a ChartPoint with the supplied x and y coordinates
ChartPoint(double x, double y, Highlight h)
          Creates a ChartPoint with the supplied x and y coordinates and with the supplied Highlight
ChartPoint(double x, Positionable y)
          Creates a ChartPoint using the supplied double as the x coordinate and the Positionable as the y coordinate.
ChartPoint(double x, Positionable y, Highlight h)
          Creates a ChartPoint using the supplied double for the x coordinate, and the Positionable value for the y coordinate, and also applying the supplied Highlight
ChartPoint(Positionable x, double y)
          Creates a ChartPoint using the supplied Positionable object for the x coordinate, and the double value for the y coordinate
ChartPoint(Positionable x, double y, Highlight h)
          Creates a ChartPoint using the supplied Positionable object for the x coordinate, and the double value for the y coordinate, and also applying the supplied Highlight
ChartPoint(Positionable x, Positionable y)
          Creates a ChartPoint using the supplied Positionable objects to determine the x and y coordinates
ChartPoint(Positionable x, Positionable y, Highlight h)
          Creates a ChartPoint using the supplied Positionables as the x and y coordinates, and applying the supplied Highlight
 
Method Summary
 int compareTo(Chartable other)
          Compares this chart point instance to another instance.
 boolean equals(Object obj)
           
 Highlight getHighlight()
          Returns the highlight applied to this chart point, if any
 String getName()
          Returns the name of the ChartPoint instance
 Positionable getX()
          Gets the x coordinate of the Chartable object
 Positionable getY()
          Gets the y coordinate of the Chartable object
 int hashCode()
           
 boolean isHighlight(Highlight h)
          Is the highlight for this chart point the same as the supplied highlight? If the supplied highlight is null, this always returns false.
 void setHighlight(Highlight h)
          Sets the highlight associated with this chart point, if any
 void setName(String name)
          Specifies the name of the ChartPoint instance
 void setX(Positionable xPos)
          Sets the x coordinate
 void setY(Positionable yPos)
          Sets the y coordinate
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChartPoint

public ChartPoint()
Creates a ChartPoint with x and y coordinates of 0.


ChartPoint

public ChartPoint(double x,
                  double y)
Creates a ChartPoint with the supplied x and y coordinates

Parameters:
x - the x coordinate
y - the y coordinate

ChartPoint

public ChartPoint(double x,
                  double y,
                  Highlight h)
Creates a ChartPoint with the supplied x and y coordinates and with the supplied Highlight

Parameters:
x - the x coordinate
y - the y coordinate
h - the Highlight

ChartPoint

public ChartPoint(Positionable x,
                  Positionable y)
Creates a ChartPoint using the supplied Positionable objects to determine the x and y coordinates

Parameters:
x - the x coordinate
y - the y coordinate

ChartPoint

public ChartPoint(Positionable x,
                  double y)
Creates a ChartPoint using the supplied Positionable object for the x coordinate, and the double value for the y coordinate

Parameters:
x - the x coordinate
y - the y coordinate

ChartPoint

public ChartPoint(Positionable x,
                  double y,
                  Highlight h)
Creates a ChartPoint using the supplied Positionable object for the x coordinate, and the double value for the y coordinate, and also applying the supplied Highlight

Parameters:
x - the x coordinate
y - the y coordinate
h - the Highlight

ChartPoint

public ChartPoint(double x,
                  Positionable y,
                  Highlight h)
Creates a ChartPoint using the supplied double for the x coordinate, and the Positionable value for the y coordinate, and also applying the supplied Highlight

Parameters:
x - the x coordinate
y - the y coordinate
h - the Highlight

ChartPoint

public ChartPoint(double x,
                  Positionable y)
Creates a ChartPoint using the supplied double as the x coordinate and the Positionable as the y coordinate.

Parameters:
x - the x coordinate
y - the y coordinate

ChartPoint

public ChartPoint(Positionable x,
                  Positionable y,
                  Highlight h)
Creates a ChartPoint using the supplied Positionables as the x and y coordinates, and applying the supplied Highlight

Parameters:
x - the x coordinate
y - the y coordinate
h - the Highlight

ChartPoint

public ChartPoint(ChartPoint source)
A copy constructor that creates a new ChartPoint instance from an existing ChartPoint. The new ChartPoint instance has the same x and y positions as its source point, and the same Highlight too.

Method Detail

getX

public Positionable getX()
Gets the x coordinate of the Chartable object

Specified by:
getX in interface Chartable
Returns:
the x coordinate

getY

public Positionable getY()
Gets the y coordinate of the Chartable object

Specified by:
getY in interface Chartable
Returns:
the y coordinate

setX

public void setX(Positionable xPos)
Sets the x coordinate

Parameters:
xPos - the new value for the x coordinate

setY

public void setY(Positionable yPos)
Sets the y coordinate

Parameters:
yPos - the new value for the y coordinate

getHighlight

public Highlight getHighlight()
Returns the highlight applied to this chart point, if any

Specified by:
getHighlight in interface Highlightable
Returns:
the highlight applied to this chart point, if any

isHighlight

public boolean isHighlight(Highlight h)
Is the highlight for this chart point the same as the supplied highlight? If the supplied highlight is null, this always returns false.

Parameters:
h - the highlight to test
Returns:
true if the supplied highlight is the same as the result of getHighlight()

setHighlight

public void setHighlight(Highlight h)
Sets the highlight associated with this chart point, if any

Specified by:
setHighlight in interface Highlightable
Parameters:
h - the new highlight

compareTo

public int compareTo(Chartable other)
Compares this chart point instance to another instance. The comparison is based first on the value of the x coordinate, then on the value of the y coordinate.

Specified by:
compareTo in interface Comparable<Chartable>

getName

public String getName()
Returns the name of the ChartPoint instance

Specified by:
getName in interface Named
Returns:
the name of the ChartPoint instance

setName

public void setName(String name)
Specifies the name of the ChartPoint instance

Specified by:
setName in interface Nameable
Parameters:
name - the name of the instance

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

JIDE 3.5.15