net.sourceforge.webcompmath.draw
Class WcmAxes

java.lang.Object
  extended by java.awt.Component
      extended by net.sourceforge.webcompmath.draw.Drawable
          extended by net.sourceforge.webcompmath.draw.WcmAxes
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
WCMAxesBean

public class WcmAxes
extends Drawable

A set of horizontal and vertical axes that look OK and have reasonable, labeled tick marks. The number and spacing of tick marks changes depending on the scale on the axes in AUTO_TICKS mode. (The heuristics for computing this could use some improvement.)

In ABSOLUTE_TICKS and RATIONAL_TICKS mode, you explicitly specify the major and minor tick mark spacing. RATIONAL_TICKS in addition will try to convert the tick labels to rational numbers and display the labels as fractions (including factoring out multiples of pi or e).

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int ABSOLUTE_TICKS
          Explicitly specify the tick mark spacing
static int AUTO_TICKS
          Use automatic tick mark spacing
static int BOTTOM
          A constant that can be used in the setYAxisPosition() method to indicate the placement of the y-axs.
static int CENTER
          A constant that can be used in the setXAxisPosition() and setYAxisPosition() methods to indicate the placement of the axes.
static int LEFT
          A constant that can be used in the setXAxisPosition() method to indicate the placement of the x-axis.
static int NO_AXIS
          Hide the axis
static int NO_TICKS
          Show no tick marks or labels
static int RATIONAL_TICKS
          Explicitly specify the tick mark spacing, and make the labels rationals (i.e., fractions) if possible
static int RIGHT
          A constant that can be used in the setXAxisPosition() method to indicate the placement of the x-axis.
static int SMART
          A constant that can be used in the setXAxisPosition() and setYAxisPosition() methods to indicate the placement of the axes.
static int TICKS_AND_LABELS
          Show both tick marks and labels (the default)
static int TICKS_NO_LABELS
          Show tick marks but not tick labels
static int TOP
          A constant that can be used in the setYAxisPosition() method to indicate the placement of the y-axis.
 
Fields inherited from class net.sourceforge.webcompmath.draw.Drawable
canvas, coords
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WcmAxes()
          Creates axes with no names on the axes.
WcmAxes(java.lang.String xLabel, java.lang.String yLabel)
          Construct a WcmAxes with the specified labels
 
