Class 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:
  • Constructor Details

    • BooleanScalarCheckBoxViewer

      public BooleanScalarCheckBoxViewer()
    • BooleanScalarCheckBoxViewer

      public BooleanScalarCheckBoxViewer(String title)
  • Method Details

    • getAttModel

      public fr.esrf.tangoatk.core.IBooleanScalar getAttModel()
    • setAttModel

      public void setAttModel(fr.esrf.tangoatk.core.IBooleanScalar boolModel)
    • 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
    • clearModel

      public void clearModel()
    • 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
    • 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)
    • 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)