Class Complex2DFrame

All Implemented Interfaces:
ClipboardOwner, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, AppFrame, Hidable

public class Complex2DFrame extends DrawingFrame
A DrawingFrame that displays 2D plots of complex scalar fields.
Version:
1.0
Author:
W. Christian
See Also:
  • Constructor Details

    • Complex2DFrame

      public Complex2DFrame(String xlabel, String ylabel, String frameTitle)
      Constructs a Complex2DFrame with the given axes labels and frame title.
      Parameters:
      xlabel - String
      ylabel - String
      frameTitle - String
    • Complex2DFrame

      public Complex2DFrame(String frameTitle)
      Constructs a Complex2DFrame with the given frame title but without axes.
      Parameters:
      frameTitle - String
  • Method Details

    • setAutoscaleZ

      public void setAutoscaleZ(boolean isAutoscale, double floor, double ceil)
      Sets the autoscale flag and the floor and ceiling values for the intensity.
      Parameters:
      isAutoscale -
      floor -
      ceil -
    • setBuffered

      public void setBuffered(boolean b)
      Sets the buffered image option. Buffered panels copy the offscreen image into the panel during a repaint unless the image has been invalidated. Use the render() method to draw the image immediately.
      Parameters:
      b -
    • setShowGrid

      public void setShowGrid(boolean show)
      Outlines the data grid's boundaries.
      Parameters:
      showGrid -
    • isShowGrid

      public boolean isShowGrid()
      True if the data grid's boundaries are shown.
      Returns:
      showGrid
    • addMenuItems

      protected void addMenuItems()
      Adds Views menu items on the menu bar.
      Overrides:
      addMenuItems in class DrawingFrame
    • getDrawables

      public ArrayList<Drawable> getDrawables()
      Gets Drawable objects added by the user to this frame.
      Overrides:
      getDrawables in class DrawingFrame
      Returns:
      the list
    • getDrawables

      public <T extends Drawable> ArrayList<T> getDrawables(Class<T> c)
      Gets Drawable objects added by the user of an assignable type. The list contains objects that are assignable from the class or interface.
      Overrides:
      getDrawables in class DrawingFrame
      Parameters:
      c - the type of Drawable object
      Returns:
      the cloned list
      See Also:
    • clearDrawables

      public void clearDrawables()
      Removes drawable objects added by the user from this frame.
      Overrides:
      clearDrawables in class DrawingFrame
    • clearData

      public void clearData()
      Clears data by setting the scalar field to zero.
      Overrides:
      clearData in class OSPFrame
    • convertToInterpolatedPlot

      public void convertToInterpolatedPlot()
    • convertToGridPlot

      public void convertToGridPlot()
    • convertToSurfacePlot

      public void convertToSurfacePlot()
      Converts to a SurfacePlot plot.
    • resizeGrid

      public void resizeGrid(int nx, int ny)
      Resizes the grid used to store the field using the panel's preferred min/max values.
      Parameters:
      nx - int
      ny - int
    • setRow

      public void setRow(int row, double[][] vals) throws IllegalArgumentException
      Throws:
      IllegalArgumentException
    • setAll

      public void setAll(double[][][] vals, double xmin, double xmax, double ymin, double ymax)
      Sets the complex field's values and scale..
      Parameters:
      vals - int[][][] the new values
      xmin - double
      xmax - double
      ymin - double
      ymax - double
    • setAll

      public void setAll(double[][][] vals)
      Sets the complex field's values. vals[0][][] is assumed to contain the real components of the field. vals[1][][] is assumed to contain the imaginary components of the field.
      Parameters:
      vals - double[][][] complex field values
    • setAll

      public void setAll(double[] vals, int nx, double xmin, double xmax, double ymin, double ymax)
      Sets the comples field's data and scale. The array is assumed to contain complex numbers in row-major format.
      Parameters:
      vals - int[][][] the new values
      nx -
      xmin - double
      xmax - double
      ymin - double
      ymax - double
    • setAll

      public void setAll(double[] vals)
      Sets the comples field's data using the given array. The array is assumed to contain complex numbers in row-major format.
      Parameters:
      vals - double[] complex field values
    • showDataTable

      public void showDataTable(boolean show)
      Shows or hides the data table.
      Parameters:
      show - boolean
    • indexToX

      public double indexToX(int i)
      Gets the x coordinate for the given index.
      Parameters:
      i - int
      Returns:
      double the x coordiante
    • xToIndex

      public int xToIndex(double x)
      Gets the index that is closest to the given x value
      Returns:
      double the x coordiante
    • yToIndex

      public int yToIndex(double y)
      Gets the index that is closest to the given y value
      Returns:
      double the y coordiante
    • indexToY

      public double indexToY(int i)
      Gets the y coordinate for the given index.
      Parameters:
      i - int
      Returns:
      double the y coordiante