Class ViewJComponentFunct

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class ViewJComponentFunct extends JComponent
This is a custom made Swing component. It is coordinates for the ViewJComponentGraph as well as the line color. The graph then uses this information to draw the function.
Version:
1.0 Jun 1, 1999
Author:
Neva Cherniavsky
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • MAX_NUM_COORDS

      public static final int MAX_NUM_COORDS
      Maximum size of the coordinate arrays.
      See Also:
    • X

      public float[] X
      DOCUMENT ME!
    • Y

      public float[] Y
      DOCUMENT ME!
    • XYCoords

      public int[][] XYCoords
      xy coordinates of voi boundar
    • functName

      private String functName
      DOCUMENT ME!
    • lineColor

      private Color lineColor
      DOCUMENT ME!
    • newX

      private int[] newX
      DOCUMENT ME!
    • newXLength

      private int newXLength
      DOCUMENT ME!
    • newY

      private int[] newY
      DOCUMENT ME!
    • newYLength

      private int newYLength
      DOCUMENT ME!
    • originalX

      private float[] originalX
      DOCUMENT ME!
    • originalY

      private float[] originalY
      DOCUMENT ME!
    • showFitFunction

      private boolean showFitFunction
      DOCUMENT ME!
    • showFunction

      private boolean showFunction
      DOCUMENT ME!
    • voi

      private VOI voi
      DOCUMENT ME!
  • Constructor Details

    • ViewJComponentFunct

      public ViewJComponentFunct()
      Constructor - creates empty function.
    • ViewJComponentFunct

      public ViewJComponentFunct(float[] x, float[] y, Color lineColor, VOI v, int[][] xyCoords)
      Constructor - creates functions with specified coordinates and color.
      Parameters:
      x - x coordinates of the function
      y - y coordinates of the function
      lineColor - color for the function
      v - voi this is drawn for if it is for a point, should be null otherwise
    • ViewJComponentFunct

      public ViewJComponentFunct(float[] x, float[] y, int name, VOI v, int[][] xyCoords)
      Constructor - creates functions with specified coordinates, and number for name.
      Parameters:
      x - x coordinates of the function
      y - y coordinates of the function
      name - integer for name of function
      v - voi this is drawn for if it is for a point, should be null otherwise
    • ViewJComponentFunct

      public ViewJComponentFunct(float[] x, float[] y, Color lineColor, String name, VOI v)
      Constructor - creates functions with specified coordinates, color, and name string.
      Parameters:
      x - x coordinates of the function
      y - y coordinates of the function
      lineColor - color for the function
      name - name of function
      v - voi this is drawn for if it is for a point, should be null otherwise
    • ViewJComponentFunct

      public ViewJComponentFunct(float[] x, float[] y, Color lineColor, int name, VOI v, int[][] xyCoords)
      Constructor - creates functions with specified coordinates, color, and number for name.
      Parameters:
      x - x coordinates of the function
      y - y coordinates of the function
      lineColor - color for the function
      name - integer for name of function
      v - voi this is drawn for if it is for a point, should be null otherwise
  • Method Details

    • getColor

      public Color getColor()
      getColor - gets the color of the line on the graph.
      Returns:
      color of the line on the graph
    • getFitFunctionVisible

      public boolean getFitFunctionVisible()
      getFitFunctionVisible - accessor that gets the visible flag of the fitted function.
      Returns:
      the boolean visible flag
    • getFunctionVisible

      public boolean getFunctionVisible()
      getFunctionVisible - accessor that gets the visible flag of the function.
      Returns:
      the boolean visible flag
    • getFunctName

      public String getFunctName()
      getFunctNames - gets the names of the functions.
      Returns:
      names of the functions
    • getNewXs

      public int[] getNewXs()
      getNewXs - accessor that gets the array of x coordinates to be plotted; used by the graphics for the actual plotting of the graph.
      Returns:
      the array of x coordinates
    • getNewXsLength

      public int getNewXsLength()
      Accessor that gets the number of x coordinates to be plotted.
      Returns:
      DOCUMENT ME!
    • getNewYs

      public int[] getNewYs()
      getNewYs - accessor that gets the array of y coordinates to be plotted used by the graphics for the actual plotting of the graph.
      Returns:
      the array of y coordinates
    • getNewYsLength

      public int getNewYsLength()
      Accessor that gets the number of y coordinates to be plotted.
      Returns:
      DOCUMENT ME!
    • getOriginalXs

      public float[] getOriginalXs()
      getOriginalXs - accessor that gets the array of x coordinates to be plotted; used by the zoom to reset the graph.
      Returns:
      the array of x coordinates
    • getOriginalYs

      public float[] getOriginalYs()
      getOriginalYs - accessor that gets the array of y coordinates to be plotted used by the zoom for the rest of the graph.
      Returns:
      the array of y coordinates
    • getVOI

      public VOI getVOI()
      gets the voi associated with this function if it corresponds to a point, otherwise returns null.
      Returns:
      DOCUMENT ME!
    • getXs

      public float[] getXs()
      getXs - accessor that gets the array of x coordinates to be plotted.
      Returns:
      the array of x coordinates
    • getXYCoords

      public int[][] getXYCoords()
    • getYs

      public float[] getYs()
      getYs - accessor that gets the array of y coordinates to be plotted.
      Returns:
      the array of y coordinates
    • setColor

      public void setColor(Color color)
      setColor - sets the color of the line on the graph.
      Parameters:
      color - color to set the line to
    • setColor

      public void setColor(int color)
      setColor - sets the color of the line on the graph.
      Parameters:
      color - code for the color to set the line to
    • setFitFunctionVisible

      public void setFitFunctionVisible(boolean visible)
      setFitFunctionVisible - accessor that tells whether to show the fitted function.
      Parameters:
      visible - boolean to set it to
    • setFunctionVisible

      public void setFunctionVisible(boolean visible)
      setFunctionVisible - accessor that tells whether to show the function.
      Parameters:
      visible - boolean to set it to
    • setFunctName

      public void setFunctName(String name)
      setFunctName - sets the names of the functons.
      Parameters:
      name - - String of function name
    • setFunctName

      public void setFunctName(int i)
      setFunctName - sets the names of the functions to default names (function + number).
      Parameters:
      i - - number of functions
    • setNewXs

      public void setNewXs(int[] oldX, int len)
      setNewXs - accessor that sets the integer array of x coordinates to be plotted; used by the graphics for the actual plotting of the graph.
      Parameters:
      oldX - the array of x coordinates
      len - number of coordinates
    • setNewYs

      public void setNewYs(int[] oldY, int len)
      setNewYs - accessor that sets the integer array of y coordinates to be plotted; used by the graphics for the actual plotting of the graph.
      Parameters:
      oldY - the array of y coordinates
      len - the number of y coordinates
    • setOriginalXs

      public void setOriginalXs(float[] oldX)
      setOriginalXs - accessor that sets the array of x coordinates to be plotted; used by the zoom to reset the graph.
      Parameters:
      oldX - the array of x coordinates
    • setOriginalYs

      public void setOriginalYs(float[] oldY)
      setOriginalYs - accessor that sets the array of y coordinates to be plotted; used by the zoom for reseting the graph.
      Parameters:
      oldY - the array of y coordinates
    • setXs

      public void setXs(float[] oldX)
      setXs - accessor that sets the array of x coordinates to be plotted.
      Parameters:
      oldX - the array of x coordinates
    • setYs

      public void setYs(float[] oldY)
      setYs - accessor that sets the array of y coordinates to be plotted.
      Parameters:
      oldY - the array of y coordinates