Class ViewJComponentGraphAxes

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class ViewJComponentGraphAxes extends JComponent
See Also:
  • Field Details

    • serialVersionUID

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

      public static final int X_AXIS
      See Also:
    • Y_AXIS

      public static final int Y_AXIS
      See Also:
    • LEFT

      public static final int LEFT
      See Also:
    • TOP

      public static final int TOP
      See Also:
    • BOTTOM

      public static final int BOTTOM
      See Also:
    • bounds

      private Rectangle bounds
      DOCUMENT ME!
    • font12B

      private Font font12B
      DOCUMENT ME!
    • gridLines

      private int gridLines
      DOCUMENT ME!
    • label

      private String label
      DOCUMENT ME!
    • orientation

      private int orientation
    • justified

      private int justified
    • border

      private int border
    • min

      protected float min
    • max

      protected float max
  • Constructor Details

    • ViewJComponentGraphAxes

      public ViewJComponentGraphAxes(int orientation, int justified, int width, int height, String label, int border)
  • Method Details

    • setMinMax

      public void setMinMax(float min, float max)
    • getPreferredSize

      public Dimension getPreferredSize()
      Accessor that returns the preferred size of the component.
      Overrides:
      getPreferredSize in class JComponent
      Returns:
      the preferred size
    • paintComponent

      public void paintComponent(Graphics g)
      Paints the graph. Checks if the labels are defined and draws them, checks if the gridlines should be shown and draws them, then calls PolyLine with the points.
      Overrides:
      paintComponent in class JComponent
      Parameters:
      g - Graphics to paint in
    • update

      public void update(Graphics g)
      Calls paint.
      Overrides:
      update in class JComponent
      Parameters:
      g - Graphics to paint in
    • makeString

      private String makeString(float number, int decPts)
      Makes a string of a float with a specific number of decimal points.
      Parameters:
      number - number to be converted to a string
      decPts - the number of decimal points
      Returns:
      string representation of the number