Class ScalarLevelMeterViewer

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
fr.esrf.tangoatk.widget.attribute.ScalarLevelMeterViewer
All Implemented Interfaces:
fr.esrf.tangoatk.core.IAttributeStateListener, fr.esrf.tangoatk.core.IErrorListener, fr.esrf.tangoatk.core.INumberScalarListener, ImageObserver, MenuContainer, Serializable, EventListener

public class ScalarLevelMeterViewer extends JComponent implements fr.esrf.tangoatk.core.INumberScalarListener
See Also:
  • Constructor Details

    • ScalarLevelMeterViewer

      public ScalarLevelMeterViewer()
  • Method Details

    • setDrawGradient

      public void setDrawGradient(boolean draw)
      Sets wether draw or not the gradient background
      Parameters:
      draw - draw flag
    • setMin

      public void setMin(double min)
      Sets the minimum of the level meter
      Parameters:
      min - Minimum value
    • getMin

      public double getMin()
    • setMax

      public void setMax(double max)
      Sets the maximum of the level meter
      Parameters:
      max - Miaxmum value
    • getMax

      public double getMax()
    • setViewBackground

      public void setViewBackground(Color c)
      Sets the view meter background color
      Parameters:
      c - background color
    • getViewBackground

      public Color getViewBackground()
      Returns:
      the view meter background color
    • addLabel

      public void addLabel(double x, String label)
      Add a label
      Parameters:
      x - position on the view meter in pourcent)
      label - Label to display
    • clearLabel

      public void clearLabel()
      Clears label
    • numberScalarChange

      public void numberScalarChange(fr.esrf.tangoatk.core.NumberScalarEvent evt)
      Specified by:
      numberScalarChange in interface fr.esrf.tangoatk.core.INumberScalarListener
    • 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
    • paint

      public void paint(Graphics g)
      Overrides:
      paint in class JComponent
    • clearModel

      public void clearModel()
    • setModel

      public void setModel(fr.esrf.tangoatk.core.INumberScalar model)
    • main

      public static void main(String[] args) throws Exception
      Test function
      Parameters:
      args - Not used
      Throws:
      Exception - In case of failure