Class BooleanScalarCheckBoxViewer
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JToggleButton
javax.swing.JCheckBox
fr.esrf.tangoatk.widget.attribute.BooleanScalarCheckBoxViewer
- All Implemented Interfaces:
fr.esrf.tangoatk.core.IAttributeStateListener,fr.esrf.tangoatk.core.IBooleanScalarListener,fr.esrf.tangoatk.core.IErrorListener,fr.esrf.tangoatk.core.ISetErrorListener,JDrawable,ActionListener,ImageObserver,ItemSelectable,MenuContainer,Serializable,EventListener,Accessible,SwingConstants
- Direct Known Subclasses:
NumberScalarCheckBoxViewer
public class BooleanScalarCheckBoxViewer
extends JCheckBox
implements ActionListener, fr.esrf.tangoatk.core.IBooleanScalarListener, fr.esrf.tangoatk.core.ISetErrorListener, JDrawable
An BooleanScalarCheckBoxViewer is a BooleanScalar attribute viewer. This means that
the attribute used as the model for this viewer should implement the IBooleanScalar
interface. The viewer is updated when the boolean attribute value changes.
The checkBox is "checked" if the attribute value is "true" and it is unchecked
if the attribute value is "false".
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JCheckBox
JCheckBox.AccessibleJCheckBoxNested classes/interfaces inherited from class javax.swing.JToggleButton
JToggleButton.AccessibleJToggleButton, JToggleButton.ToggleButtonModelNested classes/interfaces inherited from class javax.swing.AbstractButton
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListenerNested 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 javax.swing.JCheckBox
BORDER_PAINTED_FLAT_CHANGED_PROPERTYFields inherited from class javax.swing.AbstractButton
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTYFields 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, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidbooleanScalarChange(fr.esrf.tangoatk.core.BooleanScalarEvent e) voidvoiderrorChange(fr.esrf.tangoatk.core.ErrorEvent evt) fr.esrf.tangoatk.core.IBooleanScalargetDescription(String extName) Get a description of this extensions.getExtendedParam(String name) Returns the specified parameter value.String[]booleangetHasToolTipreturns true if the viewer has a tooltip (attribute full name)booleangetQualityEnabledreturns a boolean to know whether quality will be displayed as background or not.voidCall after a component of a JDSwingObject is created, this give a default look and feel for editing.static voidvoidsetAttModel(fr.esrf.tangoatk.core.IBooleanScalar boolModel) voidsetBackground(Color bg) protected voidsetBoolValue(boolean val) voidsetEnabled(boolean b) voidsetErrorOccured(fr.esrf.tangoatk.core.ErrorEvent evt) booleansetExtendedParam(String name, String value, boolean popupErr) Sets the specified param.voidsetFalseLabel(String fLabel) voidsetHasToolTip(boolean b) setHasToolTipdisplay or not a tooltip for this viewervoidsetQualityEnabled(boolean b) setQualityEnabledview or not the attribute quality for this viewervoidsetTrueLabel(String tLabel) voidstateChange(fr.esrf.tangoatk.core.AttributeStateEvent evt) Methods inherited from class javax.swing.JCheckBox
getAccessibleContext, getUIClassID, isBorderPaintedFlat, paramString, setBorderPaintedFlat, updateUIMethods inherited from class javax.swing.JToggleButton
requestFocus, requestFocusInWindowMethods inherited from class javax.swing.AbstractButton
actionPropertyChanged, addActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, configurePropertiesFromAction, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, init, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, removeNotify, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setModel, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPositionMethods 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, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, 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, 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, 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, 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
-
BooleanScalarCheckBoxViewer
public BooleanScalarCheckBoxViewer() -
BooleanScalarCheckBoxViewer
-
-
Method Details
-
getAttModel
public fr.esrf.tangoatk.core.IBooleanScalar getAttModel() -
setAttModel
public void setAttModel(fr.esrf.tangoatk.core.IBooleanScalar boolModel) -
getTrueLabel
-
setTrueLabel
-
getFalseLabel
-
setFalseLabel
-
getHasToolTip
public boolean getHasToolTip()getHasToolTipreturns true if the viewer has a tooltip (attribute full name)- Returns:
- a
booleanvalue
-
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
-
getQualityEnabled
public boolean getQualityEnabled()getQualityEnabledreturns a boolean to know whether quality will be displayed as background or not.- Returns:
- a
booleanvalue
-
setQualityEnabled
public void setQualityEnabled(boolean b) setQualityEnabledview or not the attribute quality for this viewer- Parameters:
b- If True the background Color represents the attribute quality factor
-
clearModel
public void clearModel() -
initForEditing
public void initForEditing()Description copied from interface:JDrawableCall after a component of a JDSwingObject is created, this give a default look and feel for editing.- Specified by:
initForEditingin interfaceJDrawable
-
getComponent
- Specified by:
getComponentin interfaceJDrawable- Returns:
- the JComponent that implements this interface.
-
getDescription
Description copied from interface:JDrawableGet a description of this extensions.- Specified by:
getDescriptionin interfaceJDrawable- Parameters:
extName- Extension name- Returns:
- Empty string for no description.
-
getExtensionList
- Specified by:
getExtensionListin interfaceJDrawable- Returns:
- list of extension name for this objects (Empty array for none).
-
setExtendedParam
Description copied from interface:JDrawableSets the specified param.- Specified by:
setExtendedParamin interfaceJDrawable- Parameters:
name- Parameter name (Case unsensitive).value- Parameter value.popupErr- true when the JDrawable should display a popup if the parameter value is incorrect, false otherwise. Note that the JDrawable must not display an error message if the parameter does not exists even if popupAllowed is true.- Returns:
- true if parameters has been succesfully applied, false otherwise.
-
getExtendedParam
Description copied from interface:JDrawableReturns the specified parameter value.- Specified by:
getExtendedParamin interfaceJDrawable- Parameters:
name- Param name (Case unsensitive).- Returns:
- Empty string if not exists, the value otherwise.
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
booleanScalarChange
public void booleanScalarChange(fr.esrf.tangoatk.core.BooleanScalarEvent e) - Specified by:
booleanScalarChangein interfacefr.esrf.tangoatk.core.IBooleanScalarListener
-
stateChange
public void stateChange(fr.esrf.tangoatk.core.AttributeStateEvent evt) - 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
-
setBoolValue
protected void setBoolValue(boolean val) -
setErrorOccured
public void setErrorOccured(fr.esrf.tangoatk.core.ErrorEvent evt) - Specified by:
setErrorOccuredin interfacefr.esrf.tangoatk.core.ISetErrorListener
-
setBackground
- Overrides:
setBackgroundin classJComponent
-
setEnabled
public void setEnabled(boolean b) - Overrides:
setEnabledin classAbstractButton
-
main
-