public interface GJGraphInterface extends GJLayerInterface<GJGraphInterface>, GJAxisSupportInterface, GJObservableInterface, GJLinkableInterface
Modifier and Type | Method and Description |
---|---|
java.awt.Component |
add(java.awt.Component c,
double x,
double y)
Add a component at the specified axis location
|
java.awt.Component |
add(java.awt.Component c,
double x,
double y,
int alignX,
int alignY)
Add a component at the specified axis location with the specified
alignment
|
void |
add(GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font> a)
Adds an annotation to the container for the graph.
|
GJPlotInterface |
add(GJPlotInterface plot)
Adds a plot to the graph.
|
GJPlotInterface |
add(GJPlotInterface plot,
boolean flag)
Adds a plot to a graph
|
void |
addListeners()
Adds listeners or registers the mouse handle to be returned by
getMouseHandler . |
void |
autoScale()
Auto-scales the graph's axes
|
java.awt.geom.Rectangle2D |
convertPixelsToPosition(java.awt.geom.Rectangle2D r)
Returns a rectangle defined in axes units from a rectangle defined in
pixels.
|
void |
createAxes()
Creates the objects for drawing axes for this graph.
|
GJEditorInterface |
fetchEditor()
Returns the editor.
|
GJAbstractGraphContainer |
getGraphContainer()
Returns the container for this graph.
|
java.awt.event.MouseAdapter |
getMouseHandler()
Returns a MouseAdapter for this component.
|
javax.swing.JLabel |
getMousePositionTextField()
Returns a reference to a JLabel that will be updated with the mouse
position (unless null).
|
double |
getPixelHeight()
Returns the height of a pixel in graph coordinates.
|
double |
getPixelWidth()
Returns the width of a pixel in graph coordinates.
|
java.util.ArrayList<GJPlotInterface> |
getPlots()
Returns the list of top plots associated with this graph.
|
java.util.ArrayList<GJPlotInterface> |
getSelectedPlots()
Returns a list of plot that are currently selected (e.g.
|
GJDataTransformInterface |
getXTransform()
Get the transform for the x-data
|
GJDataTransformInterface |
getYTransform()
Get the transform for the y-data
|
boolean |
isPolar() |
boolean |
isTextAsInverse()
Returns true if the data shown in the
mousePositionTextField are
inverse transformed. |
void |
remove(GJPlotInterface plot)
Removes a plot from this graph's hierarchy.
|
void |
saveAsXML(java.lang.String s)
Convenience method to save a graph to a "kclf" file.
|
void |
setBackgroundPainted(boolean flag)
Determines whether the background is painted.
|
void |
setEditor(GJEditorInterface editor)
Sets the editor to be activated when this graph is double-clicked.
|
void |
setGraphContainer(GJAbstractGraphContainer c)
Sets the
GJAbstractGraphContainer for this graph. |
void |
setGraphContainer(GJAbstractGraphContainer c,
java.awt.Insets insets) |
void |
setKeyAntialiasing(java.lang.Object o)
Sets the anti-aliasing key for rendering this graph.
|
void |
setMousePositionTextField(javax.swing.JLabel t)
Sets a reference to a JLabel that will be updated with the mouse position
(unless null).
|
void |
setPlots(java.util.ArrayList<GJPlotInterface> list)
Replaces the internal plot list (or its contents) with the supplied
ArrayList (or its contents). |
void |
setSelectedPlots(java.util.ArrayList<GJPlotInterface> p)
Programmatically selects plots.
|
void |
setTextAntialiasing(java.lang.Object o)
Sets the text anti-aliasing key for rendering this graph.
|
void |
setTextAsInverse(boolean flag)
Sets the textAsInverse flag.
|
void |
setXTransform(GJDataTransformInterface tr)
Sets the transform for the x-data
|
void |
setYTransform(GJDataTransformInterface tr)
Sets the transform for the y-data
|
double |
xPixelToPosition(double pixel)
Convert a pixel location to a graph coordinate on the x-axis.
|
double[] |
xPixelToPosition(double[] pixel)
Convert an array of pixel locations to graph coordinates on the x-axis.
|
double[] |
xPixelToPositioni(double[] pixel)
Convert an array of pixel locations to graph coordinates on the x-axis.
|
double |
xPositionToPixel(double position)
Convert an axis location to a pixel value This method does not compensate
for rotation or zoom.
|
double[] |
xPositionToPixel(double[] positions)
Convert an array of axis locations to a pixel values.
|
double[] |
xPositionToPixeli(double[] positions)
Convert an array of axis locations to a pixel values.
|
double |
yPixelToPosition(double pixel)
Convert a pixel location to a graph coordinate on the y-axis.
|
double[] |
yPixelToPosition(double[] pixel)
Convert an array of pixel locations to graph coordinates on the y-axis.
|
double[] |
yPixelToPositioni(double[] pixel)
Convert an array of pixel locations to graph coordinates on the y-axis.
|
double |
yPositionToPixel(double position)
Convert an array of axis locations to a pixel values.
|
double[] |
yPositionToPixel(double[] positions)
Convert an array of axis locations to a pixel values.
|
double[] |
yPositionToPixeli(double[] positions)
Convert an array of axis locations to a pixel values.
|
add, getAncestorGraph, getCurrentLayer, getCurrentLayerIndex, getLayer, getLayers, indexOf, setCurrentLayer, setCurrentLayerIndex
format, formatXAxisLabel, formatYAxisLabel, getAxesBounds, getAxisColor, getAxisMouseHandler, getAxisStrokeWeight, getBottomAxisPanel, getCategoricalLabels, getLeftAxisPanel, getMajorGridColor, getMajorGridStrokeWeight, getMajorXHint, getMajorYHint, getMinorCountXHint, getMinorCountYHint, getMinorGridColor, getMinorGridStrokeWeight, getOrigin, getOriginX, getOriginY, getRightAxisPanel, getTopAxisPanel, getXAxisLabelRotation, getXLabel, getXLeft, getXMax, getXMin, getXRight, getYAxisLabelRotation, getYBottom, getYLabel, getYMax, getYMin, getYTop, isBottomAxisLabelled, isBottomAxisPainted, isCategorical, isInnerAxisLabelled, isInnerAxisPainted, isLeftAxisLabelled, isLeftAxisPainted, isMajorGridPainted, isMinorGridPainted, isRightAxisLabelled, isRightAxisPainted, isTopAxisLabelled, isTopAxisPainted, isXReversed, isYReversed, setAxesBounds, setAxisColor, setAxisStrokeWeight, setBottomAxisLabelled, setBottomAxisPainted, setInnerAxisLabelled, setInnerAxisPainted, setLeftAxisLabelled, setLeftAxisPainted, setMajorGridColor, setMajorGridPainted, setMajorGridStrokeWeight, setMajorXHint, setMajorXHint, setMajorYHint, setMajorYHint, setMinorCountXHint, setMinorCountYHint, setMinorGridColor, setMinorGridPainted, setMinorGridStrokeWeight, setOrigin, setOriginX, setOriginY, setReverseX, setReverseY, setRightAxisLabelled, setRightAxisPainted, setTopAxisLabelled, setTopAxisPainted, setXLabel, setXLeft, setXRight, setYBottom, setYLabel, setYTop
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, hasSelfListener, removePropertyChangeListener, removePropertyChangeListener
addLink, getLinks, removeLink, setLinks
void setGraphContainer(GJAbstractGraphContainer c)
GJAbstractGraphContainer
for this graph.c
- the Container to add this GJAbstractGraph toGJPlotInterface add(GJPlotInterface plot)
add(plot, true);
plot
- the plot to add to the graphGJPlotInterface add(GJPlotInterface plot, boolean flag)
plot
- the plot to addflag
- if true, the graph will be rescaled to accomodate the added
plot.void remove(GJPlotInterface plot)
plot
- the plot to remove.java.awt.Component add(java.awt.Component c, double x, double y)
c
- The component to addx
- The x-axis positiony
- The y-axis positionjava.awt.Component add(java.awt.Component c, double x, double y, int alignX, int alignY)
c
- The component to addx
- The x-axis positiony
- The y-axis positionalignX
- The X-alignment of the component on x,yalignY
- The Y-alignment of the component on x,yvoid add(GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font> a)
a
- the GJAnnotationInterface
to addvoid setGraphContainer(GJAbstractGraphContainer c, java.awt.Insets insets)
c
- the GJAbstractGraphContainer
to add this GJAbstractGraph
toinsets
- an Insets object specifying the marginsGJAbstractGraphContainer getGraphContainer()
void createAxes()
double xPixelToPosition(double pixel)
pixel
- location on xdouble[] xPixelToPosition(double[] pixel)
pixel
- location on xdouble[] xPixelToPositioni(double[] pixel)
pixel
- location on xdouble yPixelToPosition(double pixel)
pixel
- location on ydouble[] yPixelToPosition(double[] pixel)
pixel
- location on ydouble[] yPixelToPositioni(double[] pixel)
pixel
- location on ydouble getPixelWidth()
double getPixelHeight()
double xPositionToPixel(double position)
position
- on x-axisdouble[] xPositionToPixel(double[] positions)
positions
- on x-axisdouble[] xPositionToPixeli(double[] positions)
positions
- on x-axisdouble yPositionToPixel(double position)
position
- on y-axisdouble[] yPositionToPixel(double[] positions)
positions
- on y-axisdouble[] yPositionToPixeli(double[] positions)
positions
- on y-axisjava.awt.geom.Rectangle2D convertPixelsToPosition(java.awt.geom.Rectangle2D r)
r
- a Rectangle2D in pixelsGJDataTransformInterface getXTransform()
GJDataTransformInterface
void setXTransform(GJDataTransformInterface tr)
tr
- a GJDataTransformInterface
GJDataTransformInterface getYTransform()
GJDataTransformInterface
void setYTransform(GJDataTransformInterface tr)
tr
- a GJDataTransformInterface
java.util.ArrayList<GJPlotInterface> getPlots()
void setPlots(java.util.ArrayList<GJPlotInterface> list)
ArrayList
(or its contents). Copying the contents is recommended.
This method is called during de-serialization of xml files. It is public
for that reason only and is not intended for use elsewhere.list
- a ArrayList<GJPlotInterface>
java.util.ArrayList<GJPlotInterface> getSelectedPlots()
ArrayList<GJPlotInterface>
void setSelectedPlots(java.util.ArrayList<GJPlotInterface> p)
p
- a ArrayList<GJPlotInterface>
void setEditor(GJEditorInterface editor)
editor
- an object implementing the GJEditorInterface
.GJEditorInterface fetchEditor()
GJEditorInterface
.void saveAsXML(java.lang.String s)
s
- String description of the file.void setKeyAntialiasing(java.lang.Object o)
o
- a rendering key valuevoid setTextAntialiasing(java.lang.Object o)
o
- a rendering key valuejavax.swing.JLabel getMousePositionTextField()
void setMousePositionTextField(javax.swing.JLabel t)
t
- a JLabelboolean isPolar()
boolean isTextAsInverse()
mousePositionTextField
are
inverse transformed.void setTextAsInverse(boolean flag)
flag
- the textAsInverse to setvoid setBackgroundPainted(boolean flag)
flag
- boolean valuejava.awt.event.MouseAdapter getMouseHandler()
GJAddedComponentMouseHandler
to support rotated and zoomed graphs. Instead of adding mouse listeners
directly to graphs, they are located by reflection and the methods called
after on the target graph after accounting for any rotation/zoom of the
graphics output.void addListeners()
getMouseHandler
.void autoScale()