org.opensourcephysics.display.axes
Class AbstractAxes

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

public abstract class AbstractAxes
extends java.lang.Object
implements DrawableAxes

An abstract class for axes that defines font and title accessor methods.

Copyright (c) 2006

Version:
1.0
Author:
Wolfgang Christian

Field Summary
protected  int defaultBottomGutter
           
protected  int defaultLeftGutter
          default gutters.
protected  int defaultRightGutter
           
protected  int defaultTopGutter
           
protected  DrawingPanel drawingPanel
           
protected  java.awt.Color gridcolor
           
protected  java.awt.Color interiorColor
           
protected  java.awt.Font labelFont
           
protected  java.text.DecimalFormat labelFormat
           
protected  java.awt.Font superscriptFont
           
protected  java.awt.Font titleFont
           
protected  DrawableTextLine titleLine
           
protected  boolean visible
           
 
Constructor Summary
AbstractAxes(DrawingPanel drawingPanel)
          Creates axes that will display themselves within the given drawing panel.
 
Method Summary
 java.awt.Color getInteriorBackground()
          Gets the color of the interior of the axes.
 java.lang.String getTitle()
          Gets the title.
 boolean isVisible()
          Gets the visibility of the axes.
 void resetPanelGutters()
           
 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(java.awt.Color color)
          Sets the interior background color.
 void setTitle(java.lang.String s, java.lang.String font_name)
          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.axes.DrawableAxes
getXLabel, getYLabel, setShowMajorXGrid, setShowMajorYGrid, setShowMinorXGrid, setShowMinorYGrid, setXLabel, setYLabel
 
Methods inherited from interface org.opensourcephysics.display.Drawable
draw
 

Field Detail

defaultLeftGutter

protected int defaultLeftGutter
default gutters.


defaultTopGutter

protected int defaultTopGutter

defaultRightGutter

protected int defaultRightGutter

defaultBottomGutter

protected int defaultBottomGutter

visible

protected boolean visible

titleFont

protected java.awt.Font titleFont

labelFont

protected java.awt.Font labelFont

superscriptFont

protected java.awt.Font superscriptFont

labelFormat

protected java.text.DecimalFormat labelFormat

gridcolor

protected java.awt.Color gridcolor

interiorColor

protected java.awt.Color interiorColor

titleLine

protected DrawableTextLine titleLine

drawingPanel

protected DrawingPanel drawingPanel
Constructor Detail

AbstractAxes

public AbstractAxes(DrawingPanel drawingPanel)
Creates axes that will display themselves within the given drawing panel.

Parameters:
drawingPanel - DrawingPanel
Method Detail

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(java.awt.Color color)
Sets the interior background color.

Specified by:
setInteriorBackground in interface DrawableAxes
Parameters:
color - The new interiorBackground value

getInteriorBackground

public java.awt.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 java.lang.String getTitle()
Gets the title.

Specified by:
getTitle in interface DrawableAxes
Returns:
String

setTitle

public void setTitle(java.lang.String s,
                     java.lang.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