Class DensityWindow

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

public class DensityWindow extends GraphicsWindow
Graphics window which displays a density plot, that is a 2-dimensional histogram. Each screen pixel corresponds to a bin of the 2-d histogram, and is coloured according to how many items fall into it.
Since:
1 Dec 2005
Author:
Mark Taylor
See Also:
  • Constructor Details

    • DensityWindow

      public DensityWindow(Component parent)
      Constructs a new DensityWindow.
      Parameters:
      parent - parent component (may be used for positioning)
  • Method Details

    • init

      protected void init()
      Description copied from class: GraphicsWindow
      Perform initialisation which can't be done in the constructor (typically because it calls potentially overridden methods).
      Overrides:
      init in class GraphicsWindow
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • exportFits

      public void exportFits(OutputStream ostrm) throws IOException
      Exports the grids currently displayed in the plot as a FITS image (primary HDU).
      Parameters:
      ostrm - output stream
      Throws:
      IOException