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.

A abstract class for combined category plot where the axis is shared.

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
           The default gap between plots.
protected  double plotGap
           The gap between plots.
protected  java.util.List subPlots
           Storage for the subplot.
protected  java.util.List subPlotWight
           The wight of sub plots.
 
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()
           A constructor.
 
Method Summary
 void addSubPlot(XYPlot plot)
           Add a sub plot and sends a PlotChangeEvent to all registered listeners.
 void addSubPlot(XYPlot plot, double wight)
           Add a sub plot and sends a PlotChangeEvent to all registered listeners.
 void clearSubPlots()
           Removes all sub plots.
 java.lang.Object clone()
           Returns a clone of the plot.
 boolean equals(java.lang.Object obj)
           Tests the plot for equality with an arbitrary object.
protected  int getAxisCountByPosition(XYPlot plot, ChartOrientation orientation, RectangleEdge edge)
           Calculate the axis count for the specified position.
 double getPlotGap()
           Returns the gap between plots.
 double getPlotWight(XYPlot plot)
           Returns the wight for the specified plot.
 java.util.Collection getRenders()
           Returns the collection of renders,and this collection is unmodifiable.
 java.util.Collection getSubPlots()
           Returns all sub plots.
 int hashCode()
           Returns a hash code for this object.
 void removeSubPlot(XYPlot plot)
           Remove a sub plot and sends a PlotChangeEvent to all registered listeners.
 void setPlotGap(double gap)
           Sets the gap between plots and sends a PlotChangeEvent to all registered listeners.
 void setPlotWight(XYPlot plot, double wight)
           Sets the wight for the specified plot and sends a PlotChangeEvent to all registered listeners.
 void zoomDomainAxes(java.awt.geom.Rectangle2D selectArea, java.awt.geom.Rectangle2D dataArea, java.awt.geom.Point2D source)
           Zoom domain axes.
 void zoomValueAxes(java.awt.geom.Rectangle2D selectArea, java.awt.geom.Rectangle2D dataArea, java.awt.geom.Point2D source)
           Zoom value axes.
 
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
The default gap between plots.

See Also:
Constant Field Values

subPlots

protected java.util.List subPlots
Storage for the subplot.


subPlotWight

protected java.util.List subPlotWight
The wight of sub plots.


plotGap

protected double plotGap
The gap between plots.

Constructor Detail

AbstractCombineXYPlot

public AbstractCombineXYPlot()
A constructor.

Method Detail

addSubPlot

public void addSubPlot(XYPlot plot)
Add a sub plot and sends a PlotChangeEvent to all registered listeners.

Parameters:
plot - XYPlot The XYPlot object (null not permitted).

addSubPlot

public void addSubPlot(XYPlot plot,
                       double wight)
Add a sub plot and sends a PlotChangeEvent to all registered listeners.

Parameters:
plot - XYPlot The XYPlot object (null not permitted).
wight - double The widght,must be >0.

removeSubPlot

public void removeSubPlot(XYPlot plot)
Remove a sub plot and sends a PlotChangeEvent to all registered listeners.

Parameters:
plot - XYPlot The XYPlot object (null not permitted).

getSubPlots

public java.util.Collection getSubPlots()
Returns all sub plots.

Overrides:
getSubPlots in class AbstractPlot
Returns:
Collection The collection of sub plots (unmodifiable).

clearSubPlots

public void clearSubPlots()
Removes all sub plots.


getPlotWight

public double getPlotWight(XYPlot plot)
Returns the wight for the specified plot.

Parameters:
plot - XYPlot The XYPlot object (null not permitted).
Returns:
double The wight,-1 if not found.

setPlotWight

public void setPlotWight(XYPlot plot,
                         double wight)
Sets the wight for the specified plot and sends a PlotChangeEvent to all registered listeners.

Parameters:
plot - XYPlot The XYPlot object (null not permitted).
wight - double The widght,must be >0.

getPlotGap

public double getPlotGap()
Returns the gap between plots.

Returns:
double The gap.

setPlotGap

public void setPlotGap(double gap)
Sets the gap between plots and sends a PlotChangeEvent to all registered listeners.

Parameters:
gap - double

getRenders

public java.util.Collection getRenders()
Returns the collection of renders,and this collection is unmodifiable.

Overrides:
getRenders in class XYPlot
Returns:
Collection The collection of renders.

zoomDomainAxes

public void zoomDomainAxes(java.awt.geom.Rectangle2D selectArea,
                           java.awt.geom.Rectangle2D dataArea,
                           java.awt.geom.Point2D source)
Zoom domain axes.

Specified by:
zoomDomainAxes in interface IZoomable
Overrides:
zoomDomainAxes in class XYPlot
Parameters:
selectArea - Rectangle2D The selected area,null to restore chart.
dataArea - Rectangle2D The data area,null to restore chart.
source - Point2D The source mouse point (null not permitted).

zoomValueAxes

public void zoomValueAxes(java.awt.geom.Rectangle2D selectArea,
                          java.awt.geom.Rectangle2D dataArea,
                          java.awt.geom.Point2D source)
Zoom value axes.

Specified by:
zoomValueAxes in interface IZoomable
Overrides:
zoomValueAxes in class AbstractAxisPlot
Parameters:
selectArea - Rectangle2D The selected area,null to restore chart.
dataArea - Rectangle2D The data area,null to restore chart.
source - Point2D The source mouse point (null not permitted).

getAxisCountByPosition

protected int getAxisCountByPosition(XYPlot plot,
                                     ChartOrientation orientation,
                                     RectangleEdge edge)
Calculate the axis count for the specified position.

Parameters:
plot - XYPlot The XYPlot object.
orientation - ChartOrientation The direction of chart.
edge - RectangleEdge The position.
Returns:
int The axis count.

equals

public boolean equals(java.lang.Object obj)
Tests the plot for equality with an arbitrary object.

Overrides:
equals in class XYPlot
Parameters:
obj - The object to test against (null permitted).
Returns:
A boolean.

hashCode

public int hashCode()
Returns a hash code for this object.

Overrides:
hashCode in class XYPlot
Returns:
A hash code.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a clone of the plot.

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