kcl.waterloo.graphics.plots2D
Interface GJPlotInterface
-
- All Superinterfaces:
- java.util.EventListener, GJDataModelInterface<java.awt.geom.Rectangle2D,GJGraphInterface>, GJLinkableInterface, GJObservableInterface, GJScreenDataInterface<java.awt.Shape>, GJVisualsInterface<GJMarker,java.awt.Paint,java.awt.BasicStroke,java.awt.Dimension,java.awt.Shape>, java.beans.PropertyChangeListener
- All Known Implementing Classes:
- GJAbstractPlot, GJAbstractPlotModelImpl, GJAbstractPolarPlot, GJBar, GJBox, GJCloud, GJComponentPlot, GJContour, GJErrorBar, GJFastLine, GJFeather, GJLine, GJPathPlot, GJPie, GJPolarBar, GJPolarLine, GJPolarScatter, GJPolarStem, GJQuiver, GJScatter, GJStairs, GJStem
public interface GJPlotInterface extends GJVisualsInterface<GJMarker,java.awt.Paint,java.awt.BasicStroke,java.awt.Dimension,java.awt.Shape>, GJDataModelInterface<java.awt.geom.Rectangle2D,GJGraphInterface>, GJObservableInterface, GJLinkableInterface, GJScreenDataInterface<java.awt.Shape>
GJPlotInterface defines methods that must be implemented by all plots. All but one of these have concrete implementations inGJAbstractPlotand will therefore not generally need to be implemented by user-created plots. ApaintPlotmethod will need to be implemented for individualGJAbstractPlotsubclasses.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description GJPlotInterfaceadd(GJPlotInterface plot)Adds a plot as a child plot of this plot.javax.swing.JFramecreateFrame()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 beneathjava.awt.Pointin the coordinate space of the parent plot.java.util.ArrayList<GJPlotInterface>getNode()Returns an ArrayList of plots that are descendant plots of this plot.GJGraphInterfacegetParentGraph()GJPlotInterfacegetParentPlot()Returns a reference to parent plot.java.util.ArrayList<GJPlotInterface>getPlotList()java.util.ArrayList<GJPlotInterface>getPlots()Returns an ArrayList of plots that are child plots of this plot.GJPlotInterfacegetTopPlot()Returns the ancestor plot that is the TopPlot in this plot's hierarchy.GJVisualModelgetVisualModel()Returns theGJAbstractVisualModelfor the plot.booleanintersects(double x, double y)Determines whether the specified point intersects the data in the ScreenDataArray.booleanintersects(java.awt.geom.Point2D p)Determines whether the specified point intersects the data in the ScreenDataArray.booleanisSelected()Returns true if this plot is presently selectedbooleanisTopPlot()Returns true if this plot is a "TopPlot"booleanisVisible()Returns true if painting of this plot is enabledvoidpaintPlot(java.awt.Graphics2D g2)Method to paint the graphics within the clip limits of the parent graph.voidpaintPlotEntry(java.awt.Graphics2D g2)Method called by the graph paint methods to coordinate the painting of individual plot hierarchies.GJPlotInterfaceplus(GJPlotInterface plot)Simply callsadd.voidsaveAsXML(java.lang.String s)voidsetAntialiasing(boolean flag)voidsetParentGraph(GJGraphInterface gr)Sets the parent graph for this plot.voidsetParentPlot(GJPlotInterface p)Sets the parent plot for this plot.voidsetPlotList(java.util.ArrayList<GJPlotInterface> list)voidsetSelected(boolean flag)Sets or clears the selected flag for this plot, together with its ancestors and descendant plotsvoidsetSelectionFlag(boolean flag)Sets or clears the selected flag for this plot, together with its descendant plots but not ancestorsvoidsetVisible(boolean flag)Enables/disables painting of this plot.voidsetVisualModel(GJVisualModel m)Sets theGJAbstractVisualModelfor the plot.-
Methods inherited from interface kcl.waterloo.plotmodel2D.GJVisualsInterface
getAlpha, getCompositeMode, getDynamicMarkerSize, getEdgeColor, getEdgeStroke, getFill, getLineColor, getLineStroke, getMarker, getMarkerArray, getRenderHintState, getTextHintState, setAlpha, setCompositeMode, setDynamicMarkerSize, setEdgeColor, setEdgeColor, setEdgeColor, setEdgeColor, setEdgeColor, setEdgeStroke, setEdgeStroke, setEdgeStroke, setEdgeStroke, setEdgeStroke, setFill, setFill, setFill, setFill, setFill, setLineColor, setLineColor, setLineColor, setLineColor, setLineStroke, setLineStroke, setLineStroke, setLineStroke, setLineStroke, setMarker, setMarker, setMarkerArray, setMarkerArray, setMarkerArray, setRenderHintState, setTextHintState
-
Methods inherited from interface kcl.waterloo.plotmodel2D.GJDataModelInterface
getDataModel, getDataRange, getMultiplexLength, getName, getVisualRange, getXData, getXDataValues, getXTransform, getYData, getYDataValues, getYTransform, isMultiplexed, isMultiplexible, setAlpha, setData, setDataModel, setExtraData0, setExtraData1, setExtraData2, setExtraData3, setName, setXData, setXData, setXData, setXData, setXData, setYData, setYData, setYData, setYData, setYData
-
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
-
Methods inherited from interface kcl.waterloo.plotmodel2D.GJScreenDataInterface
getScreenDataArray, getScreenDataArrayAsCopy, setScreenDataArray
-
-
-
-
Method Detail
-
setParentGraph
void setParentGraph(GJGraphInterface gr)
Sets the parent graph for this plot. A plot can exist in only one graph at any time.- Parameters:
gr-
-
getParentGraph
GJGraphInterface getParentGraph()
- Returns:
- the parent graph
-
getVisualModel
GJVisualModel getVisualModel()
Returns theGJAbstractVisualModelfor the plot.- Returns:
- the GJVisualModel
-
setVisualModel
void setVisualModel(GJVisualModel m)
Sets theGJAbstractVisualModelfor the plot.- Parameters:
m- theGJAbstractVisualModel
-
getParentPlot
GJPlotInterface getParentPlot()
Returns a reference to parent plot. If this plot is a "TopPlot", it has no plot ancestor and returns null.- Returns:
- the parent GJPlotInterface if one exists
-
setParentPlot
void setParentPlot(GJPlotInterface p)
Sets the parent plot for this plot. This will be called from other methods when required and should not normally need to be called from user-code.- Parameters:
p- the parent plot
-
add
GJPlotInterface add(GJPlotInterface plot)
Adds a plot as a child plot of this plot.- Parameters:
plot-- Returns:
- this GJPlotInterface instance after the addition.
-
plus
GJPlotInterface plus(GJPlotInterface plot)
Simply callsadd. Provided for use in systems that allow addition via a "+" operator.- Parameters:
plot-- Returns:
- this instance after addition of plot
-
getTopPlot
GJPlotInterface getTopPlot()
Returns the ancestor plot that is the TopPlot in this plot's hierarchy.- Returns:
- the GJPlotInterface
-
isTopPlot
boolean isTopPlot()
Returns true if this plot is a "TopPlot"- Returns:
- the flag
-
getPlots
java.util.ArrayList<GJPlotInterface> getPlots()
Returns an ArrayList of plots that are child plots of this plot.- Returns:
- an ArrayList
-
getNode
java.util.ArrayList<GJPlotInterface> getNode()
Returns an ArrayList of plots that are descendant plots of this plot.- Returns:
- a ArrayList
-
findPlotBelow
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.- Parameters:
x-y-- Returns:
- an ArrayList
-
findPlotBelow
java.util.ArrayList<GJPlotInterface> findPlotBelow(java.awt.geom.Point2D p)
Returns an ArrayList of plots located beneathjava.awt.Pointin the coordinate space of the parent plot.- Parameters:
p-- Returns:
- an ArrayList
-
paintPlot
void paintPlot(java.awt.Graphics2D g2)
Method to paint the graphics within the clip limits of the parent graph.- Parameters:
g2-
-
paintPlotEntry
void paintPlotEntry(java.awt.Graphics2D g2)
Method called by the graph paint methods to coordinate the painting of individual plot hierarchies.- Parameters:
g2- Graphics2D instance from the graph paint methods.
-
intersects
boolean intersects(java.awt.geom.Point2D p)
Determines whether the specified point intersects the data in the ScreenDataArray. Note: this method calls the Path2D intersect method on the elements of the ScreenDataArray.- Parameters:
p- the Point- Returns:
- true if the Point intesects the ScreenDataArray.
-
intersects
boolean intersects(double x, double y)Determines whether the specified point intersects the data in the ScreenDataArray. Note: this method calls the Path2D intersect method on the elements of the ScreenDataArray.- Parameters:
x- the x locationy- the y location- Returns:
- true if the Point intesects the ScreenDataArray.
-
isVisible
boolean isVisible()
Returns true if painting of this plot is enabled- Returns:
- the flag
-
setVisible
void setVisible(boolean flag)
Enables/disables painting of this plot. This can be useful when updating the data model for the plot if the there is a risk that the transient state of the plot will cause the paintPlot method to throw exceptions. When visible is set false, the paintPlot method will not be called. You can therefore avoid the need for conditional statements in the the paintPlot method that might slow down rendering when it is being called frequently.- Parameters:
flag- true so enable painting
-
isSelected
boolean isSelected()
Returns true if this plot is presently selected- Returns:
- the selection state
-
setSelected
void setSelected(boolean flag)
Sets or clears the selected flag for this plot, together with its ancestors and descendant plots- Parameters:
flag-
-
setSelectionFlag
void setSelectionFlag(boolean flag)
Sets or clears the selected flag for this plot, together with its descendant plots but not ancestors- Parameters:
flag-
-
saveAsXML
void saveAsXML(java.lang.String s)
-
setAntialiasing
void setAntialiasing(boolean flag)
-
createFrame
javax.swing.JFrame createFrame()
-
getPlotList
java.util.ArrayList<GJPlotInterface> getPlotList()
-
setPlotList
void setPlotList(java.util.ArrayList<GJPlotInterface> list)
-
-
DMelt 3.0 © DataMelt by jWork.ORG