|
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.JCAbstractIndicator | +--com.klg.jclass.swing.gauge.JCAbstractNeedle
A needle points to a current value on its associated scale. The end user may choose to interact with a needle. There may be multiple needles associated with a scale.
JCAbstractNeedle
,
Serialized FormNested Class Summary | |
static class |
JCAbstractNeedle.InteractionType
Needle interaction types. |
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 ChangeEvent |
changeEvent
Reuse the same event for notifications. |
protected com.klg.jclass.util.JCListenerList |
changeListeners
List of listeners interested in knowing when a needle's value has changed. |
protected JCAbstractNeedle.InteractionType |
interactionType
The type of interaction, one of InteractionType.NONE
InteractionType.DRAG
InteractionType.CLICK
InteractionType CLICK_DRAG
|
protected boolean |
sendEvents
Controls whether to send change events or not. |
Fields inherited from class com.klg.jclass.swing.gauge.JCAbstractIndicator |
indicatorStyle, indicatorWidth, inner_extent, outer_extent, reversed, 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 | |
JCAbstractNeedle(Color foreground,
double needleWidth,
com.klg.jclass.swing.gauge.JCScale scale,
boolean visible,
double inner_extent,
double outer_extent,
com.klg.jclass.swing.gauge.JCIndicatorStyle needleStyle,
double value)
Creates a needle. |
|
JCAbstractNeedle(Color foreground,
double needleWidth,
com.klg.jclass.swing.gauge.JCScale scale,
JCAbstractNeedle.InteractionType interactionType,
boolean visible,
double length,
com.klg.jclass.swing.gauge.JCIndicatorStyle needleStyle,
double value)
Deprecated. Beginning with JClass 5, the length parameter has
been replaced with inner_extent and outer_extent . |
|
JCAbstractNeedle(com.klg.jclass.swing.gauge.JCScale scale)
Creates a needle. |
Method Summary | |
void |
addChangeListener(ChangeListener l)
Adds listener interested in needle movements. |
JCAbstractNeedle.InteractionType |
getInteractionType()
Returns the interation type for this needle. |
double |
getLength()
Returns the length of this needle as a ratio of the scale's radius, width, or height (depending on the scale's type and orientation). |
com.klg.jclass.swing.gauge.JCIndicatorStyle |
getNeedleStyle()
Returns the JCIndicatorStyle for this needle. |
double |
getNeedleWidth()
Returns the width for this needle (this is actually stored in the inherited indicatorWidth property). |
Dimension |
getPreferredSize()
Returns the preferred size for this component. |
boolean |
getSendEvents()
Returns a sendEvents flag; true means events will
be sent when the needle's value changes, false means do not
send the events. |
abstract void |
paint(Graphics g)
This routine actually draws the needle object on the screen. |
void |
removeChangeListener(ChangeListener l)
Removes listener interested in needle movements. |
void |
sendChangeEvent(ChangeEvent ev)
Broadcasts the move event to interested listeners. |
void |
setInteractionType(JCAbstractNeedle.InteractionType interactionType)
Sets the interation type for this needle. |
void |
setLength(double length)
Sets the length of this needle as a ratio of the scale's radius, width, or height (depending on the scale's type and orientation). |
void |
setNeedleStyle(com.klg.jclass.swing.gauge.JCIndicatorStyle needleStyle)
Sets the JCIndicatorStyle for this needle. |
void |
setNeedleWidth(double needleWidth)
Sets the width of needle (this is actually stored in the inherited indicatorWidth property). |
void |
setSendEvents(boolean sendEvents)
Sets the sendEvents flag; true means events will
be sent when the needle's value changes, false means do not
send the events. |
void |
setValue(double value)
Sets the scale value to which this needle should point. |
Methods inherited from class com.klg.jclass.swing.gauge.JCAbstractIndicator |
getIndicatorStyle, getIndicatorWidth, getInnerExtent, getOuterExtent, getScale, getValue, isReversed, redraw, setIndicatorStyle, setIndicatorWidth, setInnerExtent, setOuterExtent, setReversed, setScale |
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.JCIndicator |
getIndicatorStyle, getIndicatorWidth, getInnerExtent, getOuterExtent, getScale, getValue, isReversed, setIndicatorStyle, setIndicatorWidth, setInnerExtent, setOuterExtent, setReversed |
Field Detail |
protected com.klg.jclass.util.JCListenerList changeListeners
protected ChangeEvent changeEvent
protected boolean sendEvents
protected JCAbstractNeedle.InteractionType interactionType
InteractionType.NONE
InteractionType.DRAG
InteractionType.CLICK
InteractionType CLICK_DRAG
Constructor Detail |
public JCAbstractNeedle(com.klg.jclass.swing.gauge.JCScale scale)
scale
- the associated circular or linear scalepublic JCAbstractNeedle(Color foreground, double needleWidth, com.klg.jclass.swing.gauge.JCScale scale, boolean visible, double inner_extent, double outer_extent, com.klg.jclass.swing.gauge.JCIndicatorStyle needleStyle, double value)
foreground
- the needle's colorneedleWidth
- the needle's width in pixelsscale
- the associated JCScale
visible
- a Boolean that controls the visibility of the needleinner_extent
- the needle's inner extent, expressed as a ratio of its
length to the relevant dimension (radius, width/length) of the associated
scaleouter_extent
- the needle's outer extent, expressed as a ratio of its
length to the relevant dimension of the associated scaleneedleStyle
- needle styles are kept in JCIndicatorStyle
;
user-defined needle styles may be passed to the
JCIndicatorStyle
's constructorvalue
- the needle's value; the needle points to this value on its
associated scalepublic JCAbstractNeedle(Color foreground, double needleWidth, com.klg.jclass.swing.gauge.JCScale scale, JCAbstractNeedle.InteractionType interactionType, boolean visible, double length, com.klg.jclass.swing.gauge.JCIndicatorStyle needleStyle, double value)
length
parameter has
been replaced with inner_extent
and outer_extent
.
foreground
- the needle's colorneedleWidth
- the needle's width in pixelsscale
- the associated JCScale
interactionType
- the interaction type,
CLICK
, CLICK_DRAG
, or NONE
visible
- a Boolean that controls the visibility of the needlelength
- the needle's length, expressed as a ratio of its length to
the relevant dimension (radius, width/length) of the associated scaleneedleStyle
- needle styles are kept in JCIndicatorStyle
;
user-defined needle styles may be passed to the
JCIndicatorStyle
's constructorvalue
- the needle's value; the needle points to this value on its
associated scaleMethod Detail |
public Dimension getPreferredSize()
getPreferredSize
in class JCAbstractIndicator
public abstract void paint(Graphics g)
paint
in class JCAbstractIndicator
g
- public void addChangeListener(ChangeListener l)
l
- the listener to be addedpublic void removeChangeListener(ChangeListener l)
removeChangeListener
in interface JCNeedle
l
- the listener to be removedpublic void sendChangeEvent(ChangeEvent ev)
sendChangeEvent
in interface JCNeedle
ev
- the ChangeEvent
of interestpublic void setValue(double value)
sendEvents
is true
.
setValue
in interface JCIndicator
setValue
in class JCAbstractIndicator
value
- the value at which to pointpublic double getLength()
getLength
in interface JCNeedle
public void setLength(double length)
setLength
in interface JCNeedle
length
- the length of this needle as a ratio of the scale's radius,
width, or height (depending on the scale's type and orientation)public com.klg.jclass.swing.gauge.JCIndicatorStyle getNeedleStyle()
JCIndicatorStyle
for this needle.
getNeedleStyle
in interface JCNeedle
JCIndicatorStyle
of this needlepublic void setNeedleStyle(com.klg.jclass.swing.gauge.JCIndicatorStyle needleStyle)
JCIndicatorStyle
for this needle.
setNeedleStyle
in interface JCNeedle
needleStyle
- the JCIndicatorStyle
for this needlepublic double getNeedleWidth()
indicatorWidth
property).
getNeedleWidth
in interface JCNeedle
public void setNeedleWidth(double needleWidth)
indicatorWidth
property).
setNeedleWidth
in interface JCNeedle
needleWidth
- the width of this needlepublic JCAbstractNeedle.InteractionType getInteractionType()
getInteractionType
in interface JCNeedle
JCAbstractNeedle.InteractionType
for this needlepublic void setInteractionType(JCAbstractNeedle.InteractionType interactionType)
setInteractionType
in interface JCNeedle
interactionType
- the JCNeedle.InteractionType
for this
needle, one of: InteractionType.NONE
InteractionType.DRAG
InteractionType.CLICK
InteractionType.CLICK_DRAG
public boolean getSendEvents()
sendEvents
flag; true
means events will
be sent when the needle's value changes, false
means do not
send the events.
getSendEvents
in interface JCNeedle
sendEvents
booleanpublic void setSendEvents(boolean sendEvents)
sendEvents
flag; true
means events will
be sent when the needle's value changes, false
means do not
send the events.
setSendEvents
in interface JCNeedle
sendEvents
- true
means send needle's value change events
to listeners, false
means do not send the events
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |