fr.esrf.tangoatk.widget.device
Class SimpleStateViewer

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by fr.esrf.tangoatk.widget.util.JSmoothLabel
                  extended by fr.esrf.tangoatk.widget.device.SimpleStateViewer
All Implemented Interfaces:
IErrorListener, IStateListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener

public class SimpleStateViewer
extends JSmoothLabel
implements IStateListener, IErrorListener

SimpleStateViewer is a viewer to surveil the state of a Device. Background color are defined in ATKConstant . SimpleStateViewer offer the possibility to use Antialiased font for better rendering. SimpleStateViewer has no label. Normally one connects the device with the viewer like this:

 Device device = DeviceFactory.getInstance().getDevice("my_device");
 SimpleStateViewer state = new SimpleStateViewer();
 state.setModel(device);
 

See Also:
Serialized Form

Nested Class Summary
 
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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class fr.esrf.tangoatk.widget.util.JSmoothLabel
CENTER_ALIGNMENT, CLASSIC_BEHAVIOR, LEFT_ALIGNMENT, MATRIX_BEHAVIOR, RIGHT_ALIGNMENT
 
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, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SimpleStateViewer()
          Contructs a SimpleStateViewer.
 
Method Summary
 void clearModel()
           
 void errorChange(ErrorEvent evt)
           
 IDeviceApplication getApplication()
          Gets the application attached to this state viewer.
 Device getModel()
          getModel gets the model of this stateviewer.
 IDevicePopUp getPopUp()
          Get the value of popUp.
 java.lang.String getState()
          getState
 boolean isStateClickable()
          isStateClickable returns if the state is clickable or not.
 void setApplication(IDeviceApplication runnable)
          Set the application which will be displayed on right mouse click.
 void setModel(Device devModel)
          setModel sets the model of this viewer.
 void setPopUp(IDevicePopUp v)
          Set the popup which will be displayed on left mouse click.
 void setStateClickable(boolean clickable)
          setStateClickable will the state be clickable?
 void stateChange(StateEvent evt)
           
 
Methods inherited from class fr.esrf.tangoatk.widget.util.JSmoothLabel
getHorizontalAlignment, getMinimumSize, getPreferredSize, getSizingBehavior, getText, getVerticalOffset, paintComponent, setHorizontalAlignment, setSizingBehavior, setText, setValueOffsets, setVerticalOffset
 
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, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, 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, 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
 

Constructor Detail

SimpleStateViewer

public SimpleStateViewer()
Contructs a SimpleStateViewer.

Method Detail

setModel

public void setModel(Device devModel)
setModel sets the model of this viewer. If the textLabel property is not set, the name of the device is shown on the textLabel.

Parameters:
device - a Device to surveil

clearModel

public void clearModel()

getModel

public Device getModel()
getModel gets the model of this stateviewer.

Returns:
a Device value

getState

public java.lang.String getState()
getState

Returns:
a String value presenting the state of the device

stateChange

public void stateChange(StateEvent evt)
Specified by:
stateChange in interface IStateListener

errorChange

public void errorChange(ErrorEvent evt)
Specified by:
errorChange in interface IErrorListener

setStateClickable

public void setStateClickable(boolean clickable)
setStateClickable will the state be clickable?

Parameters:
clickable - a boolean value

isStateClickable

public boolean isStateClickable()
isStateClickable returns if the state is clickable or not.

Returns:
a boolean value

setApplication

public void setApplication(IDeviceApplication runnable)
Set the application which will be displayed on right mouse click.

Parameters:
runnable - Application to be launched

getApplication

public IDeviceApplication getApplication()
Gets the application attached to this state viewer.

See Also:
setApplication(fr.esrf.tangoatk.core.IDeviceApplication)

getPopUp

public IDevicePopUp getPopUp()
Get the value of popUp.

Returns:
value of popUp.
See Also:
setPopUp(fr.esrf.tangoatk.widget.device.IDevicePopUp)

setPopUp

public void setPopUp(IDevicePopUp v)
Set the popup which will be displayed on left mouse click.

Parameters:
v - Value to assign to popUp.