|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--com.klg.jclass.swing.gauge.JCAbstractScale
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.
Nested Class Summary | |
static class |
JCAbstractScale.Direction
Enum's for the direction parameter. |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
protected JCAbstractScale.Direction |
direction
A JCCircularScale.Direction enum, FORWARD or
BACKWARD , giving the direction in which scale values increase. |
protected com.klg.jclass.swing.gauge.JCGauge |
gauge
The parent gauge. |
protected Image |
image
An image may be used for this scale. |
protected double |
max
The minumum value this scale can have. |
protected double |
min
The maximum value this scale can have. |
protected Vector |
ranges
The list of ranges for this scale. |
protected boolean |
scaleImage
Boolean that determines if the image should be matched when the scale is resized. |
protected Vector |
ticks
A list of tick objects for this scale. |
protected double |
zoomFactor
Paints a scale background, covering this ratio from the origin for circular scales and the top or left for linear scales. |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
JCAbstractScale(com.klg.jclass.swing.gauge.JCGauge gauge)
Creates a graduated scale. |
|
JCAbstractScale(com.klg.jclass.swing.gauge.JCGauge gauge,
JCAbstractScale.Direction direction,
double min,
double max,
Color foreground)
Creates a graduated scale. |
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 JCCircularScale.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. |
Image |
getImage()
Gets the Image used to mark the 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. |
boolean |
getScaleImage()
Scales the image in relation to the scale dimensions. |
Vector |
getTicks()
Returns the Vector of tick objects for this scale. |
double |
getZoomFactor()
Returns the zoom factor for this scale. |
boolean |
inBounds(double value)
Returns true if the value is within the scale's minimum and
maximum. |
abstract double |
pick(Point p)
Given a screen position in pixels, returns the closest scale value. |
void |
redraw()
Call this instead of paint so that the repaintEnabled flag can
be checked. |
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 from a 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 zoomFactor)
Deprecated. As of JClass version 4.5.1 replaced by setZoomFactor() . |
void |
setImage(Image image)
Sets the Image used to mark the scale. |
void |
setMax(double max)
Sets the maximum value for this scale. |
void |
setMin(double min)
Sets the minimum value for this scale. |
void |
setScaleImage(boolean scaleImage)
Determines whether to adapt the image according to the scale dimensions. |
void |
setZoomFactor(double zoomFactor)
Sets the zoom factor for this scale. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.klg.jclass.swing.gauge.JCScale |
setBorder |
Field Detail |
protected com.klg.jclass.swing.gauge.JCGauge gauge
protected JCAbstractScale.Direction direction
JCCircularScale.Direction
enum, FORWARD
or
BACKWARD
, giving the direction in which scale values increase.
FORWARD
.
protected double min
protected double max
protected double zoomFactor
1.0
.
protected Vector ticks
protected Vector ranges
protected Image image
protected boolean scaleImage
true
.
Constructor Detail |
public JCAbstractScale(com.klg.jclass.swing.gauge.JCGauge gauge)
gauge
- the parent gaugepublic JCAbstractScale(com.klg.jclass.swing.gauge.JCGauge gauge, JCAbstractScale.Direction direction, double min, double max, Color foreground)
gauge
- the parent gaugedirection
- the scale's directionmin
- the scale's minimum valuemax
- the scale's maximum valueforeground
- the scale's foreground colorMethod Detail |
public com.klg.jclass.swing.gauge.JCGauge getGauge()
getGauge
in interface JCScale
public JCAbstractScale.Direction getDirection()
JCCircularScale.Direction
for this scale,
FORWARD
or BACKWARD
, giving the direction in
which scale values increase.
getDirection
in interface JCScale
JCCircularScale.Direction
for this scalepublic void setDirection(JCAbstractScale.Direction direction)
JCAbstractScale.Direction
for this scale,
FORWARD
or BACKWARD
, giving the direction in
which scale values increase.
setDirection
in interface JCScale
direction
- the JCCircularScale.Direction
public double getMax()
getMax
in interface JCScale
public void setMax(double max)
setMax
in interface JCScale
max
- the maxiumum value for this scalepublic double getMin()
getMin
in interface JCScale
public void setMin(double min)
setMin
in interface JCScale
min
- the minimum value for this scalepublic double getExtent()
getZoomFactor()
.
getExtent
in interface JCScale
zoomFactor
of this scalepublic void setExtent(double zoomFactor)
setZoomFactor()
.
setExtent
in interface JCScale
zoomFactor
- the new zoomFactor
public double getZoomFactor()
zoomFactor
allows the scale to be
smaller so things outside the scale can be seen.
getZoomFactor
in interface JCScale
zoomFactor
of this scalepublic void setZoomFactor(double zoomFactor)
setZoomFactor
in interface JCScale
zoomFactor
- the new zoomFactor
public Vector getTicks()
Vector
of tick objects for this scale.
getTicks
in interface JCScale
Vector
of tickspublic void addTick(com.klg.jclass.swing.gauge.JCTick tick)
addTick
in interface JCScale
tick
- the tick object to be addedpublic void addTick(com.klg.jclass.swing.gauge.JCTick tick, int index)
addTick
in interface JCScale
tick
- the JCTick
to be added to the scaleindex
- the Z-order indexpublic void removeTick(com.klg.jclass.swing.gauge.JCTick tick)
removeTick
in interface JCScale
tick
- the JCCircularTick
to be removedpublic Vector getRanges()
Vector
of tick objects for this scale.
getRanges
in interface JCScale
Vector
of rangespublic void addRange(com.klg.jclass.swing.gauge.JCRange range)
addRange
in interface JCScale
range
- the range object to be addedpublic void addRange(com.klg.jclass.swing.gauge.JCRange range, int index)
addRange
in interface JCScale
range
- the JCRange
to be added to the scaleindex
- the Z-order indexpublic void removeRange(com.klg.jclass.swing.gauge.JCRange range)
removeRange
in interface JCScale
range
- the JCRange
to be removedpublic boolean inBounds(double value)
true
if the value is within the scale's minimum and
maximum.
inBounds
in interface JCScale
value
- the value to be tested
true
if the value is within the scale's minimum and
maximumpublic Image getImage()
Image
used to mark the scale.
Image
used to mark the scalepublic void setImage(Image image)
Image
used to mark the scale.
image
- the Image
used to mark the scalepublic boolean getScaleImage()
true
if the image is to be matched to the size of the
bounding box of the scale; otherwise, center the image based on its
length and widthpublic void setScaleImage(boolean scaleImage)
scaleImage
- true
if the image is to be matched to the
size of the bounding box of the scale; otherwise, center the image based
on its length and widthpublic void redraw()
repaintEnabled
flag can
be checked. No repaint will occur if that flag is false
.
public abstract double pick(Point p)
pick
in interface JCScale
p
- the point representing the X, Y coordinates of the
click
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |