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 intprotected intdefault gutters.protected intprotected intprotected DrawingPanelprotected Colorprotected Colorprotected Fontprotected DecimalFormatprotected Fontprotected Fontprotected DrawableTextLineprotected 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.booleanGets the visibility of the axes.voidvoidresizeFonts(double factor, DrawingPanel panel) Resizes fonts by the specified factor.voidsetDefaultGutters(int left, int top, int right, int bottom) Sets gutters that give the best appearance.voidsetInteriorBackground(Color color) Sets the interior background color.voidSet a title that will be drawn within the drawing panel.voidsetVisible(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, waitMethods inherited from interface org.opensourcephysics.display.Drawable
draw, isInteractiveMethods 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:
setVisiblein 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:
setInteriorBackgroundin interfaceDrawableAxes- Parameters:
color- The new interiorBackground value
-
getInteriorBackground
Gets the color of the interior of the axes.- Specified by:
getInteriorBackgroundin interfaceDrawableAxes- Returns:
- Color
-
resizeFonts
Resizes fonts by the specified factor.- Specified by:
resizeFontsin interfaceDrawableAxes- Parameters:
factor- the factorpanel- the drawing panel on which these axes are drawn
-
getTitle
Gets the title.- Specified by:
getTitlein 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:
setTitlein interfaceDrawableAxes- Parameters:
s- the labelfont_name- an optional font name
-