com.ijchart.xychart.plot.combine
Class AbstractCombineCategoryPlot

java.lang.Object
  extended by com.ijchart.xychart.plot.AbstractPlot
      extended by com.ijchart.xychart.plot.AbstractAxisPlot
          extended by com.ijchart.xychart.plot.CategoryPlot
              extended by com.ijchart.xychart.plot.combine.AbstractCombineCategoryPlot
All Implemented Interfaces:
IAxisChangeListener, IDatasetChangeListener, IRenderChangeListener, IZoomable, java.io.Serializable, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
CombineCategoryAxisCategoryPlot, CombineValueAxisCategoryPlot

public abstract class AbstractCombineCategoryPlot
extends CategoryPlot
implements java.lang.Cloneable, java.io.Serializable

Title: IJChart

Description: a chart library for the Java(tm) platform.

多个CategoryPlot之间共享坐标轴,此类为抽象类.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Field Summary
static double DEFAULT_PLOT_GAP
          缺省的plot之间的间隔.
protected  double plotGap
          plot之间的间隔.
protected  java.util.List subPlots
          子plot集合.
protected  java.util.List subPlotWight
          子plot的权重.
 
Fields inherited from class com.ijchart.xychart.plot.CategoryPlot
DEFAULT_CATEGORY_CROSSHAIR_LOCKED_ON_DATA, DEFAULT_CATEGORY_CROSSHAIR_VISIBLE
 
Fields inherited from class com.ijchart.xychart.plot.AbstractAxisPlot
DEFAULT_CHART_ORIENTATION, DEFAULT_CROSSHAIR_PAINT, DEFAULT_CROSSHAIR_STROKE, DEFAULT_DOMAIN_CROSSHAIR_LOCKED_ON_DATA, DEFAULT_DOMAIN_CROSSHAIR_VISIBLE, DEFAULT_DOMAIN_GRIDLINE_VISIBLE, DEFAULT_DOMAIN_ZERO_BASELINE_VISIBLE, DEFAULT_GRIDLINE_PAINT, DEFAULT_GRIDLINE_STROKE, DEFAULT_VALUE_CROSSHAIR_LOCKED_ON_DATA, DEFAULT_VALUE_CROSSHAIR_VISIBLE, DEFAULT_VALUE_GRIDLINE_VISIBLE, domainAxes, renderToDomainAxis, renderToValueAxis, valueAxes
 
Fields inherited from class com.ijchart.xychart.plot.AbstractPlot
dataArea, DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_IMAGE_ALIGNMENT, DEFAULT_BACKGROUND_PAINT, DEFAULT_BORDER_PAINT, DEFAULT_BORDER_STROKE, DEFAULT_BORDER_VISIBLE, DEFAULT_DRAW_NO_DATA_MESSAGE, DEFAULT_DRAWINT_SUPPLIER, DEFAULT_FOREGROUND_ALPHA, DEFAULT_INSETS, DEFAULT_MINIMUM_HEIGHT_TO_DRAW, DEFAULT_MINIMUM_WIDTH_TO_DRAW, DEFAULT_NO_DATA_MESSAGE, DEFAULT_NO_DATA_MESSAGE_FONT, DEFAULT_NO_DATA_MESSAGE_PAINT, DEFAULT_RENDER_CALL_ORDER, drawNoDataMessage, plotShapes, renderingOrder, renderShapesList
 
Constructor Summary
AbstractCombineCategoryPlot()
          无参数构造器.
 
Method Summary
 void addSubPlot(CategoryPlot plot)
          增加一个子plot,并向所有监听器发送PlotChangeEvent事件.
 void addSubPlot(CategoryPlot plot, double wight)
          增加一个子plot,并向所有监听器发送PlotChangeEvent事件.
 void clearSubPlots()
          删除所有的子plot对象.
 java.lang.Object clone()
          克隆本对象.
 boolean drawCrosshair(java.awt.geom.Point2D mouseClickPoint)
          绘制十字线.
 boolean equals(java.lang.Object obj)
          测试两个对象是否相等.
