Package rocca

Class SpectrogramPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class SpectrogramPanel extends JPanel
Creates a graphical representation from a matrix. Like Matlab's imagesc.
See Also:
  • Constructor Details

    • SpectrogramPanel

      public SpectrogramPanel(RoccaSpecPopUp roccaSpecPopUp)
      Creates a new SpectrogramPanel for the given data matrix
  • Method Details

    • setColors

      public void setColors()
      Set the colors of the spectrogram, based on the FFT values
    • setColorOffset

      public void setColorOffset(double colorOffset)
      Updates the offset factor used to calculate brightness. Increasing this variable increases the brightness of the spectrogram, while decreasing it has the opposite effect
      Parameters:
      colorOffset - the offset factor used to calculate the brightness
    • getColorOffset

      public double getColorOffset()
    • setColorScale

      public void setColorScale(double colorScale)
      Updates the scale factor used to calculate contrast. Increasing this variable increases the contrast of the spectrogram, while decreasing it has the opposite effect
      Parameters:
      colorScale - the scaling factor used to calculate the contrast
    • getColorScale

      public double getColorScale()
    • getVZoom

      public float getVZoom()
    • getHZoom

      public float getHZoom()
    • getData

      public double getData(int x, int y)
    • getDataWidth

      public int getDataWidth()
    • getDataHeight

      public int getDataHeight()
    • paintComponent

      public void paintComponent(Graphics g)
      Paint the component. This will be called by AWT/Swing.
      Parameters:
      g - The Graphics to draw on.
    • getScaledImageSize

      public Dimension getScaledImageSize()