Class SignalScalarCheckBoxViewer

All Implemented Interfaces:
fr.esrf.tangoatk.core.IAttributeStateListener, fr.esrf.tangoatk.core.IBooleanScalarListener, fr.esrf.tangoatk.core.IErrorListener, fr.esrf.tangoatk.core.INumberScalarListener, fr.esrf.tangoatk.core.ISetErrorListener, JDrawable, ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, SwingConstants

public class SignalScalarCheckBoxViewer extends JCheckBox implements ActionListener, fr.esrf.tangoatk.core.IBooleanScalarListener, fr.esrf.tangoatk.core.INumberScalarListener, fr.esrf.tangoatk.core.ISetErrorListener, JDrawable
A SignalScalarCheckBoxViewer is a viewer, represented as a CheckBox, for a signal attribute (this means an attribute representing a boolean value, but of type BooleanScalar or NumberScalar). The viewer is updated when the attribute value changes. The checkBox is "checked" if the attribute value is "true" or does not equal "0" and it is unchecked if the attribute value is "false" are equals "0".
Author:
GIRARDOT
See Also:
  • Field Details

    • attModel

      protected fr.esrf.tangoatk.core.IAttribute attModel
    • trueLabel

      protected String trueLabel
    • falseLabel

      protected String falseLabel
    • fixedLabel

      protected String fixedLabel
    • hasToolTip

      protected boolean hasToolTip
    • qualityEnabled

      protected boolean qualityEnabled
    • background

      protected Color background
    • exts

      protected String[] exts
    • enabled

      protected boolean enabled
  • Constructor Details

    • SignalScalarCheckBoxViewer

      public SignalScalarCheckBoxViewer()
    • SignalScalarCheckBoxViewer

      public SignalScalarCheckBoxViewer(String title)
  • Method Details

    • getAttModel

      public fr.esrf.tangoatk.core.IAttribute getAttModel()
    • setBooleanScalarModel

      public void setBooleanScalarModel(fr.esrf.tangoatk.core.IBooleanScalar boolModel)
    • setNumberScalarModel

      public void setNumberScalarModel(fr.esrf.tangoatk.core.INumberScalar numModel)
    • clearModel

      public void clearModel()
    • getTrueLabel

      public String getTrueLabel()
    • setTrueLabel

      public void setTrueLabel(String tLabel)
    • getFalseLabel

      public String getFalseLabel()
    • setFalseLabel

      public void setFalseLabel(String fLabel)
    • getHasToolTip

      public boolean getHasToolTip()
      getHasToolTip returns true if the viewer has a tooltip (attribute full name)
      Returns:
      a boolean value
    • setHasToolTip

      public void setHasToolTip(boolean b)
      setHasToolTip display 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()
      getQualityEnabled returns a boolean to know whether quality will be displayed as background or not.
      Returns:
      a boolean value
    • setQualityEnabled

      public void setQualityEnabled(boolean b)
      setQualityEnabled view or not the attribute quality for this viewer
      Parameters:
      b - If True the background Color represents the attribute quality factor
    • initForEditing

      public void initForEditing()
      Description copied from interface: JDrawable
      Call after a component of a JDSwingObject is created, this give a default look and feel for editing.
      Specified by:
      initForEditing in interface JDrawable
    • getComponent

      public JComponent getComponent()
      Specified by:
      getComponent in interface JDrawable
      Returns:
      the JComponent that implements this interface.
    • getDescription

      public String getDescription(String extName)
      Description copied from interface: JDrawable
      Get a description of this extensions.
      Specified by:
      getDescription in interface JDrawable
      Parameters:
      extName - Extension name
      Returns:
      Empty string for no description.
    • getExtensionList

      public String[] getExtensionList()
      Specified by:
      getExtensionList in interface JDrawable
      Returns:
      list of extension name for this objects (Empty array for none).
    • setExtendedParam

      public boolean setExtendedParam(String name, String value, boolean popupErr)
      Description copied from interface: JDrawable
      Sets the specified param.
      Specified by:
      setExtendedParam in interface JDrawable
      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

      public String getExtendedParam(String name)
      Description copied from interface: JDrawable
      Returns the specified parameter value.
      Specified by:
      getExtendedParam in interface JDrawable
      Parameters:
      name - Param name (Case unsensitive).
      Returns:
      Empty string if not exists, the value otherwise.
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener
    • booleanScalarChange

      public void booleanScalarChange(fr.esrf.tangoatk.core.BooleanScalarEvent e)
      Specified by:
      booleanScalarChange in interface fr.esrf.tangoatk.core.IBooleanScalarListener
    • numberScalarChange

      public void numberScalarChange(fr.esrf.tangoatk.core.NumberScalarEvent e)
      Specified by:
      numberScalarChange in interface fr.esrf.tangoatk.core.INumberScalarListener
    • stateChange

      public void stateChange(fr.esrf.tangoatk.core.AttributeStateEvent evt)
      Specified by:
      stateChange in interface fr.esrf.tangoatk.core.IAttributeStateListener
    • errorChange

      public void errorChange(fr.esrf.tangoatk.core.ErrorEvent evt)
      Specified by:
      errorChange in interface fr.esrf.tangoatk.core.IErrorListener
    • setBoolValue

      protected void setBoolValue(boolean val)
    • setBoolValue

      protected void setBoolValue(double val)
    • setErrorOccured

      public void setErrorOccured(fr.esrf.tangoatk.core.ErrorEvent evt)
      Specified by:
      setErrorOccured in interface fr.esrf.tangoatk.core.ISetErrorListener
    • setBackground

      public void setBackground(Color bg)
      Overrides:
      setBackground in class JComponent
    • setEnabled

      public void setEnabled(boolean b)
      Overrides:
      setEnabled in class AbstractButton
    • main

      public static void main(String[] args)