Class AnnotationPanel

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener

public class AnnotationPanel extends JComponent implements ActionListener
Transparent component for adding additional decoration to an existing plot component.
Since:
8 Apr 2008
Author:
Mark Taylor
See Also:
  • Constructor Details

    • AnnotationPanel

      public AnnotationPanel()
      Constructor.
  • Method Details

    • setActivePoints

      public void setActivePoints(int[] ipoints)
      Sets points which should be marked as "active" by drawing a cursor or something over them.
      Parameters:
      ipoints - array of point indexes (indexes into current PlotData sequence)
    • getActivePoints

      public int[] getActivePoints()
      Returns the current list of active points.
      Returns:
      array of point indexes (indexes into current PlotData sequence)
    • clear

      public void clear()
      Removes any decorations associated with this panel.
    • setPlotData

      public void setPlotData(uk.ac.starlink.ttools.plot.PlotData data)
      Sets the data used by this panel.
      Parameters:
      data - plot data
    • setPlacer

      public void setPlacer(uk.ac.starlink.ttools.plot.PointPlacer placer)
      Sets the PointPlacer which maps from PlotData coordinates to screen positions.
      Parameters:
      placer - point placer
    • getPlacer

      public uk.ac.starlink.ttools.plot.PointPlacer getPlacer()
      Returns the PointPlacer which maps from PlotData coordinates to screen positions. This method may be overridden by subclases (in which case setPlacer(uk.ac.starlink.ttools.plot.PointPlacer) might not work).
      Returns:
      point placer
    • isIncluded

      protected boolean isIncluded(uk.ac.starlink.ttools.plot.PointSequence pseq)
      Indicates whether the current point in a given point sequence is to be included for the purposes of annotations.
      Parameters:
      pseq - point sequence
      Returns:
      true iff the current point of pseq is included
    • dropInvisibles

      public void dropInvisibles()
      Removes any indexes from the active point list which are not currently visible.
    • setPulsing

      public void setPulsing(boolean isPulsing)
      Sets whether active points should pulse or not.
      Parameters:
      isPulsing - true iff you want points to pulse
    • actionPerformed

      public void actionPerformed(ActionEvent evt)
      Specified by:
      actionPerformed in interface ActionListener
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent