Package fr.esrf.tangoatk.widget.device
Class SimpleStateViewer
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
fr.esrf.tangoatk.widget.util.JSmoothLabel
fr.esrf.tangoatk.widget.device.SimpleStateViewer
- All Implemented Interfaces:
fr.esrf.tangoatk.core.IErrorListener,fr.esrf.tangoatk.core.IStateListener,ImageObserver,MenuContainer,Serializable,EventListener
public class SimpleStateViewer
extends JSmoothLabel
implements fr.esrf.tangoatk.core.IStateListener, fr.esrf.tangoatk.core.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);
- Version:
- $Revision$
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class fr.esrf.tangoatk.widget.util.JSmoothLabel
CENTER_ALIGNMENT, CLASSIC_BEHAVIOR, LEFT_ALIGNMENT, MATRIX_BEHAVIOR, RIGHT_ALIGNMENTFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiderrorChange(fr.esrf.tangoatk.core.ErrorEvent evt) fr.esrf.tangoatk.core.IDeviceApplicationfr.esrf.tangoatk.core.DevicegetModel()getModelgets the model of this stateviewer.getPopUp()Get the value of popUp.getState()getStatebooleanisStateClickablereturns if the state is clickable or not.voidsetApplication(fr.esrf.tangoatk.core.IDeviceApplication runnable) Set the application which will be displayed on right mouse click.voidsetModel(fr.esrf.tangoatk.core.Device devModel) setModelsets the model of this viewer.voidSet the popup which will be displayed on left mouse click.voidsetStateClickable(boolean clickable) setStateClickablewill the state be clickable?voidstateChange(fr.esrf.tangoatk.core.StateEvent evt) Methods inherited from class fr.esrf.tangoatk.widget.util.JSmoothLabel
getHorizontalAlignment, getMinimumSize, getPreferredSize, getSizingBehavior, getText, getVerticalOffset, paintComponent, setHorizontalAlignment, setSizingBehavior, setText, setValueOffsets, setVerticalOffsetMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, getUI, 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, updateUIMethods 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, transferFocusDownCycle, validate, validateTreeMethods 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, getAccessibleContext, 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
SimpleStateViewer
public SimpleStateViewer()Contructs a SimpleStateViewer.
-
-
Method Details
-
setModel
public void setModel(fr.esrf.tangoatk.core.Device devModel) setModelsets the model of this viewer. If the textLabel property is not set, the name of the device is shown on the textLabel.- Parameters:
devModel- aDeviceto surveil
-
clearModel
public void clearModel() -
getModel
public fr.esrf.tangoatk.core.Device getModel()getModelgets the model of this stateviewer.- Returns:
- a
Devicevalue
-
getState
getState- Returns:
- a
Stringvalue presenting the state of the device
-
stateChange
public void stateChange(fr.esrf.tangoatk.core.StateEvent evt) - Specified by:
stateChangein interfacefr.esrf.tangoatk.core.IStateListener
-
errorChange
public void errorChange(fr.esrf.tangoatk.core.ErrorEvent evt) - Specified by:
errorChangein interfacefr.esrf.tangoatk.core.IErrorListener
-
setStateClickable
public void setStateClickable(boolean clickable) setStateClickablewill the state be clickable?- Parameters:
clickable- abooleanvalue
-
isStateClickable
public boolean isStateClickable()isStateClickablereturns if the state is clickable or not.- Returns:
- a
booleanvalue
-
setApplication
public void setApplication(fr.esrf.tangoatk.core.IDeviceApplication runnable) Set the application which will be displayed on right mouse click.- Parameters:
runnable- Application to be launched
-
getApplication
public fr.esrf.tangoatk.core.IDeviceApplication getApplication()- Returns:
- the application attached to this state viewer.
- See Also:
-
getPopUp
Get the value of popUp.- Returns:
- value of popUp.
- See Also:
-
setPopUp
Set the popup which will be displayed on left mouse click.- Parameters:
v- Value to assign to popUp.
-