Documentation of 'visad.java2d.DisplayRendererJ2D' Java class
DisplayRendererJ2D
visad.java2d

Class DisplayRendererJ2D

  • All Implemented Interfaces:
    java.util.EventListener, ControlListener, RendererSourceListener
    Direct Known Subclasses:
    DefaultDisplayRendererJ2D


    public abstract class DisplayRendererJ2D
    extends DisplayRenderer
    implements RendererSourceListener
    DisplayRendererJ2D is the VisAD abstract super-class for background and metadata rendering algorithms. These complement depictions of Data objects created by DataRenderer objects.

    DisplayRendererJ2D also manages the overall relation of DataRenderer output to Java2D and manages the VisAD scene graph.

    It creates the binding between Control objects and scene graph Behavior objects for direct manipulation of Control objects.

    DisplayRendererJ2D is not Serializable and should not be copied between JVMs.

    • Constructor Detail

      • DisplayRendererJ2D

        public DisplayRendererJ2D()
    • Method Detail

      • setClip

        public void setClip(float xlow,
                            float xhi,
                            float ylow,
                            float yhi)
      • unsetClip

        public void unsetClip()
      • initControl

        public void initControl(RendererControl ctl)
        Internal method used to initialize newly created RendererControl with current renderer settings before it is actually connected to the renderer. This means that changes will not generate MonitorEvents.
        Specified by:
        initControl in class DisplayRenderer
        Parameters:
        ctl - RendererControl to initialize
      • controlChanged

        public void controlChanged(ControlEvent evt)
                            throws VisADException,
                                   java.rmi.RemoteException
        Update internal values from those in the RendererControl.
        Specified by:
        controlChanged in interface ControlListener
        Parameters:
        evt - ControlEvent generated by a change to the RendererControl
        Throws:
        VisADException
        java.rmi.RemoteException
      • getTrans

        public java.awt.geom.AffineTransform getTrans()
      • getImage

        public java.awt.image.BufferedImage getImage()
        Description copied from class: DisplayRenderer
        Get a snapshot of the displayed image.
        Specified by:
        getImage in class DisplayRenderer
        Returns:
        The current image being displayed.
      • getCursorOnBranch

        public VisADGroup getCursorOnBranch()
      • getBoxOnBranch

        public VisADGroup getBoxOnBranch()
      • setCursorOn

        public void setCursorOn(boolean on)
        Description copied from class: DisplayRenderer
        set flag indicating whether the cursor should be displayed.
        Specified by:
        setCursorOn in class DisplayRenderer
        Parameters:
        on - value of flag to set
      • setDirectOn

        public void setDirectOn(boolean on)
        Description copied from class: DisplayRenderer
        set flag indicating whether direct manipulation is active
        Specified by:
        setDirectOn in class DisplayRenderer
        Parameters:
        on - value of flag to set
      • createSceneGraph

        public abstract VisADGroup createSceneGraph(VisADCanvasJ2D c)
                                             throws DisplayException
        Create scene graph root, if none exists, with Transform, direct manipulation root, and non-direct-manipulation root; create special graphics (e.g., 3-D box, SkewT background), any lights, any user interface embedded in scene.
        Parameters:
        c -
        Returns:
        Scene graph root.
        Throws:
        DisplayException
      • clearScene

        public void clearScene(DataRenderer renderer)
      • getCursor

        public double[] getCursor()
        Returns the location of the last unmodified, middle mouse button press.
        Specified by:
        getCursor in class DisplayRenderer
        Returns:
        The location of the last unmodified, middle mouse button press as (Display.XAxis, Display.YAxis, 0.0).
      • depth_cursor

        public void depth_cursor(VisADRay ray)
        Description copied from class: DisplayRenderer
        set a VisADRay along which to drag cursor in depth (in and out of screen)
        Specified by:
        depth_cursor in class DisplayRenderer
        Parameters:
        ray - VisADRay to set
      • drag_depth

        public void drag_depth(float diff)
        Description copied from class: DisplayRenderer
        drag cursor in depth (in and out of screen)
        Specified by:
        drag_depth in class DisplayRenderer
        Parameters:
        diff - amount to move cursor in depth (0.0 corresponds to no movement)
      • drag_cursor

        public void drag_cursor(VisADRay ray,
                                boolean first)
        Description copied from class: DisplayRenderer
        drag cursor parallel to plane of screen
        Specified by:
        drag_cursor in class DisplayRenderer
        Parameters:
        ray - VisADRay that goes through new cursor location
        first - true to indicate this is first call to drag_cursor() for this drag
      • render_trigger

        public void render_trigger()
        Description copied from class: DisplayRenderer
        trigger the graphics API to render the scene graph to the screen; intended to be over-ridden by graphics-API-specific extensions of DisplayRenderer
        Overrides:
        render_trigger in class DisplayRenderer
      • anyCursorStringVector

        public boolean anyCursorStringVector()
      • drawCursorStringVector

        public void drawCursorStringVector(java.awt.Graphics graphics,
                                           java.awt.geom.AffineTransform tgeometry,
                                           int width,
                                           int height)
        Whenever cursorOn or directOn is true, display Strings in cursorStringVector.
        Parameters:
        graphics -
        tgeometry -
        width -
        height -
      • findDirect

        public DataRenderer findDirect(VisADRay ray,
                                       int mouseModifiers)
        Description copied from class: DisplayRenderer
        Returns a direct manipulation renderer if one is close to the specified ray (within pick threshold).
        Specified by:
        findDirect in class DisplayRenderer
        Parameters:
        ray - The ray used to look for a nearby direct manipulation renderer.
        mouseModifiers - Value of InputEvent.getModifiers().
        Returns:
        DataRenderer or null.
      • anyDirects

        public boolean anyDirects()
        Specified by:
        anyDirects in class DisplayRenderer
        Returns:
        flag indicating whether there are any direct manipulation DataRenderers linked to Display
      • setScaleOn

        public void setScaleOn(boolean on)
        Allow scales to be displayed if they are set on.
        Specified by:
        setScaleOn in class DisplayRenderer
        Parameters:
        on - true to turn them on, false to set them invisible
      • setScale

        public void setScale(int axis,
                             int axis_ordinal,
                             VisADLineArray array,
                             float[] scale_color)
                      throws VisADException
        Set the scale for the appropriate axis.
        Specified by:
        setScale in class DisplayRenderer
        Parameters:
        axis - axis for this scale (0 = XAxis, 1 = YAxis, 2 = ZAxis)
        axis_ordinal - position along the axis
        array - VisADLineArray representing the scale plot
        scale_color - array (dim 3) representing the red, green and blue color values.
        Throws:
        VisADException - couldn't set the scale
      • setScale

        public void setScale(int axis,
                             int axis_ordinal,
                             VisADLineArray array,
                             VisADTriangleArray labels,
                             float[] scale_color)
                      throws VisADException
        Set the scale for the appropriate axis.
        Specified by:
        setScale in class DisplayRenderer
        Parameters:
        axis - axis for this scale (0 = XAxis, 1 = YAxis, 2 = ZAxis)
        axis_ordinal - position along the axis
        array - VisADLineArray representing the scale plot
        labels - VisADTriangleArray representing the labels created using a font (can be null)
        scale_color - array (dim 3) representing the red, green and blue color values.
        Throws:
        VisADException - couldn't set the scale
      • clearScales

        public void clearScales()
        Remove all the scales being rendered.
        Specified by:
        clearScales in class DisplayRenderer
      • clearScale

        public void clearScale(AxisScale axisScale)
        Remove a particular scale being rendered.
        Specified by:
        clearScale in class DisplayRenderer
        Parameters:
        axisScale - scale to be removed
      • setTransform2D

        public void setTransform2D(java.awt.geom.AffineTransform t)
      • makeControl

        public Control makeControl(ScalarMap map)
        Factory for constructing a subclass of Control appropriate for the graphics API and for this DisplayRenderer; invoked by ScalarMap when it is addMap()ed to a Display.
        Specified by:
        makeControl in class DisplayRenderer
        Parameters:
        map - The ScalarMap for which a Control should be built.
        Returns:
        The appropriate Control.
      • legalDataRenderer

        public boolean legalDataRenderer(DataRenderer renderer)
        Description copied from class: DisplayRenderer
        determine whether a DataRenderer is legal for this DisplayRenderer
        Specified by:
        legalDataRenderer in class DisplayRenderer
        Parameters:
        renderer - DisplayRenderer to test for legality
        Returns:
        true if renderer is legal
      • setLineWidth

        public void setLineWidth(float width)
      • addKeyboardBehavior

        public void addKeyboardBehavior(KeyboardBehaviorJ2D behavior)
        Add a KeyboardBehavior for keyboard control of translation and zoom. This adds a KeyListener to the VisADCanvasJ2D to handle the behaviors for the arrow keys. Do not use this in conjunction with other KeyListeners that handle events for the arrow keys.
        Parameters:
        behavior - keyboard behavior to add
      • setWaitFlag

        public void setWaitFlag(boolean b)
        Description copied from class: DisplayRenderer
        Set the wait flag to the specified value. (When the wait flag is enabled, the user is informed that the application is busy, typically by displaying a Please wait . . . message at the bottom of the Display.) DisplayEvent.WAIT_ON and DisplayEvent.WAIT_OFF events are fired based on value of b.
        Overrides:
        setWaitFlag in class DisplayRenderer
        Parameters:
        b - Boolean value to which wait flag is set.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.