Class CustomAxes
java.lang.Object
org.opensourcephysics.display.axes.AbstractAxes
org.opensourcephysics.display.axes.CustomAxes
- All Implemented Interfaces:
DrawableAxes,Drawable
-
Field Summary
Fields inherited from class org.opensourcephysics.display.axes.AbstractAxes
defaultBottomGutter, defaultLeftGutter, defaultRightGutter, defaultTopGutter, drawingPanel, gridcolor, interiorColor, labelFont, labelFormat, superscriptFont, titleFont, titleLine, visible -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDrawable(Drawable drawable) Adds a drawable object to the drawable list.voiddraw(DrawingPanel panel, Graphics g) Draws the axes in a drawing panel.getTitle()Gets the title.Gets the x axis label.Gets the y axis label.voidsetInteriorBackground(Color color) Sets the interior background color.voidsetShowMajorXGrid(boolean showGrid) Shows a grid line for every x axis major tickmark.voidsetShowMajorYGrid(boolean showGrid) Shows a grid line for every y axis major tickmark.voidsetShowMinorXGrid(boolean showGrid) Shows a grid line for every x axis minor tickmark.voidsetShowMinorYGrid(boolean showGrid) Shows a grid line for every y axis minor tickmark.voidSet a title that will be drawn within the drawing panel.voidsetVisible(boolean isVisible) Sets the visibility of the axes.voidSets the x label of the axes.voidsetXLog(boolean isLog) Sets the x axis to linear or logarithmic.voidSets the y label of the axes.voidsetYLog(boolean isLog) Sets the y axis to linear or logarithmic.Methods inherited from class org.opensourcephysics.display.axes.AbstractAxes
getInteriorBackground, isVisible, resetPanelGutters, resizeFonts, setDefaultGuttersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensourcephysics.display.Drawable
isInteractiveMethods inherited from interface org.opensourcephysics.display.axes.DrawableAxes
getInteriorBackground, resizeFonts
-
Constructor Details
-
CustomAxes
Constructor CustomAxes- Parameters:
panel-
-
-
Method Details
-
setXLabel
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:
setXLabelin interfaceDrawableAxes- Parameters:
s- the labelfont_name- an optional font name
-
setYLabel
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:
setYLabelin interfaceDrawableAxes- Parameters:
s- the labelfont_name- an optional font name
-
getXLabel
Gets the x axis label.- Specified by:
getXLabelin interfaceDrawableAxes- Returns:
- String
-
getYLabel
Gets the y axis label.- Specified by:
getYLabelin interfaceDrawableAxes- Returns:
- String
-
getTitle
Gets the title.- Specified by:
getTitlein interfaceDrawableAxes- Overrides:
getTitlein classAbstractAxes- 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- Overrides:
setTitlein classAbstractAxes- Parameters:
s- the labelfont_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:
setVisiblein interfaceDrawableAxes- Overrides:
setVisiblein classAbstractAxes- Parameters:
isVisible- true if the axes are visible
-
setInteriorBackground
Sets the interior background color.- Specified by:
setInteriorBackgroundin interfaceDrawableAxes- Overrides:
setInteriorBackgroundin classAbstractAxes- Parameters:
color-
-
setShowMajorXGrid
public void setShowMajorXGrid(boolean showGrid) Shows a grid line for every x axis major tickmark.- Specified by:
setShowMajorXGridin interfaceDrawableAxes- Parameters:
showGrid-
-
setShowMinorXGrid
public void setShowMinorXGrid(boolean showGrid) Shows a grid line for every x axis minor tickmark.- Specified by:
setShowMinorXGridin interfaceDrawableAxes- Parameters:
showGrid-
-
setShowMajorYGrid
public void setShowMajorYGrid(boolean showGrid) Shows a grid line for every y axis major tickmark.- Specified by:
setShowMajorYGridin interfaceDrawableAxes- Parameters:
showGrid-
-
setShowMinorYGrid
public void setShowMinorYGrid(boolean showGrid) Shows a grid line for every y axis minor tickmark.- Specified by:
setShowMinorYGridin interfaceDrawableAxes- Parameters:
showGrid-
-
addDrawable
Adds a drawable object to the drawable list.- Parameters:
drawable-
-
draw
Draws the axes in a drawing panel.
-