Class MultiNumberSpectrumViewer

All Implemented Interfaces:
fr.esrf.tangoatk.core.IAttributeStateListener, fr.esrf.tangoatk.core.IErrorListener, fr.esrf.tangoatk.core.ISpectrumListener, IJLChartListener, JDrawable, ActionListener, MouseListener, MouseMotionListener, MouseWheelListener, ImageObserver, MenuContainer, Serializable, EventListener

public class MultiNumberSpectrumViewer extends JLChart implements fr.esrf.tangoatk.core.ISpectrumListener, IJLChartListener, JDrawable
A class to display several spectrum attributes in the same chart. The MultipleNumberSpectrumViewer displays the spectrums according to index value (x axis shows value index).
See Also:
  • Field Details

  • Constructor Details

    • MultiNumberSpectrumViewer

      public MultiNumberSpectrumViewer()
  • Method Details

    • addNumberSpectrumModel

      public void addNumberSpectrumModel(fr.esrf.tangoatk.core.INumberSpectrum ins)
      Adds a numberSpectrum attribute model to the viewer; This method adds the representing DataView to the default axis determined by the defaultAxis bean property which can only be set to AXIS_Y1 or AXIS_Y2
      Parameters:
      ins - : INumberSpectrum the number spectrum attribute
    • getJDWAttributeNumber

      public int getJDWAttributeNumber()
      Returns number of JDW attribute
      Returns:
      Number of JDW attribute
    • getJDWAttribute

      public JDWAttribute getJDWAttribute(int idx)
      Parameters:
      idx - Index of JDW attribute
      Returns:
      the specified JDW attribute
    • addNumberSpectrumModel

      public void addNumberSpectrumModel(fr.esrf.tangoatk.core.INumberSpectrum ins, JDWAttribute jdwAtt)
    • addNumberSpectrumModel

      public void addNumberSpectrumModel(fr.esrf.tangoatk.core.INumberSpectrum ins, String axis)
      Adds a numberSpectrum attribute model to the viewer; This method allows to add the representing DataView to the specified axis.
      Parameters:
      ins - : INumberSpectrum the number spectrum attribute
      axis - : String if AXIS_Y1 the spectrum plot will be added to Y1 axis, if AXIS_Y2 it will be added to Y2 axis, if AXIS_X the spectrum plot will be added to X axis.
    • addNumberSpectrumModelToX

      protected void addNumberSpectrumModelToX(fr.esrf.tangoatk.core.INumberSpectrum ins)
    • removeNumberSpectrumModel

      public void removeNumberSpectrumModel(fr.esrf.tangoatk.core.INumberSpectrum ins)
      Removes a numberSpectrum attribute model from the viewer
      Parameters:
      ins - : INumberSpectrum the number spectrum attribute to remove
    • clearModel

      public void clearModel()
    • getDataView

      public JLDataView getDataView(fr.esrf.tangoatk.core.INumberSpectrum ins)
    • getDefaultAxis

      public String getDefaultAxis()
      Gets the default Axis name.
      Returns:
      the default axis name : AXIS_Y1 or AXIS_Y2
    • setDefaultAxis

      public void setDefaultAxis(String axisName)
      Sets the default Axis name.
      Parameters:
      axisName - : one of the AXIS_Y1 or AXIS_Y2; The default axis cannot be set to AXIS_X
    • setXAxisAffineTransform

      public void setXAxisAffineTransform(double a0, double a1)
      Sets an affine transform to the X axis. This allows to transform spectra index displayed on X axis.
      Parameters:
      a0 - a0 coefficient
      a1 - a1 coefficient
    • setSettings

      public String setSettings(String cfg)
      Apply configuration.
      Parameters:
      cfg - String containing configuration
      Returns:
      error string when failure or an empty string when succesfull
    • getSettings

      public String getSettings()
      Return configuration.
      Returns:
      current chart configuration as string
    • initForEditing

      public void initForEditing()
      Description copied from interface: JDrawable
      Call after a component of a JDSwingObject is created, this give a default look and feel for editing.
      Specified by:
      initForEditing in interface JDrawable
    • getComponent

      public JComponent getComponent()
      Specified by:
      getComponent in interface JDrawable
      Returns:
      the JComponent that implements this interface.
    • getDescription

      public String getDescription(String name)
      Description copied from interface: JDrawable
      Get a description of this extensions.
      Specified by:
      getDescription in interface JDrawable
      Parameters:
      name - Extension name
      Returns:
      Empty string for no description.
    • getExtensionList

      public String[] getExtensionList()
      Specified by:
      getExtensionList in interface JDrawable
      Returns:
      list of extension name for this objects (Empty array for none).
    • setExtendedParam

      public boolean setExtendedParam(String name, String value, boolean popupErr)
      Description copied from interface: JDrawable
      Sets the specified param.
      Specified by:
      setExtendedParam in interface JDrawable
      Parameters:
      name - Parameter name (Case unsensitive).
      value - Parameter value.
      popupErr - true when the JDrawable should display a popup if the parameter value is incorrect, false otherwise. Note that the JDrawable must not display an error message if the parameter does not exists even if popupAllowed is true.
      Returns:
      true if parameters has been succesfully applied, false otherwise.
    • getExtendedParam

      public String getExtendedParam(String name)
      Description copied from interface: JDrawable
      Returns the specified parameter value.
      Specified by:
      getExtendedParam in interface JDrawable
      Parameters:
      name - Param name (Case unsensitive).
      Returns:
      Empty string if not exists, the value otherwise.
    • clickOnChart

      public String[] clickOnChart(JLChartEvent e)
      Description copied from interface: IJLChartListener
      Called when the user click on the chart
      Specified by:
      clickOnChart in interface IJLChartListener
      Parameters:
      e - Event object (containing click inforamtion)
      Returns:
      A set of string to display in the value tooltip. Does not display the tooltip if an empty array is returned. Keep default behavior when null is returned
    • errorChange

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

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

      public void spectrumChange(fr.esrf.tangoatk.core.NumberSpectrumEvent evt)
      Specified by:
      spectrumChange in interface fr.esrf.tangoatk.core.ISpectrumListener
    • main

      public static void main(String[] args)