Method Summary
 void draw(java.awt.Graphics g, boolean coordsChanged)
          Axes drawing
 boolean getAutoTicks()
          Get whether autoticks is in use.
 int getAutoXTicks()
          Get the style of x axis tick mark spacing.
 int getAutoYTicks()
          Get the style of y axis tick mark spacing.
 java.awt.Color getAxesColor()
          Get the color that is used for drawing the axes, when they are drawn in their true position.
 java.awt.Color getLabelColor()
          Get the color that is used for drawing the labels on the x- and y-axes.
 java.awt.Color getLightAxesColor()
          Get the color that is used for drawing an axis, when it is drawn along an edge of the CoordinateRect instead of in its proper x- or y-position.
 double getMajorXTickSpacing()
          Get the major tick spacing for the x axis
 float getMajorXTickWidth()
          Get the width of major tick marks on the x axis.
 double getMajorYTickSpacing()
          Get the major tick spacing for the y axis
 float getMajorYTickWidth()
          Get the width of major tick marks on the y axis.
 double getMinorXTickSpacing()
          Get the minor tick spacing for the x axis
 double getMinorYTickSpacing()
          Get the minor tick spacing for the y axis
 boolean getPaintTicks()
          Get whether ticks and labels are in use.
 int getStyleXAxis()
          Get the style of the x axis.
 int getStyleYAxis()
          Get the style of the y axis.
 java.awt.Color getTickColor()
          Get the color used for ticks and tick labels
 java.awt.Color getXAxisColor()
          Get the color for the x axis.
 int getXAxisPosition()
          Get the positioning constant that tells where the x-axis is drawn.
 java.lang.String getXLabel()
          Get the label that appears on the x-axis.
 java.awt.Color getXLabelColor()
          Get the color for the x axis label.
 int getXLabelFontSize()
          Get the x axis font size
 float getXLineWidth()
          Get the line width for the x axis.
 java.awt.Color getXTickColor()
          Get the color of tick marks and labels on the x axis.
 int getXTickFontSize()
          Get the x axis tick label font size
 java.awt.Color getYAxisColor()
          Get the color for the y axis
 int getYAxisPosition()
          Get the positioning constant that tells where the y-axis is drawn.
 java.lang.String getYLabel()
          Get the label that appears on the y-axis.
 java.awt.Color getYLabelColor()
          Get the color for the y axis label.
 int getYLabelFontSize()
          Get the y axis label font size
 float getYLineWidth()
          Get the line width for the y axis.
 java.awt.Color getYTickColor()
          Get the color of tick marks and labels on the y axis.
 int getYTickFontSize()
          Get the y axis tick label font size
 boolean isRationalXText()
          For rational labels, get whether to use text or typeset labels for the x axis.
 boolean isRationalYText()
          For rational labels, get whether to use text or typeset labels for the y axis
 boolean isXAvoidOverlap()
          Get whether or not x tick labels are allowed to overlap.
 boolean isXLabelsAbove()
          Get whether to prefer x labels above the axis
 boolean isYAvoidOverlap()
          Get whether or not y tick labels are allowed to overlap.
 boolean isYLabelsLeft()
          Get whether to prefer y labels to the left of the axis
 void setAutoTicks(boolean b)
          Set both axes to use AUTO_TICKS if true, ABSOLUTE_TICKS if false
 void setAutoXTicks(int choice)
          Set the style of x axis tick mark spacing.
 void setAutoYTicks(int choice)
          Set the style of y axis tick mark spacing.
 void setAxesColor(java.awt.Color c)
          Set the color that is used for drawing the axes, when they are drawn in their true position.
 void setLabelColor(java.awt.Color c)
          Set the color that is used for drawing the labels (usually the names of the variables) on both the x- and y-axes.
 void setLightAxesColor(java.awt.Color c)
          Get the color that is used for drawing an axis, when it is drawn along an edge of the CoordinateRect instead of in its proper x- or y-position.
 void setLineWidth()
          set default line width
 void setLineWidth(float thickness)
          Set the width of the axes for both axes.
 void setMajorTickWidth(float thickness)
          Set the major tick mark thickness.
 void setMajorXTickSpacing(double spacing)
          Set the major tick spacing for the x axis
 void setMajorXTickWidth(float thickness)
          Set the width of major tick marks on the x axis.
 void setMajorYTickSpacing(double spacing)
          Set the major tick spacing for the y axis
 void setMajorYTickWidth(float thickness)
          Set the width of major tick marks on the y axis.
 void setMinorXTickSpacing(double spacing)
          Set the minor tick spacing for the x axis
 void setMinorYTickSpacing(double spacing)
          Set the minor tick spacing for the y axis
 void setPaintTicks(boolean b)
          Set the style for both axes
 void setRationalXText(boolean rationalText)
          For rational labels, set whether to use text or typeset labels for the x axis.
 void setRationalYText(boolean rationalText)
          For rational labels, set whether to use text or typeset labels for the y axis.
 void setStyleXAxis(int styleXAxis)
          Set the style of the x axis.
 void setStyleYAxis(int styleYAxis)
          Set the style of the y axis.
 void setTickColor(java.awt.Color tickColor)
          Set the color used for ticks and tick labels on both axes.
 void setTickSpacing(double forX, double forY, double minorX, double minorY)
          Set all tick spacings at once.
 void setXAvoidOverlap(boolean avoidOverlap)
          Set whether or not x tick labels are allowed to overlap.
 void setXAxisColor(java.awt.Color c)
          Set the color for the x axis.
 void setXAxisPosition(int pos)
          Set the positioning constant that tells where the x-axis is drawn.
 void setXLabel(java.lang.String s)
          Set the label that appears on the x-axis.
 void setXLabelColor(java.awt.Color c)
          Set the color for the x axis label.
 void setXLabelFontSize(int fs)
          Set the font size for the x axis label
 void setXLabelsAbove(boolean labelsAbove)
          Set whether to prefer x labels above the axis (default is true)
 void setXLineWidth(float thickness)
          Set the line width for the x axis.
 void setXTickColor(java.awt.Color tickColor)
          Set the color of tick marks and labels on the x axis.
 void setXTickFontSize(int fs)
          Set the x axis tick label font size
 void setYAvoidOverlap(boolean avoidOverlap)
          Set whether or not y tick labels are allowed to overlap.
 void setYAxisColor(java.awt.Color c)
          Set the color for the y axis.
 void setYAxisPosition(int pos)
          Set the positioning constant that tells where the y-axis is drawn.
 void setYLabel(java.lang.String s)
          Set the label that appears on the y-axis.
 void setYLabelColor(java.awt.Color c)
          Set the color for the y axis label.
 void setYLabelFontSize(int fs)
          Set the y axis label font size
 void setYLabelsLeft(boolean labelsLeft)
          Set whether to prefer y labels to the left of the axis (default is true)
 void setYLineWidth(float thickness)
          Set the line width for the y axis.
 void setYTickColor(java.awt.Color tickColor)
          Set the color of tick marks and labels on the y axis.
 void setYTickFontSize(int fs)
          Set the y axis tick label font size
 
Methods inherited from class net.sourceforge.webcompmath.draw.Drawable
getVisible, needsRedraw, setOwnerData, setVisible
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TOP

public static final int TOP
A constant that can be used in the setYAxisPosition() method to indicate the placement of the y-axis. The axis is placed at the top of the CoordinateRect.

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
A constant that can be used in the setYAxisPosition() method to indicate the placement of the y-axs. The axis is placed at the bottom of the CoordinateRect.

See Also:
Constant Field Values

LEFT

public static final int LEFT
A constant that can be used in the setXAxisPosition() method to indicate the placement of the x-axis. The axis is placed at the left edge of the CoordinateRect.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
A constant that can be used in the setXAxisPosition() method to indicate the placement of the x-axis. The axis is placed at the right edge of the CoordinateRect.

See Also:
Constant Field Values

CENTER

public static final int CENTER
A constant that can be used in the setXAxisPosition() and setYAxisPosition() methods to indicate the placement of the axes. The axis is placed in the center of the CoordinateRect.

See Also:
Constant Field Values

SMART

public static final int SMART
A constant that can be used in the setXAxisPosition() and setYAxisPosition() methods to indicate the placement of the axes. The axis is placed at its true x- or y-position, if that lies within the range of values shown on the CoordinateRect. Otherwise, it is placed along an edge of the CoordinateRect. This is the default value for axis placement.

See Also:
Constant Field Values

AUTO_TICKS

public static final int AUTO_TICKS
Use automatic tick mark spacing

See Also:
Constant Field Values

ABSOLUTE_TICKS

public static final int ABSOLUTE_TICKS
Explicitly specify the tick mark spacing

See Also:
Constant Field Values

RATIONAL_TICKS

public static final int RATIONAL_TICKS
Explicitly specify the tick mark spacing, and make the labels rationals (i.e., fractions) if possible

See Also:
Constant Field Values

NO_AXIS

public static final int NO_AXIS
Hide the axis

See Also:
Constant Field Values

NO_TICKS

public static final int NO_TICKS
Show no tick marks or labels

See Also:
Constant Field Values

TICKS_NO_LABELS

public static final int TICKS_NO_LABELS
Show tick marks but not tick labels

See Also:
Constant Field Values

TICKS_AND_LABELS

public static final int TICKS_AND_LABELS
Show both tick marks and labels (the default)

See Also:
Constant Field Values
Constructor Detail

WcmAxes

public WcmAxes()
Creates axes with no names on the axes.


WcmAxes

public WcmAxes(java.lang.String xLabel,
               java.lang.String yLabel)
Construct a WcmAxes with the specified labels

Parameters:
xLabel - the x-axis label
yLabel - the y-axis label
Method Detail

getXLabelFontSize

public int getXLabelFontSize()
Get the x axis font size

Returns:
Returns the font size.

setXLabelFontSize

public void setXLabelFontSize(int fs)
Set the font size for the x axis label

Parameters:
fs - the new font size

getXTickFontSize

public int getXTickFontSize()
Get the x axis tick label font size

Returns:
Returns the font size.

setXTickFontSize

public void setXTickFontSize(int fs)
Set the x axis tick label font size

Parameters:
fs - The font size to set.

getYLabelFontSize

public int getYLabelFontSize()
Get the y axis label font size

Returns:
Returns the font size.

setYLabelFontSize

public void setYLabelFontSize(int fs)
Set the y axis label font size

Parameters:
fs - The font size to set.

getYTickFontSize

public int getYTickFontSize()
Get the y axis tick label font size

Returns:
Returns the font size.

setYTickFontSize

public void setYTickFontSize(int fs)
Set the y axis tick label font size

Parameters:
fs - The font sizze to set.

draw

public void draw(java.awt.Graphics g,
                 boolean coordsChanged)
Axes drawing

Specified by:
draw in class Drawable
Parameters:
g - context
coordsChanged - value if coordinates have changed

