DESY ACOP Beans Home

com.cosylab.gui.components
Class DialKnob

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.cosylab.gui.components.DialKnob
All Implemented Interfaces:
StateOriginator, CosyTransferHandler.MouseFilter, PopupManageable, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
DialKnobDisplayer

public class DialKnob
extends javax.swing.JComponent
implements PopupManageable, StateOriginator, CosyTransferHandler.MouseFilter

A visual component for displaying and manipulating a double ranged value. The value is set and displayed by a round dial knob GUI which can be rotated by the user via mouse drag.

Version:
$id$
Author:
Nejc Kosnik, Jernej Kamenik (jernej.kamenik&x40;cosylab.com)
See Also:
Serialized Form

Nested Class Summary
protected  class DialKnob.MouseHandler
          Utiliy class that handles user mouse actions on the Dial knob.
protected  class DialKnob.Renderer
          Utility class that rendering of the component
protected  class DialKnob.TiltHandler
          An extension of Timer used for periodic tilting of the Dial Knob.
protected  class DialKnob.UserValueListener
          Listens for changes in uservalue.
protected  class DialKnob.ValueListener
          ValueListener handles events that occured due to externally made changes to the RangedValue.
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.lang.String format
           
protected  PrintfFormat formatter
           
protected  DialKnob.MouseHandler mouseHandler
           
protected  RangedValueController rangedValue
           
protected  DialKnob.Renderer renderer
           
protected  java.lang.String title
           
protected  boolean titleVisible
           
protected  java.lang.String units
           
protected  RangedValueController userRangedValue
           
 
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
DialKnob()
          Creates a new DialKnob object with null title and 0 values.
DialKnob(java.lang.String newLabel)
          Constructs a new DialKnob object with the given title of the widget.
DialKnob(java.lang.String newLabel, double newUserValue, double newValue)
          Constructs DialKnob with the given title and given user and readback values.
 
Method Summary
 void addSetListener(SetListener listener)
          Adds a listener which receive event notifications when the user sets a new value.
 java.awt.Color getAlarmColor()
          Returns the color which indicates the alarm state.
 long getAutoSynchronizeDelay()
          Returns the time in milliseconds that specify the delay of the auto synchronization.
 AbstractCustomizerPanel getCustomizer()
          Loads and returns the default Customizer for this displayer.
 java.lang.String getFormat()
          Gets the C-style number display format string.
 double getGraphMax()
          Gets the maximum value displayed.
 double getGraphMin()
          Returns the minimum value displayed.
 double getHighAlarmLimit()
          Returns the high alarm limit.
 double getHighWarningLimit()
          Returns the high warning limit.
 double getLowAlarmLimit()
          Returns the low alarm limit.
 double getLowWarningLimit()
          Returns the low warning limit.
 double getMaximum()
          A convenience method returns the user maximum value
 double getMinimum()
          Convenience method returns the minimum user value.
 java.awt.Color getNormalColor()
          Returns the color which indicates the normal state.
 java.awt.Color getOutOfBoundsColor()
          Returns the color that indicates out of bound state.
 PopupManager getPopupManager()
          Returns the popup manager employed by this widget.
protected  RangedValueController getRangedValue()
          Returns the main ranged value.
 State getState()
          Returns the current state of the component.
 java.lang.String getTitle()
          Returns the title of the widget.
 java.lang.String getUnits()
          Returns the displayed units.
 double getUserMax()
          Returns the maximum value the user can set.
 double getUserMin()
          Returns the minimum value the user can set.
protected  RangedValueController getUserRangedValue()
          Returns the user ranged value.
 double getUserValue()
          Return the value as set by the user.
 double getValue()
          Returns the displayed value.
 RangedValuePolicy getValuePolicy()
          Returns the value policy.
 java.awt.Color getWarningColor()
          Returns the warning color.
 boolean isAutoSynchronize()
          Returns true if auto synchronization is turn on.
 boolean isDragArea(java.awt.event.MouseEvent e)
          If the event happened in the area where drag is enabled, this method should return true.
 boolean isDragEnabled()
          Returns true if drag is enabled.
 boolean isDropEnabled()
          Returns true if drop is enabled.
 boolean isEditable()
          Returns whether the value can be edited by user.
 boolean isEnhanced()
          Returns whether the component should be rendered enhanced.
 boolean isPopupEnabled()
          Returns whether the user can trigger the component's popup menu through a mouse click.
 boolean isRangeColors()
          Returns true if marker is colored when out of range.
 boolean isResizable()
          Returns true if the component's text adjusts to the size of the component.
 boolean isTiltingEnabled()
          Returns whether the component should indicate value out of bounds condition by visually tilting its border.
 boolean isTitleVisible()
          Returns true if title is visible.
 boolean isUnitsVisible()
          Returns true if units are visible.
static void main(java.lang.String[] args)
          Demonstration.
protected  void notifyListeners(double newValue)
          Notifies all the listeners attached to user value.
protected  void paintComponent(java.awt.Graphics arg0)
          Paints the Dial Knob component by utilizing the Renderer.
 void removeSetListener(SetListener listener)
          Removes a listener from the list of listeners receiving event notifications when the user sets a new value.
 void repaint()
           
 void setAlarmColor(java.awt.Color alarmColor)
          Sets the color which indicates the alarm state.
 void setAutoSynchronize(boolean autoSynchronize)
          Turns the autoSynchronization on/off.
 void setAutoSynchronizeDelay(long autoSynchronizeDelay)
          Sets the autoSynchronization in miliseconds.
 void setBackground(java.awt.Color bg)
           
 void setDragEnabled(boolean enabled)
          Enables/disables mouse dragging.
 void setDropEnabled(boolean enabled)
          Enable/disable the mouse drop.
 void setEditable(boolean b)
          Sets the editable property.
 void setEnabled(boolean enabled)
          Overriden to implement visual notification of enabled state.
 void setEnhanced(boolean b)
          Sets the enhanced rendering of the widget.
 void setForeground(java.awt.Color fg)
           
 void setFormat(java.lang.String newFormat)
          Sets the C-style number display format string.
 void setGraphMax(double newMax)
          Sets the maximum value displayed.
 void setGraphMin(double newMin)
          Sets the minimum value displayed.
 void setHighAlarmLimit(double highAlarmLimit)
          Sets the high alarm limit.
 void setHighWarningLimit(double highWarningLimit)
          Sets the high warning limit.
 void setLowAlarmLimit(double lowAlarmLimit)
          Sets the low alarm limit.
 void setLowWarningLimit(double lowWarningLimit)
          Sets the low warning limit.
 void setMaximum(double value)
          Sets all max values for this widget.
 void setMinimum(double value)
          Sets all min values for this widget.
 void setNormalColor(java.awt.Color normalColor)
          Sets the color which indicates the normal state.
 void setOutOfBoundsColor(java.awt.Color outOfBoundsColor)
          Sets the color that indicates out of bound state.
 void setPopupEnabled(boolean b)
          Enables or disables the popup capabilities of the component.
 void setRangeColors(boolean rangeColors)
          Set whether the value marker is colored when out of range.
 void setResizable(boolean b)
          Enables/disables text adjusting.
 void setState(State state)
          Sets the state to the component.
 void setTiltingEnabled(boolean b)
          Enables/disables the tilting.
 void setTitle(java.lang.String string)
          Sets the title above the knob.
 void setTitleVisible(boolean b)
          Toggles title's visibility.
 void setTransferHandler(javax.swing.TransferHandler newHandler)
           
 void setUnits(java.lang.String newUnit)
          Sets the displayed units.
 void setUnitsVisible(boolean b)
          Sets the units visible/invisible.
 void setUserMax(double newMax)
          Sets the maximum value the user can set.
 void setUserMin(double newMin)
          Sets the minimum value the user can set.
 void setUserValue(double newUserValue)
          Sets the user value.
 void setValue(double newValue)
          Sets the value displayed
 void setValuePolicy(RangedValuePolicy p)
          Sets the ValuePolicy.
 void setWarningColor(java.awt.Color warningColor)
          Sets the color which idicates warning state.
 void synchronize()
          Synchronizes the user value with the value;
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mouseHandler

protected DialKnob.MouseHandler mouseHandler

formatter

protected PrintfFormat formatter

userRangedValue

protected RangedValueController userRangedValue

renderer

protected DialKnob.Renderer renderer

format

protected java.lang.String format

title

protected java.lang.String title

units

protected java.lang.String units

titleVisible

protected boolean titleVisible

rangedValue

protected RangedValueController rangedValue
Constructor Detail

DialKnob

public DialKnob()
Creates a new DialKnob object with null title and 0 values.


DialKnob

public DialKnob(java.lang.String newLabel)
Constructs a new DialKnob object with the given title of the widget.

Parameters:
newLabel - title of the widget

DialKnob

public DialKnob(java.lang.String newLabel,
                double newUserValue,
                double newValue)
Constructs DialKnob with the given title and given user and readback values.

Parameters:
newLabel - title of the widget
newUserValue - user value
newValue - readback value (shadow)
Method Detail

getCustomizer

public AbstractCustomizerPanel getCustomizer()
Loads and returns the default Customizer for this displayer.

Returns:
the Customizer intance for this displayer
See Also:
Customizer

setEnhanced

public void setEnhanced(boolean b)
Sets the enhanced rendering of the widget. If property is true there will be much more attention payed to the visual details when rendering of the displayer occurs. Such rendering might cost more CPU time. By default enhanced rendering is on.

Parameters:
b -

isEnhanced

public boolean isEnhanced()
Returns whether the component should be rendered enhanced.

Returns:
enhanced

setFormat

public void setFormat(java.lang.String newFormat)
Sets the C-style number display format string.

Parameters:
newFormat - C-style format string.

getFormat

public java.lang.String getFormat()
Gets the C-style number display format string.

Returns:
String

setUserMax

public void setUserMax(double newMax)
Sets the maximum value the user can set.

Parameters:
newMax - maximum value the user can set.

setGraphMax

public void setGraphMax(double newMax)
Sets the maximum value displayed.

Parameters:
newMax - maximum for the knob scale

setMaximum

public void setMaximum(double value)
Sets all max values for this widget. This method will set the max value a user can set as well as the max displayed value.

Parameters:
value - new maximum value
See Also:
setUserMax(double), setGraphMax(double)

getUserMax

public double getUserMax()
Returns the maximum value the user can set.

Returns:
double upper bound value the user can set.

getMaximum

public double getMaximum()
A convenience method returns the user maximum value

Returns:
double upper bound value the user can set.

getGraphMax

public double getGraphMax()
Gets the maximum value displayed.

Returns:
double upper bound value for knob scale

setUserMin

public void setUserMin(double newMin)
Sets the minimum value the user can set.

Parameters:
newMin - minimum value the user can set.

setGraphMin

public void setGraphMin(double newMin)
Sets the minimum value displayed.

Parameters:
newMin - minimum for the knob scale

setMinimum

public void setMinimum(double value)
Sets all min values for this widget. This method will set the min value a user can set as well as the min displayed value.

Parameters:
value - new minimum value
See Also:
setUserMin(double), setGraphMin(double)

getMinimum

public double getMinimum()
Convenience method returns the minimum user value.

Returns:
double lower bound value the user can set

getUserMin

public double getUserMin()
Returns the minimum value the user can set.

Returns:
user minimum

getGraphMin

public double getGraphMin()
Returns the minimum value displayed.

Returns:
double lower bound value for knob scale

isPopupEnabled

public boolean isPopupEnabled()
Returns whether the user can trigger the component's popup menu through a mouse click.

Returns:
true if popup is enabled

getPopupManager

public PopupManager getPopupManager()
Returns the popup manager employed by this widget. Default values in the popup menu are Synchronize, Preferences..., and Capture Screen....

Specified by:
getPopupManager in interface PopupManageable
Returns:
returns popup manager, which manages popup menu
See Also:
PopupManageable.getPopupManager()

setResizable

public void setResizable(boolean b)
Enables/disables text adjusting.

Parameters:
b - whether the text should adjust its side to the size of the component.

isResizable

public boolean isResizable()
Returns true if the component's text adjusts to the size of the component.

Returns:
resizable property.

setState

public void setState(State state)
Sets the state to the component.

Specified by:
setState in interface StateOriginator
Parameters:
state - to set.
See Also:
StateOriginator.setState(com.cosylab.application.state.State)

getState

public State getState()
Returns the current state of the component.

Specified by:
getState in interface StateOriginator
Returns:
current state.
See Also:
StateOriginator.getState()

setTitle

public void setTitle(java.lang.String string)
Sets the title above the knob.

Parameters:
string - new title

getTitle

public java.lang.String getTitle()
Returns the title of the widget.

Returns:
Title

setTitleVisible

public void setTitleVisible(boolean b)
Toggles title's visibility.

Parameters:
b - visibility of the title

isTitleVisible

public boolean isTitleVisible()
Returns true if title is visible.

Returns:
titleVisible visibility of the title

setUnits

public void setUnits(java.lang.String newUnit)
Sets the displayed units.

Parameters:
newUnit - units to be displayed on the value title

getUnits

public java.lang.String getUnits()
Returns the displayed units.

Returns:
String current units shown on the value title

setUserValue

public void setUserValue(double newUserValue)
Sets the user value.

Parameters:
newUserValue - new value.

getUserValue

public double getUserValue()
Return the value as set by the user.

Returns:
double user value setting

setValue

public void setValue(double newValue)
Sets the value displayed

Parameters:
newValue - value to be displayed on the title marker

getValue

public double getValue()
Returns the displayed value.

Returns:
double value displayed on the title marker

addSetListener

public void addSetListener(SetListener listener)
Adds a listener which receive event notifications when the user sets a new value.

Parameters:
listener - listener to be added

setEditable

public void setEditable(boolean b)
Sets the editable property. If editable, the user can change the user value by mouse dragg.

Parameters:
b - editable

isEditable

public boolean isEditable()
Returns whether the value can be edited by user.

Returns:
editable

setEnabled

public void setEnabled(boolean enabled)
Overriden to implement visual notification of enabled state.

Overrides:
setEnabled in class javax.swing.JComponent
See Also:
Component.setEnabled(boolean)

setPopupEnabled

public void setPopupEnabled(boolean b)
Enables or disables the popup capabilities of the component.

Parameters:
b - the component should bring up popup dialog on mouse click.

setTiltingEnabled

public void setTiltingEnabled(boolean b)
Enables/disables the tilting. Component tilts when value is out of bounds.

Parameters:
b - whether the component should tilt when value is out of bounds.

isTiltingEnabled

public boolean isTiltingEnabled()
Returns whether the component should indicate value out of bounds condition by visually tilting its border.

Returns:
boolean

removeSetListener

public void removeSetListener(SetListener listener)
Removes a listener from the list of listeners receiving event notifications when the user sets a new value.

Parameters:
listener - listener to remove

repaint

public void repaint()
Overrides:
repaint in class java.awt.Component

synchronize

public void synchronize()
Synchronizes the user value with the value;


notifyListeners

protected void notifyListeners(double newValue)
Notifies all the listeners attached to user value.

Parameters:
newValue - new user value

paintComponent

protected void paintComponent(java.awt.Graphics arg0)
Paints the Dial Knob component by utilizing the Renderer. The GUI comprises of a round shape with a value title in the middle, a title on the top and value tick marks around approximately upper two thirds of the circle.

Overrides:
paintComponent in class javax.swing.JComponent
Parameters:
arg0 - Graphics of the DialKnob component.
See Also:
com.cosylab.gui.components.range.Tick, JComponent.paintComponent(java.awt.Graphics)

setValuePolicy

public void setValuePolicy(RangedValuePolicy p)
Sets the ValuePolicy.

Parameters:
p - new value policy

getValuePolicy

public RangedValuePolicy getValuePolicy()
Returns the value policy.

Returns:

getRangedValue

protected RangedValueController getRangedValue()
Returns the main ranged value.

Returns:

getUserRangedValue

protected RangedValueController getUserRangedValue()
Returns the user ranged value.

Returns:

isUnitsVisible

public boolean isUnitsVisible()
Returns true if units are visible.

Returns:
units visibile

setUnitsVisible

public void setUnitsVisible(boolean b)
Sets the units visible/invisible.

Parameters:
b - units visible

getAlarmColor

public java.awt.Color getAlarmColor()
Returns the color which indicates the alarm state.

Returns:
Returns the alarmColor.

setAlarmColor

public void setAlarmColor(java.awt.Color alarmColor)
Sets the color which indicates the alarm state.

Parameters:
alarmColor - The alarmColor to set.

getHighAlarmLimit

public double getHighAlarmLimit()
Returns the high alarm limit.

Returns:
Returns the highAlarmLimit.

setHighAlarmLimit

public void setHighAlarmLimit(double highAlarmLimit)
Sets the high alarm limit.

Parameters:
highAlarmLimit - new high alarm limit

getHighWarningLimit

public double getHighWarningLimit()
Returns the high warning limit.

