uk.ac.starlink.treeview
Class NdxDisplayer

java.lang.Object
  extended by uk.ac.starlink.treeview.NdxDisplayer
Direct Known Subclasses:
SogNdxDisplayer, SplatNdxDisplayer

public abstract class NdxDisplayer
extends Object

Abstract class which encapsulates a service that can display NDXs. The display can in general be achieved in two ways - using SOAP communication to send the NDX as XML over the wire to a suitable existing SOAP endpoint, or entirely within the same JVM by manipulating the Ndx object in some way.


Constructor Summary
protected NdxDisplayer(String endpoint, String displayMethod)
          Constructs a new NdxDisplayer, describing the SOAP service which can be used for RPC.
 
Method Summary
 boolean canDisplay(uk.ac.starlink.ndx.Ndx ndx)
          Indicates whether this displayer can be expected to display the given NDX.
 boolean display(uk.ac.starlink.ndx.Ndx ndx, boolean embedded)
          Attempts to display the given NDX.
abstract  boolean localDisplay(uk.ac.starlink.ndx.Ndx ndx, boolean embedded)
          Attempts to display the given NDX using a locally created object.
static void main(String[] args)
          Attempts to display one or more NDXs using an appropriate viewer.
 boolean soapDisplay(uk.ac.starlink.ndx.Ndx ndx)
          Attempts to display the given NDX using remote communication.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NdxDisplayer

protected NdxDisplayer(String endpoint,
                       String displayMethod)
Constructs a new NdxDisplayer, describing the SOAP service which can be used for RPC.

The arguments endpoint and displayMethod relate to the SOAP sercice for RPC display. If any are null, it is assumed that no SOAP display service is available, and only local display will be attempted.

Parameters:
endpoint - the endpoint for the SOAP communication (must be a valid URL)
displayMethod - the operation name for the display service
Method Detail

localDisplay

public abstract boolean localDisplay(uk.ac.starlink.ndx.Ndx ndx,
                                     boolean embedded)
Attempts to display the given NDX using a locally created object. If this is for use in an embedded sense then embedded should be true (in this case local created objects should expect to be not remotely controlled and not take charge of application exit).

Parameters:
ndx - the NDX to display
embedded - is the local object to be embedded
Returns:
true if the display was successful

canDisplay

public boolean canDisplay(uk.ac.starlink.ndx.Ndx ndx)
Indicates whether this displayer can be expected to display the given NDX. The NdxDisplayer implementation returns true.

Parameters:
ndx - the Ndx to display
Returns:
whether it's worth trying to call display(uk.ac.starlink.ndx.Ndx, boolean)

display

public boolean display(uk.ac.starlink.ndx.Ndx ndx,
                       boolean embedded)
Attempts to display the given NDX. Display may be in the same or a different JVM depending on whether the remote service is available and works. If the display takes place in the local JVM then the embedded parameter is used to control whether the displayer takes charge of application exit (it may also activate a full set of services, such as remote control).

Parameters:
ndx - the NDX to display
embedded - whether a local displayer should not assume it is the full application instance, or not
Returns:
true if the display was successful

soapDisplay

public boolean soapDisplay(uk.ac.starlink.ndx.Ndx ndx)
Attempts to display the given NDX using remote communication.

Parameters:
ndx - the NDX to display
Returns:
true iff the display was successful

main

public static void main(String[] args)
Attempts to display one or more NDXs using an appropriate viewer. Currently, it will pass a 1-d NDX to SPLAT and a 2-d one to SoG. If there is a problem displaying any of the NDXs a message will be printed to standard error.

Parameters:
args - an array of NDX names


Copyright © 2002-2017 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.