Documentation of 'kcl.waterloo.graphics.GJAbstractGraph' Java class
GJAbstractGraph
kcl.waterloo.graphics

Class GJAbstractGraph

  • All Implemented Interfaces:
    java.awt.event.ComponentListener, java.awt.event.ContainerListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.Scrollable, GJAxisSupportInterface, GJGraphInterface, GJLayerInterface<GJGraphInterface>, GJLinkableInterface, GJObservableInterface
    Direct Known Subclasses:
    GJGraph


    public abstract class GJAbstractGraph
    extends GJAbstractGraph1
    Abstract class implementing the 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

    See Also:
    Serialized Form
    • Method Detail

      • createAxes

        public final void createAxes()
        Description copied from interface: GJGraphInterface
        Creates the objects for drawing axes for this graph.
      • plus

        public final GJGraphInterface plus(GJGraphInterface graph)
        Adds the specified graph as a new layer.
        Parameters:
        graph - the graph to add
        Returns:
        the added graph
      • add

        public java.awt.Component add(java.awt.Component c)
        Overridden 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.
        Overrides:
        add in class java.awt.Container
        Parameters:
        c -
        Returns:
        the added Component
      • add

        public final void add(GJAnnotationInterface<java.awt.geom.Path2D,GJGraphInterface,java.awt.Stroke,java.awt.Paint,java.awt.Font> a)
        Description copied from interface: GJGraphInterface
        Adds an annotation to the container for the graph. The annotation setGraph method is used to reference this graph in the annotation instance.
        Parameters:
        a - the GJAnnotationInterface to add
      • plus

        public final GJPlotInterface plus(GJPlotInterface plot)
        Adds the specified plot as a top plot
        Parameters:
        plot - the plot to add
        Returns:
        the added plot
      • add

        public final GJPlotInterface add(GJPlotInterface plot)
        Description copied from interface: GJGraphInterface
        Adds a plot to the graph. Equivalent to add(plot, true);
        Parameters:
        plot - the plot to add to the graph
        Returns:
        a reference to the added plot
      • add

        public final GJPlotInterface add(GJPlotInterface plot,
                                         boolean flag)
        Description copied from interface: GJGraphInterface
        Adds a plot to a graph
        Parameters:
        plot - the plot to add
        flag - if true, the graph will be rescaled to accomodate the added plot.
        Returns:
        a reference to the added plot
      • remove

        public void remove(GJPlotInterface plot)
        Description copied from interface: GJGraphInterface
        Removes a plot from this graph's hierarchy.
        Parameters:
        plot - the plot to remove.
      • getPlotAt

        public final java.util.ArrayList<GJPlotInterface> getPlotAt(double x,
                                                                    double y)
        Returns the plots below the screen pixel location specified.
        Parameters:
        x - the x-Position
        y - the y-Position
        Returns:
        the plots as an ArrayList
      • getLayers

        public final java.util.ArrayList<GJGraphInterface> getLayers()
        Description copied from interface: GJLayerInterface
        Returns a list of the layers for this graph. The list includes this graph at element 0.
        Returns:
        an ArrayList
      • getLayer

        public final GJGraphInterface getLayer(int n)
        Description copied from interface: GJLayerInterface
        Returns the layer at the specified index
        Parameters:
        n - the layer number - zero is this layer
        Returns:
        the layer
      • getCurrentLayer

        public final GJGraphInterface getCurrentLayer()
        Description copied from interface: GJLayerInterface
        Returns the currently selected layer
        Returns:
        a GJGraphInterface instance
      • setCurrentLayer

        public final void setCurrentLayer(GJGraphInterface layer)
        Description copied from interface: GJLayerInterface
        Sets the current layer for this graph.
      • setCurrentLayerIndex

        public final void setCurrentLayerIndex(int n)
        Description copied from interface: GJLayerInterface
        Sets the current layer by index.
      • getCurrentLayerIndex

        public final int getCurrentLayerIndex()
        Description copied from interface: GJLayerInterface
        Returns the index of the current layer.
        Returns:
        the index
      • indexOf

        public final int indexOf()
        Description copied from interface: GJLayerInterface
        Returns the index of this graph as a layer in the view.
        Returns:
        the index
      • getAncestorGraph

        public final GJAbstractGraph getAncestorGraph()
        Description copied from interface: GJLayerInterface
        Returns the graph that forms the view in this graph's ancestry.
        Returns:
        the graph
      • add

        public final java.awt.Component add(java.awt.Component c,
                                            double x,
                                            double y)
        Description copied from interface: GJGraphInterface
        Add a component at the specified axis location
        Parameters:
        c - The component to add
        x - The x-axis position
        y - The y-axis position
        Returns:
        the added component
      • add

        public final java.awt.Component add(java.awt.Component c,
                                            double x,
                                            double y,
                                            int alignX,
                                            int alignY)
        Description copied from interface: GJGraphInterface
        Add a component at the specified axis location with the specified alignment
        Parameters:
        c - The component to add
        x - The x-axis position
        y - The y-axis position
        alignX - The X-alignment of the component on x,y
        alignY - The Y-alignment of the component on x,y
        Returns:
        the added component
      • remove

        public final void remove(java.awt.Component c)
        Overrides:
        remove in class java.awt.Container
      • setGraphContainer

        public final void setGraphContainer(GJAbstractGraphContainer c)
        Description copied from interface: GJGraphInterface
        Sets the GJAbstractGraphContainer for this graph.
        Parameters:
        c - the Container to add this GJAbstractGraph to
      • setGraphContainer

        public final void setGraphContainer(GJAbstractGraphContainer c,
                                            java.awt.Insets insets)
        Parameters:
        c - the GJAbstractGraphContainer to add this GJAbstractGraph to
        insets - an Insets object specifying the margins
      • getGraphContainer

        public final GJAbstractGraphContainer getGraphContainer()
        Description copied from interface: GJGraphInterface
        Returns the container for this graph. Null if the graph has no container.
        Returns:
        the GJAbstractGraphContainer
      • isInnerAxisPainted

        public final boolean isInnerAxisPainted()
        Description copied from interface: GJAxisSupportInterface
        Returns true if the inner axis is painted
        Returns:
        the flag
      • setInnerAxisPainted

        public final void setInnerAxisPainted(boolean flag)
        Description copied from interface: GJAxisSupportInterface
        Sets the flag for painting the inner axis
        Parameters:
        flag - the boolean value
      • isInnerAxisLabelled

        public final boolean isInnerAxisLabelled()
        Description copied from interface: GJAxisSupportInterface
        Returns the flag for painting the inner axis labels
        Returns:
        the flag
      • setInnerAxisLabelled

        public final void setInnerAxisLabelled(boolean textPainted)
        Description copied from interface: GJAxisSupportInterface
        Sets the flag for painting the inner axis labels
        Parameters:
        textPainted - the boolean value
      • isMajorGridPainted

        public final boolean isMajorGridPainted()
        Description copied from interface: GJAxisSupportInterface
        Returns true if the major grid is painted
        Returns:
        the flag
      • setMajorGridPainted

        public final void setMajorGridPainted(boolean gridPainted)
        Description copied from interface: GJAxisSupportInterface
        Sets the flag for painting the major grid
        Parameters:
        gridPainted - the boolean value
      • isMinorGridPainted

        public final boolean isMinorGridPainted()
        Description copied from interface: GJAxisSupportInterface
        Returns true if the minor grid is painted
        Returns:
        the flag
      • setMinorGridPainted

        public final void setMinorGridPainted(boolean gridPainted)
        Description copied from interface: GJAxisSupportInterface
        Sets the flag for painting the minor grid
        Parameters:
        gridPainted - the boolean value
      • isLeftAxisPainted

        public final boolean isLeftAxisPainted()
        Returns:
        true if the left axis is painted
      • isRightAxisPainted

        public final boolean isRightAxisPainted()
        Returns:
        true if the right axis is painted
      • isTopAxisPainted

        public final boolean isTopAxisPainted()
        Returns:
        true if the top axis is painted
      • isBottomAxisPainted

        public final boolean isBottomAxisPainted()
        Returns:
        true if the bottom axis is painted
      • isLeftAxisLabelled

        public final boolean isLeftAxisLabelled()
        Description copied from interface: GJAxisSupportInterface
        Returns true if the left axis is labelled
        Returns:
        the label flag
      • setLeftAxisLabelled

        public final void setLeftAxisLabelled(boolean flag)
        Description copied from interface: GJAxisSupportInterface
        Sets the left axis is labelling flag
        Parameters:
        flag - the label flag
      • isRightAxisLabelled

        public final boolean isRightAxisLabelled()
        Description copied from interface: GJAxisSupportInterface
        Returns true if the right axis is labelled
        Returns:
        the label flag
      • setRightAxisLabelled

        public final void setRightAxisLabelled(boolean flag)
        Description copied from interface: GJAxisSupportInterface
        Sets the right axis is labelling flag
        Parameters:
        flag - the label flag
      • isTopAxisLabelled

        public final boolean isTopAxisLabelled()
        Description copied from interface: GJAxisSupportInterface
        Returns true if the top axis is labelled
        Returns:
        the label flag
      • setTopAxisLabelled

        public final void setTopAxisLabelled(boolean flag)
        Description copied from interface: GJAxisSupportInterface
        Sets the top axis is labelling flag
        Parameters:
        flag - the label flag
      • isBottomAxisLabelled

        public final boolean isBottomAxisLabelled()
        Description copied from interface: GJAxisSupportInterface
        Returns true if the bottom axis is labelled
        Returns:
        the label flag
      • setBottomAxisLabelled

        public final void setBottomAxisLabelled(boolean flag)
        Description copied from interface: GJAxisSupportInterface
        Sets the bottom axis is labelling flag
        Parameters:
        flag - the label flag
      • getLeftAxisPanel

        public final GJAxisPanel getLeftAxisPanel()
        Description copied from interface: GJAxisSupportInterface
        Returns the panel for drawing the left axis.
        Returns:
        a GJAxisPanel instance
      • setLeftAxisPanel

        public final void setLeftAxisPanel(GJAxisPanel axp)
      • getRightAxisPanel

        public final GJAxisPanel getRightAxisPanel()
        Description copied from interface: GJAxisSupportInterface
        Returns the panel for drawing the right axis.
        Returns:
        a GJAxisPanel instance
      • setRightAxisPanel

        public final void setRightAxisPanel(GJAxisPanel axp)
      • getTopAxisPanel

        public final GJAxisPanel getTopAxisPanel()
        Description copied from interface: GJAxisSupportInterface
        Returns the panel for drawing the top axis.
        Returns:
        a GJAxisPanel instance
      • setTopAxisPanel

        public final void setTopAxisPanel(GJAxisPanel axp)
      • getBottomAxisPanel

        public final GJAxisPanel getBottomAxisPanel()
        Description copied from interface: GJAxisSupportInterface
        Returns the panel for drawing the bottom axis.
        Returns:
        a GJAxisPanel instance
      • setBottomAxisPanel

        public final void setBottomAxisPanel(GJAxisPanel axp)
      • getMajorGridColor

        public final java.awt.Color getMajorGridColor()
        Description copied from interface: GJAxisSupportInterface
        Returns the major grid painting color
        Returns:
        the color
      • setMajorGridColor

        public final void setMajorGridColor(java.awt.Color majorGridColor)
        Description copied from interface: GJAxisSupportInterface
        Sets the color for painting the major grid
        Parameters:
        majorGridColor - the color
      • getMinorGridColor

        public final java.awt.Color getMinorGridColor()
        Description copied from interface: GJAxisSupportInterface
        Returns the minor grid painting color
        Returns:
        the color
      • setMinorGridColor

        public final void setMinorGridColor(java.awt.Color minorGridColor)
        Description copied from interface: GJAxisSupportInterface
        Sets the color for painting the minor grid
        Parameters:
        minorGridColor - the color
      • getMajorXHint

        public final double getMajorXHint()
        Description copied from interface: GJAxisSupportInterface
        Returns the value for the hint
        Returns:
        the value
      • setMajorXHint

        public final void setMajorXHint()
        Description copied from interface: GJAxisSupportInterface
        Automatically sets the hint
      • setMajorXHint

        public final void setMajorXHint(double majorX)
        Description copied from interface: GJAxisSupportInterface
        Sets the hint to the specified value
        Parameters:
        majorX - the value
      • setMinorCountXHint

        public final void setMinorCountXHint(int minorCountX)
        Description copied from interface: GJAxisSupportInterface
        Provides a hint to how many minor grid lines should be painted.
        Parameters:
        minorCountX - number for the x-axis
      • getMajorYHint

        public final double getMajorYHint()
        Description copied from interface: GJAxisSupportInterface
        Returns the value for the hint
        Returns:
        the value
      • setMajorYHint

        public final void setMajorYHint()
        Description copied from interface: GJAxisSupportInterface
        Automatically sets the hint
      • setMajorYHint

        public final void setMajorYHint(double majorY)
        Description copied from interface: GJAxisSupportInterface
        Sets the hint to the specified value
        Parameters:
        majorY - the value
      • getMinorCountXHint

        public final int getMinorCountXHint()
        Description copied from interface: GJAxisSupportInterface
        Returns a hint for the number of minor grids to paint per major grid division for the x-axis.
        Returns:
        an int
      • getMinorCountYHint

        public final int getMinorCountYHint()
        Description copied from interface: GJAxisSupportInterface
        Returns a hint for the number of minor grids to paint per major grid division for the y-axis.
        Returns:
        an int
      • setMinorCountYHint

        public final void setMinorCountYHint(int minorCountY)
        Description copied from interface: GJAxisSupportInterface
        Provides a hint to how many minor grid lines should be painted.
        Parameters:
        minorCountY - number for the y-axis
      • setAxesBoundsAndOrigin

        public 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:

        • xLeft: bounds.getX()
        • yBottom: bounds.getY()
        • yTop: bounds.getMaxX() (xLeft + bounds.getWidth())
        • xRight: bounds.getMaxY() (yBottom + bounds.getHeight())

        The origin is located at the center of the view. Its coordinates are defined by calling bounds.getCenterX() and bounds.getCenterY().

        Parameters:
        bounds - the rectangle defining the graph's view and its origin
      • setAxesBounds

        public final void setAxesBounds(double x,
                                        double y,
                                        double w,
                                        double h)
      • setAxesBounds

        public final void setAxesBounds(java.awt.geom.Rectangle2D bounds)
        Description copied from interface: GJAxisSupportInterface
        Sets the bounds of the axes (xLeft, yBottom, width, height)
        Parameters:
        bounds - a Rectangle2D
      • getAxesBounds

        public final java.awt.geom.Rectangle2D getAxesBounds()
        Description copied from interface: GJAxisSupportInterface
        Returns the bounds of the axes (xLeft, yBottom, width, height)
        Returns:
        a Rectangle2D
      • resetView

        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).

        See Also:
        setAxesBounds(Rectangle2D), setAxesBoundsAndOrigin(Rectangle2D)
      • updatePlots

        public final void updatePlots()
      • getDataRange

        public final java.awt.geom.Rectangle2D getDataRange()
        Returns the data range for the x- and y-data of the plots for this graph. This range takes no account of the size of markers and does not require the plot to have been rendered to the graphics device.
        Returns:
        the data range as a Rectangle2D object [X min, Y min ,width,height]
      • getAxisColor

        public final java.awt.Color getAxisColor()
        Description copied from interface: GJAxisSupportInterface
        Returns the axis painting color
        Returns:
        the color
      • setAxisColor

        public final void setAxisColor(java.awt.Color axisColor)
        Description copied from interface: GJAxisSupportInterface
        Sets the color for painting the axis
        Parameters:
        axisColor - the color
      • getXLabel

        public final java.lang.String getXLabel()
        Description copied from interface: GJAxisSupportInterface
        Returns the string for the x-axis label
        Returns:
        the String
      • setXLabel

        public final void setXLabel(java.lang.String s)
        Description copied from interface: GJAxisSupportInterface
        Sets the string for the x-axis label
        Parameters:
        s - the String
      • getYLabel

        public final java.lang.String getYLabel()
        Description copied from interface: GJAxisSupportInterface
        Returns the string for the y-axis label
        Returns:
        the String
      • setYLabel

        public final void setYLabel(java.lang.String s)
        Description copied from interface: GJAxisSupportInterface
        Sets the string for the x-axis label
        Parameters:
        s - the String
      • getPlots

        public final java.util.ArrayList<GJPlotInterface> getPlots()
        Description copied from interface: GJGraphInterface
        Returns the list of top plots associated with this graph. It is recommended that this should be a clone of the internal ArrayList.
        Returns:
        a ArrayList
      • getAllPlots

        public final java.util.ArrayList<GJPlotInterface> getAllPlots()
      • setPlots

        public final void setPlots(java.util.ArrayList<GJPlotInterface> list)
        Description copied from interface: GJGraphInterface
        Replaces the internal plot list (or its contents) with the supplied 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.
        Parameters:
        list - a ArrayList<GJPlotInterface>
      • removePlotAt

        public final void removePlotAt(int n)

        Removes the specified plot from this layer.

        Parameters:
        n -
      • removeAllPlots

        public final void removeAllPlots()

        Removes all the plots currently associated with this layer.

      • removeListeners

        public final void removeListeners()
      • addListeners

        public final void addListeners()
        Description copied from interface: GJGraphInterface
        Adds listeners or registers the mouse handle to be returned by getMouseHandler.
      • inverseTransform

        public final java.awt.geom.Point2D inverseTransform(int x,
                                                            int y)
        Convenience caller to inverseTransformPoint(Point)
        Parameters:
        x - Position in the graph
        y - Position in the graph
        Returns:
        Point rotated,scaled and translated according to the graphContainer's Rotation and Zoom settings. Null if there is no graphContainer associated with this graph
      • autoScale

        public final void autoScale()
        Description copied from interface: GJGraphInterface
        Auto-scales the graph's axes
      • getMousePositionTextField

        public final javax.swing.JLabel getMousePositionTextField()
        Description copied from interface: GJGraphInterface
        Returns a reference to a JLabel that will be updated with the mouse position (unless null).
        Returns:
        a JLabel
      • setMousePositionTextField

        public final void setMousePositionTextField(javax.swing.JLabel t)
        Description copied from interface: GJGraphInterface
        Sets a reference to a JLabel that will be updated with the mouse position (unless null).
        Parameters:
        t - a JLabel
      • setKeyAntialiasing

        public final void setKeyAntialiasing(java.lang.Object o)
        Sets the keyAntialiasing value
        Parameters:
        o -
      • setAntialiasing

        public final void setAntialiasing(boolean flag)
      • setTextAntialiasing

        public final void setTextAntialiasing(java.lang.Object o)
        Sets the textAntialiasing value
        Parameters:
        o -
      • setReverseX

        public final void setReverseX(boolean flag)
        Description copied from interface: GJAxisSupportInterface
        Sets the axis reversal flag for the x-axis.
      • isXReversed

        public final boolean isXReversed()
        Description copied from interface: GJAxisSupportInterface
        Returns true if the x-axis and data are painted in reverse
        Returns:
        the reversal flag
      • setReverseY

        public final void setReverseY(boolean flag)
        Description copied from interface: GJAxisSupportInterface
        Sets the axis reversal flag for the x-axis.
      • isYReversed

        public final boolean isYReversed()
        Description copied from interface: GJAxisSupportInterface
        Returns true if the y-axis and data are painted in reverse
        Returns:
        the reversal flag
      • format

        public final java.lang.String format(double number)
        Description copied from interface: GJAxisSupportInterface
        Returns a string for axis labels formatted by an internal formatter
        Parameters:
        number - the value to format
        Returns:
        the String
      • isCategorical

        public 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.
        Parameters:
        or -
        Returns:
        the flag
      • getCategoricalLabels

        public java.util.ArrayList<Category> getCategoricalLabels(GJAxisPanel.Orientation o)
        Description copied from interface: GJAxisSupportInterface
        Returns the categorical data on the specified axis
        Parameters:
        o - a GJAxisPanel.Orientation value
        Returns:
        an ArrayList
      • setLeftAxisPainted

        public final void setLeftAxisPainted(boolean flag)
        Description copied from interface: GJAxisSupportInterface
        Sets the flag for painting the left axis
        Parameters:
        flag - the setting to use
      • setRightAxisPainted

        public final void setRightAxisPainted(boolean flag)
        Description copied from interface: GJAxisSupportInterface
        Sets the flag for painting the right axis
        Parameters:
        flag - the setting to use
      • setBottomAxisPainted

        public final void setBottomAxisPainted(boolean flag)
        Description copied from interface: GJAxisSupportInterface
        Sets the flag for painting the bottom axis
        Parameters:
        flag - the setting to use
      • setTopAxisPainted

        public final void setTopAxisPainted(boolean flag)
        Description copied from interface: GJAxisSupportInterface
        Sets the flag for painting the top axis
        Parameters:
        flag - the setting to use
      • getSelectedPlots

        public final java.util.ArrayList<GJPlotInterface> getSelectedPlots()
        Description copied from interface: GJGraphInterface
        Returns a list of plot that are currently selected (e.g. by mouse click).
        Returns:
        a ArrayList<GJPlotInterface>
      • setSelectedPlots

        public final void setSelectedPlots(java.util.ArrayList<GJPlotInterface> arr)
        Description copied from interface: GJGraphInterface
        Programmatically selects plots.
        Parameters:
        arr - a ArrayList<GJPlotInterface>
      • setEditor

        public final void setEditor(GJEditorInterface Editor)
        Description copied from interface: GJGraphInterface
        Sets the editor to be activated when this graph is double-clicked.
        Parameters:
        Editor - an object implementing the GJEditorInterface.
      • getMouseHandler

        public final java.awt.event.MouseAdapter getMouseHandler()
        Description copied from interface: GJGraphInterface
        Returns a MouseAdapter for this component. The methods of the handler can then be called by the mouse listeners of components that are higher in the Swing hierarchy. This is used in Waterloo e.g. by the 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.
        Returns:
        the MouseAdapter
      • getAxisMouseHandler

        public final java.awt.event.MouseAdapter getAxisMouseHandler()
        Description copied from interface: GJAxisSupportInterface
        Returns the mouse handler for this axis
        Returns:
        a MouseAdapter
      • getMouseWheelHandler

        public final java.awt.event.MouseWheelListener getMouseWheelHandler()
      • isTightAxes

        public final boolean isTightAxes()
        Returns:
        the tightAxes
      • setTightAxes

        public final void setTightAxes(boolean tightAxes)
        Parameters:
        tightAxes - the tightAxes to set
      • getAxesPadding

        public final double getAxesPadding()
        Returns:
        the axesPadding
      • setAxesPadding

        public final void setAxesPadding(double axesPadding)
        Parameters:
        axesPadding - the axesPadding to set
      • isTextAsInverse

        public final boolean isTextAsInverse()
        Description copied from interface: GJGraphInterface
        Returns true if the data shown in the mousePositionTextField are inverse transformed.
        Returns:
        the mouseTextAsInverse
      • setTextAsInverse

        public final void setTextAsInverse(boolean flag)
        Sets the textAsInverse flag. When set true, mouse position values shown in the mousePositionTextField will be inverse transformed.
        Parameters:
        flag -
      • getMainFormatter

        public final java.text.NumberFormat getMainFormatter()
        Returns:
        the mainFormatter
      • setMainFormatter

        public final void setMainFormatter(java.text.NumberFormat mainFormatter)
        Parameters:
        mainFormatter - the mainFormatter to set
      • isMouseTextAsInverse

        public final boolean isMouseTextAsInverse()
        Returns:
        the mouseTextAsInverse
      • setMouseTextAsInverse

        public final void setMouseTextAsInverse(boolean mouseTextAsInverse)
        Parameters:
        mouseTextAsInverse - the mouseTextAsInverse to set
      • getSecondFormatter

        public final java.text.NumberFormat getSecondFormatter()
        Returns:
        the secondFormatter
      • setSecondFormatter

        public final void setSecondFormatter(java.text.NumberFormat secondFormatter)
        Parameters:
        secondFormatter - the secondFormatter to set
      • getMousePositionTextFormat

        public final java.lang.String getMousePositionTextFormat()
        Returns:
        the mousePositionTextFormat
      • setMousePositionTextFormat

        public final void setMousePositionTextFormat(java.lang.String mousePositionTextFormat)
        Parameters:
        mousePositionTextFormat - the mousePositionTextFormat to set
      • getDragStart

        public final java.awt.geom.Point2D getDragStart()
        Returns:
        the dragStart
      • setDragStart

        public final void setDragStart(java.awt.geom.Point2D dragStart)
        Parameters:
        dragStart - the dragStart to set
      • isDragX

        public final boolean isDragX()
        Returns:
        the dragX
      • setDragX

        public final void setDragX(boolean dragX)
        Parameters:
        dragX - the dragX to set
      • isDragY

        public final boolean isDragY()
        Returns:
        the dragY
      • setDragY

        public final void setDragY(boolean dragY)
        Parameters:
        dragY - the dragY to set
      • getCurrentMousePosition

        public final java.awt.geom.Point2D getCurrentMousePosition()
        Returns:
        the currentMousePosition
      • isPolar

        public boolean isPolar()
        Returns:
        the polar
      • setPolar

        public void setPolar(boolean polar)
        Parameters:
        polar - the polar to set
      • getAxisStrokeWeight

        public float getAxisStrokeWeight()
        Description copied from interface: GJAxisSupportInterface
        Returns the stroke thickness for axes
        Returns:
        thickness in pixels
      • setAxisStrokeWeight

        public void setAxisStrokeWeight(float axisStrokeWeight)
        Description copied from interface: GJAxisSupportInterface
        Sets the width of lines for the axes
        Parameters:
        axisStrokeWeight - the stroke thickness in pixels
      • getMinorGridStrokeWeight

        public float getMinorGridStrokeWeight()
        Description copied from interface: GJAxisSupportInterface
        Returns the stroke thickness for minor grids
        Returns:
        thickness in pixels
      • setMinorGridStrokeWeight

        public void setMinorGridStrokeWeight(float minorGridStrokeWeight)
        Description copied from interface: GJAxisSupportInterface
        Sets the stroke thickness for minor grids
        Parameters:
        minorGridStrokeWeight - the thickness in pixels
      • getMajorGridStrokeWeight

        public float getMajorGridStrokeWeight()
        Description copied from interface: GJAxisSupportInterface
        Returns the stroke thickness for major grids
        Returns:
        thickness in pixels
      • setMajorGridStrokeWeight

        public void setMajorGridStrokeWeight(float majorGridStrokeWeight)
        Description copied from interface: GJAxisSupportInterface
        Sets the stroke thickness for major grids
        Parameters:
        majorGridStrokeWeight - the thickness in pixels
      • getGridInterface

        public GJGridInterface getGridInterface()
        Returns:
        the gridInterface
      • setGridInterface

        public void setGridInterface(GJGridInterface gridInterface)
        Parameters:
        gridInterface - the gridInterface to set
      • getCurrentROI

        public java.awt.geom.Rectangle2D.Double getCurrentROI()
        Returns:
        a copy of the currentROI
      • setCurrentROI

        public void setCurrentROI(java.awt.geom.Rectangle2D.Double currentROI)
        Parameters:
        currentROI - the currentROI to set
      • getAvailableROI

        public java.util.ArrayList<java.awt.geom.Rectangle2D> getAvailableROI()
        Returns:
        the availableROI
      • setAvailableROI

        public void setAvailableROI(java.util.ArrayList<java.awt.geom.Rectangle2D> availableROI)
        Parameters:
        availableROI - the availableROI to set
      • clearSelectedRegions

        public void clearSelectedRegions()
      • getMouseDown

        public java.awt.geom.Point2D getMouseDown()
        Returns:
        the mouseDown
      • setMouseDown

        public void setMouseDown(java.awt.geom.Point2D mouseDown)
        Parameters:
        mouseDown - the mouseDown to set
      • getContextMenu

        public javax.swing.JPopupMenu getContextMenu()
        Returns:
        the contentMenu
      • linkAxes

        public void linkAxes(GJAbstractGraph gr)
        Links both the x- and y-axes of this graph to the specified graph
        Parameters:
        gr -
      • linkAxesXX

        public void linkAxesXX(GJAbstractGraph gr)
        Links the x-axis of this graph to that of the specified graph.
        Parameters:
        gr - the graph to link the axis of.
      • linkAxesYY

        public void linkAxesYY(GJAbstractGraph gr)
        Links the y-axis of this graph to that of the specified graph.
        Parameters:
        gr - the graph to link the axis of.
      • linkAxesXY

        public void linkAxesXY(GJAbstractGraph gr)
        Links the x-axis of this graph to the y-axis of the specified graph.
        Parameters:
        gr - the graph to link the axis of.
      • linkAxesYX

        public void linkAxesYX(GJAbstractGraph gr)
        Links the y-axis of this graph to the x-axis of the specified graph.
        Parameters:
        gr - the graph to link the axis of.
      • openLinks

        public void openLinks()
        Makes any linked graphs referenced by this graph visible - housing them in a standard Waterloo swing hierarchy if required.
      • getKeyListener

        public final java.awt.event.KeyListener getKeyListener()
      • addLink

        public final void addLink(java.lang.Object o)
        Description copied from interface: GJLinkableInterface
        Adds an Object to the Links map
      • removeLink

        public final void removeLink(java.lang.Object o)
        Description copied from interface: GJLinkableInterface
        Removes an Object from the Links map
      • clearLinks

        public final void clearLinks()
      • getLinks

        public final java.util.ArrayList<java.lang.Object> getLinks()
        Description copied from interface: GJLinkableInterface
        Returns the list of linked Objects
        Returns:
        the ArrayList of linked Objects
      • setLinks

        public final void setLinks(java.util.ArrayList<java.lang.Object> links)
        Description copied from interface: GJLinkableInterface
        Sets the list of linked objects
        Parameters:
        links - ArrayList
        • hasSelfListener

          public boolean hasSelfListener()
          Description copied from interface: GJObservableInterface
          Returns true if the implementing instance is a listener.
          Returns:
          true/false
        • saveAsXML

          public final void saveAsXML(java.lang.String fileName)
          Description copied from interface: GJGraphInterface
          Convenience method to save a graph to a "kclf" file.
          Parameters:
          fileName - String description of the file.
        • firePropertyChange

          public void firePropertyChange(java.beans.PropertyChangeEvent pce)
        • propertyChange

          public void propertyChange(java.beans.PropertyChangeEvent evt)

        DMelt 3.0 © DataMelt by jWork.ORG

        You see the box below because you did not login.