visad
Class DisplayImpl

java.lang.Object
  extended by visad.ActionImpl
      extended by visad.DisplayImpl
All Implemented Interfaces:
java.lang.Runnable, java.util.EventListener, Action, Display, LocalDisplay, ThingChangedListener
Direct Known Subclasses:
DisplayImplJ2D, DisplayImplJ3D

public abstract class DisplayImpl
extends ActionImpl
implements LocalDisplay

DisplayImpl is the abstract VisAD superclass for display implementations. It is runnable.

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


Nested Class Summary
 class DisplayImpl.Syncher
           
 
Field Summary
 
Fields inherited from interface visad.Display
Alpha, Animation, Blue, CMY, components3c, components3s, componentscmy, componentscyl, componentsflow1, componentsflow1s, componentsflow2, componentsflow2s, componentshsv, componentsrgb, componentsso, Cyan, CylAzimuth, CylRadius, CylZAxis, DisplayCMYCoordSys, DisplayCMYTuple, DisplayCylindricalCoordSys, DisplayFlow1SphericalCoordSys, DisplayFlow1SphericalTuple, DisplayFlow1Tuple, DisplayFlow2SphericalCoordSys, DisplayFlow2SphericalTuple, DisplayFlow2Tuple, DisplayHSVCoordSys, DisplayHSVTuple, DisplayRealArray, DisplayRGBTuple, DisplaySpatialCartesianTuple, DisplaySpatialCylindricalTuple, DisplaySpatialOffsetTuple, DisplaySpatialSphericalTuple, DisplaySphericalCoordSys, Flow1Azimuth, Flow1Elevation, Flow1Radial, Flow1X, Flow1Y, Flow1Z, Flow2Azimuth, Flow2Elevation, Flow2Radial, Flow2X, Flow2Y, Flow2Z, Green, HSV, Hue, IsoContour, Latitude, LineStyle, LineWidth, List, Longitude, Magenta, PointSize, Radius, Red, RGB, RGBA, Saturation, SelectRange, SelectValue, Shape, ShapeScale, Text, TextureEnable, Value, XAxis, XAxisOffset, YAxis, YAxisOffset, Yellow, ZAxis, ZAxisOffset
 
Constructor Summary
DisplayImpl(RemoteDisplay rmtDpy, DisplayRenderer renderer)
          construct DisplayImpl from RemoteDisplay
DisplayImpl(RemoteDisplay rmtDpy, DisplayRenderer renderer, boolean cl)
           
DisplayImpl(java.lang.String name, DisplayRenderer renderer)
          constructor with non-default DisplayRenderer
 
Method Summary
 void addActivityHandler(ActivityHandler ah)
          Add a busy/idle activity handler.
 void addControl(Control control)
           
 void addDataSourceListener(RemoteSourceListener listener)
          Deprecated.  
 void addDisplayListener(DisplayListener listener)
          add a DisplayListener
 void addMap(ScalarMap map)
          add a ScalarMap to this Display; can only be invoked when no DataReference-s are linked to this Display
 void addMap(ScalarMap map, int remoteId)
           
 void addMessageListener(MessageListener listener)
          Forward messages to the specified listener
 void addReference(DataReference ref, ConstantMap[] constant_maps)
          Link a reference to this Display.
 void addReference(ThingReference ref)
          Link a reference to this Display.
 void addReferences(DataRenderer renderer, DataReference ref)
          Link a reference to this Display using a non-default renderer.
 void addReferences(DataRenderer renderer, DataReference[] refs)
          Link references to this display using a non-default renderer.
 void addReferences(DataRenderer renderer, DataReference[] refs, ConstantMap[][] constant_maps)
          Link references to this display using the non-default renderer.
 void addReferences(DataRenderer renderer, DataReference ref, ConstantMap[] constant_maps)
          Link a reference to this Display using a non-default renderer.
 void addRemoteSourceListener(RemoteSourceListener listener)
          Inform listener of changes in the availability of remote data/collaboration sources.
 void addRendererSourceListener(RendererSourceListener listener)
          Inform listener of deleted DataRenderers.
 void addSlave(RemoteSlaveDisplay display)
          links a slave display to this display
 boolean checkTicks()
          DisplayImpl always runs doAction to find out if there is work to do
 void clearMaps()
          clear set of ScalarMap-s associated with this display; can only be invoked when no DataReference-s are linked to this Display
 void connectionFailed(DataRenderer renderer, DataDisplayLink link)
          Notify this Display that a connection to a remote server has failed
 void controlChanged()
          used by Control-s to notify this DisplayImpl that they have changed
static void delay(int millis)
          Deprecated. Use new visad.util.Delay(millis) instead.
 void destroy()
          destroy this display
 void disableEvent(int id)
          Disables reporting of a DisplayEvent of a given type when it occurs in this display.
 void doAction()
          a Display is runnable; doAction is invoked by any event that requires a re-transform
 void enableEvent(int id)
          Enables reporting of a DisplayEvent of a given type when it occurs in this display.
 boolean equals(java.lang.Object obj)
          given their complexity, its reasonable that DisplayImpl objects are only equal to themselves
 int getAPI()
           
 java.awt.Component getComponent()
          return the java.awt.Component (e.g., JPanel or AppletPanel) this DisplayImpl uses; returns null for an offscreen DisplayImpl
 int getConnectionID(RemoteDisplay rmtDpy)
          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.
 java.util.Vector getConstantMapVector()
           
 Control getControl(java.lang.Class c)
          only called for Control objects associated with 'single' DisplayRealType-s
 Control getControl(java.lang.Class c, int inst)
          find specified occurance for Control object of the specified class
 java.util.Vector getControls(java.lang.Class c)
          find all Control objects of the specified class
 java.util.Vector getControlVector()
          Deprecated. - DisplayImpl shouldn't expose itself at this level.
protected abstract  DisplayRenderer getDefaultDisplayRenderer()
          return the default DisplayRenderer for this DisplayImpl
 DisplayMonitor getDisplayMonitor()
          Returns the DisplayMonitor associated with this Display.
 DisplayRenderer getDisplayRenderer()
          return the DisplayRenderer associated with this DisplayImpl
 DisplayRealType getDisplayScalar(int index)
           
 int getDisplayScalarCount()
           
 int getDisplayScalarIndex(DisplayRealType dreal)
           
 DisplaySync getDisplaySync()
          Returns the DisplaySync associated with this Display.
abstract  GraphicsModeControl getGraphicsModeControl()
          return the GraphicsModeControl associated with this DisplayImpl
 java.awt.image.BufferedImage getImage()
          return a captured image of the display
 java.awt.image.BufferedImage getImage(boolean sync)
          return a captured image of the display; synchronize if sync
 java.util.Vector getMapVector()
          return a Vector of the ScalarMap-s associated with this Display
 MouseBehavior getMouseBehavior()
           
 int getNumberOfControls()
          return the total number of controls used by this display
 java.awt.print.Printable getPrintable()
          Return the Printable object to be used by a PrinterJob.
abstract  ProjectionControl getProjectionControl()
          return the ProjectionControl associated with this DisplayImpl
 java.util.Vector getRenderers()
          Returns the list of DataRenderer-s.
 java.util.Vector getRendererVector()
          Returns a clone of the list of DataRenderer-s.
 ScalarType getScalar(int index)
           
 int getScalarCount()
           
 int getScalarIndex(ScalarType real)
           
 int getValueArrayLength()
           
 int[] getValueToMap()
           
 int[] getValueToScalar()
           
 java.awt.Container getWidgetPanel()
          get a GUI component containing this Display's Control widgets, creating the widgets as necessary
 boolean hasSlaves()
          whether there are any slave displays linked to this display
 boolean isEventEnabled(int id)
          Gets whether a DisplayEvent of a given type is reported when it occurs in this display.
 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!
 double[] make_matrix(double rotx, double roty, double rotz, double scale, double transx, double transy, double transz)
           
 double[] multiply_matrix(double[] a, double[] b)
           
 void notifyListeners(DisplayEvent evt)
          Notify this instance's DisplayListeners.
 void notifyListeners(int id, int x, int y)
           
static void printStack(java.lang.String message)
          print a stack dump
 void reAutoScale()
          re-apply auto-scaling of ScalarMap ranges next time Display is triggered
 void reDisplayAll()
           
 void removeActivityHandler(ActivityHandler ah)
          Remove a busy/idle activity handler.
 void removeAllReferences()
          remove all DataReference links
 void removeAllSlaves()
          removes all links between slave displays and this display
 void removeDataSourceListener(RemoteSourceListener listener)
          Deprecated.  
 void removeDisplayListener(DisplayListener listener)
          remove a DisplayListener
 void removeMessageListener(MessageListener listener)
          Remove listener from the message list.
 void removeReference(ThingReference ref)
          remove link to ref; must be local DataReferenceImpl; if ref was added as part of a DataReference array passed to addReferences, remove links to all of them
 void removeRemoteSourceListener(RemoteSourceListener listener)
          Remove listener from the remote source notification list.
 void removeRendererSourceListener(RendererSourceListener listener)
          Remove listener from the DataRenderer deletion list.
 void removeSlave(RemoteSlaveDisplay display)
          removes a link between a slave display and this display
 void replaceReference(RemoteDisplay rDpy, DataReference ref, ConstantMap[] constant_maps)
          Replace remote reference with local reference.
 void replaceReference(RemoteDisplay rDpy, ThingReference ref)
          Replace remote reference with local reference.
 void replaceReferences(RemoteDisplay rDpy, DataRenderer renderer, DataReference ref)
          Replace remote reference with local reference using non-default renderer.
 void replaceReferences(RemoteDisplay rDpy, DataRenderer renderer, DataReference[] refs)
          Replace remote references with local references.
 void replaceReferences(RemoteDisplay rDpy, DataRenderer renderer, DataReference[] refs, ConstantMap[][] constant_maps)
          Replace remote references with local references.
 void replaceReferences(RemoteDisplay rDpy, DataRenderer renderer, DataReference ref, ConstantMap[] constant_maps)
          Replace remote reference with local reference using non-default renderer.
 void sendMessage(MessageEvent msg)
          Send a message to all MessageListeners.
 void setAlwaysAutoScale(boolean a)
          if auto is true, re-apply auto-scaling of ScalarMap ranges every time Display is triggered
 void setComponent(java.awt.Component c)
           
 void setMouseBehavior(MouseBehavior m)
           
protected  void syncRemoteData(RemoteDisplay rmtDpy)
           
 java.lang.String toString()
           
 java.lang.String toString(java.lang.String pre)
           
 void updateBusyStatus()
          Indicate to activity monitor that the Display is busy.
 void updateSlaves(java.awt.image.BufferedImage img)
          updates all linked slave displays with the given image
 void updateSlaves(java.lang.String message)
          updates all linked slave display with the given message
 
Methods inherited from class visad.ActionImpl
disableAction, enableAction, findReference, getCurrentActionThread, getLinks, getName, run, setEnabled, setName, setThreadPoolMaximum, stop, stopThreadPool, thingChanged, waitForTasks
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface visad.Action
getName
 
Methods inherited from interface visad.ThingChangedListener
thingChanged
 

Constructor Detail

DisplayImpl

public DisplayImpl(java.lang.String name,
                   DisplayRenderer renderer)
            throws VisADException,
                   java.rmi.RemoteException
constructor with non-default DisplayRenderer

Throws:
VisADException
java.rmi.RemoteException

DisplayImpl

public DisplayImpl(RemoteDisplay rmtDpy,
                   DisplayRenderer renderer)
            throws VisADException,
                   java.rmi.RemoteException
construct DisplayImpl from RemoteDisplay

Throws:
VisADException
java.rmi.RemoteException

DisplayImpl

public DisplayImpl(RemoteDisplay rmtDpy,
                   DisplayRenderer renderer,
                   boolean cl)
            throws VisADException,
                   java.rmi.RemoteException
Throws:
VisADException
java.rmi.RemoteException
Method Detail

syncRemoteData

protected void syncRemoteData(RemoteDisplay rmtDpy)
                       throws VisADException,
                              java.rmi.RemoteException
Throws:
VisADException
java.rmi.RemoteException

notifyListeners

public void notifyListeners(int id,
                            int x,
                            int y)
                     throws VisADException,
                            java.rmi.RemoteException
Throws:
VisADException
java.rmi.RemoteException

notifyListeners

public void notifyListeners(DisplayEvent evt)
                     throws VisADException,
                            java.rmi.RemoteException
Notify this instance's DisplayListeners.

Parameters:
evt - The DisplayEvent to be passed to the DisplayListeners.
Throws:
VisADException - if a VisAD failure occurs.
java.rmi.RemoteException - if a Java RMI failure occurs.

addDisplayListener

public void addDisplayListener(DisplayListener listener)
add a DisplayListener

Specified by:
addDisplayListener in interface LocalDisplay

removeDisplayListener

public void removeDisplayListener(DisplayListener listener)
remove a DisplayListener

Specified by:
removeDisplayListener in interface LocalDisplay
Parameters:
listener - The listener to be removed. Nothing happens if the listener isn't registered with this instance.

getComponent

public java.awt.Component getComponent()
return the java.awt.Component (e.g., JPanel or AppletPanel) this DisplayImpl uses; returns null for an offscreen DisplayImpl

Specified by:
getComponent in interface LocalDisplay

setComponent

public void setComponent(java.awt.Component c)

reAutoScale

public void reAutoScale()
re-apply auto-scaling of ScalarMap ranges next time Display is triggered


setAlwaysAutoScale

public void setAlwaysAutoScale(boolean a)
if auto is true, re-apply auto-scaling of ScalarMap ranges every time Display is triggered


reDisplayAll

public void reDisplayAll()

addSlave

public void addSlave(RemoteSlaveDisplay display)
links a slave display to this display

Specified by:
addSlave in interface Display

removeSlave

public void removeSlave(RemoteSlaveDisplay display)
removes a link between a slave display and this display

Specified by:
removeSlave in interface Display

removeAllSlaves

public void removeAllSlaves()
removes all links between slave displays and this display

Specified by:
removeAllSlaves in interface Display

hasSlaves

public boolean hasSlaves()
whether there are any slave displays linked to this display

Specified by:
hasSlaves in interface Display

updateSlaves

public void updateSlaves(java.awt.image.BufferedImage img)
updates all linked slave displays with the given image


updateSlaves

public void updateSlaves(java.lang.String message)
updates all linked slave display with the given message


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

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

isEventEnabled

public boolean isEventEnabled(int id)
Gets whether a DisplayEvent of a given type is reported when it occurs in this display.


addReference

public void addReference(ThingReference ref)
                  throws VisADException,
                         java.rmi.RemoteException
Link a reference to this Display. This method may only be invoked after all links to ScalarMaps have been made.

Specified by:
addReference in interface Action
Overrides:
addReference in class ActionImpl
Parameters:
ref - data 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:
ActionImpl.thingChanged(ThingChangedEvent), ThingReference.addThingChangedListener(ThingChangedListener, long)

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)

addReference

public void addReference(DataReference ref,
                         ConstantMap[] constant_maps)
                  throws VisADException,
                         java.rmi.RemoteException
Link a reference to this Display. ref must be a local DataReferenceImpl. This method may only be invoked after all links to ScalarMaps have been made. The ConstantMap array applies only to the rendering reference.

Specified by:
addReference in interface Display
Parameters:
ref - data reference
constant_maps - array of ConstantMaps associated with the data 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:
Section 6.1 of the Developer's Guide

replaceReference

public void replaceReference(RemoteDisplay rDpy,
                             DataReference ref,
                             ConstantMap[] constant_maps)
                      throws VisADException,
                             java.rmi.RemoteException
Replace remote reference with local reference.

Parameters:
rDpy - Remote display.
ref - Local reference which will replace the previous reference.
constant_maps - array of ConstantMaps associated with the data 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.DataReference, visad.ConstantMap[])

addReferences

public void addReferences(DataRenderer renderer,
                          DataReference ref)
                   throws VisADException,
                          java.rmi.RemoteException
Link a reference to this Display using a non-default renderer. ref must be a local DataReferenceImpl. This method may only be invoked after all links to ScalarMaps have been made. This is a method of DisplayImpl and RemoteDisplayImpl rather than Display

Parameters:
renderer - logic to render this data
ref - data 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:
Section 6.1 of the Developer's Guide

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)

addReferences

public void addReferences(DataRenderer renderer,
                          DataReference ref,
                          ConstantMap[] constant_maps)
                   throws VisADException,
                          java.rmi.RemoteException
Link a reference to this Display using a non-default renderer. ref must be a local DataReferenceImpl. This method may only be invoked after all links to ScalarMaps have been made. This is a method of DisplayImpl and RemoteDisplayImpl rather than Display

Specified by:
addReferences in interface Display
Parameters:
renderer - logic to render this data
ref - data reference
constant_maps - array of ConstantMaps associated with the data 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:
Section 6.1 of the Developer's Guide

replaceReferences

public void replaceReferences(RemoteDisplay rDpy,
                              DataRenderer renderer,
                              DataReference ref,
                              ConstantMap[] constant_maps)
                       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.
constant_maps - array of ConstantMaps associated with the data 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, visad.ConstantMap[])

addReferences

public void addReferences(DataRenderer renderer,
                          DataReference[] refs)
                   throws VisADException,
                          java.rmi.RemoteException
Link references to this display using a non-default renderer. refs must be local DataReferenceImpls. This method may only be invoked after all links to ScalarMaps have been made. This is a method of DisplayImpl and RemoteDisplayImpl rather than Display

Parameters:
renderer - logic to render this data
refs - array of data references
Throws:
VisADException - if there was a problem with one or more parameters.
java.rmi.RemoteException - if there was a problem adding the data references to the remote display.
See Also:
Section 6.1 of the Developer's Guide

replaceReferences

public void replaceReferences(RemoteDisplay rDpy,
                              DataRenderer renderer,
                              DataReference[] refs)
                       throws VisADException,
                              java.rmi.RemoteException
Replace remote references with local references.

Parameters:
rDpy - Remote display.
renderer - logic to render this data
refs - array of local data references
Throws:
VisADException - if there was a problem with one or more parameters.
java.rmi.RemoteException - if there was a problem adding the data references to the remote display.
See Also:
addReferences(visad.DataRenderer, visad.DataReference[])

addReferences

public void addReferences(DataRenderer renderer,
                          DataReference[] refs,
                          ConstantMap[][] constant_maps)
                   throws VisADException,
                          java.rmi.RemoteException
Link references to this display using the non-default renderer. refs must be local DataReferenceImpls. This method may only be invoked after all links to ScalarMaps have been made. The maps[i] array applies only to rendering refs[i]. This is a method of DisplayImpl and RemoteDisplayImpl rather than Display

Specified by:
addReferences in interface LocalDisplay
Parameters:
renderer - logic to render this data
refs - array of data references
constant_maps - array of ConstantMaps associated with data references
Throws:
VisADException - if there was a problem with one or more parameters.
java.rmi.RemoteException - if there was a problem adding the data references to the remote display.
See Also:
Section 6.1 of the Developer's Guide

replaceReferences

public void replaceReferences(RemoteDisplay rDpy,
                              DataRenderer renderer,
                              DataReference[] refs,
                              ConstantMap[][] constant_maps)
                       throws VisADException,
                              java.rmi.RemoteException
Replace remote references with local references.

Specified by:
replaceReferences in interface LocalDisplay
Parameters:
rDpy - Remote display.
renderer - logic to render this data
refs - array of data references
constant_maps - array of ConstantMaps associated with data references.
Throws:
VisADException - if there was a problem with one or more parameters.
java.rmi.RemoteException - if there was a problem adding the data references to the remote display.
See Also:
addReferences(visad.DataRenderer, visad.DataReference[], visad.ConstantMap[][])

removeReference

public void removeReference(ThingReference ref)
                     throws VisADException,
                            java.rmi.RemoteException
remove link to ref; must be 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 - The reference to be removed.
Throws:
RemoteVisADException - if the reference isn't a ThingReferenceImpl.
ReferenceException - if the reference isn't a part of this instance.
VisADException - if a VisAD failure occurs.
java.rmi.RemoteException - if a Java RMI failure occurs.

removeAllReferences

public void removeAllReferences()
                         throws VisADException,
                                java.rmi.RemoteException
remove all DataReference links

Specified by:
removeAllReferences in interface Action
Overrides:
removeAllReferences in class ActionImpl
Throws:
VisADException
java.rmi.RemoteException

controlChanged

public void controlChanged()
used by Control-s to notify this DisplayImpl that they have changed


checkTicks

public boolean checkTicks()
DisplayImpl always runs doAction to find out if there is work to do

Overrides:
checkTicks in class ActionImpl

destroy

public void destroy()
             throws VisADException,
                    java.rmi.RemoteException
destroy this display

Specified by:
destroy in interface Display
Throws:
VisADException
java.rmi.RemoteException

doAction

public void doAction()
              throws VisADException,
                     java.rmi.RemoteException
a Display is runnable; doAction is invoked by any event that requires a re-transform

Specified by:
doAction in class ActionImpl
Throws:
VisADException
java.rmi.RemoteException

getDefaultDisplayRenderer

protected abstract DisplayRenderer getDefaultDisplayRenderer()
return the default DisplayRenderer for this DisplayImpl


getDisplayRenderer

public DisplayRenderer getDisplayRenderer()
return the DisplayRenderer associated with this DisplayImpl

Specified by:
getDisplayRenderer in interface LocalDisplay

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

getDisplayScalar

public DisplayRealType getDisplayScalar(int index)

getDisplayScalarIndex

public int getDisplayScalarIndex(DisplayRealType dreal)

getScalarCount

public int getScalarCount()

getScalar

public ScalarType getScalar(int index)

getScalarIndex

public int getScalarIndex(ScalarType real)
                   throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

addMap

public void addMap(ScalarMap map)
            throws VisADException,
                   java.rmi.RemoteException
add a ScalarMap to this Display; can only be invoked when no DataReference-s are linked to this Display

Specified by:
addMap in interface Display
Throws:
VisADException
java.rmi.RemoteException

addMap

public void addMap(ScalarMap map,
                   int remoteId)
            throws VisADException,
                   java.rmi.RemoteException
Throws:
VisADException
java.rmi.RemoteException

clearMaps

public void clearMaps()
               throws VisADException,
                      java.rmi.RemoteException
clear set of ScalarMap-s associated with this display; can only be invoked when no DataReference-s are linked to this Display

Specified by:
clearMaps in interface Display
Throws:
VisADException
java.rmi.RemoteException

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

getConstantMapVector

public java.util.Vector getConstantMapVector()
Specified by:
getConstantMapVector in interface Display

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.

Returns:
DisplayMonitor.UNKNOWN_LISTENER_ID if not found; otherwise, returns the ID.
Throws:
java.rmi.RemoteException

addControl

public void addControl(Control control)

getControl

public Control getControl(java.lang.Class c)
only called for Control objects associated with 'single' DisplayRealType-s

Specified by:
getControl in interface LocalDisplay

getControl

public Control getControl(java.lang.Class c,
                          int inst)
find specified occurance for Control object of the specified class

Specified by:
getControl in interface LocalDisplay

getControls

public java.util.Vector getControls(java.lang.Class c)
find all Control objects of the specified class

Specified by:
getControls in interface LocalDisplay

getNumberOfControls

public int getNumberOfControls()
return the total number of controls used by this display


getControlVector

public java.util.Vector getControlVector()
Deprecated. - DisplayImpl shouldn't expose itself at this level.


getWidgetPanel

public java.awt.Container getWidgetPanel()
get a GUI component containing this Display's Control widgets, creating the widgets as necessary

Specified by:
getWidgetPanel in interface LocalDisplay

getValueArrayLength

public int getValueArrayLength()

getValueToScalar

public int[] getValueToScalar()

getValueToMap

public int[] getValueToMap()

getProjectionControl

public abstract ProjectionControl getProjectionControl()
return the ProjectionControl associated with this DisplayImpl

Specified by:
getProjectionControl in interface LocalDisplay

getGraphicsModeControl

public abstract GraphicsModeControl getGraphicsModeControl()
return the GraphicsModeControl associated with this DisplayImpl

Specified by:
getGraphicsModeControl in interface LocalDisplay

delay

public static void delay(int millis)
Deprecated. Use new visad.util.Delay(millis) instead.

wait for millis milliseconds


printStack

public static void printStack(java.lang.String message)
print a stack dump


equals

public boolean equals(java.lang.Object obj)
given their complexity, its reasonable that DisplayImpl objects are only equal to themselves

Overrides:
equals in class java.lang.Object

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

getMouseBehavior

public MouseBehavior getMouseBehavior()

make_matrix

public double[] make_matrix(double rotx,
                            double roty,
                            double rotz,
                            double scale,
                            double transx,
                            double transy,
                            double transz)
Specified by:
make_matrix in interface LocalDisplay

multiply_matrix

public double[] multiply_matrix(double[] a,
                                double[] b)
Specified by:
multiply_matrix in interface LocalDisplay

getImage

public java.awt.image.BufferedImage getImage()
return a captured image of the display

Specified by:
getImage in interface LocalDisplay

getImage

public java.awt.image.BufferedImage getImage(boolean sync)
return a captured image of the display; synchronize if sync


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.String pre)

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


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. 


removeDataSourceListener

public void removeDataSourceListener(RemoteSourceListener listener)
Deprecated. 


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.

removeMessageListener

public void removeMessageListener(MessageListener listener)
Remove listener from the message list.

Specified by:
removeMessageListener in interface LocalDisplay
Parameters:
listener - Object to remove.

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

addActivityHandler

public void addActivityHandler(ActivityHandler ah)
                        throws VisADException
Add a busy/idle activity handler.

Specified by:
addActivityHandler in interface LocalDisplay
Parameters:
ah - Activity handler.
Throws:
VisADException - If the handler couldn't be added.

removeActivityHandler

public void removeActivityHandler(ActivityHandler ah)
                           throws VisADException
Remove a busy/idle activity handler.

Specified by:
removeActivityHandler in interface LocalDisplay
Parameters:
ah - Activity handler.
Throws:
VisADException - If the handler couldn't be removed.

updateBusyStatus

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