Class LinesWindow

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants, TopcatListener

public class LinesWindow extends GraphicsWindow implements TopcatListener
GraphicsWindow which draws a stack of line graphs.
Since:
3 Mar 2006
Author:
Mark Taylor
See Also:
  • Constructor Details

    • LinesWindow

      public LinesWindow(Component parent)
      Constructor.
      Parameters:
      parent - parent component
  • Method Details

    • getPlotPanel

      protected JComponent getPlotPanel()
      Description copied from class: GraphicsWindow
      Returns the component containing the graphics output of this window. This is the component which is exported or printed etc alongside the legend which is managed by GraphicsWindow. It should therefore contain only the output data, not any user interface decoration.
      Specified by:
      getPlotPanel in class GraphicsWindow
      Returns:
      plot container
    • doReplot

      protected void doReplot(uk.ac.starlink.ttools.plot.PlotState state)
      Description copied from class: GraphicsWindow
      Performs an actual plot.
      Overrides:
      doReplot in class GraphicsWindow
      Parameters:
      state - plot state determining details of plot configuration
    • createPlotState

      protected uk.ac.starlink.ttools.plot.PlotState createPlotState()
      Description copied from class: GraphicsWindow
      Constructs a new PlotState. This is called by GraphicsWindow.getPlotState() prior to the PlotState configuration done there. Thus if a subclass wants to provide and configure a particular state (for instance one of a specialised subclass of PlotState) it can override this method to do so. The default implementation just invokes new PlotState().
      Overrides:
      createPlotState in class GraphicsWindow
      Returns:
      returns a new PlotState object ready for generic configuration
    • getPlotState

      public uk.ac.starlink.ttools.plot.PlotState getPlotState()
      Description copied from class: GraphicsWindow
      Returns an object which characterises the choices the user has made in the GUI to indicate the plot that s/he wants to see.

      The GraphicsWindow implementation of this method as well as populating the state with standard information also calls PointSelection.readPoints(javax.swing.BoundedRangeModel) and GraphicsWindow.calculateRanges(uk.ac.starlink.topcat.plot.PointSelection, uk.ac.starlink.topcat.plot.Points, uk.ac.starlink.ttools.plot.PlotState) if necessary.

      Overrides:
      getPlotState in class GraphicsWindow
      Returns:
      snapshot of the currently-selected plot request
    • createPointSelector

      protected PointSelector createPointSelector()
      Description copied from class: GraphicsWindow
      Returns a new PointSelector instance to be used for selecting points to be plotted.
      Overrides:
      createPointSelector in class GraphicsWindow
      Returns:
      new point selector component
    • createStyleEditor

      protected StyleEditor createStyleEditor()
      Description copied from class: GraphicsWindow
      Creates a style editor suitable for this window.
      Specified by:
      createStyleEditor in class GraphicsWindow
      Returns:
      new style editor
    • setStyles

      public void setStyles(uk.ac.starlink.ttools.plot.StyleSet styles)
      Description copied from class: GraphicsWindow
      Sets the style set to use for this window.
      Overrides:
      setStyles in class GraphicsWindow
      Parameters:
      styles - new style set
    • getStyles

      public MutableStyleSet getStyles()
      Description copied from class: GraphicsWindow
      Returns a style set suitable for use with a new PointSelector. Note this is not the same object as was set by GraphicsWindow.setStyles(uk.ac.starlink.ttools.plot.StyleSet), but it is based on it - it will dispense styles from the same set, but avoid styles already dispensed to other selectors.
      Overrides:
      getStyles in class GraphicsWindow
      Returns:
      style set suitable for a new selector
    • getDefaultStyles

      public uk.ac.starlink.ttools.plot.StyleSet getDefaultStyles(int npoint)
      Description copied from class: GraphicsWindow
      Returns a StyleSet which can supply markers. The npoint may be used as a hint for how many points are expected to be drawn with it.
      Specified by:
      getDefaultStyles in class GraphicsWindow
      Parameters:
      npoint - approximate number of points - use -1 for unknown
      Returns:
      style factory
    • calculateRanges

      public uk.ac.starlink.ttools.plot.Range[] calculateRanges(uk.ac.starlink.ttools.plot.PlotData data, uk.ac.starlink.ttools.plot.PlotState state)
      Returns a 1-element array giving only the X axis range.
      Overrides:
      calculateRanges in class GraphicsWindow
      Parameters:
      data - point data for the plot
      state - plot state
      Returns:
      ranges
    • isLegendInteresting

      protected boolean isLegendInteresting(uk.ac.starlink.ttools.plot.PlotState state)
      Description copied from class: GraphicsWindow
      Indicates whether the legend is worth showing for a given plot state.
      Overrides:
      isLegendInteresting in class GraphicsWindow
      Parameters:
      state - plot state
      Returns:
      true iff the legend would show non-trivial information
    • modelChanged

      public void modelChanged(TopcatEvent evt)
      Description copied from interface: TopcatListener
      Invoked when the model has changed in some way.
      Specified by:
      modelChanged in interface TopcatListener
      Parameters:
      evt - event description