com.ijchart.xychart.plot.combine
Class AbstractCombineXYPlot

java.lang.Object
  extended by com.ijchart.xychart.plot.AbstractPlot
      extended by com.ijchart.xychart.plot.AbstractAxisPlot
          extended by com.ijchart.xychart.plot.XYPlot
              extended by com.ijchart.xychart.plot.combine.AbstractCombineXYPlot
All Implemented Interfaces:
IAxisChangeListener, IDatasetChangeListener, IRenderChangeListener, IZoomable, java.io.Serializable, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
CombineDomainAxisXYPlot, CombineValueAxisXYPlot

public abstract class AbstractCombineXYPlot
extends XYPlot
implements java.lang.Cloneable, java.io.Serializable

Title: IJChart

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

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

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.XYPlot
DEFAULT_QUADRANT_ORIGIN, DEFAULT_QUADRANT_PAINT, DEFAULT_VALUE_ZERO_BASELINE_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
AbstractCombineXYPlot()
          无参数构造器.
 
Method Summary
 void addSubPlot(XYPlot plot)
          增加一个子plot,并向所有监听器发送PlotChangeEvent事件.
 void addSubPlot(XYPlot plot, double wight)
          增加一个子plot,并向所有监听器发送PlotChangeEvent事件.
 void clearSubPlots()
          删除所有的子plot对象.
 java.lang.Object clone()
          克隆本对象.
 boolean equals(java.lang.Object obj)
          测试两个对象是否相等.
protected  int getAxisCountByPosition(XYPlot plot, ChartOrientation orientation, RectangleEdge edge)
          计算指定位置的坐标轴的个数.
 double getPlotGap()
          返回plot之间的间隔.
 double getPlotWight(XYPlot plot)
          返回指定plot对象的权重(wight).
 java.util.Collection getRenders()
          返回render集合,此集合不可修改.
 java.util.Collection getSubPlots()
          返回所有的子plot对象.
 int hashCode()
          计算hashcode.
 void removeSubPlot(XYPlot plot)
          删除一个子plot对象,并向所有监听器发送PlotChangeEvent事件.
 void setPlotGap(double gap)
          设置plot之间的间隔,并向所有监听器发送PlotChangeEvent事件.
 void setPlotWight(XYPlot plot, double wight)
          设置指定plot对象的权重(wight),并向所有监听器发送 PlotChangeEvent事件.
 void zoomDomainAxes(java.awt.geom.Rectangle2D selectArea, java.awt.geom.Rectangle2D dataArea, java.awt.geom.Point2D source)
          缩放domain坐标轴.
 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.XYPlot
draw, drawAxes, drawQuadrantBackground, drawZeroDomainBaseline, drawZeroValueBaseline, getDomainAxis, getDomainAxis, getDomainAxisByRenderIndex, getDomainAxisCount, getDomainAxisEdge, getDomainAxisEdge, getDomainAxisIndex, getDomainAxisLocation, getDomainAxisLocation, getDomainZeroBaselinePaint, getDomainZeroBaselineStroke, getPlotType, getQuadrantOrigin, getQuadrantPaint, getRender, getRender, getRenderIndex, getValueZeroBaselinePaint, getValueZeroBaselineStroke, isDomainZeroBaselineVisible, isValueZeroBaselineVisible, setDomainAxes, setDomainAxes, setDomainAxis, setDomainAxis, setDomainAxis, setDomainAxisLocation, setDomainAxisLocation, setDomainZeroBaselinePaint, setDomainZeroBaselineStroke, setDomainZeroBaselineVisible, setQuadrantOrigin, setQuadrantPaint, setRender, setRender, setRender, setRender, setRenders, setValueZeroBaselinePaint, setValueZeroBaselineStroke, setValueZeroBaselineVisible, toString
 
Methods inherited from class com.ijchart.xychart.plot.AbstractAxisPlot
allocateRenderShapesList, clearDomainAxes, clearValueAxes, drawCrosshair, 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, setDomainCrosshairLockedOnData, setDomainCrosshairPaint, setDomainCrosshairStroke, setDomainCrosshairVisible, setDomainGridlinePaint, setDomainGridlineStroke, setDomainGridlineVisible, setOrientation, setValueAxes, setValueAxes, setValueAxis, setValueAxis, setValueAxis, setValueAxisLocation, setValueAxisLocation, setValueAxisLocation, setValueAxisLocation, setValueCrosshairLockedOnData, setValueCrosshairPaint, setValueCrosshairStroke, setValueCrosshairVisible, 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, isDomainZoomable, isDrawNoDataMessage, isValueZoomable, notifyListeners, removeChangeListener, renderChanged, resolveDomainAxisLocation, resolveValueAxisLocation, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundImageAlpha, setBackgroundPaint, setBorderPaint, setBorderStroke, setBorderVisible, setDrawingSupplier, setDrawNoDataMessage, setForegroundAlpha, setInsets, setListObject, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setRenderDrawOrder
 
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

AbstractCombineXYPlot

public AbstractCombineXYPlot()
无参数构造器.

Method Detail

addSubPlot

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

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

addSubPlot

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

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

removeSubPlot

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

Parameters:
plot - XYPlot XYPlot对象 (不可为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(XYPlot plot)
返回指定plot对象的权重(wight).

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

setPlotWight

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

Parameters:
plot - XYPlot XYPlot对象 (不可为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 XYPlot
Returns:
Collection render集合.

zoomDomainAxes

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

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

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(XYPlot plot,
                                     ChartOrientation orientation,
                                     RectangleEdge edge)
计算指定位置的坐标轴的个数.

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

equals

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

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

hashCode

public int hashCode()
计算hashcode.

Overrides:
hashCode in class XYPlot
Returns:
hashcode.

clone

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

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