Class HistogramWindow

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

public class HistogramWindow extends GraphicsWindow
GraphicsWindow which presents one-dimensional data as a histogram.
Since:
11 Nov 2005
Author:
Mark Taylor
See Also:
  • Constructor Details

    • HistogramWindow

      public HistogramWindow(Component parent)
      Constructs a new histogram window.
      Parameters:
      parent - parent component (may be used for positioning)
  • 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
    • 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
    • getMainRangeCount

      public int getMainRangeCount()
      Description copied from class: GraphicsWindow
      Returns the number of axes whose ranges can be reset excluding any auxiliary axes.
      Overrides:
      getMainRangeCount in class GraphicsWindow
    • 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
    • getStyleSets

      public uk.ac.starlink.ttools.plot.StyleSet[] getStyleSets()
    • 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
    • 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
    • calculateRanges

      public uk.ac.starlink.ttools.plot.Range[] calculateRanges(uk.ac.starlink.ttools.plot.PlotData data, uk.ac.starlink.ttools.plot.PlotState state)
      Description copied from class: GraphicsWindow
      Calculates data ranges for a given data set. The returned Range array is the one which will be returned from future calls of GraphicsWindow.getDataRanges().
      Overrides:
      calculateRanges in class GraphicsWindow
      Parameters:
      data - point data for the plot
      state - plot state
      Returns:
      ranges