Class PlotGraph

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
SpectraPanel

public class PlotGraph extends JComponent

Implements a component that can display an array of tiles, each of which is a 2D graph of sample values.

See Also:
  • Field Details

    • samples

      protected float[] samples
    • statistics

      protected PlotGraph.FloatArrayStatistics statistics
    • nTilesPerColumn

      protected int nTilesPerColumn
    • nTilesPerRow

      protected int nTilesPerRow
    • samplesPerRow

      protected int samplesPerRow
    • samplesPerTile

      protected int samplesPerTile
    • widthOfTile

      protected float widthOfTile
    • heightOfTile

      protected float heightOfTile
    • imageOfRenderedPlot

      protected BufferedImage imageOfRenderedPlot
  • Constructor Details

    • PlotGraph

      protected PlotGraph(int nTilesPerColumn, int nTilesPerRow, float minimum, float maximum)
      Parameters:
      nTilesPerColumn -
      nTilesPerRow -
      minimum -
      maximum -
    • PlotGraph

      public PlotGraph(float[] samples, int nTilesPerColumn, int nTilesPerRow)
      Parameters:
      samples -
      nTilesPerColumn -
      nTilesPerRow -
  • Method Details

    • actuallyPaintComponent

      protected void actuallyPaintComponent(Graphics g, BufferedImage backgroundImage, Rectangle boundsOfPlot, Rectangle boundsOfBackgroundImage)

      Draw the data onto the supplied graphic with the specified background.

      Parameters:
      g - the graphic to draw into
      backgroundImage - the image to use as a background
      boundsOfPlot - what sub-region of the "image" that are the rendered tiles to draw the background image
      boundsOfBackgroundImage - what sub-region of the background image to use
    • paintComponent

      public void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
      Parameters:
      g -
    • main

      public static void main(String[] arg)

      For testing.

      Display the specified sample values as an array of tiles in a window, and take a snapshot of it as a JPEG file.

      Parameters:
      arg - 5 arguments, the data filename (4 bytes per float, two floats per complex pair), the number of samples per tile, the number of tiles per column, the number of tiles per row, and the number of frames to skip (each samples*rows*columns)