public abstract class GJAbstractPlot extends GJAbstractPlotModelImpl implements GJFillableInterface<java.awt.Shape,java.awt.Paint>, GJFastPlotInterface
Required methods are defined in the GJPlotInterface interface. Among these, subclasses must implement the following methods:
a public createInstance method that calls the constructor
paintPlot
In addition, if multiplexed plots are not supported <@code isMultiplexible> should be overridden to return <@code false>.
This code is part of the Waterloo Scientific Graphics package from King's
College London
screenDataArray| Modifier | Constructor and Description |
|---|---|
protected |
GJAbstractPlot()
Default protected constructor.
|
protected |
GJAbstractPlot(GJAbstractPlot p)
Creates a new plot from an existing plot.
|
| Modifier and Type | Method and Description |
|---|---|
GJPlotInterface |
add(GJPlotInterface plot)
Adds a plot as a child plot of this plot.
|
GCFrame |
createFrame() |
protected static GJPlotInterface |
createInstance(GJPlotInterface p)
Factory method for initializing a plot.
|
protected void |
drawEffect(java.awt.Graphics2D g) |
java.util.ArrayList<GJPlotInterface> |
findPlotBelow(double x,
double y)
Returns an ArrayList of plots located beneath [x,y] in the coordinate
space of the parent plot.
|
java.util.ArrayList<GJPlotInterface> |
findPlotBelow(java.awt.geom.Point2D p)
Returns an ArrayList of plots located beneath
java.awt.Point in
the coordinate space of the parent plot. |
GJFillableInterface<java.awt.Shape,java.awt.Paint> |
getAreaFill() |
java.awt.Paint |
getAreaPaint()
Returns the object used to paint the area e.g.
|
java.awt.geom.Rectangle2D |
getDataRange()
getDataRange returns the range on the X and Y axes that can potentially
be filled by the data points given the current contents of the XData and
YData properties.
|
org.jdesktop.swingx.painter.effects.AreaEffect |
getEffect() |
java.awt.Shape |
getFillable()
getFillable provides the Area instance to fill.
|
float |
getFillAlpha() |
java.awt.AlphaComposite |
getFillComposite() |
java.util.ArrayList<GJPlotInterface> |
getNode()
Returns an ArrayList of plots that are descendant plots of this plot.
|
GJPlotInterface |
getParentPlot()
Returns a reference to parent plot.
|
java.util.ArrayList<GJPlotInterface> |
getPlots()
Deprecated.
|
GJPlotInterface |
getTopPlot()
Returns the ancestor plot that is the TopPlot in this plot's hierarchy.
|
java.awt.geom.Rectangle2D |
getVisualRange() |
boolean |
intersects(double x,
double y)
Determines whether the specified point intersects the data in the
ScreenDataArray.
|
boolean |
intersects(java.awt.geom.Point2D p)
Determines whether the specified point intersects the data in the
ScreenDataArray.
|
boolean |
isMultiplexible() |
boolean |
isOnEDT() |
boolean |
isSelected()
Returns true if this plot is presently selected
|
boolean |
isShowing()
Returns true if this plot is visible and in a host container that returns
isVisible==true.
|
boolean |
isTopPlot()
Returns true if this is a top plot, i.e.
|
boolean |
isVisible()
Returns true if painting of this plot is enabled
|
void |
paintPlot(java.awt.Graphics2D g2)
Note that this method is overloaded by all concrete sub-classes which
should call this super-class method.
|
void |
paintPlotEntry(java.awt.Graphics2D g2)
Entry point for plotting called from the graph methods.
|
void |
plotRedraw()
plotRedraw repaints this plot without re-painting the container hierarchy
and, therefore, without erasing the previous copy of the plot on screen.
|
void |
plotRedraw(java.awt.Graphics2D g)
Performs a plot redraw using the supplied Graphics instance
|
boolean |
plotUpdate()
In this abstract class implementations, plotUpdate will generally just
call plotRedraw.
|
boolean |
plotUpdate(java.awt.Graphics2D g)
Performs a plot append using the supplied Graphics instance
|
GJPlotInterface |
plus(GJPlotInterface p2)
Simply calls
add. |
protected static void |
printData(java.util.Formatter f,
double[] in) |
void |
propertyChange(java.beans.PropertyChangeEvent pce) |
void |
saveAsXML(java.lang.String fileName) |
void |
setAntialiasing(boolean flag) |
void |
setAreaFill(GJFillableInterface<java.awt.Shape,java.awt.Paint> areaFill) |
void |
setAreaPaint(java.awt.Paint p)
Sets the object used to paint the area e.g.
|
void |
setEffect(org.jdesktop.swingx.painter.effects.AreaEffect effect) |
void |
setFillAlpha(float alpha) |
void |
setFillComposite(java.awt.AlphaComposite composite) |
void |
setParentPlot(GJPlotInterface p)
Sets the parent plot for this plot.
|
void |
setSelected(boolean flag)
Sets or clears the selected flag for this plot, together with its
ancestors and descendant plots
|
void |
setSelectionFlag(boolean flag)
Sets or clears the selected flag for this plot, together with its
descendant plots but not ancestors
|
void |
setVisible(boolean flag)
Enables/disables painting of this plot.
|
protected java.lang.String |
stringSupplement()
Adds a supplement to the
fromString returned by the toString()
method. |
java.lang.String |
toString() |
java.lang.String |
toString(boolean flag) |
protected java.lang.String |
toString(boolean flag,
java.lang.String tab) |
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, initNewInstance, 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, setYDataaddLink, addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getLinks, getPCS, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, hasSelfListener, removeLink, removePropertyChangeListener, removePropertyChangeListener, setLinksclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, hasSelfListener, removePropertyChangeListener, removePropertyChangeListeneraddLink, getLinks, removeLink, setLinksprotected GJAbstractPlot()
protected GJAbstractPlot(GJAbstractPlot p)
p - protected static GJPlotInterface createInstance(GJPlotInterface p)
createInstance method in the specific plot class passing in an
instance of the plot created using its private constructor i.e. call
super.createInstance from the createInstance method of
each concrete subclass. Example:
class myPlot extends GJAbstractPlot {
public GJPlotInterface
createInstance(){
return super.createInstance(new myPlot());
}
....
}
}
p - public boolean isMultiplexible()
isMultiplexible in interface GJDataModelInterface<java.awt.geom.Rectangle2D,GJGraphInterface>public final boolean isTopPlot()
isTopPlot in interface GJPlotInterfacepublic final void setVisible(boolean flag)
GJPlotInterfacesetVisible in interface GJPlotInterfaceflag - true so enable paintingpublic final boolean isVisible()
GJPlotInterfaceisVisible in interface GJPlotInterfacepublic final boolean isShowing()
public final void setSelected(boolean flag)
GJPlotInterfacesetSelected in interface GJPlotInterfacepublic final void setSelectionFlag(boolean flag)
GJPlotInterfacesetSelectionFlag in interface GJPlotInterfacepublic final boolean isSelected()
GJPlotInterfaceisSelected in interface GJPlotInterfacepublic final GJPlotInterface plus(GJPlotInterface p2)
GJPlotInterfaceadd. Provided for use in systems that allow addition
via a "+" operator.plus in interface GJPlotInterfacepublic final GJPlotInterface add(GJPlotInterface plot)
GJPlotInterfaceadd in interface GJPlotInterfacepublic final GJPlotInterface getParentPlot()
GJPlotInterfacegetParentPlot in interface GJPlotInterfacepublic final void setParentPlot(GJPlotInterface p)
GJPlotInterfacesetParentPlot in interface GJPlotInterfacep - the parent plotpublic final boolean intersects(java.awt.geom.Point2D p)
GJPlotInterfaceintersects in interface GJPlotInterfacep - the Pointpublic final boolean intersects(double x,
double y)
GJPlotInterfaceintersects in interface GJPlotInterfacex - the x locationy - the y locationpublic final java.util.ArrayList<GJPlotInterface> findPlotBelow(java.awt.geom.Point2D p)
GJPlotInterfacejava.awt.Point in
the coordinate space of the parent plot.findPlotBelow in interface GJPlotInterfacepublic final java.util.ArrayList<GJPlotInterface> findPlotBelow(double x, double y)
GJPlotInterfacefindPlotBelow in interface GJPlotInterface@Deprecated public final java.util.ArrayList<GJPlotInterface> getPlots()
GJPlotInterfacegetPlots in interface GJPlotInterfacepublic final java.util.ArrayList<GJPlotInterface> getNode()
GJPlotInterfacegetNode in interface GJPlotInterfacepublic java.awt.geom.Rectangle2D getDataRange()
getDataRange in interface GJDataModelInterface<java.awt.geom.Rectangle2D,GJGraphInterface>public GJPlotInterface getTopPlot()
GJPlotInterfacegetTopPlot in interface GJPlotInterfacepublic final java.awt.geom.Rectangle2D getVisualRange()
getVisualRange in interface GJDataModelInterface<java.awt.geom.Rectangle2D,GJGraphInterface>public final void paintPlotEntry(java.awt.Graphics2D g2)
paintPlotEntry in interface GJPlotInterfaceg2 - public void paintPlot(java.awt.Graphics2D g2)
paintPlot in interface GJPlotInterfaceg2 - public void plotRedraw()
GJFastPlotInterfaceplotRedraw in interface GJFastPlotInterfacepublic void plotRedraw(java.awt.Graphics2D g)
GJFastPlotInterfaceplotRedraw in interface GJFastPlotInterfacepublic boolean plotUpdate()
GJFastPlotInterfaceplotUpdate in interface GJFastPlotInterfacepublic boolean plotUpdate(java.awt.Graphics2D g)
GJFastPlotInterfaceplotUpdate in interface GJFastPlotInterfacepublic java.awt.Shape getFillable()
getFillable in interface GJFillableInterface<java.awt.Shape,java.awt.Paint>public final void setAntialiasing(boolean flag)
setAntialiasing in interface GJPlotInterfacepublic void saveAsXML(java.lang.String fileName)
saveAsXML in interface GJPlotInterfacepublic GCFrame createFrame()
createFrame in interface GJPlotInterfacepublic boolean isOnEDT()
public void propertyChange(java.beans.PropertyChangeEvent pce)
propertyChange in interface java.beans.PropertyChangeListenerpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(boolean flag)
protected java.lang.String toString(boolean flag,
java.lang.String tab)
protected java.lang.String stringSupplement()
fromString returned by the toString()
method. Subclasses can override this method to add information to the end
of the toString() output.fromStringprotected static void printData(java.util.Formatter f,
double[] in)
public void setEffect(org.jdesktop.swingx.painter.effects.AreaEffect effect)
setEffect in interface GJEffectorInterfacepublic org.jdesktop.swingx.painter.effects.AreaEffect getEffect()
getEffect in interface GJEffectorInterfaceprotected final void drawEffect(java.awt.Graphics2D g)
public GJFillableInterface<java.awt.Shape,java.awt.Paint> getAreaFill()
public void setAreaFill(GJFillableInterface<java.awt.Shape,java.awt.Paint> areaFill)
areaFill - the areaFill to setpublic java.awt.Paint getAreaPaint()
GJFillableInterfacegetAreaPaint in interface GJFillableInterface<java.awt.Shape,java.awt.Paint>public void setAreaPaint(java.awt.Paint p)
GJFillableInterfacesetAreaPaint in interface GJFillableInterface<java.awt.Shape,java.awt.Paint>public java.awt.AlphaComposite getFillComposite()
getFillComposite in interface GJFillableInterface<java.awt.Shape,java.awt.Paint>public void setFillComposite(java.awt.AlphaComposite composite)
setFillComposite in interface GJFillableInterface<java.awt.Shape,java.awt.Paint>composite - the composite to setpublic float getFillAlpha()
getFillAlpha in interface GJFillableInterface<java.awt.Shape,java.awt.Paint>public void setFillAlpha(float alpha)
setFillAlpha in interface GJFillableInterface<java.awt.Shape,java.awt.Paint>