JMSLTM Numerical Library 4.0

com.imsl.chart
Class Axis1D

java.lang.Object
  extended bycom.imsl.chart.AbstractChartNode
      extended bycom.imsl.chart.ChartNode
          extended bycom.imsl.chart.Axis1D
All Implemented Interfaces:
Cloneable, Serializable

public class Axis1D
extends ChartNode

An x-axis or a y-axis.

Axis1D is created by AxisXY as its child. It can be retrieved using the method AxisXY.getAxisX() or AxisXY.getAxisY().

It in turn creates the following child nodes: AxisLine, AxisLabel, AxisTitle, AxisUnit, MajorTick, MinorTick and Grid.

The number of tick marks ("Number" attribute) is set to 5, but autoscaling can change this value.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.imsl.chart.ChartNode
AXIS_X_TOP, AXIS_Y_RIGHT, BAR_TYPE_HORIZONTAL, BAR_TYPE_VERTICAL, DASH_PATTERN_DASH, DASH_PATTERN_DASH_DOT, DASH_PATTERN_DOT, DASH_PATTERN_SOLID, DATA_TYPE_FILL, DATA_TYPE_LINE, DATA_TYPE_MARKER, DATA_TYPE_PICTURE, DATA_TYPE_TUBE, DENDROGRAM_TYPE_HORIZONTAL, DENDROGRAM_TYPE_VERTICAL, FILL_TYPE_GRADIENT, FILL_TYPE_NONE, FILL_TYPE_PAINT, FILL_TYPE_SOLID, LABEL_TYPE_PERCENT, MARKER_TYPE_ASTERISK, MARKER_TYPE_CIRCLE_CIRCLE, MARKER_TYPE_CIRCLE_PLUS, MARKER_TYPE_CIRCLE_X, MARKER_TYPE_DIAMOND_PLUS, MARKER_TYPE_FILLED_CIRCLE, MARKER_TYPE_FILLED_DIAMOND, MARKER_TYPE_FILLED_SQUARE, MARKER_TYPE_FILLED_TRIANGLE, MARKER_TYPE_HOLLOW_CIRCLE, MARKER_TYPE_HOLLOW_DIAMOND, MARKER_TYPE_HOLLOW_SQUARE, MARKER_TYPE_HOLLOW_TRIANGLE, MARKER_TYPE_OCTAGON_PLUS, MARKER_TYPE_OCTAGON_X, MARKER_TYPE_PLUS, MARKER_TYPE_SQUARE_PLUS, MARKER_TYPE_SQUARE_X, MARKER_TYPE_X, TEXT_X_CENTER, TEXT_X_LEFT, TEXT_X_RIGHT, TEXT_Y_BOTTOM, TEXT_Y_CENTER, TEXT_Y_TOP
 
Fields inherited from class com.imsl.chart.AbstractChartNode
AUTOSCALE_DATA, AUTOSCALE_DENSITY, AUTOSCALE_NUMBER, AUTOSCALE_OFF, AUTOSCALE_WINDOW, AXIS_X, AXIS_Y, AXIS_Z, LABEL_TYPE_NONE, LABEL_TYPE_TITLE, LABEL_TYPE_X, LABEL_TYPE_Y, LABEL_TYPE_Z, TRANSFORM_CUSTOM, TRANSFORM_LINEAR, TRANSFORM_LOG
 
Method Summary
 AxisLabel getAxisLabel()
          Returns the label node associated with this axis.
 AxisLine getAxisLine()
          Returns the axis line node associated with this axis.
 AxisTitle getAxisTitle()
          Returns the title node associated with this axis.
 AxisUnit getAxisUnit()
          Returns the unit node associated with this axis.
 double getFirstTick()
          Convenience routine to get the "FirstTick" attribute.
 Grid getGrid()
          Returns the grid node associated with this axis.
 MajorTick getMajorTick()
          Returns the major tick node associated with this axis.
 MinorTick getMinorTick()
          Returns the minor tick node associated with this axis.
 double getTickInterval()
          Retrieves the tick interval.
 double[] getTicks()
          Returns the value of the "Ticks" attribute, if set.
 int getType()
          Returns the axis type.
 double[] getWindow()
          Returns the window for an Axis1D.
 void paint(Draw draw)
          Paints this node and all of its children.
 void setFirstTick(double firstTick)
          Convenience routine to set the "FirstTick" attribute.
 void setTickInterval(double tickInterval)
          Sets the tick interval.
 void setTicks(double[] ticks)
          Sets the value of the "Ticks" attribute.
 void setType(int type)
          Sets the type of this node.
 void setWindow(double[] window)
          Sets the window for an Axis1D.
 void setWindow(double min, double max)
          Sets the window for an Axis1D.
 
Methods inherited from class com.imsl.chart.ChartNode
addPickListener, firePickListeners, getALT, getAxis, getBackground, getBarGap, getBarType, getBarWidth, getChart, getChartTitle, getChildren, getClipData, getComponent, getConcatenatedViewport, getDataType, getDoubleBuffering, getExplode, getFillOutlineColor, getFillOutlineType, getFillPaint, getFillType, getGradient, getHREF, getLegend, getLineDashPattern, getMarkerDashPattern, getMarkerThickness, getMarkerType, getParent, getReference, getScreenAxis, getScreenSize, getScreenViewport, getSize, getSkipWeekends, getTextAngle, getTextColor, getTitle, getToolTip, getViewport, isBitSet, removePickListener, setALT, setBarGap, setBarType, setBarWidth, setChartTitle, setClipData, setCustomTransform, setDataType, setDoubleBuffering, setExplode, setFillOutlineColor, setFillOutlineColor, setFillOutlineType, setFillPaint, setFillPaint, setFillPaint, setFillType, setGradient, setGradient, setGradient, setHREF, setImage, setLineDashPattern, setMarkerDashPattern, setMarkerThickness, setMarkerType, setReference, setScreenSize, setSize, setSkipWeekends, setTextAngle, setTextColor, setTextColor, setTitle, setTitle, setToolTip, setViewport, setViewport
 
Methods inherited from class com.imsl.chart.AbstractChartNode
clone, clone, clone, clone, getAbstractParent, getAttribute, getAutoscaleInput, getAutoscaleMinimumTimeInterval, getAutoscaleOutput, getBooleanAttribute, getChildList, getColorAttribute, getCustomTransform, getDensity, getDoubleAttribute, getFillColor, getFont, getFontName, getFontSize, getFontStyle, getImage, getIntegerAttribute, getLabelType, getLightColor, getLineColor, getLineWidth, getLocale, getMarkerColor, getMarkerSize, getName, getNumber, getPaint, getStringAttribute, getTextFormat, getTickLength, getTransform, getX, getY, isAncestorOf, isAttributeSet, isAttributeSetAtThisNode, parseColor, remove, setAttribute, setAutoscaleInput, setAutoscaleMinimumTimeInterval, setAutoscaleOutput, setDensity, setFillColor, setFillColor, setFont, setFontName, setFontSize, setFontStyle, setImage, setLabelType, setLightColor, setLightColor, setLineColor, setLineColor, setLineWidth, setLocale, setMarkerColor, setMarkerColor, setMarkerSize, setName, setNumber, setPaint, setTextFormat, setTextFormat, setTickLength, setTransform, setX, setY, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getAxisLabel

public AxisLabel getAxisLabel()
Returns the label node associated with this axis.

Returns:
the AxisLabel node created as a child by this node

getAxisLine

public AxisLine getAxisLine()
Returns the axis line node associated with this axis.

Returns:
the AxisLine node created as a child by this node

getAxisTitle

public AxisTitle getAxisTitle()
Returns the title node associated with this axis.

Returns:
the AxisTitle node created as a child by this node

getAxisUnit

public AxisUnit getAxisUnit()
Returns the unit node associated with this axis.

Returns:
the AxisUnit node created as a child by this node

getFirstTick

public double getFirstTick()
Convenience routine to get the "FirstTick" attribute.

Returns:
the double value of the "FirstTick" attribute, if defined. Otherwise, window[0] is returned.

getGrid

public Grid getGrid()
Returns the grid node associated with this axis.

Returns:
the Grid node created as a child by this node

getMajorTick

public MajorTick getMajorTick()
Returns the major tick node associated with this axis.

Returns:
the MajorTick node created as a child by this node

getMinorTick

public MinorTick getMinorTick()
Returns the minor tick node associated with this axis.

Returns:
the MinorTick node created as a child by this node

getTickInterval

public double getTickInterval()
Retrieves the tick interval.

Returns:
a double which specifies the tick interval

getTicks

public double[] getTicks()
Returns the value of the "Ticks" attribute, if set. If not set, then computed tick values are returned.

Returns:
the double value of the "Ticks" attribute, if defined. Otherwise, the computed tick values are returned.

getType

public int getType()
Returns the axis type.

Returns:
an int which specifies the node type; can be AXIS_X, AXIS_Y, AXIS_X_TOP or AXIS_Y_RIGHT
See Also:
AbstractChartNode.AXIS_X, AbstractChartNode.AXIS_Y, ChartNode.AXIS_X_TOP, ChartNode.AXIS_Y_RIGHT

getWindow

public double[] getWindow()
Returns the window for an Axis1D.

Returns:
a double array of length two containing the range of this axis.

paint

public void paint(Draw draw)
Paints this node and all of its children. This is normally called only by the paint method in this node's parent.

Specified by:
paint in class ChartNode
Parameters:
draw - the Draw object to be painted

setFirstTick

public void setFirstTick(double firstTick)
Convenience routine to set the "FirstTick" attribute.

Parameters:
firstTick - a double, the location of the first tick

setTickInterval

public void setTickInterval(double tickInterval)
Sets the tick interval.

Parameters:
tickInterval - a double which specifies a tick interval

setTicks

public void setTicks(double[] ticks)
Sets the value of the "Ticks" attribute. The attribute Number is set to the length of the array.

Parameters:
ticks - an array of doubles which contain the location, in user coordinates, of the major tick marks. If set, this attribute overrides the automatic computation of the tick values.

setType

public void setType(int type)
Sets the type of this node.

Parameters:
type - an int which specifies the node type; can be AXIS_X, AXIS_Y, AXIS_X_TOP or AXIS_Y_RIGHT
See Also:
AbstractChartNode.AXIS_X, AbstractChartNode.AXIS_Y, ChartNode.AXIS_X_TOP, ChartNode.AXIS_Y_RIGHT

setWindow

public void setWindow(double[] window)
Sets the window for an Axis1D.

Parameters:
window - is an array of length two containing the range of this axis.

setWindow

public void setWindow(double min,
                      double max)
Sets the window for an Axis1D.

Parameters:
min - a double which specifies the value of the left/bottom end of the axis
max - a double which specifies the value of the right/top end of the axis

JMSLTM Numerical Library 4.0

Copyright 1970-2006 Visual Numerics, Inc.
Built June 1 2006.