|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
public void addRange(com.klg.jclass.swing.gauge.JCRange range)
range
- the Range
object to be addedpublic void addRange(com.klg.jclass.swing.gauge.JCRange range, int index)
range
- the JCRange
to be added to the scaleindex
- the z-order indexpublic void addTick(com.klg.jclass.swing.gauge.JCTick tick)
tick
- the JCTick
to be added to the scalepublic void addTick(com.klg.jclass.swing.gauge.JCTick tick, int index)
tick
- the JCTick
to be added to the scaleindex
- the z-order indexpublic JCAbstractScale.Direction getDirection()
JCAbstractScale.Direction
for this scale,
FORWARD
or BACKWARD
, giving the direction in
which scale values increase.
JCAbstractScale.Direction
for this scalepublic double getExtent()
getZoomFactor()
.
zoomFactor
for this scale.
zoomFactor
of this scalepublic com.klg.jclass.swing.gauge.JCGauge getGauge()
public double getZoomFactor()
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.
zoomFactor
of this scalepublic double getMax()
public double getMin()
public Vector getRanges()
Vector
of tick objects for this scale.
Vector
of rangespublic Vector getTicks()
Vector
of tick objects for this scale.
Vector
of tickspublic boolean inBounds(double value)
true
if the value is within the scale's minimum and
maximum.
value
- the value to be tested
true
if the value is within the scale's minimum
and maximumpublic double pick(Point p)
p
- the point representing the x, y coordinates of
the click
Point
public void removeRange(com.klg.jclass.swing.gauge.JCRange range)
range
- the JCRange
to be removedpublic void removeTick(com.klg.jclass.swing.gauge.JCTick tick)
tick
- the tick object to be removedpublic void setBorder(Border border)
border
- the border for the scalepublic void setDirection(JCAbstractScale.Direction direction)
JCAbstractScale.Direction
for this scale,
FORWARD
or BACKWARD
, giving the direction in
which scale values increase.
direction
- the JCAbstractScale.Direction
public void setExtent(double extent)
setZoomFactor()
.
zoomFactor
for this scale.
extent
- the new zoom factorpublic void setZoomFactor(double extent)
extent
- the new zoom factorpublic void setMax(double max)
max
- the maxiumum value for this scalepublic void setMin(double min)
min
- the minimum value for this scale
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |