|
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 | +--com.klg.jclass.swing.gauge.JCLinearScale
JCLinearScale
provides a graduated scale drawn in a linear
fashion. It is oriented either horizontally or vertically.
Nested Class Summary | |
static class |
JCLinearScale.Orientation
Orientation enumeration. |
Nested classes inherited from class com.klg.jclass.swing.gauge.JCAbstractScale |
JCAbstractScale.Direction |
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 JCLinearScale.Orientation |
orientation
The orientation of this scale. |
protected boolean |
useZoomFactorForMax
Asks: "Does zoomFactor have effect in the maximum extent
direction?". |
protected boolean |
useZoomFactorForMin
Asks: "Does zoomFactor have effect in the minimum extent
direction?". |
Fields inherited from class com.klg.jclass.swing.gauge.JCAbstractScale |
direction, gauge, image, max, min, ranges, scaleImage, ticks, zoomFactor |
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 | |
JCLinearScale(com.klg.jclass.swing.gauge.JCLinearGauge gauge)
Creates a scale given its parent gauge. |
|
JCLinearScale(com.klg.jclass.swing.gauge.JCLinearGauge gauge,
JCAbstractScale.Direction direction,
double min,
double max,
JCLinearScale.Orientation orientation,
Color foreground)
Creates a graduated linear scale. |
Method Summary | |
Component |
add(Component c)
Overrides add to pass in a linear constraint. |
Component |
add(Component c,
int index)
Overrides add to pass in a linear constraint. |
protected void |
drawImage(Graphics g,
Image image,
Rectangle bounds)
Draws an image as the scale. |
com.klg.jclass.swing.gauge.JCLinearGauge |
getLinearGauge()
Returns the gauge associated with this scale. |
JCLinearScale.Orientation |
getOrientation()
Returns the JCLinearScale.Orientation for this linear scale,
HORIZONTAL or VERTICAL , giving the orientation
in which scale values are rendered. |
Dimension |
getPreferredSize()
This is called by our widget parent when it wants to know our preferred size. |
Rectangle |
getScaleSize()
Calculates the rectangle that defines the position and dimensions of the linear scale. |
boolean |
getUseZoomFactorForMax()
Gets the value of useZoomFactorForMax , which tells whether the
ZoomFactor is in effect in the maximum extent direction or not. |
boolean |
getUseZoomFactorForMin()
Gets the value of useZoomFactorForMin , which tells whether the
ZoomFactor is in effect in the minimum extent direction or not. |
void |
paintComponent(Graphics g)
Draws the background of this scale. |
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 |
setOrientation(JCLinearScale.Orientation orientation)
Sets the JCLinearScale.Orientation for this linear scale,
HORIZONTAL or VERTICAL , giving the orientation
in which scale values are rendered. |
void |
setUseZoomFactorForMax(boolean useZoomFactorForMax)
Sets the useZoomFactorForMax value, which tells whether the
ZoomFactor is in effect in the maximum extent direction or not. |
void |
setUseZoomFactorForMin(boolean useZoomFactorForMin)
Sets the useZoomFactorForMin value, which tells whether the
ZoomFactor is in effect in the minimum extent direction or not. |
Methods inherited from class com.klg.jclass.swing.gauge.JCAbstractScale |
addRange, addRange, addTick, addTick, getDirection, getExtent, getGauge, getImage, getMax, getMin, getRanges, getScaleImage, getTicks, getZoomFactor, inBounds, removeRange, removeTick, setDirection, setExtent, setImage, setMax, setMin, setScaleImage, setZoomFactor |
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 JCLinearScale.Orientation orientation
protected boolean useZoomFactorForMin
zoomFactor
have effect in the minimum extent
direction?".
protected boolean useZoomFactorForMax
zoomFactor
have effect in the maximum extent
direction?".
Constructor Detail |
public JCLinearScale(com.klg.jclass.swing.gauge.JCLinearGauge gauge)
gauge
- the JCLinearGauge
associated with this scalepublic JCLinearScale(com.klg.jclass.swing.gauge.JCLinearGauge gauge, JCAbstractScale.Direction direction, double min, double max, JCLinearScale.Orientation orientation, Color foreground)
orientation
- gauge
- the JCLinearGauge
associated with this scaledirection
- a JCAbstractScale.Direction
enum indicating
FORWARD
or BACKWARD
min
- the minumum value a scale can havemax
- the maximum value a scale can haveforeground
- the color of this scale's foregroundMethod Detail |
public com.klg.jclass.swing.gauge.JCLinearGauge getLinearGauge()
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
Dimension
(size) we'd like to be based on our
width & heightpublic Component add(Component c)
add
in class Container
c
- the component to be added
public Component add(Component c, int index)
add
in class Container
c
- the component to be addedindex
- the order this component has in the list; components added
last are drawn first
public Rectangle getScaleSize()
public void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- the Graphics
object onto which we will draw our backgroundpublic double pick(Point p)
pick
in interface JCScale
pick
in class JCAbstractScale
p
- the point representing the x, y coordinates of the
click
public JCLinearScale.Orientation getOrientation()
JCLinearScale.Orientation
for this linear scale,
HORIZONTAL
or VERTICAL
, giving the orientation
in which scale values are rendered.
JCLinearScale.Orientation
for this scalepublic void setOrientation(JCLinearScale.Orientation orientation)
JCLinearScale.Orientation
for this linear scale,
HORIZONTAL
or VERTICAL
, giving the orientation
in which scale values are rendered.
orientation
- the JCLinearScale.Orientation
public boolean getUseZoomFactorForMin()
useZoomFactorForMin
, which tells whether the
ZoomFactor
is in effect in the minimum extent direction or not.
useZoomFactorForMin
valuepublic void setUseZoomFactorForMin(boolean useZoomFactorForMin)
useZoomFactorForMin
value, which tells whether the
ZoomFactor
is in effect in the minimum extent direction or not.
useZoomFactorForMin
- the new useZoomFactorForMin
valuepublic boolean getUseZoomFactorForMax()
useZoomFactorForMax
, which tells whether the
ZoomFactor
is in effect in the maximum extent direction or not.
useZoomFactorForMax
valuepublic void setUseZoomFactorForMax(boolean useZoomFactorForMax)
useZoomFactorForMax
value, which tells whether the
ZoomFactor
is in effect in the maximum extent direction or not.
useZoomFactorForMax
- the new useZoomFactorForMax
valueprotected void drawImage(Graphics g, Image image, Rectangle bounds)
bounds
- image
- g
- the Graphics on which to drawpublic void redraw()
repaintEnabled
flag can
be checked. No repaint will occur if that flag is false
.
redraw
in class JCAbstractScale
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |