Class XYPlotPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
StatisticsPanel

public abstract class XYPlotPanel extends JPanel
The XYPlotPanel is an abstract class that draws axes and labels for an x-y plot. It is up to the child class to draw the actual x-y data.
Since:
3.1.7
Author:
Peter Hollemans
See Also:
  • Field Details

    • AXIS_TICKS

      public static final int AXIS_TICKS
      The number of axis ticks.
      See Also:
  • Constructor Details

    • XYPlotPanel

      public XYPlotPanel()
  • Method Details

    • getXLabel

      protected abstract String getXLabel()
      Gets the x-axis label.
    • getYLabel

      protected abstract String getYLabel()
      Gets the y-axis label.
    • getXRange

      protected abstract double[] getXRange()
      Gets the x-axis value range as [min, max]. If the range has invalid values or min==max, no plot is drawn.
    • getYRange

      protected abstract double[] getYRange()
      Gets the y-axis value range as [min, max]. If the range has invalid values or min==max, no plot is drawn.
    • getPlotBounds

      protected Rectangle getPlotBounds()
      Gets the rectangle used to display the plot data.
    • getPlotAffine

      protected AffineTransform getPlotAffine()
      Gets the affine transform for translating data coordinates to plot coordinates.
    • getValid

      protected boolean getValid()
      Returns true if the plot is valid, or false if not. If the plot is invalid, there is no need to draw any data.
    • paintComponent

      public void paintComponent(Graphics g)
      Paints the x-y panel axes and labels.
      Overrides:
      paintComponent in class JComponent