setMajorXTickSpacing

public void setMajorXTickSpacing(double spacing)
Set the major tick spacing for the x axis

Parameters:
spacing - the new spacing

getMajorXTickSpacing

public double getMajorXTickSpacing()
Get the major tick spacing for the x axis

Returns:
the tick spacing

setMinorXTickSpacing

public void setMinorXTickSpacing(double spacing)
Set the minor tick spacing for the x axis

Parameters:
spacing - the new spacing

getMinorXTickSpacing

public double getMinorXTickSpacing()
Get the minor tick spacing for the x axis

Returns:
the spacing

setMajorYTickSpacing

public void setMajorYTickSpacing(double spacing)
Set the major tick spacing for the y axis

Parameters:
spacing - the new spacing

getMajorYTickSpacing

public double getMajorYTickSpacing()
Get the major tick spacing for the y axis

Returns:
the spacing

setMinorYTickSpacing

public void setMinorYTickSpacing(double spacing)
Set the minor tick spacing for the y axis

Parameters:
spacing - the new spacing

getMinorYTickSpacing

public double getMinorYTickSpacing()
Get the minor tick spacing for the y axis

Returns:
the spacing

isRationalXText

public boolean isRationalXText()
For rational labels, get whether to use text or typeset labels for the x axis.

Returns:
Returns the rationalXText.

setRationalXText

public void setRationalXText(boolean rationalText)
For rational labels, set whether to use text or typeset labels for the x axis. Generally more useful on the y axis, but supported on the x axis, too.

Parameters:
rationalText - true for text labels, false for typeset labels (default)

isRationalYText

public boolean isRationalYText()
For rational labels, get whether to use text or typeset labels for the y axis

Returns:
Returns the rationalXText.

setRationalYText

public void setRationalYText(boolean rationalText)
For rational labels, set whether to use text or typeset labels for the y axis. Text labels use less vertical space than typeset labels, if the label is a fraction, so text labels allow you to display more labels on the y axis than with typeset labels.

Parameters:
rationalText - true for text labels, false for typeset labels (default)

getXAxisPosition

public int getXAxisPosition()
Get the positioning constant that tells where the x-axis is drawn. This can be TOP, BOTTOM, CENTER, or SMART.

Returns:
TOP, BOTTOM, CENTER, or SMART

setXAxisPosition

public void setXAxisPosition(int pos)
Set the positioning constant that tells where the x-axis is drawn. This can be TOP, BOTTOM, CENTER, or SMART. The default is SMART.

Parameters:
pos - TOP, BOTTOM, CENTER, or SMART

getYAxisPosition

public int getYAxisPosition()
Get the positioning constant that tells where the y-axis is drawn. This can be LEFT, RIGHT, CENTER, or SMART.

Returns:
LEFT, RIGHT, CENTER, or SMART

setYAxisPosition

public void setYAxisPosition(int pos)
Set the positioning constant that tells where the y-axis is drawn. This can be LEFT, RIGHT, CENTER, or SMART. The default is SMART.

Parameters:
pos - LEFT, RIGHT, CENTER, or SMART

isXLabelsAbove

public boolean isXLabelsAbove()
Get whether to prefer x labels above the axis

Returns:
Returns the xLabelsAbove.

setXLabelsAbove

public void setXLabelsAbove(boolean labelsAbove)
Set whether to prefer x labels above the axis (default is true)

Parameters:
labelsAbove - The xLabelsAbove to set.

isYLabelsLeft

public boolean isYLabelsLeft()
Get whether to prefer y labels to the left of the axis

Returns:
Returns the yLabelsLeft.

setYLabelsLeft

public void setYLabelsLeft(boolean labelsLeft)
Set whether to prefer y labels to the left of the axis (default is true)

Parameters:
labelsLeft - The yLabelsLeft to set.

setLineWidth

public void setLineWidth()
set default line width


setMajorTickWidth

public void setMajorTickWidth(float thickness)
Set the major tick mark thickness. This sets tick widths for both axes.

Parameters:
thickness - the new thickness

setLineWidth

public void setLineWidth(float thickness)
Set the width of the axes for both axes. If set to 0, the thinnest possible line is drawn.

Parameters:
thickness - the thickness

getXLabel

public java.lang.String getXLabel()
Get the label that appears on the x-axis. If the value is null, no label appears. This is the default.

Returns:
x axis label

setXLabel

public void setXLabel(java.lang.String s)
Set the label that appears on the x-axis. If the value is null, no label appears. This is the default.

Parameters:
s - x axis label

getYLabel

public java.lang.String getYLabel()
Get the label that appears on the y-axis. If the value is null, no label appears.

Returns:
y axis label

setYLabel

public void setYLabel(java.lang.String s)
Set the label that appears on the y-axis. If the value is null, no label appears. This is the default.

Parameters:
s - y axis label

setAutoXTicks

public void setAutoXTicks(int choice)
Set the style of x axis tick mark spacing.

Parameters:
choice - AUTO_TICKS or ABSOLUTE_TICKS or RATIONAL_TICKS

getAutoXTicks

public int getAutoXTicks()
Get the style of x axis tick mark spacing.

Returns:
AUTO_TICKS or ABSOLUTE_TICKS or RATIONAL_TICKS

setAutoYTicks

public void setAutoYTicks(int choice)
Set the style of y axis tick mark spacing.

Parameters:
choice - AUTO_TICKS or ABSOLUTE_TICKS or RATIONAL_TICKS

getAutoYTicks

public int getAutoYTicks()
Get the style of y axis tick mark spacing.

Returns:
AUTO_TICKS or ABSOLUTE_TICKS or RATIONAL_TICKS

getLightAxesColor

public java.awt.Color getLightAxesColor()
Get the color that is used for drawing an axis, when it is drawn along an edge of the CoordinateRect instead of in its proper x- or y-position.

Returns:
axes color

setLightAxesColor

public void setLightAxesColor(java.awt.Color c)
Get the color that is used for drawing an axis, when it is drawn along an edge of the CoordinateRect instead of in its proper x- or y-position. The default is a light blue.

Parameters:
c - axes color

getAxesColor

public java.awt.Color getAxesColor()
Get the color that is used for drawing the axes, when they are drawn in their true position.

Returns:
x axis color

setAxesColor

public void setAxesColor(java.awt.Color c)
Set the color that is used for drawing the axes, when they are drawn in their true position. The default is blue. This sets the color for both axes.

Parameters:
c - axes color

getXAxisColor

public java.awt.Color getXAxisColor()
Get the color for the x axis.

Returns:
Returns the color.

setXAxisColor

public void setXAxisColor(java.awt.Color c)
Set the color for the x axis.

Parameters:
c - The color to set.

getYAxisColor

public java.awt.Color getYAxisColor()
Get the color for the y axis

Returns:
Returns the color.

setYAxisColor

public void setYAxisColor(java.awt.Color c)
Set the color for the y axis.

Parameters:
c - The yAxisColor to set.

getLabelColor

public java.awt.Color getLabelColor()
Get the color that is used for drawing the labels on the x- and y-axes.

Returns:
x label color

setLabelColor

public void setLabelColor(java.awt.Color c)
Set the color that is used for drawing the labels (usually the names of the variables) on both the x- and y-axes. The default is black.

Parameters:
c - label color

getTickColor

public java.awt.Color getTickColor()
Get the color used for ticks and tick labels

Returns:
Returns the x TickColor.

setTickColor

public void setTickColor(java.awt.Color tickColor)
Set the color used for ticks and tick labels on both axes.

Parameters:
tickColor - The TickColor to set.

getStyleXAxis

public int getStyleXAxis()
Get the style of the x axis.

Returns:
NO_AXIS, NO_TICKS, TICKS_NO_LABELS or TICKS_AND_LABELS

setStyleXAxis

public void setStyleXAxis(int styleXAxis)
Set the style of the x axis.

Parameters:
styleXAxis - NO_AXIS, NO_TICKS, TICKS_NO_LABELS or TICKS_AND_LABELS

getStyleYAxis

public int getStyleYAxis()
Get the style of the y axis.

Returns:
NO_AXIS, NO_TICKS, TICKS_NO_LABELS or TICKS_AND_LABELS

setStyleYAxis

public void setStyleYAxis(int styleYAxis)
Set the style of the y axis.

Parameters:
styleYAxis - NO_AXIS, NO_TICKS, TICKS_NO_LABELS or TICKS_AND_LABELS

getXLineWidth

public float getXLineWidth()
Get the line width for the x axis.

Returns:
Returns the width.

setXLineWidth

public void setXLineWidth(float thickness)
Set the line width for the x axis. If set to 0, the thinnest possible line is drawn.

Parameters:
thickness - The width to set.

getYLineWidth

public float getYLineWidth()
Get the line width for the y axis.

Returns:
Returns the width.

