Class AttributeQualityLightViewer

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

public class AttributeQualityLightViewer extends JButton implements fr.esrf.tangoatk.core.IAttributeStateListener, fr.esrf.tangoatk.core.IErrorListener
A LED that will take the appropriate color for an attribute's quality
Author:
SOLEIL
See Also:
  • Field Details

    • 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:
    • quality

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

      public static final int labelAndQuality
      int representing the option to see attribute's label and quality as label
      See Also:
    • nameAndQuality

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

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

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

    • AttributeQualityLightViewer

      public AttributeQualityLightViewer()
      Constructs a AttributeQualityLightViewer with a devicePropertyModel = null No label will be shown. If you use setViewLabel(true), you will see the attribute's label as label by default.
    • AttributeQualityLightViewer

      public AttributeQualityLightViewer(fr.esrf.tangoatk.core.IAttribute attribute, int kindOfLabel, boolean viewLbl)
      Constructs a AttributeQualityLightViewer
      Parameters:
      attribute - the attribute to associate with this viewer (devicePropertyModel of this viewer)
      kindOfLabel - the kind of label you wish to see
      viewLbl - to say whether you wish to display label or not
  • Method Details

    • getAttributeModel

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

      public void setAttributeModel(fr.esrf.tangoatk.core.IAttribute attrModel)
      Associates an attribute to this component.
      Parameters:
      attrModel - The attribute to associate with this component.
    • clearAttributeModel

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

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

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

      public void setViewLabel(boolean b)
      To set or unset devicePropertyModel's label as text of this JLabel
      Parameters:
      b - a boolean to view or not label of this JLabel. if true and devicePropertyModel is not null, it will show label depending on the chosen label. if devicePropertyModel is null a message in label will warn user that there is no attribute
    • isViewLabel

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

      public void setChosenLabel(int chosen)
      A method to know which kind of label you want to have. The label will be visible only if you used setViewLabel(true)
      Parameters:
      chosen - the kind of label you want to have use the associated static variables.
    • getChosenLabel

      public int getChosenLabel()
      A method to know which kind of label is associated with this JLabel
      Returns:
      an int that represents the kind of label chosen. Compare it with the static variables
    • main

      public static void main(String[] args)