lt.monarch.chart.chart2D.axis
Class Axis2DX

java.lang.Object
  extended by lt.monarch.chart.engine.AbstractChartObject<AxisPaintTags>
      extended by lt.monarch.chart.mapper.Axis
          extended by lt.monarch.chart.chart2D.axis.Axis2D
              extended by lt.monarch.chart.chart2D.axis.Axis2DX
All Implemented Interfaces:
java.io.Serializable, ChartObject, StyleEditorEntity

public class Axis2DX
extends Axis2D

Graphical representation of the X coordinate axis of the 2D chart.

See Also:
Serialized Form

Nested Class Summary
Modifier and Type Class and Description
 
Nested classes/interfaces inherited from class lt.monarch.chart.chart2D.axis.Axis2D
Axis2D.AxisLabelEntity
 
Field Summary
Modifier and Type Field and Description
protected  double maxLabelHeigth
          Height of the longest rotated label projection.
protected  double preferredHeight
          Preferred height of the axis
protected  double rightInset
          Specifies how big insets from the right should be left
protected  double totalLabelHeigth
          Height of the total label height.
protected  AbstractAxisLabel[] visibleLabels
          Storage of label objects that are currently painted on the screen.
 
Fields inherited from class lt.monarch.chart.chart2D.axis.Axis2D
arrowPolygon, arrowPolygon2, arrowSettings, axisAlign, axisOrientation, dataModel, dragFrom, dragTo, finestVisibleScale, isMoreZoomAvailable, isScrollable, isVisible, isZooming, isZoomingEnabled, labelSettings, mappedAxis, mappedValue, mappedValueCoord, metaModel, mouseClick, mouseListener, mouseMotionListener, pt2D1, pt2D2, range, rangeListener, tickSettings
 
Fields inherited from class lt.monarch.chart.mapper.Axis
isInvertedMapper, mapper, textStyle
 
Fields inherited from class lt.monarch.chart.engine.AbstractChartObject
AXIS_SORT_POSITION, BREAK_LINE_POSITION, DEFAULT_SORT_POSITION, GRID_SORT_POSITION, MARKER_SERIES_SORT_POSITION, MARKERS_SORT_POSITION, paintStyle, SERIES_SORT_POSITION, sortPosition, style
 
Constructor Summary
Constructor and Description
Axis2DX(AxisMapper mapper)
          Constructs a new graphical representation of the X coordinate axis of the 2D chart with the specified axis mapper.
Axis2DX(AxisMapper mapper, MetaDataModel metaModel, DataModel dataModel)
          Constructs a new graphical representation of the X coordinate axis of the 2D chart with the specified axis mapper.
 
Method Summary
Modifier and Type Method and Description
protected  void drawAxis(AbstractGraphics g)
          Draws axis line
protected  void drawLabels(AbstractGraphics g, LinearLabelLayouter layouter)
          Draws the labels of the axis in the specified Graphics context.
protected  void drawTicksLabels(AbstractGraphics g, LinearLabelLayouter layouter)
          Prepares labels for drawing
protected  void drawTitle(AbstractGraphics g, LinearLabelLayouter layouter, AxisTitle axisTitle)
          Draws the title of the axis and updates label layouter that is used to layout the axis labels.
protected  Rectangle2D getActiveArea()
          Returns the Rectangle representing active area.
 double getHeight()
          Gets the height of the Axis
 java.awt.Insets getPreferredInsets()
          Queries preferred insets for the axis.
 Axis2DX getStackAxis2DX()
          Returns the base X axis.
 int getTitleHeight(AbstractGraphics g)
          Returns vertical amount of space needed to draw axis title.
 AbstractAxisLabel[] getVisibleLabels()
          Returns objects of visible labels.
protected  Axis2D[] getZoomableAxes()
          Gets all zoomable axes for the specified orientation
 void prepare(AbstractGraphics g)
          Calculates axis boundaries and range.
 void setStackAxis2DX(Axis2DX baseAxis)
          Stacks this X axis on top of the base X axis.
 
Methods inherited from class lt.monarch.chart.chart2D.axis.Axis2D
activate, createAxisLabel, deactivate, digitizePosition, draw, drawArrow, drawSecondArrow, drawZoomRectangle, getArrowPolygon, getArrowSettings, getAxisAlign, getAxisAlignment, getBounds, getChartObjectBounds, getFinestScale, getLabelSettings, getMappedAxis, getMappedValue, getMappedValueCoord, getMetaDataModel, getProjector, getStyle, getTickLength, getTickSettings, isScrollable, isVisible, isZoomingEnabled, setAxisAlign, setAxisPosition, setBounds, setMappedValueCoord, setScrollable, setVisible, setZoomingEnabled
 
