|
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.JCGauge
The parent class for linear and circular gauges. It contains methods for setting many of the gauge's properties, such as a header, footer, and legend, as well as for adding indicators, needles, ranges, and tick objects.
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 com.klg.jclass.swing.gauge.JCNeedle |
draggedNeedle
The needle currently being dragged. |
protected JComponent |
footer
The footer component. |
protected Rectangle |
footerLayoutHints
|
protected com.klg.jclass.swing.gauge.JCGaugeArea |
gaugeArea
The drawing area for the circular gauge. |
protected Rectangle |
gaugeAreaLayoutHints
|
protected JComponent |
header
The header component. |
protected Rectangle |
headerLayoutHints
|
protected Image |
image
An image may be used for gauge. |
protected Vector |
indicators
The list of indicators assocated with this gauge. |
protected com.klg.jclass.util.legend.JCLegend |
legend
The legend. |
protected Rectangle |
legendLayoutHints
|
protected Vector |
needles
The list of needles assocated with this gauge. |
protected com.klg.jclass.util.JCListenerList |
pickListeners
List of listeners interested in pick events. |
protected boolean |
repaintEnabled
Allows batching of changes by toggling repaint off/on. |
protected com.klg.jclass.swing.gauge.JCScale |
scale
The scale associated with this gauge. |
protected boolean |
scaleImage
Boolean that determines if the image should be matched when the gauge is resized. |
protected boolean |
snapToValue
Snaps to closest integral scale value. |
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 | |
JCGauge()
No-argument constructor for JCCircularGauge . |
Method Summary | |
void |
addIndicator(com.klg.jclass.swing.gauge.JCAbstractIndicator indicator)
Adds a indicator to this gauge. |
void |
addIndicator(com.klg.jclass.swing.gauge.JCAbstractIndicator indicator,
int index)
Adds a indicator to this gauge. |
void |
addNeedle(com.klg.jclass.swing.gauge.JCAbstractNeedle needle)
Adds a needle to this gauge. |
void |
addNeedle(com.klg.jclass.swing.gauge.JCAbstractNeedle needle,
int index)
Adds a needle to this scale. |
void |
addPickListener(com.klg.jclass.swing.gauge.JCGaugePickListener l)
Adds a listener for gauge pick events. |
void |
addRange(com.klg.jclass.swing.gauge.JCRange range)
Adds a range to the gauge (actually added to the scale). |
void |
addRange(com.klg.jclass.swing.gauge.JCRange range,
int index)
Adds a range to the gauge (actually added to the scale). |
void |
addTick(com.klg.jclass.swing.gauge.JCTick tick)
Adds a tick to a gauge (actually added to the scale). |
void |
addTick(com.klg.jclass.swing.gauge.JCTick tick,
int index)
Adds a tick object to a gauge (actually added to the scale). |
String |
getAbout()
Gets the value of the About property. |
JComponent |
getComponentArea()
Returns the JClass component's sub-component on which the actual drawing of the gauge will be performed. |
int |
getDrawingAreaHeight()
Gets the height of the drawing area represented by this gauge. |
int |
getDrawingAreaWidth()
Gets the width of the drawing area represented by this gauge. |
JComponent |
getFooter()
Returns the footer for this gauge. |
com.klg.jclass.swing.gauge.JCGaugeArea |
getGaugeArea()
Returns the gauge area for this gauge. |
JComponent |
getHeader()
Returns the header for this gauge. |
Image |
getImage()
Gets the Image to be used for the gauge background. |
Vector |
getIndicators()
Returns the list of indicators associated with this gauge. |
Rectangle |
getLayoutHints(JComponent child)
Gets layout hints for the specified gauge child. |
com.klg.jclass.util.legend.JCLegend |
getLegend()
Returns the legend for this gauge. |
Vector |
getNeedles()
Returns the list of needles associated with this gauge. |
Vector |
getRanges()
Returns the list of ranges. |
boolean |
getRepaintEnabled()
Disable/enable repaints of gauge and its components. |
com.klg.jclass.swing.gauge.JCScale |
getScale()
Returns the scale associated with this gauge. |
boolean |
getScaleImage()
Scales the image in relation to the scale dimensions. |
boolean |
getSnapToValue()
Returns the snapToValue property that controls whether the
needle should snap to the closest discrete integral scale value
(true ) or to any scale value (false ). |
Vector |
getTicks()
Returns the tick objects for this gauge. |
void |
mouseClicked(MouseEvent event)
Sends pick events to listeners. |
void |
mouseDragged(MouseEvent event)
|
void |
mouseEntered(MouseEvent event)
|
void |
mouseExited(MouseEvent event)
|
void |
mouseMoved(MouseEvent event)
|
void |
mousePressed(MouseEvent event)
|
void |
mouseReleased(MouseEvent event)
|
com.klg.jclass.swing.gauge.JCGaugePickEvent |
pick(Point p)
Given a screen location in pixels, returns the closest scale value wrapped in a JCGaugePickEvent . |
abstract void |
redraw()
Call this instead of paint so that the repaintEnabled flag can
be checked. |
void |
removeIndicator(com.klg.jclass.swing.gauge.JCAbstractIndicator indicator)
Removes a indicator from this gauge. |
void |
removeNeedle(com.klg.jclass.swing.gauge.JCAbstractNeedle needle)
Removes a needle from this gauge. |
void |
removePickListener(com.klg.jclass.swing.gauge.JCGaugePickListener l)
Removes a listener to gauge pick events. |
void |
removeRange(com.klg.jclass.swing.gauge.JCRange range)
Removes a range (actually removed from the scale). |
void |
removeTick(com.klg.jclass.swing.gauge.JCTick tick)
Removes a tick from a gauge (actually removed from the scale). |
void |
sendPickEvent(com.klg.jclass.swing.gauge.JCGaugePickEvent ev)
Broadcasts the pick event to interested listeners. |
void |
setAbout(String s)
Sets the value of the About property. |
void |
setFooter(JComponent newFooter)
Sets the Footer property. |
void |
setGaugeArea(com.klg.jclass.swing.gauge.JCGaugeArea newGaugeArea)
Sets the value of the gaugeArea property. |
void |
setHeader(JComponent newHeader)
Sets the Header property. |
void |
setImage(Image image)
Sets the Image to be used for the gauge background. |
protected void |
setIndicatorScales(com.klg.jclass.swing.gauge.JCScale scale)
Sets the given scale on each of the gauge's indicators. |
void |
setLegend(com.klg.jclass.util.legend.JCLegend newLegend)
Sets the Legend property. |
protected void |
setNeedleScales(com.klg.jclass.swing.gauge.JCScale scale)
Sets the given scale on each of the gauge's needles. |
void |
setRepaintEnabled(boolean repaintEnabled)
Disable/enable repaints of gauge and its components. |
void |
setScaleImage(boolean scaleImage)
Determines whether to adapt the image according to the gauge dimensions. |
void |
setSnapToValue(boolean snapToValue)
Sets the snapToValue property that controls whether the
needle should snap to the closest discrete integral scale value
(true ) or to any scale value (false ). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.klg.jclass.util.legend.LegendComponentLayoutUser |
getPreferredSize |
Field Detail |
protected com.klg.jclass.swing.gauge.JCGaugeArea gaugeArea
protected JComponent header
protected JComponent footer
protected com.klg.jclass.util.legend.JCLegend legend
JCLegend
protected com.klg.jclass.swing.gauge.JCScale scale
protected Vector indicators
protected Vector needles
protected com.klg.jclass.util.JCListenerList pickListeners
protected com.klg.jclass.swing.gauge.JCNeedle draggedNeedle
protected boolean snapToValue
false
.
protected boolean repaintEnabled
protected Rectangle gaugeAreaLayoutHints
protected Rectangle legendLayoutHints
protected Rectangle headerLayoutHints
protected Rectangle footerLayoutHints
protected Image image
protected boolean scaleImage
true
.
Constructor Detail |
public JCGauge()
JCCircularGauge
.
Method Detail |
public boolean getSnapToValue()
snapToValue
property that controls whether the
needle should snap to the closest discrete integral scale value
(true
) or to any scale value (false
).
true
if discrete movements are enforced;
false
means continuous movement is allowedpublic void setSnapToValue(boolean snapToValue)
snapToValue
property that controls whether the
needle should snap to the closest discrete integral scale value
(true
) or to any scale value (false
).
snapToValue
- true
for discrete movements;
false
means continuous movement is allowedpublic void addIndicator(com.klg.jclass.swing.gauge.JCAbstractIndicator indicator)
indicator
- a JCIndicator
to associate with this gaugepublic void addIndicator(com.klg.jclass.swing.gauge.JCAbstractIndicator indicator, int index)
indicator
- the indicator to be addedindex
- the position in the list of indicators where this one
is to be addedpublic void removeIndicator(com.klg.jclass.swing.gauge.JCAbstractIndicator indicator)
indicator
- the JCIndicator
to be removedpublic Vector getIndicators()
Vector
of indicators for this gaugeprotected void setIndicatorScales(com.klg.jclass.swing.gauge.JCScale scale)
scale
- the scale to be set on each indicatorpublic void addNeedle(com.klg.jclass.swing.gauge.JCAbstractNeedle needle)
needle
- a JCNeedle
to associate with this gaugepublic void addNeedle(com.klg.jclass.swing.gauge.JCAbstractNeedle needle, int index)
needle
- the needle to be addedindex
- the position in the list of needles where this one
is to be addedpublic void removeNeedle(com.klg.jclass.swing.gauge.JCAbstractNeedle needle)
needle
- the JCNeedle
to be removedprotected void setNeedleScales(com.klg.jclass.swing.gauge.JCScale scale)
scale
- the scale to be set on each needlepublic Vector getNeedles()
Vector
of needles for this gaugepublic void addTick(com.klg.jclass.swing.gauge.JCTick tick)
tick
- the JCTick
to be addedpublic void addTick(com.klg.jclass.swing.gauge.JCTick tick, int index)
tick
- the JCTick
to be addedindex
- the z-order indexpublic void removeTick(com.klg.jclass.swing.gauge.JCTick tick)
tick
- the JCTick
to be removedpublic Vector getTicks()
Vector
of tick objectspublic void addRange(com.klg.jclass.swing.gauge.JCRange range)
range
- the JCRange
to be addedpublic void addRange(com.klg.jclass.swing.gauge.JCRange range, int index)
range
- the JCRange
to be addedindex
- the z-order indexpublic void removeRange(com.klg.jclass.swing.gauge.JCRange range)
range
- the JCRange
to be removedpublic Vector getRanges()
Vector
of ranges for this gaugepublic com.klg.jclass.swing.gauge.JCScale getScale()
JCCircularGauge
component.public com.klg.jclass.util.legend.JCLegend getLegend()
getLegend
in interface LegendComponentLayoutUser
public void setLegend(com.klg.jclass.util.legend.JCLegend newLegend)
Legend
property.
The Legend
property controls the object that controls
the display of the legend.
newLegend
- the legend for this gaugepublic com.klg.jclass.swing.gauge.JCGaugeArea getGaugeArea()
JCGaugeArea
for this gaugepublic void setGaugeArea(com.klg.jclass.swing.gauge.JCGaugeArea newGaugeArea)
gaugeArea
property. The
gaugeArea
property controls the object that controls the
display of the gauge.
newGaugeArea
- public void setRepaintEnabled(boolean repaintEnabled)
true
.
repaintEnabled
- true
enables repaints,
false
disables thempublic boolean getRepaintEnabled()
true
enables repaints;
false
disables thempublic com.klg.jclass.swing.gauge.JCGaugePickEvent pick(Point p)
JCGaugePickEvent
.
p
- the Point
at which the event occurred
JCGaugePickEvent
which wraps the closest valuepublic void addPickListener(com.klg.jclass.swing.gauge.JCGaugePickListener l)
l
- public void removePickListener(com.klg.jclass.swing.gauge.JCGaugePickListener l)
l
- public void sendPickEvent(com.klg.jclass.swing.gauge.JCGaugePickEvent ev)
ev
- the JCGaugePickEvent
of interestpublic JComponent getHeader()
getHeader
in interface LegendComponentLayoutUser
public void setHeader(JComponent newHeader)
Header
property.
The Header
property controls the object that controls the
display of the header.
newHeader
- the JComponent
that is used as a header for
the gaugepublic JComponent getFooter()
getFooter
in interface LegendComponentLayoutUser
public void setFooter(JComponent newFooter)
Footer
property.
The Footer
property controls the object that controls the
display of the footer.
newFooter
- the JComponent
that is used as a footer for
the gaugepublic int getDrawingAreaHeight()
getDrawingAreaHeight
in interface LegendComponentLayoutUser
public int getDrawingAreaWidth()
getDrawingAreaWidth
in interface LegendComponentLayoutUser
public Rectangle getLayoutHints(JComponent child)
getLayoutHints
in interface LegendComponentLayoutUser
child
- gauge child: either the gaugeArea
, legend
,
header
, or footer
public JComponent getComponentArea()
getComponentArea
in interface LegendComponentLayoutUser
JCComponent
on which to drawpublic Image getImage()
Image
to be used for the gauge background.
public void setImage(Image image)
Image
to be used for the gauge background.
image
- the Image
to be used for the gauge backgroundpublic boolean getScaleImage()
true
if the image is to be matched to the size of the bounding box
of the gauge; 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 gauge; otherwise, center the image based on its length and widthpublic abstract void redraw()
repaintEnabled
flag can
be checked. No repaint will occur if that flag is false
. Method
must be overriden in subclasses.
public void mouseEntered(MouseEvent event)
mouseEntered
in interface MouseListener
event
- public void mouseExited(MouseEvent event)
mouseExited
in interface MouseListener
event
- public void mouseReleased(MouseEvent event)
mouseReleased
in interface MouseListener
event
- public void mousePressed(MouseEvent event)
mousePressed
in interface MouseListener
event
- public void mouseClicked(MouseEvent event)
mouseClicked
in interface MouseListener
event
- public void mouseMoved(MouseEvent event)
mouseMoved
in interface MouseMotionListener
public void mouseDragged(MouseEvent event)
mouseDragged
in interface MouseMotionListener
public String getAbout()
About
property.
The About
property displays contact information for
Quest Software in the Bean box.
public void setAbout(String s)
About
property.
The About
property displays contact information for
Quest Software in the Bean box.
s
-
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |