Class CustomAxes

java.lang.Object
org.opensourcephysics.display.axes.AbstractAxes
org.opensourcephysics.display.axes.CustomAxes
All Implemented Interfaces:
DrawableAxes, Drawable

public class CustomAxes extends AbstractAxes implements DrawableAxes
  • Constructor Details

    • CustomAxes

      public CustomAxes(PlottingPanel panel)
      Constructor CustomAxes
      Parameters:
      panel -
  • Method Details

    • setXLabel

      public void setXLabel(String s, String font_name)
      Sets the x label of the axes. The font names understood are those understood by java.awt.Font.decode(). If the font name is null, the font remains unchanged.
      Specified by:
      setXLabel in interface DrawableAxes
      Parameters:
      s - the label
      font_name - an optional font name
    • setYLabel

      public void setYLabel(String s, String font_name)
      Sets the y label of the axes. The font names understood are those understood by java.awt.Font.decode(). If the font name is null, the font remains unchanged.
      Specified by:
      setYLabel in interface DrawableAxes
      Parameters:
      s - the label
      font_name - an optional font name
    • getXLabel

      public String getXLabel()
      Gets the x axis label.
      Specified by:
      getXLabel in interface DrawableAxes
      Returns:
      String
    • getYLabel

      public String getYLabel()
      Gets the y axis label.
      Specified by:
      getYLabel in interface DrawableAxes
      Returns:
      String
    • getTitle

      public String getTitle()
      Gets the title.
      Specified by:
      getTitle in interface DrawableAxes
      Overrides:
      getTitle in class AbstractAxes
      Returns:
      String
    • setTitle

      public void setTitle(String s, String font_name)
      Set a title that will be drawn within the drawing panel. The font names understood are those understood by java.awt.Font.decode(). If the font name is null, the font remains unchanged.
      Specified by:
      setTitle in interface DrawableAxes
      Overrides:
      setTitle in class AbstractAxes
      Parameters:
      s - the label
      font_name - an optional font name
    • setXLog

      public void setXLog(boolean isLog)
      Sets the x axis to linear or logarithmic.
      Parameters:
      isLog - true for log scale; false otherwise
    • setYLog

      public void setYLog(boolean isLog)
      Sets the y axis to linear or logarithmic.
      Parameters:
      isLog - true for log scale; false otherwise
    • setVisible

      public void setVisible(boolean isVisible)
      Sets the visibility of the axes.
      Specified by:
      setVisible in interface DrawableAxes
      Overrides:
      setVisible in class AbstractAxes
      Parameters:
      isVisible - true if the axes are visible
    • setInteriorBackground

      public void setInteriorBackground(Color color)
      Sets the interior background color.
      Specified by:
      setInteriorBackground in interface DrawableAxes
      Overrides:
      setInteriorBackground in class AbstractAxes
      Parameters:
      color -
    • setShowMajorXGrid

      public void setShowMajorXGrid(boolean showGrid)
      Shows a grid line for every x axis major tickmark.
      Specified by:
      setShowMajorXGrid in interface DrawableAxes
      Parameters:
      showGrid -
    • setShowMinorXGrid

      public void setShowMinorXGrid(boolean showGrid)
      Shows a grid line for every x axis minor tickmark.
      Specified by:
      setShowMinorXGrid in interface DrawableAxes
      Parameters:
      showGrid -
    • setShowMajorYGrid

      public void setShowMajorYGrid(boolean showGrid)
      Shows a grid line for every y axis major tickmark.
      Specified by:
      setShowMajorYGrid in interface DrawableAxes
      Parameters:
      showGrid -
    • setShowMinorYGrid

      public void setShowMinorYGrid(boolean showGrid)
      Shows a grid line for every y axis minor tickmark.
      Specified by:
      setShowMinorYGrid in interface DrawableAxes
      Parameters:
      showGrid -
    • addDrawable

      public void addDrawable(Drawable drawable)
      Adds a drawable object to the drawable list.
      Parameters:
      drawable -
    • draw

      public void draw(DrawingPanel panel, Graphics g)
      Draws the axes in a drawing panel.
      Specified by:
      draw in interface Drawable
      Parameters:
      panel -
      g -