com.nwoods.jgo.instruments
Interface GraduatedScale

All Known Implementing Classes:
AbstractGraduatedScale

public interface GraduatedScale

The GraduatedScale interface provides a range of values that a scale may display, along with methods to map a value to a display point.


Method Summary
 boolean getIntersectionWithLine(java.awt.geom.Point2D.Float p1, java.awt.geom.Point2D.Float p2, DoubleRef outval)
          Returns true if the infinite line defined by points p1 and p2 intersect with the path of the scale; outputs the associated value at that point with the out parameter outval.
 double getMaximum()
          Gets the maximum value represented on the scale.
 double getMinimum()
          Gets the minimum value represented on the scale.
 java.awt.geom.Point2D.Float getPointForValue(double value)
          Returns a point that represents the given value.
 double getRange()
          Gets the extent of the scale's range.
 double getValueAtPoint(java.awt.geom.Point2D.Float p)
          Returns the value which would be represented at a given point.
 void setMaximum(double value)
          Sets the maximum value represented on the scale.
 void setMinimum(double value)
          Sets the minimum value represented on the scale.
 

Method Detail

getMinimum

public double getMinimum()
Gets the minimum value represented on the scale.


setMinimum

public void setMinimum(double value)
Sets the minimum value represented on the scale.

Parameters:
value - Standard behavior dictates the scale be inclusive of the minimum and maximum values.

getMaximum

public double getMaximum()
Gets the maximum value represented on the scale.


setMaximum

public void setMaximum(double value)
Sets the maximum value represented on the scale.

Parameters:
value - Standard behavior dictates the scale be inclusive of the minimum and maximum values

getRange

public double getRange()
Gets the extent of the scale's range.

Standard behavior returns the difference between the scale's Maximum and Minimum values.


getPointForValue

public java.awt.geom.Point2D.Float getPointForValue(double value)
Returns a point that represents the given value.

Parameters:
value - a double-precision floating point number
Returns:
a Point2D.Float in document coordinates

getValueAtPoint

public double getValueAtPoint(java.awt.geom.Point2D.Float p)
Returns the value which would be represented at a given point.

Parameters:
p - a Point2D.Float in document coordinates
Returns:
the corresponding double-precision floating point value

getIntersectionWithLine

public boolean getIntersectionWithLine(java.awt.geom.Point2D.Float p1,
                                       java.awt.geom.Point2D.Float p2,
                                       DoubleRef outval)
Returns true if the infinite line defined by points p1 and p2 intersect with the path of the scale; outputs the associated value at that point with the out parameter outval.

Parameters:
p1 - a Point2D.Float in document coordinates
p2 - a Point2D.Float in document coordinates
outval - a DoubleRef that is modified to hold the double value of the scale at the intersection point
Returns:
true if there is an intersection and if outval holds the corresponding double value