net.sourceforge.chart2d
Class XAxisArea

java.lang.Object
  |
  +--net.sourceforge.chart2d.Area
        |
        +--net.sourceforge.chart2d.FontArea
              |
              +--net.sourceforge.chart2d.TitledArea
                    |
                    +--net.sourceforge.chart2d.AxisArea
                          |
                          +--net.sourceforge.chart2d.XAxisArea

class XAxisArea
extends AxisArea

An x Axis for chart graphs. Supports both vertical and horizontal bar charts, low number of points line and scatter charts. Bullets can be either aligned with the labels as in horizontal bar charts or between the labels as int vertical bar charts. Label font size, type, style, and color are adjustable. Minimum gaps between labels, ticks, and labels and bullets may be specified. Ticks size and color may be specified. A title and its font may also be customized. The title may be justified withing the width of the axis, left, right or center. Supports all of bordered areas customizability except for auto min sizing. If auto minimum sizing, then the title will likely be far apart from the axis. It does support everything with auto min sizing disabled. It is recommended that the auto justification be disabled. The xAxis must be butted up against a graph area, this is best done manually. This is its default.


Fields inherited from class net.sourceforge.chart2d.Area
BETWEEN, BOTTOM, CENTER, CENTERED, CONTINUOUS, DASHED, DOTTED, FLOAT, HEIGHT, HORIZONTAL, INTEGER, LABELSBOTTOM, LABELSLEFT, LEFT, LEFTBOTTOM, LEFTRIGHT, LEFTTOP, LESSER, MAX, MAXMODEL, MIN, RIGHT, RIGHTBOTTOM, RIGHTTOP, TOP, TOPBOTTOM, VERTICAL, WIDTH
 
Constructor Summary
(package private) XAxisArea()
          Creates a new xAxis Area with the default settings.
 
Method Summary
(package private)  int getBetweenTicksGapThicknessModel()
          Returns the model thickness of the gap between the ticks.
(package private)  TextArea[] getLabels(java.awt.Graphics2D g2D)
          The labels of the axis.
(package private)  HorizontalTextListArea getTextList()
          Returns the HorizontalTextListArea for this X Axis.
(package private)  java.awt.Rectangle[] getTicks(java.awt.Graphics2D g2D)
          The bounds of the ticks.
(package private)  int getTicksAlignment()
          Returns how the ticks are aligned with respect to the labels.
(package private)  java.awt.Color getTicksColor()
          Returns the color of the ticks.
(package private)  boolean getXAxisAreaNeedsUpdate()
          Indicates whether some property of this class has changed.
(package private)  void paintComponent(java.awt.Graphics2D g2D)
          Paints all the components of this class.
(package private)  void resetXAxisModel(boolean reset)
          Resets the model for this class.
(package private)  void setBetweenTicksAndLabelsGapExistence(boolean existence)
          The existence of a gap between the row of labels and the row of ticks.
(package private)  void setBetweenTicksAndLabelsGapThicknessModel(int gap)
          The model thickness for the gap between the row of labels and the row of ticks.
(package private)  void setBetweenTicksGapExistence(boolean existence)
          The existence of a gap between each tick and the next.
(package private)  void setBetweenTicksGapThicknessModel(int gap)
          The model thickness for the gap between each tick.
(package private)  void setNumTicks(int num)
          The number of ticks should be equal to the number of x axis labels at all times, EXCEPT with a type of chart with a (LABELSBOTTOM x axis and a graph components alignment is true).
(package private)  void setTicksAlignment(int alignment)
          The horizontal alignment of the ticks respective to the labels.
(package private)  void setTicksColor(java.awt.Color color)
          The color for the ticks.
(package private)  void setTicksSizeModel(java.awt.Dimension size)
          The model size for the ticks.
(package private)  void setType(int type)
          Specifies the type of the x Axis.
(package private)  void updateXAxisArea(java.awt.Graphics2D g2D)
          Updates this parent's variables, and this' variables.
 
Methods inherited from class net.sourceforge.chart2d.TitledArea
getBetweenTitleAndSpaceGapThickness, getBetweenTitleAndSpaceGapThicknessModel, getMaxEntitledSpaceBounds, getTitle, getTitleAutoLocate, getTitledAreaNeedsUpdate, getTitleExistence, getTitleJustifications, getTitleSize, getTitleText, resetTitledAreaModel, setBetweenTitleAndSpaceGapExistence, setBetweenTitleAndSpaceGapThicknessModel, setTitle, setTitleAutoLocate, setTitleExistence, setTitleJustifications, setTitleLocation, setTitleRotateLeft, updateTitledArea
 
Methods inherited from class net.sourceforge.chart2d.FontArea
getFont, getFontAreaNeedsUpdate, getFontColor, getFontName, getFontPointModel, getFontStyle, resetFontAreaModel, setFontColor, setFontName, setFontPointModel, setFontStyle, updateFontArea
 
Methods inherited from class net.sourceforge.chart2d.Area
applyRatio, getAreaNeedsUpdate, getAutoSize, getBackgroundColor, getBackgroundExistence, getBorderColor, getBorderColor, getBorderExistence, getBorderExistence, getBorderThickness, getBorderThickness, getBorderThicknessModel, getBorderThicknessModel, getGapThickness, getGapThicknessModel, getJustifications, getRatio, getResetAreaModel, getSize, getSizeLocation, getSpaceSize, getSpaceSizeLocation, resetAreaModel, setAutoJustifys, setAutoSizes, setBackgroundColor, setBackgroundExistence, setBorderAssociations, setBorderColor, setBorderColors, setBorderCornerAssociations, setBorderExistence, setBorderExistences, setBorderThicknessModel, setBorderThicknessModels, setCustomRatio, setGapAssociations, setGapExistence, setGapExistences, setGapThicknessModel, setGapThicknessModels, setJustifications, setLockRatios, setSize, setSizeLocation, setSpaceSize, setSpaceSizeLocation, updateArea
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XAxisArea

XAxisArea()
Creates a new xAxis Area with the default settings.
Method Detail

setType

void setType(int type)
Specifies the type of the x Axis. The type refers to what type of chart it supports. In any chart the objects are plotted against one side, the values side, the values side has raw numbers like 0, 100, 200, etc. The other side, the labels side, has the labels for the data being plotted, like September, November, etc. If the labels side is along the bottom of the graph, then set the type to LABELSBOTTOM. If the labels side is along the left/right side of the graph then set the type to LABELSLEFT.
Overrides:
setType in class AxisArea
Parameters:
type - Whether this axis is used for labels bottom or labels left applications.

setTicksColor

void setTicksColor(java.awt.Color color)
The color for the ticks.
Overrides:
setTicksColor in class AxisArea
Parameters:
color - The x Axis tick color.

setTicksAlignment

void setTicksAlignment(int alignment)
The horizontal alignment of the ticks respective to the labels. The bullets can either be place in line with each label, or in in line with the middle of the space between each label. That is, bullets can be centered in the middle of the label, or placed between each label.
Overrides:
setTicksAlignment in class AxisArea
Parameters:
alignment - With values of either Area.CENTERED or Area.BETWEEN

setNumTicks

void setNumTicks(int num)
The number of ticks should be equal to the number of x axis labels at all times, EXCEPT with a type of chart with a (LABELSBOTTOM x axis and a graph components alignment is true).
Overrides:
setNumTicks in class AxisArea
Parameters:
num - The number of x axis ticks.

setTicksSizeModel

void setTicksSizeModel(java.awt.Dimension size)
The model size for the ticks. If auto maximum sizing is enabled, then the actual tick size can grow and shrink; in this case a ratio based on the maximum area size / model area size is computed and applied to the model size in order to find the actual size. With maximum sizing disabled, the actual size is the model size.
Overrides:
setTicksSizeModel in class AxisArea
Parameters:
size - The model size for the ticks. [Do not pass null]

setBetweenTicksGapExistence

void setBetweenTicksGapExistence(boolean existence)
The existence of a gap between each tick and the next. If the gap does not exist, then it will not be used in calculations.
Overrides:
setBetweenTicksGapExistence in class AxisArea
Parameters:
existence - The existence of a gap between each tick and the next. If true, then they do.

setBetweenTicksGapThicknessModel

void setBetweenTicksGapThicknessModel(int gap)
The model thickness for the gap between each tick. If auto maximum sizing is enabled, then the actual thickness size can grow and shrink; in this case a ratio based on the maximum area size / model area size is computed and applied to the model thickness in order to find the actual thickness. With maximum sizing disabled, the actual thickness is the model thickness.
Overrides:
setBetweenTicksGapThicknessModel in class AxisArea
Parameters:
gap - The model thickness for the gap between each tick.

setBetweenTicksAndLabelsGapExistence

void setBetweenTicksAndLabelsGapExistence(boolean existence)
The existence of a gap between the row of labels and the row of ticks. If the gap does not exist, then it will not be used in calculations.
Overrides:
setBetweenTicksAndLabelsGapExistence in class AxisArea
Parameters:
existence - The existence of a gap between the labels and ticks. If true, then they do.

setBetweenTicksAndLabelsGapThicknessModel

void setBetweenTicksAndLabelsGapThicknessModel(int gap)
The model thickness for the gap between the row of labels and the row of ticks. If auto maximum sizing is enabled, then the actual thickness size can grow and shrink; in this case a ratio based on the maximum area size / model area size is computed and applied to the model thickness in order to find the actual thickness. With maximum sizing disabled, the actual thickness is the model thickness. This thickness is not used in calculations if either the ticks or labels do not exist.
Overrides:
setBetweenTicksAndLabelsGapThicknessModel in class AxisArea
Parameters:
gap - The model thickness for the gap between the labels and ticks.

getTextList

HorizontalTextListArea getTextList()
Returns the HorizontalTextListArea for this X Axis. Get for standard configuration of the x axis.
Returns:
This x axis component.

getLabels

TextArea[] getLabels(java.awt.Graphics2D g2D)
The labels of the axis. The lowest order array label is the top most label.
Overrides:
getLabels in class AxisArea
Parameters:
g2D - The graphics context to use for calculations.
Returns:
The text labels; this will never be null.

getTicks

java.awt.Rectangle[] getTicks(java.awt.Graphics2D g2D)
The bounds of the ticks. The bounds of the ticks specify the locations and sizes of each actual tick. The lowest order array tick is the left most tick.
Overrides:
getTicks in class AxisArea
Parameters:
g2D - The graphics context to use for calculations.
Returns:
The bounds of the ticks. This will never be null.

getBetweenTicksGapThicknessModel

int getBetweenTicksGapThicknessModel()
Returns the model thickness of the gap between the ticks.
Overrides:
getBetweenTicksGapThicknessModel in class AxisArea
Returns:
The thickness.

getTicksColor

java.awt.Color getTicksColor()
Returns the color of the ticks.
Overrides:
getTicksColor in class AxisArea
Returns:
The color.

getTicksAlignment

int getTicksAlignment()
Returns how the ticks are aligned with respect to the labels.
Overrides:
getTicksAlignment in class AxisArea
Returns:
int With values of either Area.CENTERED or Area.BETWEEN

getXAxisAreaNeedsUpdate

boolean getXAxisAreaNeedsUpdate()
Indicates whether some property of this class has changed.
Returns:
True if some property has changed.

updateXAxisArea

void updateXAxisArea(java.awt.Graphics2D g2D)
Updates this parent's variables, and this' variables.
Parameters:
g2D - The graphics context to use for calculations.

resetXAxisModel

void resetXAxisModel(boolean reset)
Resets the model for this class. The model is used for shrinking and growing of its components based on the maximum size of this class. If this method is called, then the next time the maximum size is set, this classes model maximum size will be made equal to the new maximum size. Effectively what this does is ensure that whenever this objects maximum size is equal to the one given, then all of the components will take on their default model sizes. Note: This is only useful when auto model max sizing is disabled.
Parameters:
reset - True causes the max model size to be set upon the next max sizing.

paintComponent

void paintComponent(java.awt.Graphics2D g2D)
Paints all the components of this class. First all variables are updated.
Overrides:
paintComponent in class TitledArea
Parameters:
g2D - The graphics context for calculations and painting.