Returns:
Returns the highWarningLimit.

setHighWarningLimit

public void setHighWarningLimit(double highWarningLimit)
Sets the high warning limit.

Parameters:
highWarningLimit - new high warning limit

getLowAlarmLimit

public double getLowAlarmLimit()
Returns the low alarm limit.

Returns:
Returns the lowAlarmLimit.

setLowAlarmLimit

public void setLowAlarmLimit(double lowAlarmLimit)
Sets the low alarm limit.

Parameters:
lowAlarmLimit - new low alarm limit

getLowWarningLimit

public double getLowWarningLimit()
Returns the low warning limit.

Returns:
Returns the lowWarningLimit.

setLowWarningLimit

public void setLowWarningLimit(double lowWarningLimit)
Sets the low warning limit.

Parameters:
lowWarningLimit - new low warning limit

getNormalColor

public java.awt.Color getNormalColor()
Returns the color which indicates the normal state.

Returns:
Returns the normalColor.

setNormalColor

public void setNormalColor(java.awt.Color normalColor)
Sets the color which indicates the normal state.

Parameters:
normalColor - new normal color

getOutOfBoundsColor

public java.awt.Color getOutOfBoundsColor()
Returns the color that indicates out of bound state.

Returns:
Returns the outOfBoundsColor.

setOutOfBoundsColor

public void setOutOfBoundsColor(java.awt.Color outOfBoundsColor)
Sets the color that indicates out of bound state.

Parameters:
outOfBoundsColor - new out of bounds color

isRangeColors

public boolean isRangeColors()
Returns true if marker is colored when out of range.

Returns:
Returns the rangeColors.

setRangeColors

public void setRangeColors(boolean rangeColors)
Set whether the value marker is colored when out of range.

Parameters:
rangeColors - color value marker

getWarningColor

public java.awt.Color getWarningColor()
Returns the warning color.

Returns:
Returns the warningColor.

setWarningColor

public void setWarningColor(java.awt.Color warningColor)
Sets the color which idicates warning state.

Parameters:
warningColor - The warningColor to set.

isDragArea

public boolean isDragArea(java.awt.event.MouseEvent e)
Description copied from interface: CosyTransferHandler.MouseFilter
If the event happened in the area where drag is enabled, this method should return true.

Specified by:
isDragArea in interface CosyTransferHandler.MouseFilter
Returns:
true if drag is enabled

setTransferHandler

public void setTransferHandler(javax.swing.TransferHandler newHandler)
Overrides:
setTransferHandler in class javax.swing.JComponent

setDragEnabled

public void setDragEnabled(boolean enabled)
Enables/disables mouse dragging. Dragging can only be enabled if this component uses CosyTransferHandler.

Parameters:
enabled -

isDragEnabled

public boolean isDragEnabled()
Returns true if drag is enabled.

Returns:

setDropEnabled

public void setDropEnabled(boolean enabled)
Enable/disable the mouse drop. Drop can only be enabled if this component uses CosyTransferHandler.

Parameters:
enabled -

isDropEnabled

public boolean isDropEnabled()
Returns true if drop is enabled.

Returns:

setBackground

public void setBackground(java.awt.Color bg)
Overrides:
setBackground in class javax.swing.JComponent

setForeground

public void setForeground(java.awt.Color fg)
Overrides:
setForeground in class javax.swing.JComponent

isAutoSynchronize

public boolean isAutoSynchronize()
Returns true if auto synchronization is turn on.

Returns:

setAutoSynchronize

public void setAutoSynchronize(boolean autoSynchronize)
Turns the autoSynchronization on/off. When auto synchronization is on, the knob will automatically synchronize with the readback value if inactive for more than specified by auto sycnhronbize delay.

Parameters:
autoSynchronize -
See Also:
setAutoSynchronizeDelay(long)

getAutoSynchronizeDelay

public long getAutoSynchronizeDelay()
Returns the time in milliseconds that specify the delay of the auto synchronization.

Returns:

setAutoSynchronizeDelay

public void setAutoSynchronizeDelay(long autoSynchronizeDelay)
Sets the autoSynchronization in miliseconds.

Parameters:
autoSynchronizeDelay -
See Also:
setAutoSynchronize(boolean)

main

public static void main(java.lang.String[] args)
Demonstration.

Parameters:
args - Command line arguments.


Copyright © 2010. All Rights Reserved.