Class StateViewer

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

public class StateViewer extends JPanel implements fr.esrf.tangoatk.core.IStateListener
State State is a viewer to surveil the state of a Device. Normally one connects the device with the viewer like this:
Device device = getDevice(); // some method to obtain the device. State = new State(); state.setModel(device);
Version:
$Revision$
Author:
Erik Assum
See Also:
  • Constructor Details

    • StateViewer

      public StateViewer()
  • Method Details

    • valueLabelMouseClicked

      protected void valueLabelMouseClicked(MouseEvent evt)
    • getPopUp

      public IDevicePopUp getPopUp()
      Get the value of popUp.
      Returns:
      value of popUp.
    • setPopUp

      public void setPopUp(IDevicePopUp v)
      Set the value of popUp.
      Parameters:
      v - Value to assign to popUp.
    • setModel

      public void setModel(fr.esrf.tangoatk.core.IDevice devModel)
      setModel sets the model of this viewer. If the textLabel property is not set, the name of the device is shown on the textLabel.
      Parameters:
      devModel - a Device to survey
    • clearModel

      public void clearModel()
      clearModel clear the model of this viewer.
    • getTextLabel

      public JLabel getTextLabel()
    • getValueLabel

      public JLabel getValueLabel()
    • getModel

      public fr.esrf.tangoatk.core.IDevice getModel()
      getModel gets the model of this stateviewer.
      Returns:
      a Device value
    • getState

      public String getState()
      getState
      Returns:
      a String value presenting the state of the device
    • setLabel

      public void setLabel(String label)
      setLabel set the text of the label. The default value is to show the name of the device.
      Parameters:
      label - a String value
    • getLabel

      public String getLabel()
    • setLabelVisible

      public void setLabelVisible(boolean visible)
      setLabelVisisble makes the label visible or not.
      Parameters:
      visible - a boolean value
    • isLabelVisible

      public boolean isLabelVisible()
      isLabelVisible returns the visibility of the label
      Returns:
      a boolean value
    • setStateVisible

      public void setStateVisible(boolean visible)
      setStateVisible makes the state visible or not.
      Parameters:
      visible - a boolean value
    • isStateVisible

      public boolean isStateVisible()
      isStateVisible returns the visibility of the state
      Returns:
      a boolean value
    • stateChange

      public void stateChange(fr.esrf.tangoatk.core.StateEvent evt)
      stateChange inherited from IStateListener
      Specified by:
      stateChange in interface fr.esrf.tangoatk.core.IStateListener
      Parameters:
      evt - a StateEvent value
    • errorChange

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

      public void setStateText(String text)
      setStateText sets the text on the colored state box
      Parameters:
      text - a String value
    • getStateText

      public String getStateText()
      getStateText gets the text that is on the colored state box
      Returns:
      a String value
    • setStateFont

      public void setStateFont(Font font)
    • setFont

      public void setFont(Font font)
      Overrides:
      setFont in class JComponent
    • getStateFont

      public Font getStateFont()
    • setStateForeground

      public void setStateForeground(Color color)
    • getStateForeground

      public Color getStateForeground()
    • setForeground

      public void setForeground(Color color)
      Overrides:
      setForeground in class JComponent
    • setStateHorizontalAlignment

      public void setStateHorizontalAlignment(int i)
      setStateHorizontalAlignement
      Parameters:
      i - an int value
      See Also:
    • getStateHorizontalAlignment

      public int getStateHorizontalAlignment()
    • setStatePreferredSize

      public void setStatePreferredSize(Dimension dimension)
    • getStatePreferredSize

      public Dimension getStatePreferredSize()
    • setStateBorder

      public void setStateBorder(Border border)
    • getStateBorder

      public Border getStateBorder()
    • getStateInTooltip

      public boolean getStateInTooltip()
      getStateInTooltip returns true if the device state is displayed inside the viewer's tooltip
      Returns:
      a boolean value
    • setStateInTooltip

      public void setStateInTooltip(boolean b)
      setStateInTooltip display or not the device state inside the tooltip
      Parameters:
      b - If True the device state will be displayed inside the tooltip.
    • setStateClickable

      public void setStateClickable(boolean clickable)
      setStateClickable will the state be clickable?
      Parameters:
      clickable - a boolean value
    • isStateClickable

      public boolean isStateClickable()
      isStateClickable returns if the state is clickable or not.
      Returns:
      a boolean value
    • setApplication

      public void setApplication(fr.esrf.tangoatk.core.IDeviceApplication runnable)
    • getApplication

      public fr.esrf.tangoatk.core.IDeviceApplication getApplication()