Class SignalScalarLightViewer

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

public class SignalScalarLightViewer extends JButton implements fr.esrf.tangoatk.core.INumberScalarListener, fr.esrf.tangoatk.core.IBooleanScalarListener
A light to show the value of a signal attribute (this means an attribute representing a boolean value, but of type BooleanScalar or NumberScalar)
Author:
ho
See Also:
  • Field Details

    • bulbOff

      public static final ImageIcon bulbOff
    • bulbOn

      public static final ImageIcon bulbOn
    • bulbKO

      public static final ImageIcon bulbKO
    • blueLED

      public static final ImageIcon blueLED
    • brownGrayLED

      public static final ImageIcon brownGrayLED
    • darkGrayLED

      public static final ImageIcon darkGrayLED
    • darkOrangeLED

      public static final ImageIcon darkOrangeLED
    • grayLED

      public static final ImageIcon grayLED
    • greenLED

      public static final ImageIcon greenLED
    • darkGreenLED

      public static final ImageIcon darkGreenLED
    • lightOrangeLED

      public static final ImageIcon lightOrangeLED
    • pinkLED

      public static final ImageIcon pinkLED
    • redLED

      public static final ImageIcon redLED
    • whiteLED

      public static final ImageIcon whiteLED
    • yellowLED

      public static final ImageIcon yellowLED
    • KOLED

      public static final ImageIcon KOLED
    • booleanLabel

      public static final int booleanLabel
      int representing the option to see attribute's boolean value as label
      See Also:
    • label

      public static final int label
      int representing the option to see attribute's label as label
      See Also:
    • name

      public static final int name
      int representing the option to see attribute's name as label
      See Also:
    • completeName

      public static final int completeName
      int representing the option to see attribute's complete Name as label
      See Also:
    • customLabel

      public static final int customLabel
      int representing the option to see a custom Label as label
      See Also:
    • labelAndBoolean

      public static final int labelAndBoolean
      int representing the option to see attribute's label and the boolean value as label
      See Also:
    • nameAndBoolean

      public static final int nameAndBoolean
      int representing the option to see attribute's name and the boolean value as label
      See Also:
  • Constructor Details

    • SignalScalarLightViewer

      public SignalScalarLightViewer()
      Constructs a SignalScalarLightViewer with a devicePropertyModel = null and will not show devicePropertyModel's label on setModel(...)
    • SignalScalarLightViewer

      public SignalScalarLightViewer(boolean viewLabel)
      Constructs a SignalScalarLightViewer with a devicePropertyModel = null will show devicePropertyModel's label on setModel(...)
      Parameters:
      viewLabel - View label
  • Method Details

    • numberScalarChange

      public void numberScalarChange(fr.esrf.tangoatk.core.NumberScalarEvent arg0)
      Specified by:
      numberScalarChange in interface fr.esrf.tangoatk.core.INumberScalarListener
      See Also:
      • INumberScalarListener.numberScalarChange(fr.esrf.tangoatk.core.NumberScalarEvent)
    • setViewLabel

      public void setViewLabel(boolean b)
      To set or unset devicePropertyModel's label as text of this JLabel
      Parameters:
      b - a boolean to set or unset devicePropertyModel's label as text of this JLabel. if true and devicePropertyModel is not null, it will set devicePropertyModel's label as text. otherwise it will erase text
    • isViewLabel

      public boolean isViewLabel()
      To know whether devicePropertyModel's label is text of this JLabel or not
      Returns:
      View label flag
    • stateChange

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

      public void errorChange(fr.esrf.tangoatk.core.ErrorEvent arg0)
      Specified by:
      errorChange in interface fr.esrf.tangoatk.core.IErrorListener
      See Also:
      • IErrorListener.errorChange(fr.esrf.tangoatk.core.ErrorEvent)
    • getAttributeModel

      public fr.esrf.tangoatk.core.IAttribute getAttributeModel()
      Returns:
      Returns the numberModel.
    • setAttributeModel

      public void setAttributeModel(fr.esrf.tangoatk.core.IAttribute numberModel)
      Associates an attribute to this component. This attribute should be of type INumberScalar or IBooleanScalar. Otherwise nothing is done.
      Parameters:
      numberModel - The numberModel to set.
    • clearAttributeModel

      public void clearAttributeModel()
      Clears all devicePropertyModel and listener attached to the components
    • getChosenLabel

      public int getChosenLabel()
    • setChosenLabel

      public void setChosenLabel(int chosenLabel)
    • getFalseLabel

      public String getFalseLabel()
    • setFalseLabel

      public void setFalseLabel(String falseLabel)
    • getTrueLabel

      public String getTrueLabel()
    • setTrueLabel

      public void setTrueLabel(String trueLabel)
    • setIconLightOn

      public void setIconLightOn(ImageIcon icon)
      sets the icon associated with the "true" or "1" value (default : SignalScalarLightViewer.redLED)
      Parameters:
      icon - Icon
    • setIconLightOff

      public void setIconLightOff(ImageIcon icon)
      sets the icon associated with the "false" or "0" value (default : SignalScalarLightViewer.grayLED)
      Parameters:
      icon - Icon
    • setIconLightKO

      public void setIconLightKO(ImageIcon icon)
      sets the icon associated with "KO" value = "could not get value" (default : SignalScalarLightViewer.KOLED)
      Parameters:
      icon - Icon
    • booleanScalarChange

      public void booleanScalarChange(fr.esrf.tangoatk.core.BooleanScalarEvent arg0)
      Specified by:
      booleanScalarChange in interface fr.esrf.tangoatk.core.IBooleanScalarListener
      Parameters:
      arg0 - Event
      See Also:
      • IBooleanScalarListener.booleanScalarChange(fr.esrf.tangoatk.core.BooleanScalarEvent)
    • main

      public static void main(String[] args)