protected  int getAxisCountByPosition(CategoryPlot plot, ChartOrientation orientation, RectangleEdge edge)
          计算指定位置的坐标轴的个数.
 double getPlotGap()
          返回plot之间的间隔.
 double getPlotWight(CategoryPlot plot)
          返回指定plot对象的权重(wight).
 java.util.Collection getRenders()
          返回render集合,此集合不可修改.
 java.util.Collection getSubPlots()
          返回所有的子plot对象.
 int hashCode()
          计算hashcode.
 void removeSubPlot(CategoryPlot plot)
          删除一个子plot对象,并向所有监听器发送PlotChangeEvent事件.
 void setDomainCrosshairLockedOnData(boolean flag)
          设置十字线是否自动锁定数据点,并向所有监听器发送 PlotChangeEvent事件.
 void setDomainCrosshairStroke(java.awt.Stroke stroke)
          设置domain轴十字线的Stroke,并向所有监听器发送 PlotChangeEvent事件.
 void setDomainCrosshairVisible(boolean flag)
          设置domain轴方向的十字线是否可见,并向所有监听器发送 PlotChangeEvent事件.
 void setPlotGap(double gap)
          设置plot之间的间隔,并向所有监听器发送PlotChangeEvent事件.
 void setPlotWight(CategoryPlot plot, double wight)
          设置指定plot对象的权重(wight),并向所有监听器发送 PlotChangeEvent事件.
 void setValueCrosshairLockedOnData(boolean flag)
          设置控制十字线是否自动锁定数据点,并向所有监听器发送 PlotChangeEvent事件.
 void setValueCrosshairStroke(java.awt.Stroke stroke)
          设置value轴十字线的Stroke,并向所有监听器发送 PlotChangeEvent事件.
 void setValueCrosshairVisible(boolean flag)
          设置控制value轴方向的十字线是否可见,并向所有监听器发送 PlotChangeEvent事件.
 void zoomValueAxes(java.awt.geom.Rectangle2D selectArea, java.awt.geom.Rectangle2D dataArea, java.awt.geom.Point2D source)
          缩放value坐标轴.
 
Methods inherited from class com.ijchart.xychart.plot.CategoryPlot
draw, drawAxes, getCategoryAxis, getCategoryAxis, getCategoryAxisByRenderIndex, getCategoryAxisCount, getCategoryAxisEdge, getCategoryAxisEdge, getCategoryAxisIndex, getCategoryAxisLocation, getCategoryAxisLocation, getNotNullCategoryAxis, getNotNullValueAxis, getNotNullValueAxisEdge, getPlotType, getRender, getRender, getRenderIndex, isDomainZoomable, setCategoryAxes, setCategoryAxes, setCategoryAxis, setCategoryAxis, setCategoryAxis, setCategoryAxisLocation, setCategoryAxisLocation, setRender, setRender, setRender, setRender, setRenders, toString
 
Methods inherited from class com.ijchart.xychart.plot.AbstractAxisPlot
allocateRenderShapesList, clearDomainAxes, clearValueAxes, drawValueGridlines, getAxisOffset, getCrosshairPoint, getDomainCrosshairPaint, getDomainCrosshairStroke, getDomainGridlinePaint, getDomainGridlineStroke, getOrientation, getRenderIndexForValueAxis, getRenderShapeCollection, getValueAxis, getValueAxis, getValueAxisByRenderIndex, getValueAxisCount, getValueAxisEdge, getValueAxisEdge, getValueAxisIndex, getValueAxisLocation, getValueAxisLocation, getValueCrosshairPaint, getValueCrosshairStroke, getValueGridlinePaint, getValueGridlineStroke, isDomainCrosshairLockedOnData, isDomainCrosshairVisible, isDomainGridlineVisible, isValueCrosshairLockedOnData, isValueCrosshairVisible, isValueGridlineVisible, mapRenderToDomainAxis, mapRenderToValueAxis, mapValueAxisToRender, setAxisOffset, setDomainGridlinePaint, setDomainGridlineStroke, setDomainGridlineVisible, setOrientation, setValueAxes, setValueAxes, setValueAxis, setValueAxis, setValueAxis, setValueAxisLocation, setValueAxisLocation, setValueAxisLocation, setValueAxisLocation, setValueGridlinePaint, setValueGridlineStroke, setValueGridlineVisible, translateMarkerShapes
 
Methods inherited from class com.ijchart.xychart.plot.AbstractPlot
addChangeListener, axisChanged, datasetChanged, drawBackground, drawBackgroundImage, drawBorder, drawNoDataMessage, firePlotChanged, getBackgroundAlpha, getBackgroundImage, getBackgroundImageAlignment, getBackgroundImageAlpha, getBackgroundPaint, getBorderPaint, getBorderStroke, getDataArea, getDrawingSupplier, getForegroundAlpha, getInsets, getNoDataMessage, getNoDataMessageFont, getNoDataMessagePaint, getRenderDrawOrder, getRenderShapesList, handleClick, isBorderVisible, isDrawNoDataMessage, isValueZoomable, notifyListeners, removeChangeListener, renderChanged, resolveDomainAxisLocation, resolveValueAxisLocation, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundImageAlpha, setBackgroundPaint, setBorderPaint, setBorderStroke, setBorderVisible, setDrawingSupplier, setDrawNoDataMessage, setForegroundAlpha, setInsets, setListObject, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setRenderDrawOrder, zoomDomainAxes
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ijchart.xychart.listener.IRenderChangeListener
renderChanged
 

Field Detail

DEFAULT_PLOT_GAP

public static final double DEFAULT_PLOT_GAP
缺省的plot之间的间隔.

See Also:
Constant Field Values

subPlots

protected java.util.List subPlots
子plot集合.


subPlotWight

protected java.util.List subPlotWight
子plot的权重.


plotGap

protected double plotGap
plot之间的间隔.

Constructor Detail

AbstractCombineCategoryPlot

public AbstractCombineCategoryPlot()
无参数构造器.

Method Detail

addSubPlot

public void addSubPlot(CategoryPlot plot)
增加一个子plot,并向所有监听器发送PlotChangeEvent事件.

Parameters:
plot - CategoryPlot CategoryPlot对象 (不可为null).

addSubPlot

public void addSubPlot(CategoryPlot plot,
                       double wight)
增加一个子plot,并向所有监听器发送PlotChangeEvent事件.

Parameters:
plot - CategoryPlot CategoryPlot对象 (不可为null).
wight - double 权重,必须大于0.

removeSubPlot

public void removeSubPlot(CategoryPlot plot)
删除一个子plot对象,并向所有监听器发送PlotChangeEvent事件.

Parameters:
plot - CategoryPlot CategoryPlot对象 (不可为null).

getSubPlots

public java.util.Collection getSubPlots()
返回所有的子plot对象.

Overrides:
getSubPlots in class AbstractPlot
Returns:
Collection 子plot对象集合,此对象不可修改.

clearSubPlots

public void clearSubPlots()
删除所有的子plot对象.


getPlotWight

public double getPlotWight(CategoryPlot plot)
返回指定plot对象的权重(wight).

Parameters:
plot - CategoryPlot CategoryPlot对象 (不可为null).
Returns:
double 权重,如果没有找到plot则返回-1.

setPlotWight

public void setPlotWight(CategoryPlot plot,
                         double wight)
设置指定plot对象的权重(wight),并向所有监听器发送 PlotChangeEvent事件.

Parameters:
plot - CategoryPlot CategoryPlot对象 (不可为null).
wight - double 权重,必须大于0.

getPlotGap

public double getPlotGap()
返回plot之间的间隔.

Returns:
double 间隔.

setPlotGap

public void setPlotGap(double gap)
设置plot之间的间隔,并向所有监听器发送PlotChangeEvent事件.

Parameters:
gap - double

getRenders

public java.util.Collection getRenders()
返回render集合,此集合不可修改.

Overrides:
getRenders in class CategoryPlot
Returns:
Collection render集合.

setDomainCrosshairVisible

public void setDomainCrosshairVisible(boolean flag)
设置domain轴方向的十字线是否可见,并向所有监听器发送 PlotChangeEvent事件.

Overrides:
setDomainCrosshairVisible in class AbstractAxisPlot
Parameters:
flag - boolean 布尔值.

setDomainCrosshairLockedOnData