setYLineWidth

public void setYLineWidth(float thickness)
Set the line width for the y axis. If set to 0, the thinnest possible line is drawn.

Parameters:
thickness - The width to set.

getXTickColor

public java.awt.Color getXTickColor()
Get the color of tick marks and labels on the x axis.

Returns:
Returns the color.

setXTickColor

public void setXTickColor(java.awt.Color tickColor)
Set the color of tick marks and labels on the x axis.

Parameters:
tickColor - The color to set.

getYTickColor

public java.awt.Color getYTickColor()
Get the color of tick marks and labels on the y axis.

Returns:
Returns the color.

setYTickColor

public void setYTickColor(java.awt.Color tickColor)
Set the color of tick marks and labels on the y axis.

Parameters:
tickColor - The color to set.

getMajorXTickWidth

public float getMajorXTickWidth()
Get the width of major tick marks on the x axis.

Returns:
Returns the width.

setMajorXTickWidth

public void setMajorXTickWidth(float thickness)
Set the width of major tick marks on the x axis. Minor tick mark width will be half of this value.

Parameters:
thickness - The width to set.

getMajorYTickWidth

public float getMajorYTickWidth()
Get the width of major tick marks on the y axis.

Returns:
Returns the width.

setMajorYTickWidth

public void setMajorYTickWidth(float thickness)
Set the width of major tick marks on the y axis. Minor tick mark width will be half of this value.

Parameters:
thickness - The width to set.

getXLabelColor

public java.awt.Color getXLabelColor()
Get the color for the x axis label.

Returns:
Returns the color.

setXLabelColor

public void setXLabelColor(java.awt.Color c)
Set the color for the x axis label.

Parameters:
c - The color to set.

getYLabelColor

public java.awt.Color getYLabelColor()
Get the color for the y axis label.

Returns:
Returns the color.

setYLabelColor

public void setYLabelColor(java.awt.Color c)
Set the color for the y axis label.

Parameters:
c - The color to set.

setTickSpacing

public void setTickSpacing(double forX,
                           double forY,
                           double minorX,
                           double minorY)
Set all tick spacings at once. If the minor tick spacing doesn't divide into the major tick spacing evenly, fix it up automatically.

Parameters:
forX - the major tick spacing for the x axis
forY - the major tick spacing for the y axis
minorX - the minor tick spacing for the x axis
minorY - the minor tick spacing for the y axis

getAutoTicks

public boolean getAutoTicks()
Get whether autoticks is in use.

Returns:
true if the x axis uses AUTO_TICKS

setAutoTicks

public void setAutoTicks(boolean b)
Set both axes to use AUTO_TICKS if true, ABSOLUTE_TICKS if false

Parameters:
b - AUTO_TICKS if true, ABSOLUTE_TICKS if false

getPaintTicks

public boolean getPaintTicks()
Get whether ticks and labels are in use.

Returns:
true if x axis uses TICKS_AND_LABELS

setPaintTicks

public void setPaintTicks(boolean b)
Set the style for both axes

Parameters:
b - true for TICKS_AND_LABELS, false for NO_TICKS

isXAvoidOverlap

public boolean isXAvoidOverlap()
Get whether or not x tick labels are allowed to overlap. This only is valid for ABSOLUTE_TICKS and RATIONAL_TICKS (for AUTO_TICKS, it is not used; auto mode always avoids overlap).

Returns:
whether x tick labels can overlap

setXAvoidOverlap

public void setXAvoidOverlap(boolean avoidOverlap)
Set whether or not x tick labels are allowed to overlap. This only is valid for ABSOLUTE_TICKS and RATIONAL_TICKS (for AUTO_TICKS, it is not used; auto mode always avoids overlap). The default is true.

Parameters:
avoidOverlap - whether x tick labels can overlap

isYAvoidOverlap

public boolean isYAvoidOverlap()
Get whether or not y tick labels are allowed to overlap. This only is valid for ABSOLUTE_TICKS and RATIONAL_TICKS (for AUTO_TICKS, it is not used; auto mode always avoids overlap).

Returns:
whether y tick labels can overlap

setYAvoidOverlap

public void setYAvoidOverlap(boolean avoidOverlap)
Set whether or not y tick labels are allowed to overlap. This only is valid for ABSOLUTE_TICKS and RATIONAL_TICKS (for AUTO_TICKS, it is not used; auto mode always avoids overlap). The default is true.

Parameters:
avoidOverlap - whether y tick labels can overlap