com.jrefinery.chart
Class WindAxis

java.lang.Object
  extended by com.jrefinery.chart.Axis
      extended by com.jrefinery.chart.WindAxis
All Implemented Interfaces:
AxisConstants

public abstract class WindAxis
extends Axis


Field Summary
protected  boolean autoRange
           
protected  int autoTickIndex
           
protected  boolean autoTickValue
           
protected  java.awt.Paint gridPaint
          The paint used to draw grid lines.
protected  java.awt.Stroke gridStroke
          The stroke used to draw grid lines.
protected  boolean showGridLines
          Flag that indicates whether or not grid lines are showing for this axis.
 
Fields inherited from class com.jrefinery.chart.Axis
fixedDimension, label, labelFont, labelInsets, labelPaint, listeners, plot, tickLabelFont, tickLabelInsets, tickLabelPaint, tickLabelsVisible, tickMarkStroke, tickMarksVisible, ticks, visible
 
Fields inherited from interface com.jrefinery.chart.AxisConstants
DEFAULT_AXIS_LABEL_FONT, DEFAULT_AXIS_LABEL_INSETS, DEFAULT_AXIS_LABEL_PAINT, DEFAULT_TICK_LABEL_FONT, DEFAULT_TICK_LABEL_INSETS, DEFAULT_TICK_LABEL_PAINT, DEFAULT_TICK_STROKE
 
Constructor Summary
WindAxis(java.lang.String label)
          Standard constructor - initialises the attributes for a ValueAxis.
WindAxis(java.lang.String label, java.awt.Font labelFont, java.awt.Paint labelPaint, java.awt.Insets labelInsets, boolean showTickLabels, java.awt.Font tickLabelFont, java.awt.Paint tickLabelPaint, java.awt.Insets tickLabelInsets, boolean showTickMarks, java.awt.Stroke tickMarkStroke, boolean autoRange, boolean autoTickValue, boolean showGridLines, java.awt.Stroke gridStroke, java.awt.Paint gridPaint)
          Full constructor - initialises the attributes for a ValueAxis.
 
Method Summary
protected abstract  void autoAdjustRange()
          Automatically determines the maximum and minimum values on the axis to 'fit' the data;
 boolean getAutoTickValue()
          Returns true if the tick value is calculated automatically, and false otherwise.
 java.awt.Paint getGridPaint()
          Returns the Paint used to color the grid lines (if visible).
 java.awt.Stroke getGridStroke()
          Returns the Stroke used to draw the grid lines (if visible).
 boolean isAutoRange()
          Returns true if the axis range is automatically adjusted to fit the data, and false otherwise.
 boolean isShowGridLines()
          Returns true if the grid lines are visible for this axis, and false otherwise.
 void setAutoRange(boolean auto)
          Sets a flag that determines whether or not the axis range is automatically adjusted to fit the data, and notifies registered listeners that the axis has been modified.
 void setAutoTickValue(boolean flag)
          Sets a flag indicating whether or not the tick value is calculated automatically, and notifies registered listeners that the axis has been modified.
 void setGridPaint(java.awt.Paint paint)
          Sets the Paint used to color the grid lines (if visible) and notifies registered listeners that the axis has been modified.
 void setGridStroke(java.awt.Stroke stroke)
          Sets the Stroke used to draw the grid lines (if visible) and notifies registered listeners that the axis has been modified.
 void setShowGridLines(boolean show)
          Sets the visibility of the grid lines and notifies registered listeners that the axis has been modified.
abstract  double translateValueToJava2D(double dataValue, java.awt.geom.Rectangle2D plotArea)
          Converts a value from the data source to a Java2D user-space co-ordinate relative to the specified plotArea.
 
Methods inherited from class com.jrefinery.chart.Axis
addChangeListener, configure, draw, getFixedDimension, getLabel, getLabelFont, getLabelInsets, getLabelPaint, getMaxTickLabelWidth, getPlot, getTickLabelFont, getTickLabelInsets, getTickLabelPaint, getTickMarkStroke, isCompatiblePlot, isTickLabelsVisible, isTickMarksVisible, isVisible, notifyListeners, refreshTicks, removeChangeListener, setFixedDimension, setLabel, setLabelFont, setLabelInsets, setLabelPaint, setPlot, setTickLabelFont, setTickLabelInsets, setTickLabelPaint, setTickLabelsVisible, setTickMarkStroke, setTickMarksVisible, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

autoRange

protected boolean autoRange

autoTickValue

protected boolean autoTickValue

autoTickIndex

protected int autoTickIndex

showGridLines

protected boolean showGridLines
Flag that indicates whether or not grid lines are showing for this axis.


gridStroke

protected java.awt.Stroke gridStroke
The stroke used to draw grid lines.


gridPaint

protected java.awt.Paint gridPaint
The paint used to draw grid lines.

Constructor Detail

WindAxis

public WindAxis(java.lang.String label,
                java.awt.Font labelFont,
                java.awt.Paint labelPaint,
                java.awt.Insets labelInsets,
                boolean showTickLabels,
                java.awt.Font tickLabelFont,
                java.awt.Paint tickLabelPaint,
                java.awt.Insets tickLabelInsets,
                boolean showTickMarks,
                java.awt.Stroke tickMarkStroke,
                boolean autoRange,
                boolean autoTickValue,
                boolean showGridLines,
                java.awt.Stroke gridStroke,
                java.awt.Paint gridPaint)
Full constructor - initialises the attributes for a ValueAxis. This is an abstract class, subclasses include HorizontalValueAxis and VerticalValueAxis.

Parameters:
label - The axis label;
labelFont - The font for displaying the axis label;
labelPaint - The paint used to draw the axis label;
labelInsets - Determines the amount of blank space around the label;
showTickLabels - Flag indicating whether or not tick labels are visible;
tickLabelFont - The font used to display tick labels;
tickLabelPaint - The paint used to draw tick labels;
tickLabelInsets - Determines the amount of blank space around tick labels;
showTickMarks - Flag indicating whether or not tick marks are visible;
tickMarkStroke - The stroke used to draw tick marks (if visible);
autoRange - Flag indicating whether or not the axis range is automatically adjusted to fit the data;
autoTickValue - A flag indicating whether or not the tick value is automatically calculated;
tickUnits - The tick units;
showGridLines - Flag indicating whether or not grid lines are visible for this axis;
gridStroke - The Stroke used to display grid lines (if visible);
gridPaint - The Paint used to display grid lines (if visible).

WindAxis

public WindAxis(java.lang.String label)
Standard constructor - initialises the attributes for a ValueAxis.

Parameters:
label - The axis label;
Method Detail

isAutoRange

public boolean isAutoRange()
Returns true if the axis range is automatically adjusted to fit the data, and false otherwise.


setAutoRange

public void setAutoRange(boolean auto)
Sets a flag that determines whether or not the axis range is automatically adjusted to fit the data, and notifies registered listeners that the axis has been modified.

Parameters:
auto - Flag indicating whether or not the axis is automatically scaled to fit the data.

getAutoTickValue

public boolean getAutoTickValue()
Returns true if the tick value is calculated automatically, and false otherwise.


setAutoTickValue

public void setAutoTickValue(boolean flag)
Sets a flag indicating whether or not the tick value is calculated automatically, and notifies registered listeners that the axis has been modified.

Parameters:
flag - The new value of the flag;

isShowGridLines

public boolean isShowGridLines()
Returns true if the grid lines are visible for this axis, and false otherwise.


setShowGridLines

public void setShowGridLines(boolean show)
Sets the visibility of the grid lines and notifies registered listeners that the axis has been modified.

Parameters:
show - The new setting;

getGridStroke

public java.awt.Stroke getGridStroke()
Returns the Stroke used to draw the grid lines (if visible).


setGridStroke

public void setGridStroke(java.awt.Stroke stroke)
Sets the Stroke used to draw the grid lines (if visible) and notifies registered listeners that the axis has been modified.

Parameters:
stroke - The new grid line stroke.

getGridPaint

public java.awt.Paint getGridPaint()
Returns the Paint used to color the grid lines (if visible).


setGridPaint

public void setGridPaint(java.awt.Paint paint)
Sets the Paint used to color the grid lines (if visible) and notifies registered listeners that the axis has been modified.

Parameters:
paint - The new grid paint;

autoAdjustRange

protected abstract void autoAdjustRange()
Automatically determines the maximum and minimum values on the axis to 'fit' the data;


translateValueToJava2D

public abstract double translateValueToJava2D(double dataValue,
                                              java.awt.geom.Rectangle2D plotArea)
Converts a value from the data source to a Java2D user-space co-ordinate relative to the specified plotArea. The coordinate will be an x-value for horizontal axes and a y-value for vertical axes (refer to the subclass).

Note that it is possible for the coordinate to fall outside the plotArea.



Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.