Class DeviceStateLightViewer

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

public class DeviceStateLightViewer extends JButton implements fr.esrf.tangoatk.core.IStateListener, fr.esrf.tangoatk.core.IErrorListener
DeviceStateLightViewer is a viewer to survey the state of a Devicerepresented by a DEL. DEL color corresponds to the color defined for TANGO.
See ATKWidget Manual to check these colors.
See Also:
  • Field Details

    • name

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

      public static final int state
      int representing the option to see device's state as label
      See Also:
    • nameAndState

      public static final int nameAndState
      int representing the option to see device's name and state as label
      See Also:
    • customLabel

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

    • DeviceStateLightViewer

      public DeviceStateLightViewer()
      Contructs a DeviceStateLightViewer with no label (ie you won't see the state as label, unless you use the setStateTextVisible method).
    • DeviceStateLightViewer

      public DeviceStateLightViewer(fr.esrf.tangoatk.core.Device device, int kindOfLabel, boolean viewLbl)
      Contructs a DeviceStateLightViewer.
      Parameters:
      device - Device
      kindOfLabel - Kind of label
      viewLbl - a boolean to know whether you want to see the state as label or not
  • Method Details

    • setDeviceModel

      public void setDeviceModel(fr.esrf.tangoatk.core.Device device)
      setModel sets the devicePropertyModel of this viewer. If the textLabel property is not set, the name of the device is shown on the textLabel.
      Parameters:
      device - a Device to surveil
    • clearDeviceModel

      public void clearDeviceModel()
      Clears all devicePropertyModel and listener attached to the components
    • getDeviceModel

      public fr.esrf.tangoatk.core.Device getDeviceModel()
      getModel gets the devicePropertyModel of this stateviewer.
      Returns:
      a Device value
    • 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()
      Returns:
      whether devicePropertyModel's label is text of this JLabel or not
    • 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.
    • stateChange

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

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

      public static void main(String[] args)