Class SimpleStateViewer
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
fr.esrf.tangoatk.widget.util.JSmoothLabel
fr.esrf.tangoatk.widget.attribute.SimpleStateViewer
- All Implemented Interfaces:
fr.esrf.tangoatk.core.IAttributeStateListener,fr.esrf.tangoatk.core.IDevStateScalarListener,fr.esrf.tangoatk.core.IErrorListener,ImageObserver,MenuContainer,Serializable,EventListener
public class SimpleStateViewer
extends JSmoothLabel
implements fr.esrf.tangoatk.core.IDevStateScalarListener
SimpleStateViewer is a viewer to surveil a state attribute
DevStateScalar. 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 DevStateScalar attribute
with the viewer like this:
IDevStateScalar stateAtt = (IDevStateScalar) attributeList.add("myStateAttName");
SimpleStateViewer statev = new SimpleStateViewer();
statev.setModel(stateAtt);
- 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
FieldsModifier and TypeFieldDescriptionprotected booleanprotected fr.esrf.tangoatk.core.IDevStateScalarprotected booleanprotected booleanFields 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 TypeMethodDescriptionvoidvoiddevStateScalarChange(fr.esrf.tangoatk.core.DevStateScalarEvent evt) voiderrorChange(fr.esrf.tangoatk.core.ErrorEvent evt) fr.esrf.tangoatk.core.IDeviceApplicationfr.esrf.tangoatk.core.IDevStateScalargetModel()getModelgets the model of this stateviewer.getPopUp()Get the value of popUp.booleangetStateClickablereturns if the state is clickable or not.static voidvoidsetApplication(fr.esrf.tangoatk.core.IDeviceApplication runnable) Set the application which will be displayed on right mouse click.voidsetHasToolTip(boolean b) setHasToolTipdisplay or not a tooltip for this viewervoidsetModel(fr.esrf.tangoatk.core.IDevStateScalar stateAtt) 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.AttributeStateEvent e) protected voidMethods 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
-
Field Details
-
model
protected fr.esrf.tangoatk.core.IDevStateScalar model -
stateClickable
protected boolean stateClickable -
hasToolTip
protected boolean hasToolTip -
stateInTooltip
protected boolean stateInTooltip
-
-
Constructor Details
-
SimpleStateViewer
public SimpleStateViewer()Contructs a SimpleStateViewer.
-
-
Method Details
-
stateViewerMouseClicked
-
setHasToolTip
public void setHasToolTip(boolean b) setHasToolTipdisplay or not a tooltip for this viewer- Parameters:
b- If True the attribute full name will be displayed as tooltip for the viewer
-
setModel
public void setModel(fr.esrf.tangoatk.core.IDevStateScalar stateAtt) setModelsets the model of this viewer. If the textLabel property is not set, the name of the device is shown on the textLabel.- Parameters:
stateAtt- astateAttto survey
-
clearModel
public void clearModel() -
getModel
public fr.esrf.tangoatk.core.IDevStateScalar getModel()getModelgets the model of this stateviewer.- Returns:
- a
IDevStateScalarvalue
-
setStateClickable
public void setStateClickable(boolean clickable) setStateClickablewill the state be clickable?- Parameters:
clickable- abooleanvalue
-
getStateClickable
public boolean getStateClickable()getStateClickablereturns 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.
-
devStateScalarChange
public void devStateScalarChange(fr.esrf.tangoatk.core.DevStateScalarEvent evt) - Specified by:
devStateScalarChangein interfacefr.esrf.tangoatk.core.IDevStateScalarListener
-
stateChange
public void stateChange(fr.esrf.tangoatk.core.AttributeStateEvent e) - Specified by:
stateChangein interfacefr.esrf.tangoatk.core.IAttributeStateListener
-
errorChange
public void errorChange(fr.esrf.tangoatk.core.ErrorEvent evt) - Specified by:
errorChangein interfacefr.esrf.tangoatk.core.IErrorListener
-
main
-