|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ijchart.xychart.axis.AbstractAxis
com.ijchart.xychart.axis.category.CategoryAxis
public class CategoryAxis
Title: IJChart
Description: a chart library for the Java(tm) platform.
用于显示分类值的坐标轴.Copyright: Copyright (c) 2013
Company:
Field Summary | |
---|---|
protected double |
acategoryWidth
一个系列的宽度. |
protected java.util.Hashtable |
categoryLabelPosition
category标签的位置. |
static double |
DEFAULT_CATEGORY_MARGIN
坐标轴上的所有标签的空白区域之和与坐标轴长度的比值的缺省值,单位为百分比. |
static HorizontalAlignment |
DEFAULT_HORIZONTAL_ALIGNMENT
缺省水平对齐方式. |
Constructor Summary | |
---|---|
CategoryAxis(IMatrixDataset dataset)
由数据集构造对象. |
|
CategoryAxis(java.lang.String label,
IMatrixDataset dataset)
由坐标轴标签和数据集构造对象. |
Method Summary | |
---|---|
void |
addCategoryMarker(Layer layer,
CategoryMarker marker)
增加一个marker,并且向所有监听器发送 AxisChangeEvent 事件. |
double |
categoryToJava2D(java.lang.Object category,
TextAnchor anchor)
根据分类(colKey)的值计算位置. |
void |
clearCategoryMarkers(Layer layer)
删除所有的category marker,并向所有监听器发送 AxisChangeEvent
事件.
|
java.lang.Object |
clone()
克隆本对象. |
protected IChartShape |
createChartShape(java.awt.geom.Rectangle2D tickLabelDrawRect,
java.lang.String tickLabel,
int rowKeyIndex)
创建一个RectangleTextChartShape对象. |
void |
drawGridLine(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
RectangleEdge axisEdge,
RenderShapeCollection shapeCollection,
java.awt.Stroke stroke,
java.awt.Paint paint)
绘制网格线,须在IAxis.draw()方法之后调用. |
protected double |
drawTickLabel(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
java.awt.geom.Rectangle2D axisArea,
RectangleEdge edge,
AxisShapeCollection shapeCollection,
double cursor)
绘制坐标轴上的刻度值的标签. |
protected double |
drawTickMark(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D axisArea,
RectangleEdge edge,
AxisShapeCollection shapeCollection,
double cursor)
绘制坐标轴上的刻度. |
boolean |
equals(java.lang.Object obj)
测试本对象是否和另一个对象相等. |
HorizontalAlignment |
getCategoryLabelHorizontalAlignment()
返回标签的水平对齐方式. |
double |
getCategoryMargin()
返回坐标轴上的所有标签的空白区域之和与坐标轴长度的比值,单位为百分比. |
java.util.Collection |
getCategoryMarkers(Layer layer)
根据Layer对象返回所有的category marker. |
protected java.lang.String[] |
getFormatedTickLabels(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D maxAxisArea,
RectangleEdge edge)
返回格式化后的在坐标轴上显示的刻度值. |
protected double |
getLabelMaxDrawWidth(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
RectangleEdge edge)
计算绘制坐标轴上的标签所需要的最大宽度,并且不超过由参数maximumCategoryLabelWidthRatio确定的整个图表区域 的宽度或高度. |
int |
getMaximumCategoryLabelLines()
返回标签的最大行数. |
int |
hashCode()
计算hashcode. |
void |
markerChanged(MarkerChangeEvent event)
收到marker发生变化的事件. |
boolean |
removeCategoryMarker(Layer layer,
CategoryMarker marker)
根据指定的Layer对象删除marker对象. |
void |
setCategoryLabelHorizontalAlignment(HorizontalAlignment align)
设置标签的水平对齐方式,并向所有监听器发送 AxisChangeEvent 事件.
|
void |
setCategoryMargin(double margin)
设置坐标轴上的所有标签的空白区域之和与坐标轴长度的比值,单位为百分比,并向所有监听器发送 AxisChangeEvent 事件.
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double DEFAULT_CATEGORY_MARGIN
public static final HorizontalAlignment DEFAULT_HORIZONTAL_ALIGNMENT
public static final int DEFAULT_MAX_CATEGORY_LABEL_LINE
protected java.util.Hashtable categoryLabelPosition
protected double acategoryWidth
Constructor Detail |
---|
public CategoryAxis(IMatrixDataset dataset)
dataset
- IMatrixDataset 二维矩阵数据集 (不可为null).
public CategoryAxis(java.lang.String label, IMatrixDataset dataset)
label
- 坐标轴标签.
dataset
- IMatrixDataset 二维矩阵数据集 (不可为null).
Method Detail |
---|
public double getCategoryMargin()
public void setCategoryMargin(double margin)
AxisChangeEvent
事件.
margin
- 坐标轴上的所有标签的空白区域之和与坐标轴长度的比值(单位为百分比),例如:0.05表示5%
public int getMaximumCategoryLabelLines()
public void setMaximumCategoryLabelLines(int lines)
AxisChangeEvent
事件.
lines
- 标签的最大行数
public HorizontalAlignment getCategoryLabelHorizontalAlignment()
public void setCategoryLabelHorizontalAlignment(HorizontalAlignment align)
AxisChangeEvent
事件.
align
- HorizontalAlignment
标签的水平对齐方式 (不可为null).
protected double drawTickMark(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D axisArea, RectangleEdge edge, AxisShapeCollection shapeCollection, double cursor)
drawTickMark
in class AbstractAxis
g2
- Graphics2D 图形设备(打印机或屏幕) (不可为null).
axisArea
- Rectangle2D 剩余的空白区域.
edge
- RectangleEdge 坐标轴的位置.
shapeCollection
- AxisShapeCollection 坐标轴图形集合.
cursor
- 光标的位置.
protected double drawTickLabel(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, java.awt.geom.Rectangle2D axisArea, RectangleEdge edge, AxisShapeCollection shapeCollection, double cursor)
drawTickLabel
in class AbstractAxis
g2
- Graphics2D 图形设备(打印机或屏幕) (不可为null).
plotArea
- Rectangle2D 图表的plot区域.
axisArea
- Rectangle2D 剩余的空白区域.
edge
- RectangleEdge 坐标轴的位置.
shapeCollection
- AxisShapeCollection 坐标轴图形集合.
cursor
- 光标的位置.
public double categoryToJava2D(java.lang.Object category, TextAnchor anchor)
category
- Object 分类值(colKey).
anchor
- CategoryAnchor 文字对齐方式 (可为null).
protected IChartShape createChartShape(java.awt.geom.Rectangle2D tickLabelDrawRect, java.lang.String tickLabel, int rowKeyIndex)
tickLabelDrawRect
- Rectangle2D 刻度值的包围矩形.
tickLabel
- String 刻度值.
rowKeyIndex
- 数据集的rowKey的索引值.
protected double getLabelMaxDrawWidth(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, RectangleEdge edge)
g2
- Graphics2D 图形设备(打印机或屏幕) (不可为null).
plotArea
- Rectangle2D 图表的plot区域.
edge
- RectangleEdge 坐标轴的位置.
protected java.lang.String[] getFormatedTickLabels(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D maxAxisArea, RectangleEdge edge)
getFormatedTickLabels
in class AbstractAxis
g2
- Graphics2D 图形设备(打印机或屏幕),可为null.
maxAxisArea
- Rectangle2D 坐标轴的最大区域,肯定小于plotArea (可为null).
edge
- RectangleEdge 坐标轴的位置 (可为null).
public void addCategoryMarker(Layer layer, CategoryMarker marker)
AxisChangeEvent
事件.
一般情况下marker会垂直于category坐标轴.
layer
- Layer 绘制的顺序(前景或背景) (不可为null).
marker
- CategoryMarker CategoryMarker对象 (不可为null).
public java.util.Collection getCategoryMarkers(Layer layer)
layer
- Layer对象 (不可为null).
public boolean removeCategoryMarker(Layer layer, CategoryMarker marker)
layer
- Layer layer对象 (不可为null).
marker
- CategoryMarker CategoryMarker对象 (不可为null).
public void clearCategoryMarkers(Layer layer)
AxisChangeEvent
事件.
layer
- Layer 绘制的顺序(前景或背景) (不可为null).
public void drawGridLine(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, RectangleEdge axisEdge, RenderShapeCollection shapeCollection, java.awt.Stroke stroke, java.awt.Paint paint)
drawGridLine
in class AbstractAxis
g2
- Graphics2D 图形设备(打印机或屏幕) (不可为null).
dataArea
- Rectangle2D 图表的data区域(数据区) (不可为null).
axisEdge
- RectangleEdge 坐标轴的位置 (不可为null).
shapeCollection
- RenderShapeCollection 坐标轴图形集合 (不可为null).
stroke
- Stroke 网格线stroke (不可为null).
paint
- Paint 网格线paint (不可为null).
public void markerChanged(MarkerChangeEvent event)
markerChanged
in interface IMarkerChangeListener
event
- marker变化的事件.
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractAxis
java.lang.CloneNotSupportedException
- if some component of the axis does
not support cloning.public boolean equals(java.lang.Object obj)
equals
in class AbstractAxis
obj
- 要测试的对象 (可为null).
public int hashCode()
hashCode
in class AbstractAxis
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |