JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.swing.gauge
Interface JCNeedle

All Superinterfaces:
JCIndicator
All Known Implementing Classes:
JCAbstractNeedle

public interface JCNeedle
extends JCIndicator

The interface for needles. Those wishing to use their own needles should implement this interface. 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.


Method Summary
 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.
 boolean getSendEvents()
          Returns a sendEvents flag; true means events will be sent when the needle's value changes, false means don't send the events.
 void removeChangeListener(ChangeListener l)
          Removes listener interested in needle movements.
 void sendChangeEvent(ChangeEvent ev)
          Broadcasts the 'needle has been moved' 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 don't send the events.
 
Methods inherited from interface com.klg.jclass.swing.gauge.JCIndicator
getIndicatorStyle, getIndicatorWidth, getInnerExtent, getOuterExtent, getScale, getValue, isReversed, setIndicatorStyle, setIndicatorWidth, setInnerExtent, setOuterExtent, setReversed, setValue
 

Method Detail

getInteractionType

public JCAbstractNeedle.InteractionType getInteractionType()
Returns the interation type for this needle. The JCNeedle.InteractionType for this needle, one of

Returns:
The needle whose interaction type is being requested

getLength

public 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). Note that the length is really the outer extent.

Returns:
the length of this needle as a ratio

getNeedleStyle

public com.klg.jclass.swing.gauge.JCIndicatorStyle getNeedleStyle()
Returns the JCIndicatorStyle for this needle.

Returns:
the JCIndicatorStyle of this needle

getNeedleWidth

public double getNeedleWidth()
Returns the width for this needle.

Returns:
the width of this needle

getSendEvents

public boolean getSendEvents()
Returns a sendEvents flag; true means events will be sent when the needle's value changes, false means don't send the events.

Returns:
whether or not needle change events should be sent

removeChangeListener

public void removeChangeListener(ChangeListener l)
Removes listener interested in needle movements.

Parameters:
l - the listener to be removed

sendChangeEvent

public void sendChangeEvent(ChangeEvent ev)
Broadcasts the 'needle has been moved' event to interested listeners.

Parameters:
ev - the ChangeEvent of interest

setInteractionType

public void setInteractionType(JCAbstractNeedle.InteractionType interactionType)
Sets the interation type for this needle. The JCNeedle.InteractionType for this needle, one of

Parameters:
interactionType - the JCNeedle.InteractionType for this needle

setLength

public 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). For example, for a circular scale, a length of 0.75 means draw the needle from the center out to 75% of the scale's radius.

Parameters:
length - the needle's length expressed as a ratio

setNeedleStyle

public void setNeedleStyle(com.klg.jclass.swing.gauge.JCIndicatorStyle needleStyle)
Sets the JCIndicatorStyle for this needle.

Parameters:
needleStyle - the JCIndicatorStyle for this needle

setNeedleWidth

public void setNeedleWidth(double needleWidth)
Sets the width of needle (this is actually stored in the inherited indicatorWidth property).

Parameters:
needleWidth - the width of this needle

setSendEvents

public void setSendEvents(boolean sendEvents)
Sets the sendEvents flag; true means events will be sent when the needle's value changes, false means don't send the events.

Parameters:
sendEvents - true means send needle's value change events to listeners

Copyright © 2004 Quest Software Inc..
All rights reserved.