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);
javax.swing.JComponent.AccessibleJComponent
CENTER_ALIGNMENT, CLASSIC_BEHAVIOR, LEFT_ALIGNMENT, MATRIX_BEHAVIOR, RIGHT_ALIGNMENT
Constructor and Description |
---|
SimpleStateViewer()
Contructs a SimpleStateViewer.
|
Modifier and Type | Method and Description |
---|---|
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) |
getHorizontalAlignment, getMinimumSize, getPreferredSize, getSizingBehavior, getText, getVerticalOffset, paintComponent, setHorizontalAlignment, setSizingBehavior, setText, setValueOffsets, setVerticalOffset
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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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
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, transferFocusDownCycle, validate, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
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.device
- a Device
to surveilpublic void clearModel()
public Device getModel()
getModel
gets the model of this stateviewer.Device
valuepublic java.lang.String getState()
getState
String
value presenting the state of the devicepublic void stateChange(StateEvent evt)
stateChange
in interface IStateListener
public void errorChange(ErrorEvent evt)
errorChange
in interface IErrorListener
public void setStateClickable(boolean clickable)
setStateClickable
will the state be clickable?clickable
- a boolean
valuepublic boolean isStateClickable()
isStateClickable
returns if the state is clickable or not.boolean
valuepublic void setApplication(IDeviceApplication runnable)
runnable
- Application to be launchedpublic IDeviceApplication getApplication()
public IDevicePopUp getPopUp()
setPopUp(fr.esrf.tangoatk.widget.device.IDevicePopUp)
public void setPopUp(IDevicePopUp v)
v
- Value to assign to popUp.