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, setYData
addLink, addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getLinks, getPCS, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, hasSelfListener, removeLink, removePropertyChangeListener, removePropertyChangeListener, setLinks
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, hasSelfListener, removePropertyChangeListener, removePropertyChangeListener
addLink, getLinks, removeLink, setLinks
protected 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 GJPlotInterface
public final void setVisible(boolean flag)
GJPlotInterface
setVisible
in interface GJPlotInterface
flag
- true so enable paintingpublic final boolean isVisible()
GJPlotInterface
isVisible
in interface GJPlotInterface
public final boolean isShowing()
public final void setSelected(boolean flag)
GJPlotInterface
setSelected
in interface GJPlotInterface
public final void setSelectionFlag(boolean flag)
GJPlotInterface
setSelectionFlag
in interface GJPlotInterface
public final boolean isSelected()
GJPlotInterface
isSelected
in interface GJPlotInterface
public final GJPlotInterface plus(GJPlotInterface p2)
GJPlotInterface
add
. Provided for use in systems that allow addition
via a "+" operator.plus
in interface GJPlotInterface
public final GJPlotInterface add(GJPlotInterface plot)
GJPlotInterface
add
in interface GJPlotInterface
public final GJPlotInterface getParentPlot()
GJPlotInterface
getParentPlot
in interface GJPlotInterface
public final void setParentPlot(GJPlotInterface p)
GJPlotInterface
setParentPlot
in interface GJPlotInterface
p
- the parent plotpublic final boolean intersects(java.awt.geom.Point2D p)
GJPlotInterface
intersects
in interface GJPlotInterface
p
- the Pointpublic final boolean intersects(double x, double y)
GJPlotInterface
intersects
in interface GJPlotInterface
x
- the x locationy
- the y locationpublic final java.util.ArrayList<GJPlotInterface> findPlotBelow(java.awt.geom.Point2D p)
GJPlotInterface
java.awt.Point
in
the coordinate space of the parent plot.findPlotBelow
in interface GJPlotInterface
public final java.util.ArrayList<GJPlotInterface> findPlotBelow(double x, double y)
GJPlotInterface
findPlotBelow
in interface GJPlotInterface
@Deprecated public final java.util.ArrayList<GJPlotInterface> getPlots()
GJPlotInterface
getPlots
in interface GJPlotInterface
public final java.util.ArrayList<GJPlotInterface> getNode()
GJPlotInterface
getNode
in interface GJPlotInterface
public java.awt.geom.Rectangle2D getDataRange()
getDataRange
in interface GJDataModelInterface<java.awt.geom.Rectangle2D,GJGraphInterface>
public GJPlotInterface getTopPlot()
GJPlotInterface
getTopPlot
in interface GJPlotInterface
public 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 GJPlotInterface
g2
- public void paintPlot(java.awt.Graphics2D g2)
paintPlot
in interface GJPlotInterface
g2
- public void plotRedraw()
GJFastPlotInterface
plotRedraw
in interface GJFastPlotInterface
public void plotRedraw(java.awt.Graphics2D g)
GJFastPlotInterface
plotRedraw
in interface GJFastPlotInterface
public boolean plotUpdate()
GJFastPlotInterface
plotUpdate
in interface GJFastPlotInterface
public boolean plotUpdate(java.awt.Graphics2D g)
GJFastPlotInterface
plotUpdate
in interface GJFastPlotInterface
public java.awt.Shape getFillable()
getFillable
in interface GJFillableInterface<java.awt.Shape,java.awt.Paint>
public final void setAntialiasing(boolean flag)
setAntialiasing
in interface GJPlotInterface
public void saveAsXML(java.lang.String fileName)
saveAsXML
in interface GJPlotInterface
public GCFrame createFrame()
createFrame
in interface GJPlotInterface
public boolean isOnEDT()
public void propertyChange(java.beans.PropertyChangeEvent pce)
propertyChange
in interface java.beans.PropertyChangeListener
public java.lang.String toString()
toString
in class java.lang.Object
public 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.fromString
protected static void printData(java.util.Formatter f, double[] in)
public void setEffect(org.jdesktop.swingx.painter.effects.AreaEffect effect)
setEffect
in interface GJEffectorInterface
public org.jdesktop.swingx.painter.effects.AreaEffect getEffect()
getEffect
in interface GJEffectorInterface
protected 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()
GJFillableInterface
getAreaPaint
in interface GJFillableInterface<java.awt.Shape,java.awt.Paint>
public void setAreaPaint(java.awt.Paint p)
GJFillableInterface
setAreaPaint
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>