|
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.JCAbstractRange | +--com.klg.jclass.swing.gauge.JCLinearRange
Nested Class Summary |
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 Image |
backgroundImage
The background image used as range. |
protected double |
foregroundCoverage
Percent of foreground image that covers background image. |
protected Image |
foregroundImage
The foreground image used as range. |
static int |
HORIZONTAL
Constants used for the masking orientation of the background image. |
protected int |
maskOrientation
The coverage orientation. |
static int |
VERTICAL
|
Fields inherited from class com.klg.jclass.swing.gauge.JCAbstractRange |
image, innerExtent, outerExtent, rangeCounter, rangeName, scale, scaleImage, startValue, stopValue |
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 | |
JCLinearRange(Color foreground,
com.klg.jclass.swing.gauge.JCLinearScale scale,
double innerExtent,
double outerExtent,
double startValue,
double stopValue)
Creates a linear range. |
Method Summary | |
protected void |
drawImage(Graphics g,
Rectangle bounds)
Draws an image as the range. |
Image |
getBackgroundImage()
Returns the background image of the range. |
double |
getForegroundCoverage()
Returns the foreground coverage of the background. |
Image |
getForegroundImage()
Returns the foreground image of the range. |
Image |
getImage()
Returns the background image of the range. |
Rectangle |
getLinearRangeSize(com.klg.jclass.swing.gauge.JCLinearScale lscale,
Rectangle bounds)
This routine computes the range rectangle to be drawn with respect to range's scale. |
protected com.klg.jclass.swing.gauge.JCLinearScale |
getLinearScale()
Returns the linear scale associated with this range. |
int |
getMaskOrientation()
Gets the mask orientation of the range. |
Dimension |
getPreferredSize()
Returns the preferred size of this range, which will be the preferred size of the scale. |
void |
paintComponent(Graphics g)
Draws a linear range. |
void |
redraw()
Call this instead of paint so that the repaintEnabled flag can
be checked. |
void |
setBackgroundImage(Image image)
Sets the background image of the range. |
void |
setForegroundCoverage(double coverage)
Sets the foreground coverage of the background. |
void |
setForegroundImage(Image image)
Sets the foreground image of the range. |
void |
setImage(Image image)
Sets the background image of the range. |
void |
setMaskOrientation(int orientation)
Sets the mask orientation. |
Methods inherited from class com.klg.jclass.swing.gauge.JCAbstractRange |
getInnerExtent, getOuterExtent, getRangeName, getScale, getScaleImage, getStartValue, getStopValue, setInnerExtent, setOuterExtent, setRangeName, setScaleImage, setStartValue, setStopValue |
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.JCRange |
getForeground |
Field Detail |
public static final int HORIZONTAL
public static final int VERTICAL
protected Image foregroundImage
protected Image backgroundImage
protected double foregroundCoverage
protected int maskOrientation
Constructor Detail |
public JCLinearRange(Color foreground, com.klg.jclass.swing.gauge.JCLinearScale scale, double innerExtent, double outerExtent, double startValue, double stopValue)
foreground
- the range's colorscale
- the scale associated with this rangeinnerExtent
- the ratio of the scale's width/height to start drawing
this range from the top/left of the scale (for example, for a
horizontal scale, a value of 0.8 means start drawing this range 80% of
the scale's height from the top of the scale)outerExtent
- the ratio of the scale's width/height to stop drawing
this range from the top/left of the scale (for example, for a
vertical scale, a value of 0.9 means stop drawing this range 90% of
the scale's width from the left of the scale)startValue
- the scale value (not position) at which to begin the rangestopValue
- the scale value (not position) at which to stop the rangeMethod Detail |
protected com.klg.jclass.swing.gauge.JCLinearScale getLinearScale()
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public Rectangle getLinearRangeSize(com.klg.jclass.swing.gauge.JCLinearScale lscale, Rectangle bounds)
lscale
- the JCLinearScale
of this rangebounds
- the linear scale bounds; use lscale.getScaleSize()
for range painting and lscale.getBounds()
for image mapping
public void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- The graphics object with which to drawpublic void redraw()
repaintEnabled
flag can
be checked. No repaint will occur if that flag is false
.
redraw
in class JCAbstractRange
public void setImage(Image image)
setImage
in class JCAbstractRange
image
- the background image of the rangepublic void setForegroundImage(Image image)
image
- the foreground image of the rangepublic void setBackgroundImage(Image image)
image
- the background image of the rangepublic Image getImage()
getImage
in class JCAbstractRange
public Image getForegroundImage()
public Image getBackgroundImage()
public void setForegroundCoverage(double coverage)
coverage
- the coverage factor is a float between 0 and 1public double getForegroundCoverage()
public void setMaskOrientation(int orientation)
JCLinearRange.HORIZONTAL
, the foreground image covers the
left side of the background image;
for JCLinearRange.VERTICAL
, the foreground image covers the
upper side of the background image.
orientation
- the mask orientation of the rangepublic int getMaskOrientation()
protected void drawImage(Graphics g, Rectangle bounds)
g
- the Graphics on which to drawbounds
- the bounds of the image used for image scaling
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |