kcl.waterloo.graphics.plots2D
Class GJBar
- java.lang.Object
-
- kcl.waterloo.observable.GJAbstractObservable
-
- kcl.waterloo.graphics.plots2D.GJAbstractPlotModelImpl
-
- kcl.waterloo.graphics.plots2D.GJAbstractPlot
-
- kcl.waterloo.graphics.plots2D.GJBar
-
- All Implemented Interfaces:
- java.beans.PropertyChangeListener, java.util.EventListener, GJEffectorInterface, GJFastPlotInterface, GJPlotInterface, GJLinkableInterface, GJObservableInterface, GJDataModelInterface<java.awt.geom.Rectangle2D,GJGraphInterface>, GJFillableInterface<java.awt.Shape,java.awt.Paint>, GJScreenDataInterface<java.awt.Shape>, GJVisualsInterface<GJMarker,java.awt.Paint,java.awt.BasicStroke,java.awt.Dimension,java.awt.Shape>
public class GJBar extends GJAbstractPlot
GJBar supports bar plots and histograms. GJBar is unusual in supporting swapping of data displayed along the x- and y-axes to support both vertical and horizontal bar charts.- For vertical bars.
- The XData represent the offsets on the x-axis.
- the YData represent their heights.
- For horizontal bars.
- The XData represent the offsets on the y-axis.
- the YData represent their horizontal lengths.
getDataRange()has been overridden to account for the alignment (which facilitates auto ranging of the axes).
-
-
Field Summary
-
Fields inherited from class kcl.waterloo.graphics.plots2D.GJAbstractPlotModelImpl
screenDataArray
-
-
Constructor Summary
Constructors Constructor and Description GJBar()GJBar(GJAbstractPlot p)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static GJPlotInterfacecreateInstance()Factory method for creating a bar chart.java.awt.geom.Rectangle2DgetDataRange()This overrides the super class method providing support for horizontal bars too by swapping the x- and y- data.voidpaintPlot(java.awt.Graphics2D g2)Note that this method is overloaded by all concrete sub-classes which should call this super-class method.-
Methods inherited from class kcl.waterloo.graphics.plots2D.GJAbstractPlot
add, createFrame, findPlotBelow, findPlotBelow, getAreaFill, getAreaPaint, getEffect, getFillable, getFillAlpha, getFillComposite, getNode, getParentPlot, getPlots, getTopPlot, getVisualRange, intersects, intersects, isMultiplexible, isOnEDT, isSelected, isShowing, isTopPlot, isVisible, paintPlotEntry, plotRedraw, plotRedraw, plotUpdate, plotUpdate, plus, propertyChange, saveAsXML, setAntialiasing, setAreaFill, setAreaPaint, setEffect, setFillAlpha, setFillComposite, setParentPlot, setSelected, setSelectionFlag, setVisible, toString, toString
-
Methods inherited from class kcl.waterloo.graphics.plots2D.GJAbstractPlotModelImpl
getAlpha, getCompositeMode, getDataModel, getDynamicMarkerSize, getEdgeColor, getEdgeStroke, getFill, getLineColor, getLineStroke, getMarker, getMarkerArray, getMultiplexLength, getName, getParentGraph, getPlotList, getRenderHintState, getScreenDataArray, getScreenDataArrayAsCopy, getTextHintState, getVisualModel, getXData, getXDataValues, getXTransform, getYData, getYDataValues, getYTransform, isMultiplexed, setAlpha, setCompositeMode, setData, setDataModel, setDynamicMarkerSize, setEdgeColor, setEdgeColor, setEdgeColor, setEdgeColor, setEdgeColor, setEdgeStroke, setEdgeStroke, setEdgeStroke, setEdgeStroke, setEdgeStroke, setExtraData0, setExtraData1, setExtraData2, setExtraData3, setFill, setFill, setFill, setFill, setFill, setLineColor, setLineColor, setLineColor, setLineColor, setLineStroke, setLineStroke, setLineStroke, setLineStroke, setLineStroke, setMarker, setMarker, setMarkerArray, setMarkerArray, setMarkerArray, setName, setName, setParentGraph, setPlotList, setRenderHintState, setScreenDataArray, setTextHintState, setVisualModel, setXData, setXData, setXData, setXData, setXData, setYData, setYData, setYData, setYData, setYData
-
Methods inherited from class kcl.waterloo.observable.GJAbstractObservable
addLink, addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getLinks, getPCS, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, hasSelfListener, removeLink, removePropertyChangeListener, removePropertyChangeListener, setLinks
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface kcl.waterloo.observable.GJObservableInterface
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, hasSelfListener, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from interface kcl.waterloo.observable.GJLinkableInterface
addLink, getLinks, removeLink, setLinks
-
-
-
-
Constructor Detail
-
GJBar
public GJBar()
-
GJBar
public GJBar(GJAbstractPlot p)
-
-
Method Detail
-
createInstance
public static GJPlotInterface createInstance()
Factory method for creating a bar chart.- Returns:
- the GJBar instance
-
paintPlot
public final void paintPlot(java.awt.Graphics2D g2)
Description copied from class:GJAbstractPlotNote that this method is overloaded by all concrete sub-classes which should call this super-class method.- Specified by:
paintPlotin interfaceGJPlotInterface- Overrides:
paintPlotin classGJAbstractPlot
-
getDataRange
public final java.awt.geom.Rectangle2D getDataRange()
This overrides the super class method providing support for horizontal bars too by swapping the x- and y- data. The behaviour of other methods that call getDataRange will change as a consequence.- Specified by:
getDataRangein interfaceGJDataModelInterface<java.awt.geom.Rectangle2D,GJGraphInterface>- Overrides:
getDataRangein classGJAbstractPlot- Returns:
-
-
DMelt 3.0 © DataMelt by jWork.ORG