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

Interface GJGraphInterface

    • Method Detail

      • setGraphContainer

        void setGraphContainer(GJAbstractGraphContainer c)
        Sets the GJAbstractGraphContainer for this graph.
        Parameters:
        c - the Container to add this GJAbstractGraph to
      • add

        GJPlotInterface add(GJPlotInterface plot)
        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

        GJPlotInterface add(GJPlotInterface plot,
                            boolean flag)
        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

        void remove(GJPlotInterface plot)
        Removes a plot from this graph's hierarchy.
        Parameters:
        plot - the plot to remove.
      • add

        java.awt.Component add(java.awt.Component c,
                               double x,
                               double y)
        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

        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
        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
      • add

        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. The annotation setGraph method is used to reference this graph in the annotation instance.
        Parameters:
        a - the GJAnnotationInterface to add
      • setGraphContainer

        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

        GJAbstractGraphContainer getGraphContainer()
        Returns the container for this graph. Null if the graph has no container.
        Returns:
        the GJAbstractGraphContainer
      • createAxes

        void createAxes()
        Creates the objects for drawing axes for this graph.
      • xPixelToPosition

        double xPixelToPosition(double pixel)
        Convert a pixel location to a graph coordinate on the x-axis. This method does not compensate for rotation or zoom.
        Parameters:
        pixel - location on x
        Returns:
        the position on the x-axis
      • xPixelToPosition

        double[] xPixelToPosition(double[] pixel)
        Convert an array of pixel locations to graph coordinates on the x-axis. This method does not compensate for rotation or zoom.
        Parameters:
        pixel - location on x
        Returns:
        the positions on the x-axis
      • xPixelToPositioni

        double[] xPixelToPositioni(double[] pixel)
        Convert an array of pixel locations to graph coordinates on the x-axis. The conversion may be done in-place, so the input data are destroyed in the process. This method does not compensate for rotation or zoom.
        Parameters:
        pixel - location on x
        Returns:
        the positions on the x-axis
      • yPixelToPosition

        double yPixelToPosition(double pixel)
        Convert a pixel location to a graph coordinate on the y-axis. This method does not compensate for rotation or zoom.
        Parameters:
        pixel - location on y
        Returns:
        the position on the y-axis
      • yPixelToPosition

        double[] yPixelToPosition(double[] pixel)
        Convert an array of pixel locations to graph coordinates on the y-axis. This method does not compensate for rotation or zoom.
        Parameters:
        pixel - location on y
        Returns:
        the positions on the y-axis
      • yPixelToPositioni

        double[] yPixelToPositioni(double[] pixel)
        Convert an array of pixel locations to graph coordinates on the y-axis. The conversion may be done in-place, so the input data are destroyed in the process. This method does not compensate for rotation or zoom.
        Parameters:
        pixel - location on y
        Returns:
        the positions on the y-axis
      • getPixelWidth

        double getPixelWidth()
        Returns the width of a pixel in graph coordinates. This method does not compensate for rotation or zoom.
        Returns:
        the value
      • getPixelHeight

        double getPixelHeight()
        Returns the height of a pixel in graph coordinates. This method does not compensate for rotation or zoom.
        Returns:
        the value
      • xPositionToPixel

        double xPositionToPixel(double position)
        Convert an axis location to a pixel value This method does not compensate for rotation or zoom.
        Parameters:
        position - on x-axis
        Returns:
        pixel location on x
      • xPositionToPixel

        double[] xPositionToPixel(double[] positions)
        Convert an array of axis locations to a pixel values. This method does not compensate for rotation or zoom.
        Parameters:
        positions - on x-axis
        Returns:
        pixel locations on x
      • xPositionToPixeli

        double[] xPositionToPixeli(double[] positions)
        Convert an array of axis locations to a pixel values. The conversion may be done in-place, thus destroying the input values. This method does not compensate for rotation or zoom.
        Parameters:
        positions - on x-axis
        Returns:
        pixel locations on x
      • yPositionToPixel

        double yPositionToPixel(double position)
        Convert an array of axis locations to a pixel values. This method does not compensate for rotation or zoom.
        Parameters:
        position - on y-axis
        Returns:
        pixel locations on y
      • yPositionToPixel

        double[] yPositionToPixel(double[] positions)
        Convert an array of axis locations to a pixel values. This method does not compensate for rotation or zoom.
        Parameters:
        positions - on y-axis
        Returns:
        pixel locations on y
      • yPositionToPixeli

        double[] yPositionToPixeli(double[] positions)
        Convert an array of axis locations to a pixel values. The conversion may be done in-place, thus destroying the input values. This method does not compensate for rotation or zoom.
        Parameters:
        positions - on y-axis
        Returns:
        pixel locations on y
      • convertPixelsToPosition

        java.awt.geom.Rectangle2D convertPixelsToPosition(java.awt.geom.Rectangle2D r)
        Returns a rectangle defined in axes units from a rectangle defined in pixels.
        Parameters:
        r - a Rectangle2D in pixels
        Returns:
        a Rectangle2D in axes units
      • getXTransform

        GJDataTransformInterface getXTransform()
        Get the transform for the x-data
        Returns:
        a GJDataTransformInterface
      • setXTransform

        void setXTransform(GJDataTransformInterface tr)
        Sets the transform for the x-data
        Parameters:
        tr - a GJDataTransformInterface
      • getYTransform

        GJDataTransformInterface getYTransform()
        Get the transform for the y-data
        Returns:
        a GJDataTransformInterface
      • setYTransform

        void setYTransform(GJDataTransformInterface tr)
        Sets the transform for the y-data
        Parameters:
        tr - a GJDataTransformInterface
      • getPlots

        java.util.ArrayList<GJPlotInterface> getPlots()
        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
      • setPlots

        void setPlots(java.util.ArrayList<GJPlotInterface> list)
        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>
      • getSelectedPlots

        java.util.ArrayList<GJPlotInterface> getSelectedPlots()
        Returns a list of plot that are currently selected (e.g. by mouse click).
        Returns:
        a ArrayList<GJPlotInterface>
      • setSelectedPlots

        void setSelectedPlots(java.util.ArrayList<GJPlotInterface> p)
        Programmatically selects plots.
        Parameters:
        p - a ArrayList<GJPlotInterface>
      • setEditor

        void setEditor(GJEditorInterface editor)
        Sets the editor to be activated when this graph is double-clicked.
        Parameters:
        editor - an object implementing the GJEditorInterface.
      • fetchEditor

        GJEditorInterface fetchEditor()
        Returns the editor.
        Returns:
        a GJEditorInterface.
      • saveAsXML

        void saveAsXML(java.lang.String s)
        Convenience method to save a graph to a "kclf" file.
        Parameters:
        s - String description of the file.
      • setKeyAntialiasing

        void setKeyAntialiasing(java.lang.Object o)
        Sets the anti-aliasing key for rendering this graph. Note this setting will be overriden while rendering plots.
        Parameters:
        o - a rendering key value
      • setTextAntialiasing

        void setTextAntialiasing(java.lang.Object o)
        Sets the text anti-aliasing key for rendering this graph. Note this setting will be overriden while rendering plots.
        Parameters:
        o - a rendering key value
      • getMousePositionTextField

        javax.swing.JLabel getMousePositionTextField()
        Returns a reference to a JLabel that will be updated with the mouse position (unless null).
        Returns:
        a JLabel
      • setMousePositionTextField

        void setMousePositionTextField(javax.swing.JLabel t)
        Sets a reference to a JLabel that will be updated with the mouse position (unless null).
        Parameters:
        t - a JLabel
      • isPolar

        boolean isPolar()
      • isTextAsInverse

        boolean isTextAsInverse()
        Returns true if the data shown in the mousePositionTextField are inverse transformed.
        Returns:
        the flag
      • setTextAsInverse

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

        void setBackgroundPainted(boolean flag)
        Determines whether the background is painted. Background painting needs to be turned off to support multi-layered graphs so that graphs at the top of the z-order does not obscure those below.
        Parameters:
        flag - boolean value
      • getMouseHandler

        java.awt.event.MouseAdapter getMouseHandler()
        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
      • addListeners

        void addListeners()
        Adds listeners or registers the mouse handle to be returned by getMouseHandler.
      • autoScale

        void autoScale()
        Auto-scales the graph's axes

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.