public void setDomainCrosshairLockedOnData(boolean flag)
设置十字线是否自动锁定数据点,并向所有监听器发送 PlotChangeEvent事件.

Overrides:
setDomainCrosshairLockedOnData in class AbstractAxisPlot
Parameters:
flag - boolean 布尔值.

setDomainCrosshairStroke

public void setDomainCrosshairStroke(java.awt.Stroke stroke)
设置domain轴十字线的Stroke,并向所有监听器发送 PlotChangeEvent事件.

Overrides:
setDomainCrosshairStroke in class AbstractAxisPlot
Parameters:
stroke - Stroke Stroke对象 (不可为null).

setDomainCrosshairPaint

public void setDomainCrosshairPaint(java.awt.Paint paint)
设置domain轴十字线的Paint,并向所有监听器发送 PlotChangeEvent事件.

Overrides:
setDomainCrosshairPaint in class AbstractAxisPlot
Parameters:
paint - Paint Paint对象 (不可为null).

setValueCrosshairVisible

public void setValueCrosshairVisible(boolean flag)
设置控制value轴方向的十字线是否可见,并向所有监听器发送 PlotChangeEvent事件.

Overrides:
setValueCrosshairVisible in class AbstractAxisPlot
Parameters:
flag - boolean 布尔值.

setValueCrosshairLockedOnData

public void setValueCrosshairLockedOnData(boolean flag)
设置控制十字线是否自动锁定数据点,并向所有监听器发送 PlotChangeEvent事件.

Overrides:
setValueCrosshairLockedOnData in class AbstractAxisPlot
Parameters:
flag - boolean 布尔值.

setValueCrosshairStroke

public void setValueCrosshairStroke(java.awt.Stroke stroke)
设置value轴十字线的Stroke,并向所有监听器发送 PlotChangeEvent事件.

Overrides:
setValueCrosshairStroke in class AbstractAxisPlot
Parameters:
stroke - Stroke Stroke对象 (不可为null).

setValueCrosshairPaint

public void setValueCrosshairPaint(java.awt.Paint paint)
设置value轴十字线的Paint,并向所有监听器发送 PlotChangeEvent事件.

Overrides:
setValueCrosshairPaint in class AbstractAxisPlot
Parameters:
paint - Paint Paint对象 (不可为null).

drawCrosshair

public boolean drawCrosshair(java.awt.geom.Point2D mouseClickPoint)
绘制十字线.

Overrides:
drawCrosshair in class AbstractAxisPlot
Parameters:
mouseClickPoint - Point2D 鼠标点击时产生的坐标 (可为null).
Returns:
boolean 是否十字线发生了变化.

zoomValueAxes

public void zoomValueAxes(java.awt.geom.Rectangle2D selectArea,
                          java.awt.geom.Rectangle2D dataArea,
                          java.awt.geom.Point2D source)
缩放value坐标轴.

Specified by:
zoomValueAxes in interface IZoomable
Overrides:
zoomValueAxes in class AbstractAxisPlot
Parameters:
selectArea - Rectangle2D 鼠标选中区域,为null表示恢复到缩放前状态.
dataArea - Rectangle2D 数据区域,为null表示恢复到缩放前状态.
source - Point2D 源坐标点 (不可为null).

getAxisCountByPosition

protected int getAxisCountByPosition(CategoryPlot plot,
                                     ChartOrientation orientation,
                                     RectangleEdge edge)
计算指定位置的坐标轴的个数.

Parameters:
plot - CategoryPlot CategoryPlot对象.
orientation - ChartOrientation chart的方向.
edge - RectangleEdge 坐标轴的位置.
Returns:
int 数量.

equals

public boolean equals(java.lang.Object obj)
测试两个对象是否相等.

Overrides:
equals in class CategoryPlot
Parameters:
obj - 要比较的对象 (可为null).
Returns:
A boolean.

hashCode

public int hashCode()
计算hashcode.

Overrides:
hashCode in class CategoryPlot
Returns:
hashcode.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
克隆本对象.

Overrides:
clone in class CategoryPlot
Returns:
A clone.
Throws:
java.lang.CloneNotSupportedException - if the cloning is not supported.