JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.swing.gauge
Interface JCScale

All Known Implementing Classes:
JCAbstractScale

public interface JCScale

JCScale is the interface for circular and linear scales. Those wishing to use their own type of scale should implement this interface. A JCScale represents a graduated scale. A scale has a minimum value, a maximum value, and a direction. It also is associated with other objects like JCTick, JCIndicator, JCNeedle, and JCRange. These associated objects use the scale to get information that they need to render themselves.


Method Summary
 void addRange(com.klg.jclass.swing.gauge.JCRange range)
          Adds a range object to a scale.
 void addRange(com.klg.jclass.swing.gauge.JCRange range, int index)
          Adds a range object to a scale.
 void addTick(com.klg.jclass.swing.gauge.JCTick tick)
          Adds a tick object to a scale.
 void addTick(com.klg.jclass.swing.gauge.JCTick tick, int index)
          Adds a tick object to a scale.
 JCAbstractScale.Direction getDirection()
          Returns the JCAbstractScale.Direction for this scale, FORWARD or BACKWARD, giving the direction in which scale values increase.
 double getExtent()
          Deprecated. As of JClass version 4.5.1; replaced by getZoomFactor().
 com.klg.jclass.swing.gauge.JCGauge getGauge()
          Returns the gauge associated with this scale.
 double getMax()
          Returns the maximum value for this scale.
 double getMin()
          Returns the minimum value for this scale.
 Vector getRanges()
          Returns the Vector of tick objects for this scale.
 Vector getTicks()
          Returns the Vector of tick objects for this scale.
 double getZoomFactor()
          Returns the zoomFactor for this scale.
 boolean inBounds(double value)
          Returns true if the value is within the scale's minimum and maximum.
 double pick(Point p)
          Given a screen position in pixels, returns the closest scale value.
 void removeRange(com.klg.jclass.swing.gauge.JCRange range)
          Removes a range from a scale.
 void removeTick(com.klg.jclass.swing.gauge.JCTick tick)
          Removes a tick series from a scale.
 void setBorder(Border border)
          Sets a border on the scale.
 void setDirection(JCAbstractScale.Direction direction)
          Sets the JCAbstractScale.Direction for this scale, FORWARD or BACKWARD, giving the direction in which scale values increase.
 void setExtent(double extent)
          Deprecated. As of JClass version 4.5.1; replaced by setZoomFactor().
 void setMax(double max)
          Sets the maximum value for this scale.
 void setMin(double min)
          Sets the minimum value for this scale.
 void setZoomFactor(double extent)
          Sets the zoom factor for this scale.
 

Method Detail

addRange

public void addRange(com.klg.jclass.swing.gauge.JCRange range)
Adds a range object to a scale.

Parameters:
range - the Range object to be added

addRange

public void addRange(com.klg.jclass.swing.gauge.JCRange range,
                     int index)
Adds a range object to a scale.

Parameters:
range - the JCRange to be added to the scale
index - the z-order index

addTick

public void addTick(com.klg.jclass.swing.gauge.JCTick tick)
Adds a tick object to a scale.

Parameters:
tick - the JCTick to be added to the scale

addTick

public void addTick(com.klg.jclass.swing.gauge.JCTick tick,
                    int index)
Adds a tick object to a scale.

Parameters:
tick - the JCTick to be added to the scale
index - the z-order index

getDirection

public JCAbstractScale.Direction getDirection()
Returns the JCAbstractScale.Direction for this scale, FORWARD or BACKWARD, giving the direction in which scale values increase.

Returns:
the JCAbstractScale.Direction for this scale

getExtent

public double getExtent()
Deprecated. As of JClass version 4.5.1; replaced by getZoomFactor().

Returns the zoomFactor for this scale.

Returns:
The zoomFactor of this scale

getGauge

public com.klg.jclass.swing.gauge.JCGauge getGauge()
Returns the gauge associated with this scale.

Returns:
The gauge associated with this scale

getZoomFactor

public double getZoomFactor()
Returns the zoomFactor for this scale. The scale is normally sized so it fits exactly within the component. This may not always be what the user wants, since ticks, labels, and other components may need to be drawn outside the scale. Setting zoomFactor allows the scale to be smaller so things outside the scale can be seen.

Returns:
The zoomFactor of this scale

getMax

public double getMax()
Returns the maximum value for this scale.

Returns:
the maximum value for this scale

getMin

public double getMin()
Returns the minimum value for this scale.

Returns:
the minimum value for this scale

getRanges

public Vector getRanges()
Returns the Vector of tick objects for this scale.

Returns:
a Vector of ranges

getTicks

public Vector getTicks()
Returns the Vector of tick objects for this scale.

Returns:
a Vector of ticks

inBounds

public boolean inBounds(double value)
Returns true if the value is within the scale's minimum and maximum.

Parameters:
value - the value to be tested
Returns:
true if the value is within the scale's minimum and maximum

pick

public double pick(Point p)
Given a screen position in pixels, returns the closest scale value.

Parameters:
p - the point representing the x, y coordinates of the click
Returns:
the scale value closest to the Point

removeRange

public void removeRange(com.klg.jclass.swing.gauge.JCRange range)
Removes a range from a scale.

Parameters:
range - the JCRange to be removed

removeTick

public void removeTick(com.klg.jclass.swing.gauge.JCTick tick)
Removes a tick series from a scale.

Parameters:
tick - the tick object to be removed

setBorder

public void setBorder(Border border)
Sets a border on the scale.

Parameters:
border - the border for the scale

setDirection

public void setDirection(JCAbstractScale.Direction direction)
Sets the JCAbstractScale.Direction for this scale, FORWARD or BACKWARD, giving the direction in which scale values increase.

Parameters:
direction - the JCAbstractScale.Direction

setExtent

public void setExtent(double extent)
Deprecated. As of JClass version 4.5.1; replaced by setZoomFactor().

Sets the zoomFactor for this scale.

Parameters:
extent - the new zoom factor

setZoomFactor

public void setZoomFactor(double extent)
Sets the zoom factor for this scale. The scale is normally sized so it fits exactly within the component. This may not always be what the user wants, since ticks, labels, and other components may need to be drawn outside the scale.

Parameters:
extent - the new zoom factor

setMax

public void setMax(double max)
Sets the maximum value for this scale.

Parameters:
max - the maxiumum value for this scale

setMin

public void setMin(double min)
Sets the minimum value for this scale.

Parameters:
min - the minimum value for this scale

Copyright © 2004 Quest Software Inc..
All rights reserved.