|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--visad.ActionImpl
|
+--visad.DisplayImpl
DisplayImpl is the abstract VisAD superclass for display implementations. It is runnable.
DisplayImpl is not Serializable and should not be copied between JVMs.
| Inner Class Summary | |
class |
DisplayImpl.Syncher
Class used to ensure that all linked Data have been transformed and rendered, used by getImage() |
| Field Summary | |
(package private) Component |
component
Component where data depictions are rendered; must be set by concrete subclass constructor; may be null for off-screen displays |
| Constructor Summary | |
DisplayImpl(RemoteDisplay rmtDpy,
DisplayRenderer renderer)
construct a DisplayImpl collaborating with the given RemoteDisplay, and with the given DisplayRenderer |
|
DisplayImpl(String name,
DisplayRenderer renderer)
construct a DisplayImpl with given name and DisplayRenderer |
|
| Method Summary | |
(package private) void |
adaptedAddReference(RemoteDataReference ref,
RemoteDisplay display,
ConstantMap[] constant_maps)
Link a RemoteDataReference to this Display. |
(package private) void |
adaptedAddReferences(DataRenderer renderer,
DataReference[] refs,
RemoteDisplay display,
ConstantMap[][] constant_maps)
Link references to this display using the non-default renderer. |
(package private) void |
adaptedDisplayRemoveReference(DataReference ref)
remove link to a DataReference; uses by removeReference() method of RemoteActionImpl that adapts this ActionImpl; because DataReference array input to adaptedAddReferences may be a mix of local and remote, we tolerate either here |
void |
addActivityHandler(ActivityHandler ah)
Add a busy/idle activity handler. |
void |
addControl(Control control)
add a Control to this DisplayImpl |
void |
addDataSourceListener(RemoteSourceListener listener)
Deprecated. |
void |
addDisplayListener(DisplayListener listener)
add a DisplayListener |
(package private) void |
addDisplayScalar(ScalarMap map)
add a ScalarType from a ScalarMap from this Display |
(package private) void |
addLink(DataDisplayLink link)
Add a link to a DataReference object |
void |
addMap(ScalarMap map)
add a ScalarMap to this Display, assuming a local source |
void |
addMap(ScalarMap map,
int remoteId)
add a ScalarMap to this Display |
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)
link a slave display to this |
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 |
void |
clearMaps()
remove all ScalarMaps linked this display; |
void |
connectionFailed(DataRenderer renderer,
DataDisplayLink link)
Notify this Display that a connection to a remote server has failed |
void |
controlChanged()
trigger possible re-transform of linked Data used by Controls to notify this DisplayImpl that they have changed |
(package private) void |
copyConstantMaps(RemoteDisplay rmtDpy)
copy ConstantMaps from RemoteDisplay to this |
(package private) void |
copyGraphicsModeControl(RemoteDisplay rmtDpy)
copy GraphicsModeControl settings from RemoteDisplay to this |
(package private) void |
copyScalarMaps(RemoteDisplay rmtDpy)
|
static void |
delay(int millis)
Deprecated. Use new visad.util.Delay(millis) instead. |
void |
destroy()
destroy this display: clear all references to objects (so they can be garbage collected), stop all Threads and remove all links |
void |
disableEvent(int id)
Disables reporting of a DisplayEvent of a given type when it occurs in this display. |
void |
doAction()
Check if any Data need re-transform, and if so, do it. |
void |
enableEvent(int id)
Enables reporting of a DisplayEvent of a given type when it occurs in this display. |
boolean |
equals(Object obj)
test for equality between this and the given Object given their complexity, its reasonable that DisplayImpl objects are only equal to themselves |
protected void |
finalize()
|
int |
getAPI()
Return the API used for this display |
Component |
getComponent()
|
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. |
Vector |
getConstantMapVector()
|
Control |
getControl(Class c)
get a linked Control with the given Class; only called for Control objects associated with 'single' DisplayRealTypes |
Control |
getControl(Class c,
int inst)
get ordinal instance of linked Control object of the specified class |
Vector |
getControls(Class c)
get all linked Control objects of the specified Class |
Vector |
getControlVector()
Deprecated. - DisplayImpl shouldn't expose itself at this level |
protected abstract DisplayRenderer |
getDefaultDisplayRenderer()
|
DisplayMonitor |
getDisplayMonitor()
|
DisplayRenderer |
getDisplayRenderer()
|
DisplayRealType |
getDisplayScalar(int index)
get the DisplayRealType with the given index |
int |
getDisplayScalarCount()
|
int |
getDisplayScalarIndex(DisplayRealType dreal)
get the index for the given DisplayRealType |
DisplaySync |
getDisplaySync()
|
abstract GraphicsModeControl |
getGraphicsModeControl()
|
BufferedImage |
getImage()
get a BufferedImage of this Display, without synchronizing (assume the application has made sure Data have been transformed and rendered) |
BufferedImage |
getImage(boolean sync)
get a BufferedImage of this Display |
Vector |
getMapVector()
|
MouseBehavior |
getMouseBehavior()
|
int |
getNumberOfControls()
|
Printable |
getPrintable()
Return the Printable object to be used by a PrinterJob. |
abstract ProjectionControl |
getProjectionControl()
|
Vector |
getRenderers()
Returns the list of DataRenderer-s. |
Vector |
getRendererVector()
Returns a clone of the list of DataRenderer-s. |
ScalarType |
getScalar(int index)
get the ScalarType with the given index |
int |
getScalarCount()
|
int |
getScalarIndex(ScalarType real)
get the index for the given ScalarType |
int |
getValueArrayLength()
|
int[] |
getValueToMap()
|
int[] |
getValueToScalar()
|
Container |
getWidgetPanel()
get a GUI component containing this Display's Control widgets; create the widgets as necessary |
(package private) void |
handleRunDisconnectException(ReferenceActionLink raLink)
handle DisconnectException for the given ReferenceActionLink |
boolean |
hasSlaves()
|
boolean |
isEventEnabled(int id)
|
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)
make projection matrix from given arguments |
double[] |
multiply_matrix(double[] a,
double[] b)
multiply matrices |
void |
notifyListeners(DisplayEvent evt)
Notify this instance's DisplayListeners. |
void |
notifyListeners(int id,
int x,
int y)
Notify this instance's DisplayListeners. |
static void |
printStack(String message)
print a stack dump with the given message |
void |
reAutoScale()
request auto-scaling of ScalarMap ranges the next time Data are transformed into scene graph elements |
void |
reDisplayAll()
request all linked Data to be re-transformed into scene graph elements |
void |
removeActivityHandler(ActivityHandler ah)
Remove a busy/idle activity handler. |
void |
removeAllReferences()
remove all links to DataReferences |
void |
removeAllSlaves()
remove all links to slave displays |
void |
removeDataSourceListener(RemoteSourceListener listener)
Deprecated. |
void |
removeDisplayListener(DisplayListener listener)
remove a DisplayListener |
(package private) void |
removeLinks(DataDisplayLink[] links)
remove DataDisplayLinks from this DisplayImpl |
void |
removeMap(ScalarMap map)
remove a ScalarMap from this Display, assuming a local source |
void |
removeMap(ScalarMap map,
int remoteId)
remove a ScalarMap from this Display |
void |
removeMessageListener(MessageListener listener)
Remove listener from the message list. |
void |
removeReference(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 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)
remove a link between a slave display and this |
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 |
(package private) void |
setAspectCartesian(double[] aspect)
set aspect ratio of XAxis, YAxis & ZAxis in ScalarMaps rather than matrix (i.e., don't distort text fonts); called by ProjectionControl.setAspectCartesian() |
void |
setComponent(Component c)
set the java.awt.Component this DisplayImpl uses |
void |
setMouseBehavior(MouseBehavior m)
set given MouseBehavior |
protected void |
syncRemoteData(RemoteDisplay rmtDpy)
copy Data from RemoteDisplay to this |
String |
toString()
|
String |
toString(String pre)
|
void |
updateBusyStatus()
Indicate to activity monitor that the Display is busy. |
void |
updateSlaves(BufferedImage img)
update all linked slave displays with the given image |
void |
updateSlaves(String message)
update all linked slave display with the given message |
| Methods inherited from class visad.ActionImpl |
adaptedAddReference,
adaptedRemoveReference,
addLink,
disableAction,
enableAction,
findLink,
findReference,
getCurrentActionThread,
getLinkId,
getLinks,
getName,
notifyAction,
removeLinks,
run,
setEnabled,
setName,
setThreadPoolMaximum,
stop,
stopThreadPool,
thingChanged,
waitForTasks |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
Component component
| Constructor Detail |
public DisplayImpl(String name,
DisplayRenderer renderer)
throws VisADException,
RemoteException
name - String name for DisplayImpl (used for debugging)renderer - DisplayRenderer that controls aspects of the
display not specific to any particular Data
public DisplayImpl(RemoteDisplay rmtDpy,
DisplayRenderer renderer)
throws VisADException,
RemoteException
rmtDpy - RemoteDisplay to collaborate withrenderer - DisplayRenderer that controls aspects of the
display not specific to any particular Data| Method Detail |
void copyScalarMaps(RemoteDisplay rmtDpy)
void copyConstantMaps(RemoteDisplay rmtDpy)
rmtDpy - RemoteDisplay to get ConstantMaps fromvoid copyGraphicsModeControl(RemoteDisplay rmtDpy)
rmtDpy - RemoteDisplay to get GraphicsModeControl settings from
protected void syncRemoteData(RemoteDisplay rmtDpy)
throws VisADException,
RemoteException
rmtDpy - RemoteDisplay to get Data from
public void notifyListeners(int id,
int x,
int y)
throws VisADException,
RemoteException
DisplayListeners.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
public void notifyListeners(DisplayEvent evt)
throws VisADException,
RemoteException
DisplayListeners.evt - The DisplayEvent to be passed to the
DisplayListeners.public void addDisplayListener(DisplayListener listener)
listener - DisplayListener to addpublic void removeDisplayListener(DisplayListener listener)
listener - DisplayListener to removepublic Component getComponent()
public void setComponent(Component c)
c - Component to setpublic void reAutoScale()
public void setAlwaysAutoScale(boolean a)
a - flag indicating whether to always re-apply auto-scalingpublic void reDisplayAll()
public void addSlave(RemoteSlaveDisplay display)
display - RemoteSlaveDisplay to linkpublic void removeSlave(RemoteSlaveDisplay display)
display - RemoteSlaveDisplay to removepublic void removeAllSlaves()
public boolean hasSlaves()
public void updateSlaves(BufferedImage img)
img - BufferedImage to send to all linked slave displayspublic void updateSlaves(String message)
message - String to send to all linked slave displayspublic void enableEvent(int id)
id - DisplayEvent type to enable. Valid types are:
public void disableEvent(int id)
id - DisplayEvent type to disable. Valid types are:
public boolean isEventEnabled(int id)
id - DisplayEvent type
public void addReference(ThingReference ref)
throws VisADException,
RemoteException
ref - data reference
public void replaceReference(RemoteDisplay rDpy,
ThingReference ref)
throws VisADException,
RemoteException
rDpy - Remote display.ref - Local reference which will replace the previous
reference.addReference(visad.ThingReference)
void addLink(DataDisplayLink link)
throws VisADException,
RemoteException
link - The link to the DataReference.
public void addReference(DataReference ref,
ConstantMap[] constant_maps)
throws VisADException,
RemoteException
ref - data referenceconstant_maps - array of ConstantMaps
associated with the data reference
public void replaceReference(RemoteDisplay rDpy,
DataReference ref,
ConstantMap[] constant_maps)
throws VisADException,
RemoteException
rDpy - Remote display.ref - Local reference which will replace the previous
reference.constant_maps - array of ConstantMaps
associated with the data referenceaddReference(visad.DataReference, visad.ConstantMap[])
void adaptedAddReference(RemoteDataReference ref,
RemoteDisplay display,
ConstantMap[] constant_maps)
throws VisADException,
RemoteException
ref - remote data referencedisplay - RemoteDisplay adapting thisconstant_maps - array of ConstantMaps
associated with the data reference
public void addReferences(DataRenderer renderer,
DataReference ref)
throws VisADException,
RemoteException
renderer - logic to render this dataref - data reference
public void replaceReferences(RemoteDisplay rDpy,
DataRenderer renderer,
DataReference ref)
throws VisADException,
RemoteException
rDpy - Remote display.renderer - logic to render this dataref - Local reference which will replace the previous
reference.addReferences(visad.DataRenderer, visad.DataReference)
public void addReferences(DataRenderer renderer,
DataReference ref,
ConstantMap[] constant_maps)
throws VisADException,
RemoteException
renderer - logic to render this dataref - data referenceconstant_maps - array of ConstantMaps
associated with the data reference
public void replaceReferences(RemoteDisplay rDpy,
DataRenderer renderer,
DataReference ref,
ConstantMap[] constant_maps)
throws VisADException,
RemoteException
rDpy - Remote display.renderer - logic to render this dataref - Local reference which will replace the previous
reference.constant_maps - array of ConstantMaps
associated with the data referenceaddReferences(visad.DataRenderer, visad.DataReference, visad.ConstantMap[])
public void addReferences(DataRenderer renderer,
DataReference[] refs)
throws VisADException,
RemoteException
renderer - logic to render this datarefs - array of data references
public void replaceReferences(RemoteDisplay rDpy,
DataRenderer renderer,
DataReference[] refs)
throws VisADException,
RemoteException
rDpy - Remote display.renderer - logic to render this datarefs - array of local data referencesaddReferences(visad.DataRenderer, visad.DataReference[])
public void addReferences(DataRenderer renderer,
DataReference[] refs,
ConstantMap[][] constant_maps)
throws VisADException,
RemoteException
renderer - logic to render this datarefs - array of data referencesconstant_maps - array of ConstantMaps
associated with data references
public void replaceReferences(RemoteDisplay rDpy,
DataRenderer renderer,
DataReference[] refs,
ConstantMap[][] constant_maps)
throws VisADException,
RemoteException
rDpy - Remote display.renderer - logic to render this datarefs - array of data referencesconstant_maps - array of ConstantMaps
associated with data references.addReferences(visad.DataRenderer, visad.DataReference[], visad.ConstantMap[][])
void adaptedAddReferences(DataRenderer renderer,
DataReference[] refs,
RemoteDisplay display,
ConstantMap[][] constant_maps)
throws VisADException,
RemoteException
renderer - logic to render this datarefs - array of data referencesdisplay - RemoteDisplay adapting thisconstant_maps - array of ConstantMaps
associated with data references.
public void removeReference(ThingReference ref)
throws VisADException,
RemoteException
ref - ThingReference to remove
void removeLinks(DataDisplayLink[] links)
throws RemoteException,
VisADException
links - array of DataDisplayLinks to remove
void adaptedDisplayRemoveReference(DataReference ref)
throws VisADException,
RemoteException
ref - DataReference to remove
public void removeAllReferences()
throws VisADException,
RemoteException
public void controlChanged()
public boolean checkTicks()
public void destroy()
throws VisADException,
RemoteException
public void doAction()
throws VisADException,
RemoteException
protected abstract DisplayRenderer getDefaultDisplayRenderer()
public DisplayRenderer getDisplayRenderer()
public Vector getRendererVector()
getRenderers()public int getDisplayScalarCount()
public DisplayRealType getDisplayScalar(int index)
index - index into Vector of DisplayRealTypespublic int getDisplayScalarIndex(DisplayRealType dreal)
dreal - DisplayRealType to search forpublic int getScalarCount()
public ScalarType getScalar(int index)
index - index into Vector of ScalarTypes
public int getScalarIndex(ScalarType real)
throws RemoteException
real - ScalarType to search for
public void addMap(ScalarMap map)
throws VisADException,
RemoteException
map - ScalarMap to add
public void addMap(ScalarMap map,
int remoteId)
throws VisADException,
RemoteException
map - ScalarMap to addremoteId - remote source for collab, or VisADEvent.LOCAL_SOURCE
public void removeMap(ScalarMap map)
throws VisADException,
RemoteException
map - ScalarMap to remove
public void removeMap(ScalarMap map,
int remoteId)
throws VisADException,
RemoteException
map - ScalarMap to addremoteId - remote source for collab, or VisADEvent.LOCAL_SOURCEvoid addDisplayScalar(ScalarMap map)
map - ScalarMap whose ScalarType to add
public void clearMaps()
throws VisADException,
RemoteException
public Vector getMapVector()
public Vector getConstantMapVector()
public int getConnectionID(RemoteDisplay rmtDpy)
throws RemoteException
rmtDpy - the specified remote display.public void addControl(Control control)
control - Control to addpublic Control getControl(Class c)
c - sub-Class of Control to search for
public Control getControl(Class c,
int inst)
c - sub-Class of Control to search forinst - ordinal instance numberpublic Vector getControls(Class c)
c - sub-Class of Control to search forpublic int getNumberOfControls()
public Vector getControlVector()
public Container getWidgetPanel()
public int getValueArrayLength()
public int[] getValueToScalar()
public int[] getValueToMap()
public abstract ProjectionControl getProjectionControl()
public abstract GraphicsModeControl getGraphicsModeControl()
public static void delay(int millis)
new visad.util.Delay(millis) instead.millis - number of milliseconds to waitpublic static void printStack(String message)
message - String to print with stack dumppublic boolean equals(Object obj)
obj - Object to test for equality with thispublic Vector getRenderers()
getRendererVector().getRendererVector()
public int getAPI()
throws VisADException
public DisplayMonitor getDisplayMonitor()
DisplayMonitor associated with this
Display.public DisplaySync getDisplaySync()
DisplaySync associated with this
Display.public void setMouseBehavior(MouseBehavior m)
m - MouseBehavior to setpublic MouseBehavior getMouseBehavior()
public double[] make_matrix(double rotx,
double roty,
double rotz,
double scale,
double transx,
double transy,
double transz)
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
public double[] multiply_matrix(double[] a,
double[] b)
a - first operand matrixb - second operand matrixpublic BufferedImage getImage()
public BufferedImage getImage(boolean sync)
sync - if true, ensure that all linked Data have been
transformed and renderedpublic String toString()
public String toString(String pre)
pre - String added to start of each line
protected void finalize()
throws Throwable
public Printable getPrintable()
PrinterJob printJob = PrinterJob.getPrinterJob();
PageFormat pf = printJob.defaultPage();
printJob.setPrintable(display.getPrintable(), pf);
if (printJob.printDialog()) {
try {
printJob.print();
}
catch (Exception pe) {
pe.printStackTrace();
}
}
void handleRunDisconnectException(ReferenceActionLink raLink)
raLink - ReferenceActionLink with DisconnectException
public void connectionFailed(DataRenderer renderer,
DataDisplayLink link)
renderer - DataRenderer with failurelink - DataDisplayLink with failurepublic void addRendererSourceListener(RendererSourceListener