visad
Class DisplayImpl
- java.lang.Object
-
- visad.ActionImpl
-
- 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
Nested Classes Modifier and Type Class and Description classDisplayImpl.SyncherClass used to ensure that all linked Data have been transformed and rendered, used by getImage()
-
Field Summary
-
Fields inherited from class visad.ActionImpl
TRACE_STACK, TRACE_TIME
-
Fields inherited from interface visad.Display
AdjustProjectionSeam, Alpha, Animation, Blue, CacheAppearances, CMY, ColorMode, components3c, components3s, componentscmy, componentscyl, componentsflow1, componentsflow1s, componentsflow2, componentsflow2s, componentshsv, componentsrgb, componentsso, CurvedSize, 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, MergeGeometries, MissingTransparent, PointMode, PointSize, PolygonMode, PolygonOffset, PolygonOffsetFactor, Radius, Red, RGB, RGBA, Saturation, SelectRange, SelectValue, Shape, ShapeScale, Text, Texture3DMode, TextureEnable, Value, XAxis, XAxisOffset, YAxis, YAxisOffset, Yellow, ZAxis, ZAxisOffset
-
-
Constructor Summary
Constructors Constructor and Description DisplayImpl(RemoteDisplay rmtDpy, DisplayRenderer renderer)construct a DisplayImpl collaborating with the given RemoteDisplay, and with the given DisplayRendererDisplayImpl(java.lang.String name, DisplayRenderer renderer)construct a DisplayImpl with given name and DisplayRenderer
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description voidaddActivityHandler(ActivityHandler ah)Add a busy/idle activity handler.voidaddControl(Control control)add a Control to this DisplayImplvoidaddDataSourceListener(RemoteSourceListener listener)Deprecated.voidaddDisplayListener(DisplayListener listener)add a DisplayListenervoidaddMap(ScalarMap map)add a ScalarMap to this Display, assuming a local sourcevoidaddMap(ScalarMap map, int remoteId)add a ScalarMap to this DisplayvoidaddMessageListener(MessageListener listener)Forward messages to the specified listenervoidaddReference(DataReference ref, ConstantMap[] constant_maps)Link a reference to this Display.voidaddReference(ThingReference ref)Link a reference to this Display.voidaddReferences(DataRenderer renderer, DataReference ref)Link a reference to this Display using a non-default renderer.voidaddReferences(DataRenderer renderer, DataReference[] refs)Link references to this display using a non-default renderer.voidaddReferences(DataRenderer renderer, DataReference[] refs, ConstantMap[][] constant_maps)Link references to this display using the non-default renderer.voidaddReferences(DataRenderer renderer, DataReference ref, ConstantMap[] constant_maps)Link a reference to this Display using a non-default renderer.voidaddRemoteSourceListener(RemoteSourceListener listener)Inform listener of changes in the availability of remote data/collaboration sources.voidaddRendererSourceListener(RendererSourceListener listener)Inform listener of deletedDataRenderers.voidaddSlave(RemoteSlaveDisplay display)link a slave display to thisbooleancheckTicks()over-ride ActionImpl.checkTicks() to always return true, since DisplayImpl always runs doAction to find out if any linked Data needs to be re-transformedvoidclearMaps()remove all ScalarMaps linked this display;voidconnectionFailed(DataRenderer renderer, DataDisplayLink link)Notify this Display that a connection to a remote server has failedvoidcontrolChanged()trigger possible re-transform of linked Data used by Controls to notify this DisplayImpl that they have changedstatic voiddelay(int millis)Deprecated.Usenew visad.util.Delay(millis)instead.voiddestroy()destroy this display: clear all references to objects (so they can be garbage collected), stop all Threads and remove all linksvoiddisableEvent(int id)Disables reporting of a DisplayEvent of a given type when it occurs in this display.voiddoAction()Check if any Data need re-transform, and if so, do it.voidenableEvent(int id)Enables reporting of a DisplayEvent of a given type when it occurs in this display.booleanequals(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 themselvesintgetAPI()Return the API used for this displayjava.awt.ComponentgetComponent()return the java.awt.Component (e.g., JPanel or AppletPanel) this Display uses; returns null for an offscreen DisplayintgetConnectionID(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.VectorgetConstantMapVector()ControlgetControl(java.lang.Class c)get a linked Control with the given Class; only called for Control objects associated with 'single' DisplayRealTypesControlgetControl(java.lang.Class c, int inst)get ordinal instance of linked Control object of the specified classjava.util.VectorgetControls(java.lang.Class c)get all linked Control objects of the specified Classjava.util.VectorgetControlVector()Deprecated.- DisplayImpl shouldn't expose itself at this levelDisplayMonitorgetDisplayMonitor()DisplayRenderergetDisplayRenderer()return the DisplayRenderer associated with this DisplayDisplayRealTypegetDisplayScalar(int index)get the DisplayRealType with the given indexintgetDisplayScalarCount()intgetDisplayScalarIndex(DisplayRealType dreal)get the index for the given DisplayRealTypeDisplaySyncgetDisplaySync()abstract GraphicsModeControlgetGraphicsModeControl()return the GraphicsModeControl associated with this Displayjava.awt.image.BufferedImagegetImage()get a BufferedImage of this Display, without synchronizing (assume the application has made sure Data have been transformed and rendered)java.awt.image.BufferedImagegetImage(boolean sync)get a BufferedImage of this Displayjava.util.VectorgetMapVector()return a Vector of the ScalarMap-s associated with this DisplayMouseBehaviorgetMouseBehavior()intgetNumberOfControls()java.awt.print.PrintablegetPrintable()Return the Printable object to be used by a PrinterJob.abstract ProjectionControlgetProjectionControl()return the ProjectionControl associated with this Displayjava.util.VectorgetRenderers()Returns the list of DataRenderer-s.java.util.VectorgetRendererVector()Returns a clone of the list of DataRenderer-s.ScalarTypegetScalar(int index)get the ScalarType with the given indexintgetScalarCount()intgetScalarIndex(ScalarType real)get the index for the given ScalarTypeintgetValueArrayLength()int[]getValueToMap()int[]getValueToScalar()java.awt.ContainergetWidgetPanel()get a GUI component containing this Display's Control widgets; create the widgets as necessarybooleanhasSlaves()booleanisDestroyed()has this display been destroyedbooleanisEventEnabled(int id)voidlostCollabConnection(int id)InformRemoteSourceListeners 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)make projection matrix from given argumentsdouble[]multiply_matrix(double[] a, double[] b)multiply matricesvoidnotifyListeners(DisplayEvent evt)Notify this instance'sDisplayListeners.voidnotifyListeners(int id, int x, int y)Notify this instance'sDisplayListeners.static voidprintStack(java.lang.String message)print a stack dump with the given messagevoidreAutoScale()request auto-scaling of ScalarMap ranges the next time Data are transformed into scene graph elementsvoidreDisplayAll()request all linked Data to be re-transformed into scene graph elementsvoidremoveActivityHandler(ActivityHandler ah)Remove a busy/idle activity handler.voidremoveAllReferences()remove all links to DataReferences.voidremoveAllSlaves()remove all links to slave displaysvoidremoveDataSourceListener(RemoteSourceListener listener)Deprecated.voidremoveDisplayListener(DisplayListener listener)remove a DisplayListenervoidremoveMap(ScalarMap map)remove a ScalarMap from this Display, assuming a local sourcevoidremoveMap(ScalarMap map, int remoteId)remove a ScalarMap from this DisplayvoidremoveMessageListener(MessageListener listener)Remove listener from the message list.voidremoveReference(ThingReference ref)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 themvoidremoveRemoteSourceListener(RemoteSourceListener listener)Remove listener from the remote source notification list.voidremoveRendererSourceListener(RendererSourceListener listener)Remove listener from theDataRendererdeletion list.voidremoveSlave(RemoteSlaveDisplay display)remove a link between a slave display and thisvoidreplaceReference(RemoteDisplay rDpy, DataReference ref, ConstantMap[] constant_maps)Replace remote reference with local reference.voidreplaceReference(RemoteDisplay rDpy, ThingReference ref)Replace remote reference with local reference.voidreplaceReferences(RemoteDisplay rDpy, DataRenderer renderer, DataReference ref)Replace remote reference with local reference using non-default renderer.voidreplaceReferences(RemoteDisplay rDpy, DataRenderer renderer, DataReference[] refs)Replace remote references with local references.voidreplaceReferences(RemoteDisplay rDpy, DataRenderer renderer, DataReference[] refs, ConstantMap[][] constant_maps)Replace remote references with local references.voidreplaceReferences(RemoteDisplay rDpy, DataRenderer renderer, DataReference ref, ConstantMap[] constant_maps)Replace remote reference with local reference using non-default renderer.voidsendMessage(MessageEvent msg)Send a message to all MessageListeners.voidsetAlwaysAutoScale(boolean a)if auto is true, re-apply auto-scaling of ScalarMap ranges every time Display is triggeredvoidsetComponent(java.awt.Component c)set the java.awt.Component this DisplayImpl usesvoidsetDepthBufferOffset(DataRenderer renderer, GraphicsModeControl mode)Can be optionally implemented by graphics-api dependent DisplayImpls.voidsetMouseBehavior(MouseBehavior m)set given MouseBehaviorjava.lang.StringtoString()java.lang.StringtoString(java.lang.String pre)voidupdateBusyStatus()Indicate to activity monitor that the Display is busy.voidupdateSlaves(java.awt.image.BufferedImage img)update all linked slave displays with the given imagevoidupdateSlaves(java.lang.String message)update all linked slave display with the given message-
Methods inherited from class visad.ActionImpl
disableAction, enableAction, findReference, getCurrentActionThread, getLinks, getName, getTaskCount, printPool, run, setEnabled, setName, setThreadPoolMaximum, stop, stopThreadPool, thingChanged, waitForTasks
-
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface visad.ThingChangedListener
thingChanged
-
-
-
-
Constructor Detail
-
DisplayImpl
public DisplayImpl(java.lang.String name, DisplayRenderer renderer) throws VisADException, java.rmi.RemoteExceptionconstruct 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 occurredjava.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 withrenderer- DisplayRenderer that controls aspects of the display not specific to any particular Data- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
-
Method Detail
-
notifyListeners
public void notifyListeners(int id, int x, int y) throws VisADException, java.rmi.RemoteExceptionNotify this instance'sDisplayListeners.- Parameters:
id- type of DisplayEvent that is to be sentx- the horizontal x coordinate for the mouse location in the display componenty- 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.
-
notifyListeners
public void notifyListeners(DisplayEvent evt) throws VisADException, java.rmi.RemoteException
Notify this instance'sDisplayListeners.- Parameters:
evt- TheDisplayEventto be passed to theDisplayListeners.- 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:
addDisplayListenerin interfaceLocalDisplay- Parameters:
listener- DisplayListener to add
-
removeDisplayListener
public void removeDisplayListener(DisplayListener listener)
remove a DisplayListener- Specified by:
removeDisplayListenerin interfaceLocalDisplay- Parameters:
listener- DisplayListener to remove
-
getComponent
public java.awt.Component getComponent()
Description copied from interface:LocalDisplayreturn the java.awt.Component (e.g., JPanel or AppletPanel) this Display uses; returns null for an offscreen Display- Specified by:
getComponentin interfaceLocalDisplay- 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
-
removeSlave
public void removeSlave(RemoteSlaveDisplay display)
remove a link between a slave display and this- Specified by:
removeSlavein interfaceDisplay- Parameters:
display- RemoteSlaveDisplay to remove
-
removeAllSlaves
public void removeAllSlaves()
remove all links to slave displays- Specified by:
removeAllSlavesin interfaceDisplay
-
hasSlaves
public boolean hasSlaves()
-
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.
-
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 toScalarMapshave been made.- Specified by:
addReferencein interfaceAction- Overrides:
addReferencein classActionImpl- 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 localDataReferenceImpl. TheConstantMaparray applies only to the rendering reference.- Specified by:
addReferencein interfaceDisplay- Parameters:
ref- data referenceconstant_maps- array ofConstantMapsassociated 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 ofConstantMapsassociated 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 localDataReferenceImpl. This is a method ofDisplayImplandRemoteDisplayImplrather thanDisplay- Parameters:
renderer- logic to render this dataref- 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 dataref- 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 localDataReferenceImpl. This is a method ofDisplayImplandRemoteDisplayImplrather thanDisplay- Specified by:
addReferencesin interfaceDisplay- Parameters:
renderer- logic to render this dataref- data referenceconstant_maps- array ofConstantMapsassociated 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 dataref- Local reference which will replace the previous reference.constant_maps- array ofConstantMapsassociated 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 localDataReferenceImpls. This is a method ofDisplayImplandRemoteDisplayImplrather thanDisplay- Parameters:
renderer- logic to render this datarefs- 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 datarefs- 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 localDataReferenceImpls. The maps[i] array applies only to rendering refs[i]. This is a method ofDisplayImplandRemoteDisplayImplrather thanDisplay- Specified by:
addReferencesin interfaceLocalDisplay- Parameters:
renderer- logic to render this datarefs- array of data referencesconstant_maps- array ofConstantMapsassociated 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:
replaceReferencesin interfaceLocalDisplay- Parameters:
rDpy- Remote display.renderer- logic to render this datarefs- array of data referencesconstant_maps- array ofConstantMapsassociated 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, 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:
removeReferencein interfaceAction- Overrides:
removeReferencein classActionImpl- Parameters:
ref- ThingReference to remove- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
removeAllReferences
public void removeAllReferences() throws VisADException, java.rmi.RemoteExceptionremove all links to DataReferences.- Specified by:
removeAllReferencesin interfaceAction- Overrides:
removeAllReferencesin classActionImpl- Throws:
VisADException- a VisAD error occurredjava.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:
checkTicksin classActionImpl- 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.RemoteExceptiondestroy this display: clear all references to objects (so they can be garbage collected), stop all Threads and remove all links- Specified by:
destroyin interfaceDisplay- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
doAction
public void doAction() throws VisADException, java.rmi.RemoteExceptionCheck 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:
doActionin classActionImpl- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
getDisplayRenderer
public DisplayRenderer getDisplayRenderer()
Description copied from interface:LocalDisplayreturn the DisplayRenderer associated with this Display- Specified by:
getDisplayRendererin interfaceLocalDisplay- 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:
getRendererVectorin interfaceLocalDisplay- 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:
addMapin interfaceDisplay- Parameters:
map- ScalarMap to add- Throws:
VisADException- a VisAD error occurredjava.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 addremoteId- remote source for collab, or VisADEvent.LOCAL_SOURCE- Throws:
VisADException- a VisAD error occurredjava.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:
removeMapin interfaceDisplay- Parameters:
map- ScalarMap to remove- Throws:
VisADException- a VisAD error occurredjava.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 addremoteId- remote source for collab, or VisADEvent.LOCAL_SOURCE- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
clearMaps
public void clearMaps() throws VisADException, java.rmi.RemoteExceptionremove all ScalarMaps linked this display;- Specified by:
clearMapsin interfaceDisplay- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
getMapVector
public java.util.Vector getMapVector()
Description copied from interface:LocalDisplayreturn a Vector of the ScalarMap-s associated with this Display- Specified by:
getMapVectorin interfaceLocalDisplay- Returns:
- clone of Vector of ScalarMaps linked to this DisplayImpl (doesn't include ConstantMaps)
-
getConstantMapVector
public java.util.Vector getConstantMapVector()
- Specified by:
getConstantMapVectorin interfaceDisplay- 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:
getControlin interfaceLocalDisplay- 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:
getControlin interfaceLocalDisplay- Parameters:
c- sub-Class of Control to search forinst- 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:
getControlsin interfaceLocalDisplay- 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:
getWidgetPanelin interfaceLocalDisplay- 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:LocalDisplayreturn the ProjectionControl associated with this Display- Specified by:
getProjectionControlin interfaceLocalDisplay- Returns:
- the ProjectionControl associated with this DisplayImpl
-
getGraphicsModeControl
public abstract GraphicsModeControl getGraphicsModeControl()
Description copied from interface:LocalDisplayreturn the GraphicsModeControl associated with this Display- Specified by:
getGraphicsModeControlin interfaceLocalDisplay- Returns:
- the GraphicsModeControl associated with this DisplayImpl
-
delay
public static void delay(int millis)
Deprecated. Usenew 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:
equalsin classjava.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 usegetRendererVector().- Specified by:
getRenderersin interfaceLocalDisplay- Returns:
- The list of DataRenderer-s.
- See Also:
getRendererVector()
-
getAPI
public int getAPI() throws VisADExceptionReturn 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
DisplayMonitorassociated with thisDisplay.
-
getDisplaySync
public DisplaySync getDisplaySync()
- Returns:
- the
DisplaySyncassociated with thisDisplay.
-
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_matrixin interfaceLocalDisplay- Parameters:
rotx- rotation about x axisroty- rotation about y axisrotz- rotation about z axisscale- linear scale factortransx- translation along x axistransy- translation along y axistransz- translation along z axis- Returns:
- projection matrix
-
multiply_matrix
public double[] multiply_matrix(double[] a, double[] b)multiply matrices- Specified by:
multiply_matrixin interfaceLocalDisplay- Parameters:
a- first operand matrixb- 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:
getImagein interfaceLocalDisplay- 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:
toStringin classjava.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 failurelink- DataDisplayLink with failure
-
addRendererSourceListener
public void addRendererSourceListener(RendererSourceListener listener)
Inform listener of deletedDataRenderers.- Parameters:
listener- Object to add.
-
removeRendererSourceListener
public void removeRendererSourceListener(RendererSourceListener listener)
Remove listener from theDataRendererdeletion 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)
InformRemoteSourceListeners 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:
addMessageListenerin interfaceLocalDisplay- Parameters:
listener- New message receiver.
-
removeMessageListener
public void removeMessageListener(MessageListener listener)
Remove listener from the message list.- Specified by:
removeMessageListenerin interfaceLocalDisplay- Parameters:
listener- Object to remove.
-
sendMessage
public void sendMessage(MessageEvent msg) throws java.rmi.RemoteException
Send a message to all MessageListeners.- Specified by:
sendMessagein interfaceDisplay- 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:
addActivityHandlerin interfaceLocalDisplay- 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:
removeActivityHandlerin interfaceLocalDisplay- 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.
-
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