Class AugmentedAxesSelector

  • All Implemented Interfaces:
    AxesSelector, uk.ac.starlink.util.Wrapper

    public class AugmentedAxesSelector
    extends java.lang.Object
    implements AxesSelector, uk.ac.starlink.util.Wrapper
    AxesSelector implementation that wraps an existing one and adds some auxiliary axes of its own. These auxiliary axes are optional and may be rendered visible or not using the setAuxVisible(int) method.
    Since:
    4 Jun 2007
    Author:
    Mark Taylor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addActionListener​(java.awt.event.ActionListener listener)
      Adds a listener which is notified when any of the selections made by this component changes.
      AxisEditor[] createAxisEditors()
      Constructs an array of AxisEditor objects suitable for modifying the axes which are defined by this selector.
      PointStore createPointStore​(int npoint)
      Returns a PointStore suitable for storing coordinate and error information generated by the current state of this selector.
      CartesianAxesSelector getAuxSelector()
      Returns the constituent selector which deals only with the auxiliary axes.
      java.lang.Object getBase()
      Returns the selector that this one is augmenting (before the auxiliary axes are added to it).
      javax.swing.JComponent getColumnSelectorPanel()
      Returns the panel which contains column selectors and any other UI components that the concrete subclass wants to place.
      javax.swing.JComboBox[] getColumnSelectors()
      Returns the array of combo boxes which are used to select column or other values.
      uk.ac.starlink.table.StarTable getData()
      Returns a StarTable which corresponds to the data in the columns selected by the current selections on this object.
      uk.ac.starlink.table.StarTable getErrorData()
      Returns a StarTable which corresponds to the error data defined by the current selections.
      uk.ac.starlink.ttools.plot.ErrorMode[] getErrorModes()
      Returns the error modes currently in force for this selector.
      uk.ac.starlink.table.StarTable getLabelData()
      Returns a StarTable whose single column contains a label for each point.
      int getNdim()
      Returns the number of columns in the table that AxesSelector.getData() will return.
      void initialiseSelectors()
      Hint to set up the values of the column selectors to a sensible value.
      boolean isReady()
      Indicates whether this selector has enough state filled in to be able to specify some point data.
      void removeActionListener​(java.awt.event.ActionListener listener)
      void setAuxVisible​(int nVis)
      Sets the number of auxiliary axis selectors which are visible.
      void setTable​(TopcatModel tcModel)
      Set up column selectors correctly for the given model.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AugmentedAxesSelector

        public AugmentedAxesSelector​(AxesSelector baseSelector,
                                     int naux,
                                     ToggleButtonModel[] logModels,
                                     ToggleButtonModel[] flipModels,
                                     javax.swing.ComboBoxModel[] shaderModels)
        Constructor. Initially none of the auxiliary axes are visible.
        Parameters:
        baseSelector - the base selector to which this will append auxiliary axes
        naux - number of auxiliary axes to append
        logModels - naux-element array of models flagging per-axis log scaling (or null)
        flipModels - naux-element array of models flagging per-axis sense inversion (or null)
        shaderModels - naux-element array of combo box models to display with each aux axis (or null)
    • Method Detail

      • getBase

        public java.lang.Object getBase()
        Returns the selector that this one is augmenting (before the auxiliary axes are added to it).
        Specified by:
        getBase in interface uk.ac.starlink.util.Wrapper
        Returns:
        base axes selector
      • getAuxSelector

        public CartesianAxesSelector getAuxSelector()
        Returns the constituent selector which deals only with the auxiliary axes.
        Returns:
        auxiliary-only axes selector
      • setAuxVisible

        public void setAuxVisible​(int nVis)
        Sets the number of auxiliary axis selectors which are visible. The initial value is zero. Calling this method will make the first nVis axes visible.
        Parameters:
        nVis - number of auxiliary axis selectors to show
      • getColumnSelectorPanel

        public javax.swing.JComponent getColumnSelectorPanel()
        Description copied from interface: AxesSelector
        Returns the panel which contains column selectors and any other UI components that the concrete subclass wants to place.
        Specified by:
        getColumnSelectorPanel in interface AxesSelector
        Returns:
        column selector panel
      • getColumnSelectors

        public javax.swing.JComboBox[] getColumnSelectors()
        Description copied from interface: AxesSelector
        Returns the array of combo boxes which are used to select column or other values.
        Specified by:
        getColumnSelectors in interface AxesSelector
        Returns:
        array of column selector combo boxes
      • isReady

        public boolean isReady()
        Description copied from interface: AxesSelector
        Indicates whether this selector has enough state filled in to be able to specify some point data.
        Specified by:
        isReady in interface AxesSelector
        Returns:
        true iff properly filled in
      • getData

        public uk.ac.starlink.table.StarTable getData()
        Description copied from interface: AxesSelector
        Returns a StarTable which corresponds to the data in the columns selected by the current selections on this object.

        Note: for performance reasons, it is imperative that two tables returned from this method must match according to the Object.equals(java.lang.Object) method if they are known to contain the same cell data (i.e. if the state of this selector has not changed in the mean time). Don't forget to do hashCode too.

        Specified by:
        getData in interface AxesSelector
        Returns:
        table containing the data from the current selection
      • getErrorData

        public uk.ac.starlink.table.StarTable getErrorData()
        Description copied from interface: AxesSelector
        Returns a StarTable which corresponds to the error data defined by the current selections. The details of how the table columns are laid out are down to the concrete subclass.

        See the notes in AxesSelector.getData() about table equality - the same constraints apply.

        Specified by:
        getErrorData in interface AxesSelector
        Returns:
        error data table
      • getErrorModes

        public uk.ac.starlink.ttools.plot.ErrorMode[] getErrorModes()
        Description copied from interface: AxesSelector
        Returns the error modes currently in force for this selector.
        Specified by:
        getErrorModes in interface AxesSelector
        Returns:
        error mode array
      • getLabelData

        public uk.ac.starlink.table.StarTable getLabelData()
        Description copied from interface: AxesSelector
        Returns a StarTable whose single column contains a label for each point.

        See the notes in AxesSelector.getData() about table equality - the same constraints apply.

        Specified by:
        getLabelData in interface AxesSelector
        Returns:
        label table
      • createAxisEditors

        public AxisEditor[] createAxisEditors()
        Description copied from interface: AxesSelector
        Constructs an array of AxisEditor objects suitable for modifying the axes which are defined by this selector. The number of them is often, but not necessarily, the same as the dimensionality of this selector.
        Specified by:
        createAxisEditors in interface AxesSelector
        Returns:
        array of new AxisEditors
      • setTable

        public void setTable​(TopcatModel tcModel)
        Description copied from interface: AxesSelector
        Set up column selectors correctly for the given model. This will involve setting the column selector models appropriately. If the submitted table is null, then the selector models should be unselected.
        Specified by:
        setTable in interface AxesSelector
        Parameters:
        tcModel - table for which selectors must be configured
      • initialiseSelectors

        public void initialiseSelectors()
        Description copied from interface: AxesSelector
        Hint to set up the values of the column selectors to a sensible value. An implementation which does nothing is legal.
        Specified by:
        initialiseSelectors in interface AxesSelector
      • addActionListener

        public void addActionListener​(java.awt.event.ActionListener listener)
        Description copied from interface: AxesSelector
        Adds a listener which is notified when any of the selections made by this component changes.
        Specified by:
        addActionListener in interface AxesSelector
        Parameters:
        listener - listener to add