public abstract class GJAbstractGraph extends GJAbstractGraph1
GJGraphInterface
. At present, the
only concrete implementation is through the GJGraph
class.
While GJGraph
instances can be independent of their containers, they
will normally be added to a GJAbstractGraphContainer
instance.
GJAbstractGraph. Developed from the JXGraph class from the SwingLabs SwingX Project.
JXGraph was originally written by Romain Guy to display functions. See Filthy Rich Clients , C. Haase & R. Guy - Addison Wesley (2008).
GJAbstractGraph and its subclasses were developed to display experimental data.
-----------------------------------------------------------------------------
$Id: JXGraph.java 3671 2010-04-23 20:57:49Z kschaefe $
Copyright 2006 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser Lesser General Public License for more details.
You should have received a copy of the GNU Lesser Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-----------------------------------------------------------------------------
This version is part of the Waterloo Scientific Graphics package from King's
College London
The Waterloo Scientific Graphics library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser Lesser General Public License for more details.
You should have received a copy of the GNU Lesser Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Modifier and Type | Class and Description |
---|---|
static class |
GJAbstractGraph.GraphCycler
Handles keyboard input when the graph has focus.
|
GJBasicPanel.LocalTransferable
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Modifier and Type | Method and Description |
---|---|
java.awt.Component |
add(java.awt.Component c)
Overridden
add method. |
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
|
GJAbstractGraph |
add(GJAbstractGraph gr) |
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.
|
GJGraphInterface |
add(GJGraphInterface graph)
Adds a graph as a child of this graph.
|
GJPlotInterface |
add(GJPlotInterface plot)
Adds a plot to the graph.
|
GJPlotInterface |
add(GJPlotInterface plot,
boolean flag)
Adds a plot to a graph
|
void |
addLink(java.lang.Object o)
Adds an Object to the Links map
|
void |
addListeners()
Adds listeners or registers the mouse handle to be returned by
getMouseHandler . |
void |
autoScale()
Auto-scales the graph's axes
|
void |
clearLinks() |
void |
clearSelectedRegions() |
void |
createAxes()
Creates the objects for drawing axes for this graph.
|
protected void |
drawPlot(java.awt.Graphics2D g2,
GJPlotInterface plot)
Draws a plot to the current canvas.
|
protected void |
drawPlots(java.awt.Graphics2D g2)
Draw all plots to the current canvas
|
GJEditorInterface |
fetchEditor()
Returns the editor.
|
void |
firePropertyChange(java.beans.PropertyChangeEvent pce) |
java.lang.String |
format(double number)
Returns a string for axis labels formatted by an internal formatter
|
java.util.ArrayList<GJPlotInterface> |
getAllPlots() |
GJAbstractGraph |
getAncestorGraph()
Returns the graph that forms the view in this graph's ancestry.
|
java.util.ArrayList<java.awt.geom.Rectangle2D> |
getAvailableROI() |
java.awt.geom.Rectangle2D |
getAxesBounds()
Returns the bounds of the axes (xLeft, yBottom, width, height)
|
double |
getAxesPadding() |
java.awt.Color |
getAxisColor()
Returns the axis painting color
|
java.awt.event.MouseAdapter |
getAxisMouseHandler()
Returns the mouse handler for this axis
|
float |
getAxisStrokeWeight()
Returns the stroke thickness for axes
|
GJAxisPanel |
getBottomAxisPanel()
Returns the panel for drawing the bottom axis.
|
java.util.ArrayList<Category> |
getCategoricalLabels(GJAxisPanel.Orientation o)
Returns the categorical data on the specified axis
|
javax.swing.JPopupMenu |
getContextMenu() |
GJGraphInterface |
getCurrentLayer()
Returns the currently selected layer
|
int |
getCurrentLayerIndex()
Returns the index of the current layer.
|
java.awt.geom.Point2D |
getCurrentMousePosition() |
java.awt.geom.Rectangle2D.Double |
getCurrentROI() |
java.awt.geom.Rectangle2D |
getDataRange()
Returns the data range for the x- and y-data of the plots for this graph.
|
java.awt.geom.Point2D |
getDragStart() |
GJAbstractGraphContainer |
getGraphContainer()
Returns the container for this graph.
|
GJGridInterface |
getGridInterface() |
java.awt.event.KeyListener |
getKeyListener() |
GJGraphInterface |
getLayer(int n)
Returns the layer at the specified index
|
java.util.ArrayList<GJGraphInterface> |
getLayers()
Returns a list of the layers for this graph.
|
GJAxisPanel |
getLeftAxisPanel()
Returns the panel for drawing the left axis.
|
java.util.ArrayList<java.lang.Object> |
getLinks()
Returns the list of linked Objects
|
java.text.NumberFormat |
getMainFormatter() |
java.awt.Color |
getMajorGridColor()
Returns the major grid painting color
|
float |
getMajorGridStrokeWeight()
Returns the stroke thickness for major grids
|
double |
getMajorXHint()
Returns the value for the hint
|
double |
getMajorYHint()
Returns the value for the hint
|
int |
getMinorCountXHint()
Returns a hint for the number of minor grids to paint per major grid
division for the x-axis.
|
int |
getMinorCountYHint()
Returns a hint for the number of minor grids to paint per major grid
division for the y-axis.
|
java.awt.Color |
getMinorGridColor()
Returns the minor grid painting color
|
float |
getMinorGridStrokeWeight()
Returns the stroke thickness for minor grids
|
java.awt.geom.Point2D |
getMouseDown() |
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).
|
java.lang.String |
getMousePositionTextFormat() |
java.awt.event.MouseWheelListener |
getMouseWheelHandler() |
java.util.ArrayList<GJPlotInterface> |
getPlotAt(double x,
double y)
Returns the plots below the screen pixel location specified.
|
java.util.ArrayList<GJPlotInterface> |
getPlots()
Returns the list of top plots associated with this graph.
|
GJAxisPanel |
getRightAxisPanel()
Returns the panel for drawing the right axis.
|
java.text.NumberFormat |
getSecondFormatter() |
java.util.ArrayList<GJPlotInterface> |
getSelectedPlots()
Returns a list of plot that are currently selected (e.g.
|
GJAxisPanel |
getTopAxisPanel()
Returns the panel for drawing the top axis.
|
java.lang.String |
getXLabel()
Returns the string for the x-axis label
|
java.lang.String |
getYLabel()
Returns the string for the y-axis label
|
boolean |
hasListeners(java.lang.String propertyName)
Returns true if this instance has installed listeners.
|
boolean |
hasSelfListener()
Returns true if the implementing instance is a listener.
|
int |
indexOf()
Returns the index of this graph as a layer in the view.
|
java.awt.geom.Point2D |
inverseTransform(int x,
int y)
Convenience caller to inverseTransformPoint(Point)
|
boolean |
isBottomAxisLabelled()
Returns true if the bottom axis is labelled
|
boolean |
isBottomAxisPainted() |
boolean |
isCategorical(GJAxisPanel.Orientation or)
Returns true if any plot contained in this graph has categorical labels
associated with its data for the specified axis.
|
protected boolean |
isCloseToZero(double number) |
boolean |
isDragX() |
boolean |
isDragY() |
boolean |
isInnerAxisLabelled()
Returns the flag for painting the inner axis labels
|
boolean |
isInnerAxisPainted()
Returns true if the inner axis is painted
|
boolean |
isLeftAxisLabelled()
Returns true if the left axis is labelled
|
boolean |
isLeftAxisPainted() |
boolean |
isMajorGridPainted()
Returns true if the major grid is painted
|
boolean |
isMinorGridPainted()
Returns true if the minor grid is painted
|
boolean |
isMouseTextAsInverse() |
boolean |
isPolar() |
boolean |
isRightAxisLabelled()
Returns true if the right axis is labelled
|
boolean |
isRightAxisPainted() |
boolean |
isTextAsInverse()
Returns true if the data shown in the
mousePositionTextField are
inverse transformed. |
boolean |
isTightAxes() |
boolean |
isTopAxisLabelled()
Returns true if the top axis is labelled
|
boolean |
isTopAxisPainted() |
boolean |
isXReversed()
Returns true if the x-axis and data are painted in reverse
|
boolean |
isYReversed()
Returns true if the y-axis and data are painted in reverse
|
void |
linkAxes(GJAbstractGraph gr)
Links both the x- and y-axes of this graph to the specified graph
|
void |
linkAxesXX(GJAbstractGraph gr)
Links the x-axis of this graph to that of the specified graph.
|
void |
linkAxesXY(GJAbstractGraph gr)
Links the x-axis of this graph to the y-axis of the specified graph.
|
void |
linkAxesYX(GJAbstractGraph gr)
Links the y-axis of this graph to the x-axis of the specified graph.
|
void |
linkAxesYY(GJAbstractGraph gr)
Links the y-axis of this graph to that of the specified graph.
|
void |
openLinks()
Makes any linked graphs referenced by this graph visible - housing them
in a standard Waterloo swing hierarchy if required.
|
GJGraphInterface |
plus(GJGraphInterface graph)
Adds the specified graph as a new layer.
|
GJPlotInterface |
plus(GJPlotInterface plot)
Adds the specified plot as a top plot
|
void |
propertyChange(java.beans.PropertyChangeEvent evt) |
void |
remove(java.awt.Component c) |
void |
remove(GJPlotInterface plot)
Removes a plot from this graph's hierarchy.
|
void |
removeAllPlots()
Removes all the plots currently associated with this layer.
|
void |
removeLink(java.lang.Object o)
Removes an Object from the Links map
|
void |
removeListeners() |
void |
removePlotAt(int n)
Removes the specified plot from this layer.
|
void |
resetView()
Resets the view to the default view if it has been changed by the user by
panning and zooming.
|
void |
saveAsXML(java.lang.String fileName)
Convenience method to save a graph to a "kclf" file.
|
void |
setAntialiasing(boolean flag) |
void |
setAvailableROI(java.util.ArrayList<java.awt.geom.Rectangle2D> availableROI) |
void |
setAxesBounds(double x,
double y,
double w,
double h) |
void |
setAxesBounds(java.awt.geom.Rectangle2D bounds)
Sets the bounds of the axes (xLeft, yBottom, width, height)
|
void |
setAxesBoundsAndOrigin(java.awt.geom.Rectangle2D bounds)
Sets the view and the origin of the graph at the same time.
|
void |
setAxesPadding(double axesPadding) |
void |
setAxisColor(java.awt.Color axisColor)
Sets the color for painting the axis
|
void |
setAxisStrokeWeight(float axisStrokeWeight)
Sets the width of lines for the axes
|
void |
setBackgroundPainted(boolean backPainted)
Enables or disables the painting of background depending on the value of
the parameter.
|
void |
setBottomAxisLabelled(boolean flag)
Sets the bottom axis is labelling flag
|
void |
setBottomAxisPainted(boolean flag)
Sets the flag for painting the bottom axis
|
void |
setBottomAxisPanel(GJAxisPanel axp) |
void |
setCurrentLayer(GJGraphInterface layer)
Sets the current layer for this graph.
|
void |
setCurrentLayerIndex(int n)
Sets the current layer by index.
|
void |
setCurrentROI(java.awt.geom.Rectangle2D.Double currentROI) |
void |
setDragStart(java.awt.geom.Point2D dragStart) |
void |
setDragX(boolean dragX) |
void |
setDragY(boolean dragY) |
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 |
setGridInterface(GJGridInterface gridInterface) |
void |
setInnerAxisLabelled(boolean textPainted)
Sets the flag for painting the inner axis labels
|
void |
setInnerAxisPainted(boolean flag)
Sets the flag for painting the inner axis
|
void |
setKeyAntialiasing(java.lang.Object o)
Sets the keyAntialiasing value
|
void |
setLeftAxisLabelled(boolean flag)
Sets the left axis is labelling flag
|
void |
setLeftAxisPainted(boolean flag)
Sets the flag for painting the left axis
|
void |
setLeftAxisPanel(GJAxisPanel axp) |
void |
setLinks(java.util.ArrayList<java.lang.Object> links)
Sets the list of linked objects
|
void |
setMainFormatter(java.text.NumberFormat mainFormatter) |
void |
setMajorGridColor(java.awt.Color majorGridColor)
Sets the color for painting the major grid
|
void |
setMajorGridPainted(boolean gridPainted)
Sets the flag for painting the major grid
|
void |
setMajorGridStrokeWeight(float majorGridStrokeWeight)
Sets the stroke thickness for major grids
|
void |
setMajorXHint()
Automatically sets the hint
|
void |
setMajorXHint(double majorX)
Sets the hint to the specified value
|
void |
setMajorYHint()
Automatically sets the hint
|
void |
setMajorYHint(double majorY)
Sets the hint to the specified value
|
void |
setMinorCountXHint(int minorCountX)
Provides a hint to how many minor grid lines should be painted.
|
void |
setMinorCountYHint(int minorCountY)
Provides a hint to how many minor grid lines should be painted.
|
void |
setMinorGridColor(java.awt.Color minorGridColor)
Sets the color for painting the minor grid
|
void |
setMinorGridPainted(boolean gridPainted)
Sets the flag for painting the minor grid
|
void |
setMinorGridStrokeWeight(float minorGridStrokeWeight)
Sets the stroke thickness for minor grids
|
void |
setMouseDown(java.awt.geom.Point2D mouseDown) |
void |
setMousePositionTextField(javax.swing.JLabel t)
Sets a reference to a JLabel that will be updated with the mouse position
(unless null).
|
void |
setMousePositionTextFormat(java.lang.String mousePositionTextFormat) |
void |
setMouseTextAsInverse(boolean mouseTextAsInverse) |
void |
setPlots(java.util.ArrayList<GJPlotInterface> list)
Replaces the internal plot list (or its contents) with the supplied
ArrayList (or its contents). |
void |
setPolar(boolean polar) |
void |
setReverseX(boolean flag)
Sets the axis reversal flag for the x-axis.
|
void |
setReverseY(boolean flag)
Sets the axis reversal flag for the x-axis.
|
void |
setRightAxisLabelled(boolean flag)
Sets the right axis is labelling flag
|
void |
setRightAxisPainted(boolean flag)
Sets the flag for painting the right axis
|
void |
setRightAxisPanel(GJAxisPanel axp) |
void |
setSecondFormatter(java.text.NumberFormat secondFormatter) |
void |
setSelectedPlots(java.util.ArrayList<GJPlotInterface> arr)
Programmatically selects plots.
|
void |
setTextAntialiasing(java.lang.Object o)
Sets the textAntialiasing value
|
void |
setTextAsInverse(boolean flag)
Sets the textAsInverse flag.
|
void |
setTightAxes(boolean tightAxes) |
void |
setTopAxisLabelled(boolean flag)
Sets the top axis is labelling flag
|
void |
setTopAxisPainted(boolean flag)
Sets the flag for painting the top axis
|
void |
setTopAxisPanel(GJAxisPanel axp) |
protected void |
setupGraphics(java.awt.Graphics2D g2)
This method is called by the component prior to any drawing operation to
configure the drawing surface.
|
void |
setXLabel(java.lang.String s)
Sets the string for the x-axis label
|
void |
setYLabel(java.lang.String s)
Sets the string for the x-axis label
|
void |
updatePlots() |
formatXAxisLabel, formatYAxisLabel, getXAxisLabelRotation, getXTransform, getYAxisLabelRotation, getYTransform, setXTransform, setYTransform, transformPixelToPosition, transformPixelToPosition, transformPositionToPixel, transformPositionToPixel
convertPixelsToPosition, getOrigin, getOriginX, getOriginY, getPixelHeight, getPixelWidth, getXLeft, getXMax, getXMin, getXRight, getYBottom, getYMax, getYMin, getYTop, setOrigin, setOriginX, setOriginY, setXLeft, setXRight, setYBottom, setYTop, xPixelToPosition, xPixelToPosition, xPixelToPositioni, xPositionToPixel, xPositionToPixel, xPositionToPixeli, yPixelToPosition, yPixelToPosition, yPixelToPositioni, yPositionToPixel, yPositionToPixel, yPositionToPixeli
componentAdded, componentHidden, componentMoved, componentRemoved, componentResized, componentShown, getAllComponents, getID, getImage, getTransferable, getTransferable, isBackgroundPainted, isOnEDT, paintComponent, print, print, setID
getAlpha, getBackgroundPainter, getEffectiveAlpha, getPainterChangeListener, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableHeightHint, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getScrollableWidthHint, isInheritAlpha, isPaintBorderInsets, isPaintingOrigin, paint, setAlpha, setBackgroundPainter, setInheritAlpha, setOpaque, setPaintBorderInsets, setScrollableHeightHint, setScrollableTracksViewportHeight, setScrollableTracksViewportWidth, setScrollableWidthHint
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
public final void createAxes()
GJGraphInterface
public final GJGraphInterface plus(GJGraphInterface graph)
graph
- the graph to addpublic final GJGraphInterface add(GJGraphInterface graph)
GJLayerInterface
public java.awt.Component add(java.awt.Component c)
add
method. Performs some class checking to ensure the
correct add
method gets called during XML deserialization.
Users calling this method need to add appropriate constraints to the
layout.add
in class java.awt.Container
c
- public GJAbstractGraph add(GJAbstractGraph gr)
public final void add(GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font> a)
GJGraphInterface
a
- the GJAnnotationInterface
to addpublic final GJPlotInterface plus(GJPlotInterface plot)
plot
- the plot to addpublic final GJPlotInterface add(GJPlotInterface plot)
GJGraphInterface
add(plot, true);
plot
- the plot to add to the graphpublic final GJPlotInterface add(GJPlotInterface plot, boolean flag)
GJGraphInterface
plot
- the plot to addflag
- if true, the graph will be rescaled to accomodate the added
plot.public void remove(GJPlotInterface plot)
GJGraphInterface
plot
- the plot to remove.public final java.util.ArrayList<GJPlotInterface> getPlotAt(double x, double y)
x
- the x-Positiony
- the y-Positionpublic final java.util.ArrayList<GJGraphInterface> getLayers()
GJLayerInterface
public final GJGraphInterface getLayer(int n)
GJLayerInterface
n
- the layer number - zero is this layerpublic final GJGraphInterface getCurrentLayer()
GJLayerInterface
public final void setCurrentLayer(GJGraphInterface layer)
GJLayerInterface
public final void setCurrentLayerIndex(int n)
GJLayerInterface
public final int getCurrentLayerIndex()
GJLayerInterface
public final int indexOf()
GJLayerInterface
public final GJAbstractGraph getAncestorGraph()
GJLayerInterface
public final java.awt.Component add(java.awt.Component c, double x, double y)
GJGraphInterface
c
- The component to addx
- The x-axis positiony
- The y-axis positionpublic final java.awt.Component add(java.awt.Component c, double x, double y, int alignX, int alignY)
GJGraphInterface
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,ypublic final void remove(java.awt.Component c)
remove
in class java.awt.Container
public final void setGraphContainer(GJAbstractGraphContainer c)
GJGraphInterface
GJAbstractGraphContainer
for this graph.c
- the Container to add this GJAbstractGraph topublic final void setGraphContainer(GJAbstractGraphContainer c, java.awt.Insets insets)
c
- the GJAbstractGraphContainer
to add this GJAbstractGraph
toinsets
- an Insets object specifying the marginspublic final GJAbstractGraphContainer getGraphContainer()
GJGraphInterface
public final boolean isInnerAxisPainted()
GJAxisSupportInterface
public final void setInnerAxisPainted(boolean flag)
GJAxisSupportInterface
flag
- the boolean valuepublic final boolean isInnerAxisLabelled()
GJAxisSupportInterface
public final void setInnerAxisLabelled(boolean textPainted)
GJAxisSupportInterface
textPainted
- the boolean valuepublic final boolean isMajorGridPainted()
GJAxisSupportInterface
public final void setMajorGridPainted(boolean gridPainted)
GJAxisSupportInterface
gridPainted
- the boolean valuepublic final boolean isMinorGridPainted()
GJAxisSupportInterface
public final void setMinorGridPainted(boolean gridPainted)
GJAxisSupportInterface
gridPainted
- the boolean valuepublic final boolean isLeftAxisPainted()
public final boolean isRightAxisPainted()
public final boolean isTopAxisPainted()
public final boolean isBottomAxisPainted()
public final boolean isLeftAxisLabelled()
GJAxisSupportInterface
public final void setLeftAxisLabelled(boolean flag)
GJAxisSupportInterface
flag
- the label flagpublic final boolean isRightAxisLabelled()
GJAxisSupportInterface
public final void setRightAxisLabelled(boolean flag)
GJAxisSupportInterface
flag
- the label flagpublic final boolean isTopAxisLabelled()
GJAxisSupportInterface
public final void setTopAxisLabelled(boolean flag)
GJAxisSupportInterface
flag
- the label flagpublic final boolean isBottomAxisLabelled()
GJAxisSupportInterface
public final void setBottomAxisLabelled(boolean flag)
GJAxisSupportInterface
flag
- the label flagpublic final GJAxisPanel getLeftAxisPanel()
GJAxisSupportInterface
public final void setLeftAxisPanel(GJAxisPanel axp)
public final GJAxisPanel getRightAxisPanel()
GJAxisSupportInterface
public final void setRightAxisPanel(GJAxisPanel axp)
public final GJAxisPanel getTopAxisPanel()
GJAxisSupportInterface
public final void setTopAxisPanel(GJAxisPanel axp)
public final GJAxisPanel getBottomAxisPanel()
GJAxisSupportInterface
public final void setBottomAxisPanel(GJAxisPanel axp)
public final void setBackgroundPainted(boolean backPainted)
GJBasicPanel
Enables or disables the painting of background depending on the value of the parameter. Background painting is enabled by default.
setBackgroundPainted
in interface GJGraphInterface
setBackgroundPainted
in class GJBasicPanel
backPainted
- if true, axis labels are paintedGJBasicPanel.isBackgroundPainted()
,
JComponent.setBackground(Color)
public final java.awt.Color getMajorGridColor()
GJAxisSupportInterface
public final void setMajorGridColor(java.awt.Color majorGridColor)
GJAxisSupportInterface
majorGridColor
- the colorpublic final java.awt.Color getMinorGridColor()
GJAxisSupportInterface
public final void setMinorGridColor(java.awt.Color minorGridColor)
GJAxisSupportInterface
minorGridColor
- the colorpublic final double getMajorXHint()
GJAxisSupportInterface
public final void setMajorXHint()
GJAxisSupportInterface
public final void setMajorXHint(double majorX)
GJAxisSupportInterface
majorX
- the valuepublic final void setMinorCountXHint(int minorCountX)
GJAxisSupportInterface
minorCountX
- number for the x-axispublic final double getMajorYHint()
GJAxisSupportInterface
public final void setMajorYHint()
GJAxisSupportInterface
public final void setMajorYHint(double majorY)
GJAxisSupportInterface
majorY
- the valuepublic final int getMinorCountXHint()
GJAxisSupportInterface
public final int getMinorCountYHint()
GJAxisSupportInterface
public final void setMinorCountYHint(int minorCountY)
GJAxisSupportInterface
minorCountY
- number for the y-axispublic final void setAxesBoundsAndOrigin(java.awt.geom.Rectangle2D bounds)
Sets the view and the origin of the graph at the same time. The view minimum boundaries are defined by the location of the rectangle passed as parameter. The width and height of the rectangle define the distance between the minimum and maximum boundaries:
The origin is located at the center of the view. Its coordinates are defined by calling bounds.getCenterX() and bounds.getCenterY().
bounds
- the rectangle defining the graph's view and its originpublic final void setAxesBounds(double x, double y, double w, double h)
public final void setAxesBounds(java.awt.geom.Rectangle2D bounds)
GJAxisSupportInterface
bounds
- a Rectangle2Dpublic final java.awt.geom.Rectangle2D getAxesBounds()
GJAxisSupportInterface
public final void resetView()
Resets the view to the default view if it has been changed by the user by
panning and zooming. The default view is defined by the view last
specified in a constructor call or a call to the methods
#setAxesBounds(Rectangle2D)
and
#setAxesBoundsAndOrigin(Rectangle2D)
.
public final void updatePlots()
public final java.awt.geom.Rectangle2D getDataRange()
public final java.awt.Color getAxisColor()
GJAxisSupportInterface
public final void setAxisColor(java.awt.Color axisColor)
GJAxisSupportInterface
axisColor
- the colorpublic final java.lang.String getXLabel()
GJAxisSupportInterface
public final void setXLabel(java.lang.String s)
GJAxisSupportInterface
s
- the Stringpublic final java.lang.String getYLabel()
GJAxisSupportInterface
public final void setYLabel(java.lang.String s)
GJAxisSupportInterface
s
- the Stringpublic final java.util.ArrayList<GJPlotInterface> getPlots()
GJGraphInterface
public final java.util.ArrayList<GJPlotInterface> getAllPlots()
public final void setPlots(java.util.ArrayList<GJPlotInterface> list)
GJGraphInterface
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>
public final void removePlotAt(int n)
Removes the specified plot from this layer.
n
- public final void removeAllPlots()
Removes all the plots currently associated with this layer.
public final void removeListeners()
public final void addListeners()
GJGraphInterface
getMouseHandler
.public final java.awt.geom.Point2D inverseTransform(int x, int y)
x
- Position in the graphy
- Position in the graphpublic final void autoScale()
GJGraphInterface
protected void drawPlots(java.awt.Graphics2D g2)
g2
- current Graphics2D objectprotected void drawPlot(java.awt.Graphics2D g2, GJPlotInterface plot)
g2
- Graphics2D objectplot
- a GJAbstractPlot subclasspublic final javax.swing.JLabel getMousePositionTextField()
GJGraphInterface
public final void setMousePositionTextField(javax.swing.JLabel t)
GJGraphInterface
t
- a JLabelpublic final void setKeyAntialiasing(java.lang.Object o)
o
- public final void setAntialiasing(boolean flag)
public final void setTextAntialiasing(java.lang.Object o)
o
- protected void setupGraphics(java.awt.Graphics2D g2)
This method is called by the component prior to any drawing operation to configure the drawing surface. The default implementation enables antialiasing on the graphics.
This method can be overriden by subclasses to modify the drawing surface before any painting happens.
g2
- the graphics surface to set uppublic final void setReverseX(boolean flag)
GJAxisSupportInterface
public final boolean isXReversed()
GJAxisSupportInterface
public final void setReverseY(boolean flag)
GJAxisSupportInterface
public final boolean isYReversed()
GJAxisSupportInterface
public final java.lang.String format(double number)
GJAxisSupportInterface
number
- the value to formatpublic boolean isCategorical(GJAxisPanel.Orientation or)
or
- public java.util.ArrayList<Category> getCategoricalLabels(GJAxisPanel.Orientation o)
GJAxisSupportInterface
o
- a GJAxisPanel.Orientation valueprotected boolean isCloseToZero(double number)
public final void setLeftAxisPainted(boolean flag)
GJAxisSupportInterface
flag
- the setting to usepublic final void setRightAxisPainted(boolean flag)
GJAxisSupportInterface
flag
- the setting to usepublic final void setBottomAxisPainted(boolean flag)
GJAxisSupportInterface
flag
- the setting to usepublic final void setTopAxisPainted(boolean flag)
GJAxisSupportInterface
flag
- the setting to usepublic final java.util.ArrayList<GJPlotInterface> getSelectedPlots()
GJGraphInterface
ArrayList<GJPlotInterface>
public final void setSelectedPlots(java.util.ArrayList<GJPlotInterface> arr)
GJGraphInterface
arr
- a ArrayList<GJPlotInterface>
public final void setEditor(GJEditorInterface Editor)
GJGraphInterface
Editor
- an object implementing the GJEditorInterface
.public final GJEditorInterface fetchEditor()
GJGraphInterface
GJEditorInterface
.public final java.awt.event.MouseAdapter getMouseHandler()
GJGraphInterface
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.public final java.awt.event.MouseAdapter getAxisMouseHandler()
GJAxisSupportInterface
public final java.awt.event.MouseWheelListener getMouseWheelHandler()
public final boolean isTightAxes()
public final void setTightAxes(boolean tightAxes)
tightAxes
- the tightAxes to setpublic final double getAxesPadding()
public final void setAxesPadding(double axesPadding)
axesPadding
- the axesPadding to setpublic final boolean isTextAsInverse()
GJGraphInterface
mousePositionTextField
are
inverse transformed.public final void setTextAsInverse(boolean flag)
flag
- public final java.text.NumberFormat getMainFormatter()
public final void setMainFormatter(java.text.NumberFormat mainFormatter)
mainFormatter
- the mainFormatter to setpublic final boolean isMouseTextAsInverse()
public final void setMouseTextAsInverse(boolean mouseTextAsInverse)
mouseTextAsInverse
- the mouseTextAsInverse to setpublic final java.text.NumberFormat getSecondFormatter()
public final void setSecondFormatter(java.text.NumberFormat secondFormatter)
secondFormatter
- the secondFormatter to setpublic final java.lang.String getMousePositionTextFormat()
public final void setMousePositionTextFormat(java.lang.String mousePositionTextFormat)
mousePositionTextFormat
- the mousePositionTextFormat to setpublic final java.awt.geom.Point2D getDragStart()
public final void setDragStart(java.awt.geom.Point2D dragStart)
dragStart
- the dragStart to setpublic final boolean isDragX()
public final void setDragX(boolean dragX)
dragX
- the dragX to setpublic final boolean isDragY()
public final void setDragY(boolean dragY)
dragY
- the dragY to setpublic final java.awt.geom.Point2D getCurrentMousePosition()
public boolean isPolar()
public void setPolar(boolean polar)
polar
- the polar to setpublic float getAxisStrokeWeight()
GJAxisSupportInterface
public void setAxisStrokeWeight(float axisStrokeWeight)
GJAxisSupportInterface
axisStrokeWeight
- the stroke thickness in pixelspublic float getMinorGridStrokeWeight()
GJAxisSupportInterface
public void setMinorGridStrokeWeight(float minorGridStrokeWeight)
GJAxisSupportInterface
minorGridStrokeWeight
- the thickness in pixelspublic float getMajorGridStrokeWeight()
GJAxisSupportInterface
public void setMajorGridStrokeWeight(float majorGridStrokeWeight)
GJAxisSupportInterface
majorGridStrokeWeight
- the thickness in pixelspublic GJGridInterface getGridInterface()
public void setGridInterface(GJGridInterface gridInterface)
gridInterface
- the gridInterface to setpublic java.awt.geom.Rectangle2D.Double getCurrentROI()
public void setCurrentROI(java.awt.geom.Rectangle2D.Double currentROI)
currentROI
- the currentROI to setpublic java.util.ArrayList<java.awt.geom.Rectangle2D> getAvailableROI()
public void setAvailableROI(java.util.ArrayList<java.awt.geom.Rectangle2D> availableROI)
availableROI
- the availableROI to setpublic void clearSelectedRegions()
public java.awt.geom.Point2D getMouseDown()
public void setMouseDown(java.awt.geom.Point2D mouseDown)
mouseDown
- the mouseDown to setpublic javax.swing.JPopupMenu getContextMenu()
public void linkAxes(GJAbstractGraph gr)
gr
- public void linkAxesXX(GJAbstractGraph gr)
gr
- the graph to link the axis of.public void linkAxesYY(GJAbstractGraph gr)
gr
- the graph to link the axis of.public void linkAxesXY(GJAbstractGraph gr)
gr
- the graph to link the axis of.public void linkAxesYX(GJAbstractGraph gr)
gr
- the graph to link the axis of.public void openLinks()
public final java.awt.event.KeyListener getKeyListener()
public final void addLink(java.lang.Object o)
GJLinkableInterface
public final void removeLink(java.lang.Object o)
GJLinkableInterface
public final void clearLinks()
public final java.util.ArrayList<java.lang.Object> getLinks()
GJLinkableInterface
public final void setLinks(java.util.ArrayList<java.lang.Object> links)
GJLinkableInterface
links
- ArrayListpublic final boolean hasListeners(java.lang.String propertyName)
GJObservableInterface
public boolean hasSelfListener()
GJObservableInterface
public final void saveAsXML(java.lang.String fileName)
GJGraphInterface
fileName
- String description of the file.public void firePropertyChange(java.beans.PropertyChangeEvent pce)
public void propertyChange(java.beans.PropertyChangeEvent evt)