|
JClass 4.5.0 API Documentation |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | 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 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 needles, ranges, and tick objects.
Inner classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Field Summary | |
protected JCNeedle |
draggedNeedle
The needle currently being dragged. |
protected JComponent |
footer
The footer component. |
protected Rectangle |
footerLayoutHints
|
protected JCGaugeArea |
gaugeArea
The drawing area for the circular gauge. |
protected Rectangle |
gaugeAreaLayoutHints
|
protected JComponent |
header
The header component. |
protected Rectangle |
headerLayoutHints
|
protected 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 Vector |
ranges
The list of ranges for this gauge. |
protected boolean |
repaintEnabled
Allow batching of changes by toggling repaint off/on. |
protected JCCircularScale |
scale
The scale associated with this gauge. |
protected boolean |
snapToValue
Snap to closest integral scale value; default: false |
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 |
Constructor Summary | |
JCGauge()
No-argument constructor for JCCircularGauge . |
Method Summary | |
void |
addNeedle(JCNeedle needle)
Adds a needle to this scale. |
void |
addNeedle(JCNeedle needle,
int index)
Adds a needle to this scale. |
void |
addPickListener(JCGaugePickListener l)
Adds a listener for gauge pick events. |
void |
addRange(JCRange range)
Adds a range to the gauge. |
void |
addRange(JCRange range,
int index)
Adds a range to the gauge. |
void |
addTick(JCTick tick)
Adds a tick to a gauge. |
void |
addTick(JCTick tick,
int index)
Adds a tick object to a gauge. |
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. |
JCGaugeArea |
getGaugeArea()
Returns the gauge area for this gauge. |
JComponent |
getHeader()
Returns the header for this gauge. |
Rectangle |
getLayoutHints(JComponent child)
Gets layout hints for the specified gauge child. |
JCLegend |
getLegend()
Returns the legend for this gauge. |
Vector |
getNeedles()
Returns the list of needles associated with this scale. |
Vector |
getRanges()
Returns the list of ranges. |
boolean |
getRepaintEnabled()
Disable/enable repaints of gauge and its components. |
JCCircularScale |
getScale()
Returns the scale associated with this gauge. |
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)
|
JCGaugePickEvent |
pick(Point p)
Given a screen location in pixels, returns the closest scale value wrapped in a JCGaugePickEvent . |
void |
removeNeedle(JCNeedle needle)
Removes a needle from this scale. |
void |
removePickListener(JCGaugePickListener l)
Removes a listener to gauge pick events. |
void |
removeRange(JCRange range)
Removes a range. |
void |
removeTick(JCTick tick)
Removes a tick to a gauge. |
void |
sendPickEvent(JCGaugePickEvent ev)
Broadcasts the pick event to interested listeners. |
void |
setFooter(JComponent newFooter)
Sets the Footer property. |
void |
setGaugeArea(JCGaugeArea newGaugeArea)
Sets the value of the gaugeArea property. |
void |
setHeader(JComponent newHeader)
Sets the Header property. |
void |
setLegend(JCLegend newLegend)
Sets the Legend property The Legend property controls the object that controls the display of the legend. |
void |
setRepaintEnabled(boolean repaintEnabled)
Disable/enable repaints of gauge and its components. |
void |
setScale(JCCircularScale scale)
Adds a scale to the gauge. |
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.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected JCGaugeArea gaugeArea
protected JComponent header
protected JComponent footer
protected JCLegend legend
JCLegend
protected JCCircularScale scale
protected Vector needles
protected com.klg.jclass.util.JCListenerList pickListeners
protected JCNeedle draggedNeedle
protected Vector ranges
protected boolean snapToValue
protected boolean repaintEnabled
protected Rectangle gaugeAreaLayoutHints
protected Rectangle legendLayoutHints
protected Rectangle headerLayoutHints
protected Rectangle footerLayoutHints
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).public 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 addNeedle(JCNeedle needle)
needle
- A JCNeedle
to associate with this scalepublic void addNeedle(JCNeedle 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(JCNeedle needle)
needle
- The JCNeedle
to be removedpublic Vector getNeedles()
Vector
of needles for this scalepublic void addTick(JCTick tick)
tick
- The JCCircularTick
to be addedpublic void addTick(JCTick tick, int index)
tick
- The JCCircularTick
to be addedindex
- The z-order indexpublic void removeTick(JCTick tick)
tick
- The JCCircularTick
to be removedpublic Vector getTicks()
Vector
of tick objectspublic void addRange(JCRange range)
range
- The JCRange
to be addedpublic void addRange(JCRange range, int index)
range
- The JCRange
to be addedindex
- The z-order indexpublic void removeRange(JCRange range)
range
- The JCRange
to be removedpublic Vector getRanges()
Vector
of ranges for this gaugepublic void setScale(JCCircularScale scale)
scale
- The scale to be addedpublic JCCircularScale getScale()
JCCircularGauge
component.public JCLegend getLegend()
public void setLegend(JCLegend newLegend)
newLegend
- The legend for this gaugepublic JCGaugeArea getGaugeArea()
JCGaugeArea
for this gaugepublic void setGaugeArea(JCGaugeArea newGaugeArea)
gaugeArea
property. This is currently disabled.
The gaugeArea
property controls the object that controls the display
of the gauge.newGaugeArea
- public void setRepaintEnabled(boolean repaintEnabled)
repaintEnabled
- true enables repaints, false disables thempublic boolean getRepaintEnabled()
public JCGaugePickEvent pick(Point p)
JCGaugePickEvent
.p
- The Point
at which the event occurredJCGaugePickEvent
which wraps the closest valuepublic void addPickListener(JCGaugePickListener l)
l
- public void removePickListener(JCGaugePickListener l)
l
- public void sendPickEvent(JCGaugePickEvent ev)
ev
- The JCGaugePickEvent
of interestpublic JComponent getHeader()
public void setHeader(JComponent newHeader)
newHeader
- The JComponent
that is used as a header for
the gaugepublic JComponent getFooter()
public void setFooter(JComponent newFooter)
newFooter
- The JComponent
that is used as a footer for
the gaugepublic int getDrawingAreaHeight()
public int getDrawingAreaWidth()
public Rectangle getLayoutHints(JComponent child)
child
- gauge child -- either the gaugeArea, legend, header, or
footer.public JComponent getComponentArea()
JCComponent
on which to drawpublic void mouseEntered(MouseEvent event)
event
- public void mouseExited(MouseEvent event)
event
- public void mouseReleased(MouseEvent event)
event
- public void mousePressed(MouseEvent event)
event
- public void mouseClicked(MouseEvent event)
event
- public void mouseMoved(MouseEvent event)
public void mouseDragged(MouseEvent event)
|
Copyright© 1999-2000 KL Group Inc. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |