Class AbstractAxes

java.lang.Object
org.opensourcephysics.display.axes.AbstractAxes
All Implemented Interfaces:
DrawableAxes, Drawable
Direct Known Subclasses:
AbstractPolarAxis, CartesianType1, CartesianType2, CartesianType3, CustomAxes

public abstract class AbstractAxes extends Object implements DrawableAxes
An abstract class for axes that defines font and title accessor methods.

Copyright (c) 2024

Version:
1.0
Author:
Wolfgang Christian
  • Field Details

    • defaultLeftGutter

      protected int defaultLeftGutter
      default gutters.
    • defaultTopGutter

      protected int defaultTopGutter
    • defaultRightGutter

      protected int defaultRightGutter
    • defaultBottomGutter

      protected int defaultBottomGutter
    • visible

      protected boolean visible
    • titleFont

      protected Font titleFont
    • labelFont

      protected Font labelFont
    • superscriptFont

      protected Font superscriptFont
    • labelFormat

      protected DecimalFormat labelFormat
    • gridcolor

      protected Color gridcolor
    • interiorColor

      protected Color interiorColor
    • titleLine

      protected DrawableTextLine titleLine
    • drawingPanel

      protected DrawingPanel drawingPanel
  • Constructor Details

    • AbstractAxes

      public AbstractAxes(DrawingPanel drawingPanel)
      Creates axes that will display themselves within the given drawing panel.
      Parameters:
      drawingPanel - DrawingPanel
  • Method Details

    • setDefaultGutters

      public void setDefaultGutters(int left, int top, int right, int bottom)
      Sets gutters that give the best appearance.
      Parameters:
      left -
      top -
      right -
      bottom -
    • resetPanelGutters

      public void resetPanelGutters()
    • setVisible

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

      public boolean isVisible()
      Gets the visibility of the axes.
      Returns:
      true if the axes is drawn
    • setInteriorBackground

      public void setInteriorBackground(Color color)
      Sets the interior background color.
      Specified by:
      setInteriorBackground in interface DrawableAxes
      Parameters:
      color - The new interiorBackground value
    • getInteriorBackground

      public Color getInteriorBackground()
      Gets the color of the interior of the axes.
      Specified by:
      getInteriorBackground in interface DrawableAxes
      Returns:
      Color
    • resizeFonts

      public void resizeFonts(double factor, DrawingPanel panel)
      Resizes fonts by the specified factor.
      Specified by:
      resizeFonts in interface DrawableAxes
      Parameters:
      factor - the factor
      panel - the drawing panel on which these axes are drawn
    • getTitle

      public String getTitle()
      Gets the title.
      Specified by:
      getTitle in interface DrawableAxes
      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
      Parameters:
      s - the label
      font_name - an optional font name