Documentation of 'visad.DisplayImpl' Java class
DisplayImpl
visad

Class DisplayImpl

    • Constructor Detail

      • DisplayImpl

        public DisplayImpl(java.lang.String name,
                           DisplayRenderer renderer)
                    throws VisADException,
                           java.rmi.RemoteException
        construct a DisplayImpl with given name and DisplayRenderer
        Parameters:
        name - String name for DisplayImpl (used for debugging)
        renderer - DisplayRenderer that controls aspects of the display not specific to any particular Data
        Throws:
        VisADException - a VisAD error occurred
        java.rmi.RemoteException - an RMI error occurred
      • DisplayImpl

        public DisplayImpl(RemoteDisplay rmtDpy,
                           DisplayRenderer renderer)
                    throws VisADException,
                           java.rmi.RemoteException
        construct a DisplayImpl collaborating with the given RemoteDisplay, and with the given DisplayRenderer
        Parameters:
        rmtDpy - RemoteDisplay to collaborate with
        renderer - DisplayRenderer that controls aspects of the display not specific to any particular Data
        Throws:
        VisADException - a VisAD error occurred
        java.rmi.RemoteException - an RMI error occurred
    • Method Detail

      • notifyListeners

        public void notifyListeners(int id,
                                    int x,
                                    int y)
                             throws VisADException,
                                    java.rmi.RemoteException
        Notify this instance's DisplayListeners.
        Parameters:
        id - type of DisplayEvent that is to be sent
        x - the horizontal x coordinate for the mouse location in the display component
        y - the vertical y coordinate for the mouse location in the display component
        Throws:
        VisADException - if a VisAD failure occurs.
        java.rmi.RemoteException - if a Java RMI failure occurs.
      • getComponent

        public java.awt.Component getComponent()
        Description copied from interface: LocalDisplay
        return the java.awt.Component (e.g., JPanel or AppletPanel) this Display uses; returns null for an offscreen Display
        Specified by:
        getComponent in interface LocalDisplay
        Returns:
        the java.awt.Component (e.g., JPanel or AppletPanel) this DisplayImpl uses; returns null for an offscreen DisplayImpl
      • setComponent

        public void setComponent(java.awt.Component c)
        set the java.awt.Component this DisplayImpl uses
        Parameters:
        c - Component to set
      • reAutoScale

        public void reAutoScale()
        request auto-scaling of ScalarMap ranges the next time Data are transformed into scene graph elements
      • setAlwaysAutoScale

        public void setAlwaysAutoScale(boolean a)
        if auto is true, re-apply auto-scaling of ScalarMap ranges every time Display is triggered
        Parameters:
        a - flag indicating whether to always re-apply auto-scaling
      • reDisplayAll

        public void reDisplayAll()
        request all linked Data to be re-transformed into scene graph elements
      • addSlave

        public void addSlave(RemoteSlaveDisplay display)
        link a slave display to this
        Specified by:
        addSlave in interface Display
        Parameters:
        display - RemoteSlaveDisplay to link
      • removeSlave

        public void removeSlave(RemoteSlaveDisplay display)
        remove a link between a slave display and this
        Specified by:
        removeSlave in interface Display
        Parameters:
        display - RemoteSlaveDisplay to remove
      • removeAllSlaves

        public void removeAllSlaves()
        remove all links to slave displays
        Specified by:
        removeAllSlaves in interface Display
      • hasSlaves

        public boolean hasSlaves()
        Specified by:
        hasSlaves in interface Display
        Returns:
        flag indicating whether there are any slave displays linked to this display
      • updateSlaves

        public void updateSlaves(java.awt.image.BufferedImage img)
        update all linked slave displays with the given image
        Parameters:
        img - BufferedImage to send to all linked slave displays
      • updateSlaves

        public void updateSlaves(java.lang.String message)
        update all linked slave display with the given message
        Parameters:
        message - String to send to all linked slave displays
      • enableEvent

        public void enableEvent(int id)
        Enables reporting of a DisplayEvent of a given type when it occurs in this display.
        Parameters:
        id - DisplayEvent type to enable. Valid types are:
        • DisplayEvent.FRAME_DONE
        • DisplayEvent.TRANSFORM_DONE
        • DisplayEvent.MOUSE_PRESSED
        • DisplayEvent.MOUSE_PRESSED_LEFT
        • DisplayEvent.MOUSE_PRESSED_CENTER
        • DisplayEvent.MOUSE_PRESSED_RIGHT
        • DisplayEvent.MOUSE_RELEASED_LEFT
        • DisplayEvent.MOUSE_RELEASED_CENTER
        • DisplayEvent.MOUSE_RELEASED_RIGHT
        • DisplayEvent.MAP_ADDED
        • DisplayEvent.MAPS_CLEARED
        • DisplayEvent.REFERENCE_ADDED
        • DisplayEvent.REFERENCE_REMOVED
        • DisplayEvent.DESTROYED
        • DisplayEvent.KEY_PRESSED
        • DisplayEvent.KEY_RELEASED
        • DisplayEvent.MOUSE_DRAGGED
        • DisplayEvent.MOUSE_ENTERED
        • DisplayEvent.MOUSE_EXITED
        • DisplayEvent.MOUSE_MOVED
        • DisplayEvent.WAIT_ON
        • DisplayEvent.WAIT_OFF
        • DisplayEvent.MAP_REMOVED
        • DisplayEvent.COMPONENT_RESIZED
      • disableEvent

        public void disableEvent(int id)
        Disables reporting of a DisplayEvent of a given type when it occurs in this display.
        Parameters:
        id - DisplayEvent type to disable. Valid types are:
        • DisplayEvent.FRAME_DONE
        • DisplayEvent.TRANSFORM_DONE
        • DisplayEvent.MOUSE_PRESSED
        • DisplayEvent.MOUSE_PRESSED_LEFT
        • DisplayEvent.MOUSE_PRESSED_CENTER
        • DisplayEvent.MOUSE_PRESSED_RIGHT
        • DisplayEvent.MOUSE_RELEASED_LEFT
        • DisplayEvent.MOUSE_RELEASED_CENTER
        • DisplayEvent.MOUSE_RELEASED_RIGHT
        • DisplayEvent.MAP_ADDED
        • DisplayEvent.MAPS_CLEARED
        • DisplayEvent.REFERENCE_ADDED
        • DisplayEvent.REFERENCE_REMOVED
        • DisplayEvent.DESTROYED
        • DisplayEvent.KEY_PRESSED
        • DisplayEvent.KEY_RELEASED
        • DisplayEvent.MOUSE_DRAGGED
        • DisplayEvent.MOUSE_ENTERED
        • DisplayEvent.MOUSE_EXITED
        • DisplayEvent.MOUSE_MOVED
        • DisplayEvent.WAIT_ON
        • DisplayEvent.WAIT_OFF
        • DisplayEvent.MAP_REMOVED
        • DisplayEvent.COMPONENT_RESIZED
      • isEventEnabled

        public boolean isEventEnabled(int id)
        Parameters:
        id - DisplayEvent type
        Returns:
        flag indicating whether a DisplayEvent of a given type is eported when it occurs in this display.
      • replaceReference

        public void replaceReference(RemoteDisplay rDpy,
                                     ThingReference ref)
                              throws VisADException,
                                     java.rmi.RemoteException
        Replace remote reference with local reference.
        Parameters:
        rDpy - Remote display.
        ref - Local reference which will replace the previous reference.
        Throws:
        VisADException - if there was a problem with one or more parameters.
        java.rmi.RemoteException - if there was a problem adding the data reference to the remote display.
        See Also:
        addReference(visad.ThingReference)
      • replaceReferences

        public void replaceReferences(RemoteDisplay rDpy,
                                      DataRenderer renderer,
                                      DataReference ref)
                               throws VisADException,
                                      java.rmi.RemoteException
        Replace remote reference with local reference using non-default renderer.
        Parameters:
        rDpy - Remote display.
        renderer - logic to render this data
        ref - Local reference which will replace the previous reference.
        Throws:
        VisADException - if there was a problem with one or more parameters.
        java.rmi.RemoteException - if there was a problem adding the data reference to the remote display.
        See Also:
        addReferences(visad.DataRenderer, visad.DataReference)
      • removeReference

        public void removeReference(ThingReference ref)
                             throws VisADException,
                                    java.rmi.RemoteException
        remove link to ref, which must be a local DataReferenceImpl; if ref was added as part of a DataReference array passed to addReferences(), remove links to all of them
        Specified by:
        removeReference in interface Action
        Overrides:
        removeReference in class ActionImpl
        Parameters:
        ref - ThingReference to remove
        Throws:
        VisADException - a VisAD error occurred
        java.rmi.RemoteException - an RMI error occurred
      • controlChanged

        public void controlChanged()
        trigger possible re-transform of linked Data used by Controls to notify this DisplayImpl that they have changed
      • checkTicks

        public boolean checkTicks()
        over-ride ActionImpl.checkTicks() to always return true, since DisplayImpl always runs doAction to find out if any linked Data needs to be re-transformed
        Overrides:
        checkTicks in class ActionImpl
        Returns:
        true
      • isDestroyed

        public boolean isDestroyed()
        has this display been destroyed
        Returns:
        has this display been destroyed
      • destroy

        public void destroy()
                     throws VisADException,
                            java.rmi.RemoteException
        destroy this display: clear all references to objects (so they can be garbage collected), stop all Threads and remove all links
        Specified by:
        destroy in interface Display
        Throws:
        VisADException - a VisAD error occurred
        java.rmi.RemoteException - an RMI error occurred
      • doAction

        public void doAction()
                      throws VisADException,
                             java.rmi.RemoteException
        Check if any Data need re-transform, and if so, do it. Check if auto-scaling is needed for any ScalarMaps, and if so, do it. This method does the real work of DisplayImpl.
        Specified by:
        doAction in class ActionImpl
        Throws:
        VisADException - a VisAD error occurred
        java.rmi.RemoteException - an RMI error occurred
      • getDisplayRenderer

        public DisplayRenderer getDisplayRenderer()
        Description copied from interface: LocalDisplay
        return the DisplayRenderer associated with this Display
        Specified by:
        getDisplayRenderer in interface LocalDisplay
        Returns:
        the DisplayRenderer associated with this DisplayImpl
      • getRendererVector

        public java.util.Vector getRendererVector()
        Returns a clone of the list of DataRenderer-s. A clone is returned to avoid concurrent access problems by the Display thread.
        Specified by:
        getRendererVector in interface LocalDisplay
        Returns:
        A clone of the list of DataRenderer-s.
        See Also:
        getRenderers()
      • getDisplayScalarCount

        public int getDisplayScalarCount()
        Returns:
        the number of DisplayRealTypes in ScalarMaps linked to this DisplayImpl
      • getDisplayScalar

        public DisplayRealType getDisplayScalar(int index)
        get the DisplayRealType with the given index
        Parameters:
        index - index into Vector of DisplayRealTypes
        Returns:
        the indexed DisplayRealType
      • getDisplayScalarIndex

        public int getDisplayScalarIndex(DisplayRealType dreal)
        get the index for the given DisplayRealType
        Parameters:
        dreal - DisplayRealType to search for
        Returns:
        the index of dreal in Vector of DisplayRealTypes
      • getScalarCount

        public int getScalarCount()
        Returns:
        the number of ScalarTypes in ScalarMaps linked to this DisplayImpl
      • getScalar

        public ScalarType getScalar(int index)
        get the ScalarType with the given index
        Parameters:
        index - index into Vector of ScalarTypes
        Returns:
        the indexed ScalarType
      • getScalarIndex

        public int getScalarIndex(ScalarType real)
                           throws java.rmi.RemoteException
        get the index for the given ScalarType
        Parameters:
        real - ScalarType to search for
        Returns:
        the index of real in Vector of ScalarTypes
        Throws:
        java.rmi.RemoteException - an RMI error occurred
      • addMap

        public void addMap(ScalarMap map)
                    throws VisADException,
                           java.rmi.RemoteException
        add a ScalarMap to this Display, assuming a local source
        Specified by:
        addMap in interface Display
        Parameters:
        map - ScalarMap to add
        Throws:
        VisADException - a VisAD error occurred
        java.rmi.RemoteException - an RMI error occurred
      • addMap

        public void addMap(ScalarMap map,
                           int remoteId)
                    throws VisADException,
                           java.rmi.RemoteException
        add a ScalarMap to this Display
        Parameters:
        map - ScalarMap to add
        remoteId - remote source for collab, or VisADEvent.LOCAL_SOURCE
        Throws:
        VisADException - a VisAD error occurred
        java.rmi.RemoteException - an RMI error occurred
      • removeMap

        public void removeMap(ScalarMap map)
                       throws VisADException,
                              java.rmi.RemoteException
        remove a ScalarMap from this Display, assuming a local source
        Specified by:
        removeMap in interface Display
        Parameters:
        map - ScalarMap to remove
        Throws:
        VisADException - a VisAD error occurred
        java.rmi.RemoteException - an RMI error occurred
      • removeMap

        public void removeMap(ScalarMap map,
                              int remoteId)
                       throws VisADException,
                              java.rmi.RemoteException
        remove a ScalarMap from this Display
        Parameters:
        map - ScalarMap to add
        remoteId - remote source for collab, or VisADEvent.LOCAL_SOURCE
        Throws:
        VisADException - a VisAD error occurred
        java.rmi.RemoteException - an RMI error occurred
      • clearMaps

        public void clearMaps()
                       throws VisADException,
                              java.rmi.RemoteException
        remove all ScalarMaps linked this display;
        Specified by:
        clearMaps in interface Display
        Throws:
        VisADException - a VisAD error occurred
        java.rmi.RemoteException - an RMI error occurred
      • getMapVector

        public java.util.Vector getMapVector()
        Description copied from interface: LocalDisplay
        return a Vector of the ScalarMap-s associated with this Display
        Specified by:
        getMapVector in interface LocalDisplay
        Returns:
        clone of Vector of ScalarMaps linked to this DisplayImpl (doesn't include ConstantMaps)
      • getConstantMapVector

        public java.util.Vector getConstantMapVector()
        Specified by:
        getConstantMapVector in interface Display
        Returns:
        clone of Vector of ConstantMaps linked to this DisplayImpl
      • getConnectionID

        public int getConnectionID(RemoteDisplay rmtDpy)
                            throws java.rmi.RemoteException
        Return the ID used to identify the collaborative connection to the specified remote display.

        WARNING! Due to limitations in the Java RMI implementation, this only works with an exact copy of the RemoteDisplay used to create the collaboration link.
        Parameters:
        rmtDpy - the specified remote display.
        Returns:
        DisplayMonitor.UNKNOWN_LISTENER_ID if not found; otherwise, returns the ID.
        Throws:
        java.rmi.RemoteException - an RMI error occurred
      • addControl

        public void addControl(Control control)
        add a Control to this DisplayImpl
        Parameters:
        control - Control to add
      • getControl

        public Control getControl(java.lang.Class c)
        get a linked Control with the given Class; only called for Control objects associated with 'single' DisplayRealTypes
        Specified by:
        getControl in interface LocalDisplay
        Parameters:
        c - sub-Class of Control to search for
        Returns:
        linked Control with Class c, or null
      • getControl

        public Control getControl(java.lang.Class c,
                                  int inst)
        get ordinal instance of linked Control object of the specified class
        Specified by:
        getControl in interface LocalDisplay
        Parameters:
        c - sub-Class of Control to search for
        inst - ordinal instance number
        Returns:
        linked Control with Class c, or null
      • getControls

        public java.util.Vector getControls(java.lang.Class c)
        get all linked Control objects of the specified Class
        Specified by:
        getControls in interface LocalDisplay
        Parameters:
        c - sub-Class of Control to search for
        Returns:
        Vector of linked Controls with Class c
      • getNumberOfControls

        public int getNumberOfControls()
        Returns:
        the total number of controls used by this display
      • getControlVector

        public java.util.Vector getControlVector()
        Deprecated. - DisplayImpl shouldn't expose itself at this level
        Returns:
        clone of Vector of Controls linked to this DisplayImpl
      • getWidgetPanel

        public java.awt.Container getWidgetPanel()
        get a GUI component containing this Display's Control widgets; create the widgets as necessary
        Specified by:
        getWidgetPanel in interface LocalDisplay
        Returns:
        Container of widget panel
      • getValueArrayLength

        public int getValueArrayLength()
        Returns:
        length of valueArray passed to ShadowType.doTransform()
      • getValueToScalar

        public int[] getValueToScalar()
        Returns:
        int[] array mapping from valueArray indices to ScalarType Vector indices
      • getValueToMap

        public int[] getValueToMap()
        Returns:
        int[] array mapping from valueArray indices to ScalarMap Vector indices
      • getProjectionControl

        public abstract ProjectionControl getProjectionControl()
        Description copied from interface: LocalDisplay
        return the ProjectionControl associated with this Display
        Specified by:
        getProjectionControl in interface LocalDisplay
        Returns:
        the ProjectionControl associated with this DisplayImpl
      • getGraphicsModeControl

        public abstract GraphicsModeControl getGraphicsModeControl()
        Description copied from interface: LocalDisplay
        return the GraphicsModeControl associated with this Display
        Specified by:
        getGraphicsModeControl in interface LocalDisplay
        Returns:
        the GraphicsModeControl associated with this DisplayImpl
      • delay

        public static void delay(int millis)
        Deprecated. Use new visad.util.Delay(millis) instead.
        wait for millis milliseconds
        Parameters:
        millis - number of milliseconds to wait
      • printStack

        public static void printStack(java.lang.String message)
        print a stack dump with the given message
        Parameters:
        message - String to print with stack dump
      • equals

        public boolean equals(java.lang.Object obj)
        test for equality between this and the given Object given their complexity, its reasonable that DisplayImpl objects are only equal to themselves
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - Object to test for equality with this
        Returns:
        flag indicating whether this is equal to obj
      • getRenderers

        public java.util.Vector getRenderers()
        Returns the list of DataRenderer-s. NOTE: The actual list is returned rather than a copy. If a copy is desired, then use getRendererVector().
        Specified by:
        getRenderers in interface LocalDisplay
        Returns:
        The list of DataRenderer-s.
        See Also:
        getRendererVector()
      • getAPI

        public int getAPI()
                   throws VisADException
        Return the API used for this display
        Returns:
        the mode being used (UNKNOWN, JPANEL, APPLETFRAME, OFFSCREEN, TRANSFORM_ONLY)
        Throws:
        VisADException
      • getDisplayMonitor

        public DisplayMonitor getDisplayMonitor()
        Returns:
        the DisplayMonitor associated with this Display.
      • getDisplaySync

        public DisplaySync getDisplaySync()
        Returns:
        the DisplaySync associated with this Display.
      • setMouseBehavior

        public void setMouseBehavior(MouseBehavior m)
        set given MouseBehavior
        Parameters:
        m - MouseBehavior to set
      • getMouseBehavior

        public MouseBehavior getMouseBehavior()
        Returns:
        the MouseBehavior used for this Display
      • make_matrix

        public double[] make_matrix(double rotx,
                                    double roty,
                                    double rotz,
                                    double scale,
                                    double transx,
                                    double transy,
                                    double transz)
        make projection matrix from given arguments
        Specified by:
        make_matrix in interface LocalDisplay
        Parameters:
        rotx - rotation about x axis
        roty - rotation about y axis
        rotz - rotation about z axis
        scale - linear scale factor
        transx - translation along x axis
        transy - translation along y axis
        transz - translation along z axis
        Returns:
        projection matrix
      • multiply_matrix

        public double[] multiply_matrix(double[] a,
                                        double[] b)
        multiply matrices
        Specified by:
        multiply_matrix in interface LocalDisplay
        Parameters:
        a - first operand matrix
        b - second operand matrix
        Returns:
        product matrix
      • getImage

        public java.awt.image.BufferedImage getImage()
        get a BufferedImage of this Display, without synchronizing (assume the application has made sure Data have been transformed and rendered)
        Specified by:
        getImage in interface LocalDisplay
        Returns:
        a captured image of this Display
      • getImage

        public java.awt.image.BufferedImage getImage(boolean sync)
        get a BufferedImage of this Display
        Parameters:
        sync - if true, ensure that all linked Data have been transformed and rendered
        Returns:
        a captured image of this Display
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        a String representation of this Display
      • toString

        public java.lang.String toString(java.lang.String pre)
        Parameters:
        pre - String added to start of each line
        Returns:
        a String representation of this Display indented by pre (a string of blanks)
      • getPrintable

        public java.awt.print.Printable getPrintable()
        Return the Printable object to be used by a PrinterJob. This can be used as follows:
            PrinterJob printJob = PrinterJob.getPrinterJob();
            PageFormat pf = printJob.defaultPage();
            printJob.setPrintable(display.getPrintable(), pf);
            if (printJob.printDialog()) {
                try {
                    printJob.print();
                }
                catch (Exception pe) {
                    pe.printStackTrace();
                }
            }
         
        Returns:
        printable object
      • connectionFailed

        public void connectionFailed(DataRenderer renderer,
                                     DataDisplayLink link)
        Notify this Display that a connection to a remote server has failed
        Parameters:
        renderer - DataRenderer with failure
        link - DataDisplayLink with failure
      • addRendererSourceListener

        public void addRendererSourceListener(RendererSourceListener listener)
        Inform listener of deleted DataRenderers.
        Parameters:
        listener - Object to add.
      • removeRendererSourceListener

        public void removeRendererSourceListener(RendererSourceListener listener)
        Remove listener from the DataRenderer deletion list.
        Parameters:
        listener - Object to remove.
      • addDataSourceListener

        public void addDataSourceListener(RemoteSourceListener listener)
        Deprecated. 
        Parameters:
        listener -
      • removeDataSourceListener

        public void removeDataSourceListener(RemoteSourceListener listener)
        Deprecated. 
        Parameters:
        listener -
      • addRemoteSourceListener

        public void addRemoteSourceListener(RemoteSourceListener listener)
        Inform listener of changes in the availability of remote data/collaboration sources.
        Parameters:
        listener - Object to send change notifications.
      • removeRemoteSourceListener

        public void removeRemoteSourceListener(RemoteSourceListener listener)
        Remove listener from the remote source notification list.
        Parameters:
        listener - Object to be removed.
      • lostCollabConnection

        public void lostCollabConnection(int id)
        Inform RemoteSourceListeners that the specified collaborative connection has been lost.

        WARNING! This should only be called from within the visad.collab package!
        Parameters:
        id - ID of lost connection.
      • addMessageListener

        public void addMessageListener(MessageListener listener)
        Forward messages to the specified listener
        Specified by:
        addMessageListener in interface LocalDisplay
        Parameters:
        listener - New message receiver.
      • sendMessage

        public void sendMessage(MessageEvent msg)
                         throws java.rmi.RemoteException
        Send a message to all MessageListeners.
        Specified by:
        sendMessage in interface Display
        Parameters:
        msg - Message being sent.
        Throws:
        java.rmi.RemoteException
      • updateBusyStatus

        public void updateBusyStatus()
        Indicate to activity monitor that the Display is busy.
      • setDepthBufferOffset

        public void setDepthBufferOffset(DataRenderer renderer,
                                         GraphicsModeControl mode)
        Can be optionally implemented by graphics-api dependent DisplayImpls.
        Parameters:
        renderer -
        mode -

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.