Class AbstractAxes
java.lang.Object
org.opensourcephysics.display.axes.AbstractAxes
- All Implemented Interfaces:
DrawableAxes
,Drawable
- Direct Known Subclasses:
AbstractPolarAxis
,CartesianType1
,CartesianType2
,CartesianType3
,CustomAxes
An abstract class for axes that defines font and title accessor methods.
Copyright (c) 2024
- Version:
- 1.0
- Author:
- Wolfgang Christian
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
protected int
default gutters.protected int
protected int
protected DrawingPanel
protected Color
protected Color
protected Font
protected DecimalFormat
protected Font
protected Font
protected DrawableTextLine
protected boolean
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractAxes
(DrawingPanel drawingPanel) Creates axes that will display themselves within the given drawing panel. -
Method Summary
Modifier and TypeMethodDescriptionGets the color of the interior of the axes.getTitle()
Gets the title.boolean
Gets the visibility of the axes.void
void
resizeFonts
(double factor, DrawingPanel panel) Resizes fonts by the specified factor.void
setDefaultGutters
(int left, int top, int right, int bottom) Sets gutters that give the best appearance.void
setInteriorBackground
(Color color) Sets the interior background color.void
Set a title that will be drawn within the drawing panel.void
setVisible
(boolean isVisible) Sets the visibility of the axes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opensourcephysics.display.Drawable
draw, isInteractive
Methods inherited from interface org.opensourcephysics.display.axes.DrawableAxes
getXLabel, getYLabel, setShowMajorXGrid, setShowMajorYGrid, setShowMinorXGrid, setShowMinorYGrid, setXLabel, setYLabel
-
Field Details
-
defaultLeftGutter
protected int defaultLeftGutterdefault gutters. -
defaultTopGutter
protected int defaultTopGutter -
defaultRightGutter
protected int defaultRightGutter -
defaultBottomGutter
protected int defaultBottomGutter -
visible
protected boolean visible -
titleFont
-
labelFont
-
superscriptFont
-
labelFormat
-
gridcolor
-
interiorColor
-
titleLine
-
drawingPanel
-
-
Constructor Details
-
AbstractAxes
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 interfaceDrawableAxes
- 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
Sets the interior background color.- Specified by:
setInteriorBackground
in interfaceDrawableAxes
- Parameters:
color
- The new interiorBackground value
-
getInteriorBackground
Gets the color of the interior of the axes.- Specified by:
getInteriorBackground
in interfaceDrawableAxes
- Returns:
- Color
-
resizeFonts
Resizes fonts by the specified factor.- Specified by:
resizeFonts
in interfaceDrawableAxes
- Parameters:
factor
- the factorpanel
- the drawing panel on which these axes are drawn
-
getTitle
Gets the title.- Specified by:
getTitle
in interfaceDrawableAxes
- Returns:
- String
-
setTitle
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 interfaceDrawableAxes
- Parameters:
s
- the labelfont_name
- an optional font name
-