Methods inherited from class lt.monarch.chart.mapper.Axis
getFont, getMapper, getSortPosition, getTextStyle, getTitle, getTitles, getTitleSettings, setTitle, setTitle
 
Methods inherited from class lt.monarch.chart.engine.AbstractChartObject
chart, copy, dispose, finalize, getChart, getPaintStyle, getParent, getStyle, invalidate, layout, repaint, repaint, setChart
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rightInset

protected double rightInset
Specifies how big insets from the right should be left


preferredHeight

protected double preferredHeight
Preferred height of the axis


maxLabelHeigth

protected double maxLabelHeigth
Height of the longest rotated label projection.


totalLabelHeigth

protected double totalLabelHeigth
Height of the total label height.


visibleLabels

protected AbstractAxisLabel[] visibleLabels
Storage of label objects that are currently painted on the screen.

Constructor Detail

Axis2DX

public Axis2DX(AxisMapper mapper)
Constructs a new graphical representation of the X coordinate axis of the 2D chart with the specified axis mapper.

Parameters:
mapper - AxisMapper object that defines axis entityStyle.

Axis2DX

public Axis2DX(AxisMapper mapper,
               MetaDataModel metaModel,
               DataModel dataModel)
Constructs a new graphical representation of the X coordinate axis of the 2D chart with the specified axis mapper.

Parameters:
mapper - AxisMapper object that defines axis entityStyle.
metaModel - meta data model
dataModel - data model
Method Detail

getHeight

public double getHeight()
Gets the height of the Axis

Returns:
axis height

prepare

public void prepare(AbstractGraphics g)
Description copied from class: Axis2D
Calculates axis boundaries and range.

Specified by:
prepare in class Axis2D
Parameters:
g - current Graphics context.

drawLabels

protected void drawLabels(AbstractGraphics g,
                          LinearLabelLayouter layouter)
Description copied from class: Axis2D
Draws the labels of the axis in the specified Graphics context.

Specified by:
drawLabels in class Axis2D
Parameters:
g - the Graphics context in which the axis labels to paint
layouter - the Layouter used to layout axis labels

drawAxis

protected void drawAxis(AbstractGraphics g)
Description copied from class: Axis2D
Draws axis line

Specified by:
drawAxis in class Axis2D
Parameters:
g - graphics context

drawTicksLabels

protected void drawTicksLabels(AbstractGraphics g,
                               LinearLabelLayouter layouter)
Prepares labels for drawing

Specified by:
drawTicksLabels in class Axis2D
Parameters:
g - graphics context

drawTitle

protected void drawTitle(AbstractGraphics g,
                         LinearLabelLayouter layouter,
                         AxisTitle axisTitle)
Description copied from class: Axis2D
Draws the title of the axis and updates label layouter that is used to layout the axis labels. The layouter is updated by setting its visible range.

Specified by:
drawTitle in class Axis2D
Parameters:
g - the Graphics context in which the axis title to paint
layouter - the label layouter used to layout axis labels
axisTitle - the axis title to draw

getTitleHeight

public int getTitleHeight(AbstractGraphics g)
Returns vertical amount of space needed to draw axis title.

Parameters:
g - the Graphics context in which to paint axis
Returns:
title height in pixels

getVisibleLabels

public AbstractAxisLabel[] getVisibleLabels()
Description copied from class: Axis2D
Returns objects of visible labels.

Specified by:
getVisibleLabels in class Axis2D
Returns:
array of visible labels

setStackAxis2DX

public void setStackAxis2DX(Axis2DX baseAxis)
Stacks this X axis on top of the base X axis. This is internal API. Should not be used.

Parameters:
baseAxis - X axis, to be used as the base for the axis

getStackAxis2DX

public Axis2DX getStackAxis2DX()
Returns the base X axis.

Returns:
X axis, to be used as the base for the axis

getPreferredInsets

public java.awt.Insets getPreferredInsets()
Description copied from class: Axis2D
Queries preferred insets for the axis. Chart2D shrinks the chart area based on the inset information, collected from all axis objects, to make sure axis have enough space around the chart to draw all their labels correctly.

Overrides:
getPreferredInsets in class Axis2D
Returns:
Insets space, required between axis bounds and chart bounds.

getActiveArea

protected Rectangle2D getActiveArea()
Returns the Rectangle representing active area. The active area is area where user can scroll and zoom axis by clicking and dragging mouse.

Specified by:
getActiveArea in class Axis2D
Returns:
the Rectangle representing active area

getZoomableAxes

protected Axis2D[] getZoomableAxes()
Description copied from class: Axis2D
Gets all zoomable axes for the specified orientation

Specified by:
getZoomableAxes in class Axis2D
Returns:
array of zoomable axes