com.ptc.wvs.client.pview
Class PViewProxy

java.lang.Object
  extended bycom.ptc.wvs.client.pview.PViewProxy

public class PViewProxy
extends Object

PViewProxy is responsible for passing viewer requests to the viewer running in native code.



Supported API: false

Extendable: false


Field Summary
private static boolean applet
           
private static PViewCache cache
           
private  boolean cancelLoadingFlag
           
private static boolean debug
           
private static Vector hwnds
           
private  int myHwnd
           
private static Vector panels
           
private  int pviewid
           
private  boolean structureLocked
           
 
Constructor Summary
PViewProxy(PViewPanel panel, boolean debug)
          Creates the proxy class, associated to a parent PViewPanel.
 
Method Summary
private static void addPanelForHwnd(PViewPanel pviewPanel, int hwnd)
          Maintains a lookup between the different instances of the viewer and their window handles
protected  void annotationActivate(String name)
          Viewer command : annotationActivate
protected  void annotationShow(String name, short enable, short show)
          Viewer command : annotationShow
 void cancelLoading()
          During the execution of showComponent, Cancel the down loading of files, and end the command
 void clearMeasurements()
          Viewer command : clear all measurement
protected  void componentSelect(long visualID, long select, long reset)
          Selects the component in the viewer
protected  void copyImage()
          Viewer command : Copy Image to clipboard
protected  void deleteCache()
          Deletes the contents of the cache associated to this instance of the viewer
protected  int deleteComponent(int visualID)
          Deletes the specified component (with children) from the viewers strcuture representation.
private static void deletePanelForHwnd(int hwnd)
          Removes an entry from the lookup between the different instances of the viewer and their window handles
protected  void deselectComponent(long visualID)
          Deselects the component in the viewer
 void dimensionMeasurement()
          Viewer command : dimension measurement
 void displayHLR()
          Viewer command : display hidden line removed
 void displayShaded()
          Viewer command : display shaded
 void displayWireframe()
          Viewer command : display wire frame
 void distanceMeasurement()
          Viewer command : distance measurement
 void featureSelectMode()
          Viewer command : enter select feature mode
private static PViewPanel findPanelForHwnd(int hwnd)
          Used by the callbacks from the viewer.
protected  PViewCache getCache()
          Returns the associated cache
protected static int getHwnd(PViewPanel pvp, PViewCanvas canvas)
          Returns the Window handle that uniquely identifies this viewing panel
 String getMetaDataValue(long compid, String propName)
           
protected  int getMyHwnd()
          Returns the Window handle that uniquely identifies this viewing panel
protected  long hideComponent(long visualID)
          Hides the referenced component currently displayed in the viewer
 void hideSelected()
          Viewer command : hide selected
protected  long insertComponent(long parent, String name, String shapeSource, String idShapeSource, String location, String lengthUnit, String boundingBox, String color, String material)
          Inserts a component to be visualized
 void insertProperty(int visualID, String name, String value)
          Associates a Property and value to a coponent
static boolean isApplet()
          Returns the applet state
 boolean isCancelLoadingFlag()
          Returns the current state of Cancel Loading
 boolean isDebug()
          Returns the debug state
protected  boolean isStructureLocked()
          Returns whether the structure is locked or not
protected  long loadComponent(long visualID)
          Loads the component in the viewer, this will if necessary download the appropriate file(s) if referenced by a URL
 void move(int x, int y, int dx, int dy)
          Process the movement of the viewer
private  void nativeAnnotationActivate(int hwnd, String name)
           
private  void nativeAnnotationShow(int hwnd, String name, short enable, short show)
           
private  void nativeCancelLoading(int hwnd)
           
private  void nativeClearMeasurements(int hwnd)
           
private  void nativeComponentSelect(int hwnd, long id, long select, long reset)
           
private  void nativeCopyImage(int hwnd)
           
private  int nativeCreateView(int hwnd, String viewType)
           
private  int nativeDeleteComponent(int hwnd, int compID)
           
private  void nativeDeSelectComponent(int hwnd, long id)
           
private  void nativeDimensionMeasurement(int hwnd)
           
private  void nativeDisplayHLR(int hwnd)
           
private  int nativeDisplayIn(int hwnd, int compID, int viewID)
           
private  void nativeDisplayShaded(int hwnd)
           
private  void nativeDisplayWireframe(int hwnd)
           
private  void nativeDistanceMeasurement(int hwnd)
           
private  void nativeFeatureSelectMode(int hwnd)
           
private  void nativeFileArrived(int hwnd, String requestedFile, String localPath)
           
private  String nativeGetMetaDataValue(int hwnd, long compid, String propName)
           
private  long nativeHideComponent(int hwnd, long id)
           
private  void nativeHideSelected(int hwnd)
           
private  int nativeInitialize(int hwnd)
           
private  long nativeInsertComponent(int hwnd, long parentID, String name, String shapeSource, String idShapeSource, String location, String lengthUnit, String boundingBox, String color, String material)
           
private  void nativeInsertProperty(int hwnd, long id, String propName, String propValue)
           
private  long nativeLoadComponent(int hwnd, long id)
           
private  void nativeMethod(int hwnd, long id)
           
private  void nativePluginMove(int hwnd, int x, int y, int dx, int dy)
           
private  void nativeProbeMode(int hwnd)
           
private  void nativeProjectionAbs(int hwnd)
           
private  void nativeProjectionUsr(int hwnd)
           
private  void nativeProjectionX(int hwnd)
           
private  void nativeProjectionY(int hwnd)
           
private  void nativeProjectionZ(int hwnd)
           
private  void nativeRefreshAllWindows(int hwnd)
           
private  void nativeRefreshWindow(int hwnd)
           
private  long nativeReLoadComponent(int hwnd, long id)
           
private  int nativeReParent(int hwnd, int compID, int parentID)
           
private  void nativeRestorePosition(int hwnd)
           
private  void nativeSelectComponent(int hwnd, long id)
           
private  void nativeSelectMode(int hwnd)
           
private  void nativeSelectSpinCenter(int hwnd)
           
private  void nativeSetAstLinks(int hwnd, String etb)
           
private  void nativeSetComponentLocation(int hwnd, long compid, String location)
           
private  void nativeSetMetaDataValue(int hwnd, long compid, String propName, String propValue)
           
private  void nativeSetPropValueBool(int hwnd, long property, boolean value)
           
private  void nativeSetPropValueFloat(int hwnd, long property, float value)
           
private  void nativeSetPropValueInt(int hwnd, long property, long value)
           
private  void nativeSetPropValueString(int hwnd, long property, String value)
           
private  int nativeSetURLAnchor(int hwnd, int compID, String URL)
           
private  void nativeSetViewLocation(int hwnd, String location)
           
private  void nativeSetWindow(int hwnd)
           
private  void nativeShow(int hwnd)
           
private  void nativeShowAll(int hwnd)
           
private  long nativeShowComponent(int hwnd, long id)
           
private  void nativeShowSelected(int hwnd)
           
private  void nativeSnapToCenterPoint(int hwnd)
           
private  void nativeSnapToComponent(int hwnd)
           
private  void nativeSnapToEdgeCurve(int hwnd)
           
private  void nativeSnapToMiddleEndPoint(int hwnd)
           
private  void nativeSnapToSurface(int hwnd)
           
private  long nativeStructureLockUpdates(int hwnd)
           
private  long nativeStructureReset(int hwnd, boolean clearCache)
           
private  void nativeStructureUnlockUpdates(int hwnd)
           
private  int nativeTerminate(int hwnd)
           
private  void nativeToggleComponentRotate(int hwnd)
           
private  void nativeUpdateTreeView(int hwnd)
           
private  void nativeViewPrint(int hwnd)
           
private  void nativeZoomAll(int hwnd)
           
private  void nativeZoomSelected(int hwnd)
           
private  void nativeZoomWindow(int hwnd)
           
protected static void onComponentActivated(int hwnd, long visualID)
          Called when a component is activated in the viewer.
protected static void onComponentDeselected(int hwnd, long visualID)
          Called when a component is de-selected in the viewer.
protected static void onComponentLoad(int hwnd, long visualID)
          Called when a component is loaded Emits PViewEvent.NODE_LOADED, and caches the reference between the url and file
protected static void onComponentMoved(int hwnd, long visualID, String location)
          Called when a component is moved in the viewer.
protected static void onComponentSelected(int hwnd, long visualID)
          Called when a component is selected in the viewer.
protected static void onComponentUnload(int hwnd, long visualID)
          Called when a component is un-loaded Emits PViewEvent.NODE_UNLOADED
protected static void onComponentVisible(int hwnd, long visualID, short vis)
          Called when a component is un-loaded Emits PViewEvent.NODE_HIDDEN or PViewEvent.VIEWED
protected static void onGetFile(String url, String extension, int hwnd, long visualID)
          Called when the viewer requires to access a file referenced by a URL PViewGetFile is used to perform the transfer
protected static void onLoadComplete(int hwnd)
          Called when the loading of the assembly is complete Currently this hide the Cancel button, and emits the PViewEvent.LOAD_COMPLETE
protected static void onLoadEDComplete(int hwnd)
          Called when the loading of an ED file is complete Emits PViewEvent.LOAD_ED_COMPLETE
protected static void onProbeCoord(int hwnd, String coord)
          Called when a co-ordinate is to be return from a probe Emits PViewEvent.PROBE
protected static void onSetStatusText(int hwnd, String msg)
          Called when a status message is produced from the viewer Emits PViewEvent.MESSAGE
protected static void onViewMoved(int hwnd, String viewLocation)
          Called when the view orientation changes Emits PViewEvent.VIEW_MOVED
 void probeMode()
          Viewer command : enter probe mode
 void projectionAbs()
          Viewer command : absolute projection of measurement
 void projectionUsr()
          Viewer command : User defined projection of measurement
 void projectionX()
          Viewer command : X projection of measurement
 void projectionY()
          Viewer command : Y projection of measurement
 void projectionZ()
          Viewer command : Z projection of measurement
protected  long reLoadComponent(long visualID)
          Reloads the component in the viewer, this will if necessary download the appropriate file(s) if referenced by a URL
 int reparent(int visualID, int newParent)
          Re-parents a component in the visualization tree
 void restorePosition()
          Viewer command : restore component position
protected  void selectComponent(long visualID)
          Selects the component in the viewer
 void selectMode()
          Viewer command : enter selection mode
 void selectSpinCenter()
          Viewer command : select spin center
static void setApplet(boolean app)
          Switches applet on/off
protected  void setAstLinks(String etb)
          Viewer command : setAstLinks
 void setCancelLoadingFlag(boolean flag)
          Used to stop the downloading of files.
 void setComponentLocation(long compid, String location)
           
 void setDebug(boolean debug)
          Switches debug information on/off
 void setMetaDataValue(long compid, String propName, String propValue)
           
 void setPropValueBool(long property, boolean value)
          Sets the value of a Property to the desired boolean value Properties should be referenced via the defined constants A property that will accept and understand a boolean value will be named with _BOOL_ in its name eg.
 void setPropValueColor(long property, long value)
          Sets the value of a Property to the desired color Properties should be referenced via the defined constants A property that will accept and understand a color value will be named with _CLR_ in its name eg.
 void setPropValueFloat(long property, float value)
          Sets the value of a Property to the desired float value Properties should be referenced via the defined constants A property that will accept and understand a float value will be named with _FLOAT_ in its name eg.
 void setPropValueInt(long property, long value)
          Sets the value of a Property to the desired integer value Properties should be referenced via the defined constants A property that will accept and understand an integer value will be named with _INT_ in its name eg.
 void setPropValueString(long property, String value)
          Sets the value of a Property to the desired integer value Properties should be referenced via the defined constants A property that will accept and understand a string value will be named with _STR_ in its name eg.
 int setURLAnchor(int visualID, String url)
          Sets the URL Anchor for a component in the structure
 void setViewLocation(String location)
           
 void setWindow(int w)
           
 void show()
          Show the viewer
 void showAll()
          Viewer command : show all
protected  long showComponent(long visualID)
          Shows the component in the viewer, this will if necessary download the appropriate file(s) if referenced by a URL
 void showSelected()
          Viewer command : show selected
protected  void signalFileArrived(String url, String localPath)
          Call back to the viewer to inform it that the file has arrived when a GetFile request was made.
 void snapToCenterPoint()
          Viewer command : Snap mode, center point
 void snapToComponent()
          Viewer command : Snap mode, component
 void snapToEdgeCurve()
          Viewer command : Snap mode, edge/curve
 void snapToMiddleEndPoint()
          Viewer command : Snap mode, middle/end point
 void snapToSurface()
          Viewer command : Snap mode, surface
protected  void start(PViewPanel pviewPanel, PViewCanvas component)
          Initializes the viewer
protected  long structureLockUpdates()
          Locks the structure in the viewer so that it can be manipulated
protected  long structureReset(boolean clearCache)
          Close the active visualization structure, removes the display, and optionally the viewer can delete any cached files.
protected  void structureUnlockUpdates()
          Un-locks the structure in the viewer
protected  void terminate()
          Terminates the current viewer, after clearing out its cached files.
 void toggleComponentRotate()
          Viewer command : toggle component movement about axes from Translation to Rotation
protected  void viewPrint()
          Viewer command : Print
 void zoomAll()
          Viewer command : zoom all
 void zoomSelected()
          Viewer command : zoom to selected
 void zoomWindow()
          Viewer command : zoom window
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

panels

private static Vector panels

hwnds

private static Vector hwnds

debug

private static boolean debug

cache

private static PViewCache cache

structureLocked

private boolean structureLocked

pviewid

private int pviewid

myHwnd

private int myHwnd

cancelLoadingFlag

private boolean cancelLoadingFlag

applet

private static boolean applet
Constructor Detail

PViewProxy

public PViewProxy(PViewPanel panel,
                  boolean debug)
           throws Exception,
                  UnsatisfiedLinkError
Creates the proxy class, associated to a parent PViewPanel.

Parameters:
panel - The controlling panel
debug - specifies if debug information is to be produced
Method Detail

setDebug

public void setDebug(boolean debug)
Switches debug information on/off

Parameters:
debug - specifies if debug information is to be produced

isDebug

public boolean isDebug()
Returns the debug state

Returns:
debug state

setApplet

public static void setApplet(boolean app)
Switches applet on/off


isApplet

public static boolean isApplet()
Returns the applet state

Returns:
debug state

setCancelLoadingFlag

public void setCancelLoadingFlag(boolean flag)
Used to stop the downloading of files. Usually called from a cancel button this sets a flag that the file download monitors. When set to true, the download will be terminated. And the viewer will be informed to stop processing further downloads for this show request.

Parameters:
flag - specifies if downloading is to be cancelled

isCancelLoadingFlag

public boolean isCancelLoadingFlag()
Returns the current state of Cancel Loading

Returns:
cancel loading state

getMyHwnd

protected int getMyHwnd()
Returns the Window handle that uniquely identifies this viewing panel

Returns:
the window handle

start

protected void start(PViewPanel pviewPanel,
                     PViewCanvas component)
Initializes the viewer

Parameters:
pviewPanel - the panel that this proxy is instantiated by
component - where the viewer will run. Usually a PViewCanvas

terminate

protected void terminate()
Terminates the current viewer, after clearing out its cached files.


getCache

protected PViewCache getCache()
Returns the associated cache

Returns:
the cache

deleteCache

protected void deleteCache()
Deletes the contents of the cache associated to this instance of the viewer


show

public void show()
Show the viewer


setWindow

public void setWindow(int w)

move

public void move(int x,
                 int y,
                 int dx,
                 int dy)
Process the movement of the viewer

Parameters:
x - X location
y - Y location
dx - Delta X
dy - X Delta Y

insertComponent

protected long insertComponent(long parent,
                               String name,
                               String shapeSource,
                               String idShapeSource,
                               String location,
                               String lengthUnit,
                               String boundingBox,
                               String color,
                               String material)
Inserts a component to be visualized

Parameters:
name - displayed during file transfer and in debug messages
location - the component location relative to the parent. "AX AY AZ X Y Z"
lengthUnit - the units of the location (typically M for Windchill)
color - the color
material - the material
Returns:
the visualID to the component from the viewer

loadComponent

protected long loadComponent(long visualID)
Loads the component in the viewer, this will if necessary download the appropriate file(s) if referenced by a URL

Parameters:
visualID - the visual identifier of a component

reLoadComponent

protected long reLoadComponent(long visualID)
Reloads the component in the viewer, this will if necessary download the appropriate file(s) if referenced by a URL

Parameters:
visualID - the visual identifier of a component

showComponent

protected long showComponent(long visualID)
Shows the component in the viewer, this will if necessary download the appropriate file(s) if referenced by a URL

Parameters:
visualID - the visual identifier of a component

hideComponent

protected long hideComponent(long visualID)
Hides the referenced component currently displayed in the viewer

Parameters:
visualID - the visual identifier of a component

componentSelect

protected void componentSelect(long visualID,
                               long select,
                               long reset)
Selects the component in the viewer

Parameters:
visualID - the visual identifier of a component

selectComponent

protected void selectComponent(long visualID)
Selects the component in the viewer

Parameters:
visualID - the visual identifier of a component

deselectComponent

protected void deselectComponent(long visualID)
Deselects the component in the viewer

Parameters:
visualID - the visual identifier of a component

insertProperty

public void insertProperty(int visualID,
                           String name,
                           String value)
Associates a Property and value to a coponent

Parameters:
visualID - the visual identifier of a component
name - the property name
value - the property value

isStructureLocked

protected boolean isStructureLocked()
Returns whether the structure is locked or not

Returns:
true if the structure is locked

structureReset

protected long structureReset(boolean clearCache)
Close the active visualization structure, removes the display, and optionally the viewer can delete any cached files. This is usually false, as other code is responsible for managing the cache

Parameters:
clearCache - if true the viewer will delete cached files

structureLockUpdates

protected long structureLockUpdates()
Locks the structure in the viewer so that it can be manipulated

Returns:
-1 if failed to lock

structureUnlockUpdates

protected void structureUnlockUpdates()
Un-locks the structure in the viewer

Returns:
-1 if failed to un-lock

reparent

public int reparent(int visualID,
                    int newParent)
Re-parents a component in the visualization tree

Parameters:
visualID - the visual identifier of a component
newParent - the visual identifier of a different parent
Returns:
- 1 if reparent fails.

deleteComponent

protected int deleteComponent(int visualID)
Deletes the specified component (with children) from the viewers strcuture representation. This will remove the effected components from the display

Parameters:
visualID - the visual identifier of a component

setURLAnchor

public int setURLAnchor(int visualID,
                        String url)
Sets the URL Anchor for a component in the structure

Parameters:
visualID - the visual identifier of a component
url - the anchor

getHwnd

protected static int getHwnd(PViewPanel pvp,
                             PViewCanvas canvas)
Returns the Window handle that uniquely identifies this viewing panel

Returns:
the window handle

selectMode

public void selectMode()
Viewer command : enter selection mode


probeMode

public void probeMode()
Viewer command : enter probe mode


featureSelectMode

public void featureSelectMode()
Viewer command : enter select feature mode


selectSpinCenter

public void selectSpinCenter()
Viewer command : select spin center


zoomWindow

public void zoomWindow()
Viewer command : zoom window


zoomAll

public void zoomAll()
Viewer command : zoom all


zoomSelected

public void zoomSelected()
Viewer command : zoom to selected


hideSelected

public void hideSelected()
Viewer command : hide selected


showSelected

public void showSelected()
Viewer command : show selected


showAll

public void showAll()
Viewer command : show all


restorePosition

public void restorePosition()
Viewer command : restore component position


displayShaded

public void displayShaded()
Viewer command : display shaded


displayHLR

public void displayHLR()
Viewer command : display hidden line removed


displayWireframe

public void displayWireframe()
Viewer command : display wire frame


dimensionMeasurement

public void dimensionMeasurement()
Viewer command : dimension measurement


distanceMeasurement

public void distanceMeasurement()
Viewer command : distance measurement


clearMeasurements

public void clearMeasurements()
Viewer command : clear all measurement


projectionAbs

public void projectionAbs()
Viewer command : absolute projection of measurement


projectionX

public void projectionX()
Viewer command : X projection of measurement


projectionY

public void projectionY()
Viewer command : Y projection of measurement


projectionZ

public void projectionZ()
Viewer command : Z projection of measurement


projectionUsr

public void projectionUsr()
Viewer command : User defined projection of measurement


snapToMiddleEndPoint

public void snapToMiddleEndPoint()
Viewer command : Snap mode, middle/end point


snapToCenterPoint

public void snapToCenterPoint()
Viewer command : Snap mode, center point


snapToEdgeCurve

public void snapToEdgeCurve()
Viewer command : Snap mode, edge/curve


snapToSurface

public void snapToSurface()
Viewer command : Snap mode, surface


snapToComponent

public void snapToComponent()
Viewer command : Snap mode, component


viewPrint

protected void viewPrint()
Viewer command : Print


copyImage

protected void copyImage()
Viewer command : Copy Image to clipboard


setAstLinks

protected void setAstLinks(String etb)
Viewer command : setAstLinks


annotationActivate

protected void annotationActivate(String name)
Viewer command : annotationActivate


annotationShow

protected void annotationShow(String name,
                              short enable,
                              short show)
Viewer command : annotationShow


setPropValueColor

public void setPropValueColor(long property,
                              long value)
Sets the value of a Property to the desired color Properties should be referenced via the defined constants A property that will accept and understand a color value will be named with _CLR_ in its name eg. VIEW_PROP_CLR_BKG

Parameters:
property - the viewer property
value - the color

setPropValueInt

public void setPropValueInt(long property,
                            long value)
Sets the value of a Property to the desired integer value Properties should be referenced via the defined constants A property that will accept and understand an integer value will be named with _INT_ in its name eg. VIEW_PROP_INT_DIMUNIT

Parameters:
property - the viewer property
value - the integer value

setPropValueBool

public void setPropValueBool(long property,
                             boolean value)
Sets the value of a Property to the desired boolean value Properties should be referenced via the defined constants A property that will accept and understand a boolean value will be named with _BOOL_ in its name eg. VIEW_PROP_BOOL_GNOMON

Parameters:
property - the viewer property
value - the boolean value

setPropValueString

public void setPropValueString(long property,
                               String value)
Sets the value of a Property to the desired integer value Properties should be referenced via the defined constants A property that will accept and understand a string value will be named with _STR_ in its name eg. VIEW_PROP_STR_FONT

Parameters:
property - the viewer property
value - the string value

setPropValueFloat

public void setPropValueFloat(long property,
                              float value)
Sets the value of a Property to the desired float value Properties should be referenced via the defined constants A property that will accept and understand a float value will be named with _FLOAT_ in its name eg. VIEW_PROP_FLOAT_SLOPE

Parameters:
property - the viewer property
value - the float value

toggleComponentRotate

public void toggleComponentRotate()
Viewer command : toggle component movement about axes from Translation to Rotation


cancelLoading

public void cancelLoading()
During the execution of showComponent, Cancel the down loading of files, and end the command


setMetaDataValue

public void setMetaDataValue(long compid,
                             String propName,
                             String propValue)

getMetaDataValue

public String getMetaDataValue(long compid,
                               String propName)

setViewLocation

public void setViewLocation(String location)

setComponentLocation

public void setComponentLocation(long compid,
                                 String location)

nativeShow

private void nativeShow(int hwnd)

nativeSetWindow

private void nativeSetWindow(int hwnd)

nativeRefreshWindow

private void nativeRefreshWindow(int hwnd)

nativeRefreshAllWindows

private void nativeRefreshAllWindows(int hwnd)

nativeCreateView

private int nativeCreateView(int hwnd,
                             String viewType)

nativeUpdateTreeView

private void nativeUpdateTreeView(int hwnd)

nativeReParent

private int nativeReParent(int hwnd,
                           int compID,
                           int parentID)

nativeDeleteComponent

private int nativeDeleteComponent(int hwnd,
                                  int compID)

nativeSetURLAnchor

private int nativeSetURLAnchor(int hwnd,
                               int compID,
                               String URL)

nativeDisplayIn

private int nativeDisplayIn(int hwnd,
                            int compID,
                            int viewID)

nativeInitialize

private int nativeInitialize(int hwnd)

nativePluginMove

private void nativePluginMove(int hwnd,
                              int x,
                              int y,
                              int dx,
                              int dy)

nativeStructureReset

private long nativeStructureReset(int hwnd,
                                  boolean clearCache)

nativeStructureLockUpdates

private long nativeStructureLockUpdates(int hwnd)

nativeStructureUnlockUpdates

private void nativeStructureUnlockUpdates(int hwnd)

nativeInsertComponent

private long nativeInsertComponent(int hwnd,
                                   long parentID,
                                   String name,
                                   String shapeSource,
                                   String idShapeSource,
                                   String location,
                                   String lengthUnit,
                                   String boundingBox,
                                   String color,
                                   String material)

nativeLoadComponent

private long nativeLoadComponent(int hwnd,
                                 long id)

nativeReLoadComponent

private long nativeReLoadComponent(int hwnd,
                                   long id)

nativeShowComponent

private long nativeShowComponent(int hwnd,
                                 long id)

nativeHideComponent

private long nativeHideComponent(int hwnd,
                                 long id)

nativeComponentSelect

private void nativeComponentSelect(int hwnd,
                                   long id,
                                   long select,
                                   long reset)

nativeSelectComponent

private void nativeSelectComponent(int hwnd,
                                   long id)

nativeDeSelectComponent

private void nativeDeSelectComponent(int hwnd,
                                     long id)

nativeInsertProperty

private void nativeInsertProperty(int hwnd,
                                  long id,
                                  String propName,
                                  String propValue)

nativeTerminate

private int nativeTerminate(int hwnd)

nativeFileArrived

private void nativeFileArrived(int hwnd,
                               String requestedFile,
                               String localPath)

nativeSelectMode

private void nativeSelectMode(int hwnd)

nativeProbeMode

private void nativeProbeMode(int hwnd)

nativeFeatureSelectMode

private void nativeFeatureSelectMode(int hwnd)

nativeSelectSpinCenter

private void nativeSelectSpinCenter(int hwnd)

nativeZoomWindow

private void nativeZoomWindow(int hwnd)

nativeZoomAll

private void nativeZoomAll(int hwnd)

nativeZoomSelected

private void nativeZoomSelected(int hwnd)

nativeHideSelected

private void nativeHideSelected(int hwnd)

nativeShowSelected

private void nativeShowSelected(int hwnd)

nativeShowAll

private void nativeShowAll(int hwnd)

nativeRestorePosition

private void nativeRestorePosition(int hwnd)

nativeDisplayShaded

private void nativeDisplayShaded(int hwnd)

nativeDisplayHLR

private void nativeDisplayHLR(int hwnd)

nativeDisplayWireframe

private void nativeDisplayWireframe(int hwnd)

nativeDimensionMeasurement

private void nativeDimensionMeasurement(int hwnd)

nativeDistanceMeasurement

private void nativeDistanceMeasurement(int hwnd)

nativeClearMeasurements

private void nativeClearMeasurements(int hwnd)

nativeProjectionAbs

private void nativeProjectionAbs(int hwnd)

nativeProjectionX

private void nativeProjectionX(int hwnd)

nativeProjectionY

private void nativeProjectionY(int hwnd)

nativeProjectionZ

private void nativeProjectionZ(int hwnd)

nativeProjectionUsr

private void nativeProjectionUsr(int hwnd)

nativeSnapToMiddleEndPoint

private void nativeSnapToMiddleEndPoint(int hwnd)

nativeSnapToCenterPoint

private void nativeSnapToCenterPoint(int hwnd)

nativeSnapToEdgeCurve

private void nativeSnapToEdgeCurve(int hwnd)

nativeSnapToSurface

private void nativeSnapToSurface(int hwnd)

nativeSnapToComponent

private void nativeSnapToComponent(int hwnd)

nativeToggleComponentRotate

private void nativeToggleComponentRotate(int hwnd)

nativeCancelLoading

private void nativeCancelLoading(int hwnd)

nativeViewPrint

private void nativeViewPrint(int hwnd)

nativeCopyImage

private void nativeCopyImage(int hwnd)

nativeSetAstLinks

private void nativeSetAstLinks(int hwnd,
                               String etb)

nativeAnnotationActivate

private void nativeAnnotationActivate(int hwnd,
                                      String name)

nativeAnnotationShow

private void nativeAnnotationShow(int hwnd,
                                  String name,
                                  short enable,
                                  short show)

nativeSetMetaDataValue

private void nativeSetMetaDataValue(int hwnd,
                                    long compid,
                                    String propName,
                                    String propValue)

nativeGetMetaDataValue

private String nativeGetMetaDataValue(int hwnd,
                                      long compid,
                                      String propName)

nativeSetViewLocation

private void nativeSetViewLocation(int hwnd,
                                   String location)

nativeSetComponentLocation

private void nativeSetComponentLocation(int hwnd,
                                        long compid,
                                        String location)

nativeSetPropValueInt

private void nativeSetPropValueInt(int hwnd,
                                   long property,
                                   long value)

nativeSetPropValueBool

private void nativeSetPropValueBool(int hwnd,
                                    long property,
                                    boolean value)

nativeSetPropValueFloat

private void nativeSetPropValueFloat(int hwnd,
                                     long property,
                                     float value)

nativeSetPropValueString

private void nativeSetPropValueString(int hwnd,
                                      long property,
                                      String value)

nativeMethod

private void nativeMethod(int hwnd,
                          long id)

findPanelForHwnd

private static PViewPanel findPanelForHwnd(int hwnd)
Used by the callbacks from the viewer. This finds the Panel that is associated to the window handle

Parameters:
hwnd - the window handle
Returns:
the panel

addPanelForHwnd

private static void addPanelForHwnd(PViewPanel pviewPanel,
                                    int hwnd)
Maintains a lookup between the different instances of the viewer and their window handles

Parameters:
pviewPanel - the panel
hwnd - the window handle

deletePanelForHwnd

private static void deletePanelForHwnd(int hwnd)
Removes an entry from the lookup between the different instances of the viewer and their window handles

Parameters:
hwnd - the window handle

onComponentSelected

protected static void onComponentSelected(int hwnd,
                                          long visualID)
Called when a component is selected in the viewer. This will emit the PViewEvent.NODE_SELECTED

Parameters:
hwnd - the window handle
visualID - the visual identifier of a component

onComponentDeselected

protected static void onComponentDeselected(int hwnd,
                                            long visualID)
Called when a component is de-selected in the viewer. This will emit the PViewEvent.NODE_DESELECTED

Parameters:
hwnd - the window handle
visualID - the visual identifier of a component

onComponentActivated

protected static void onComponentActivated(int hwnd,
                                           long visualID)
Called when a component is activated in the viewer. This will emit the PViewEvent.NODE_ACTIVATED

Parameters:
hwnd - the window handle
visualID - the visual identifier of a component

onComponentMoved

protected static void onComponentMoved(int hwnd,
                                       long visualID,
                                       String location)
Called when a component is moved in the viewer. Emits PViewEvent.NODE_MOVED

Parameters:
hwnd - the window handle
visualID - the visual identifier of a component

onViewMoved

protected static void onViewMoved(int hwnd,
                                  String viewLocation)
Called when the view orientation changes Emits PViewEvent.VIEW_MOVED

Parameters:
hwnd - the window handle

onLoadComplete

protected static void onLoadComplete(int hwnd)
Called when the loading of the assembly is complete Currently this hide the Cancel button, and emits the PViewEvent.LOAD_COMPLETE

Parameters:
hwnd - the window handle

onLoadEDComplete

protected static void onLoadEDComplete(int hwnd)
Called when the loading of an ED file is complete Emits PViewEvent.LOAD_ED_COMPLETE

Parameters:
hwnd - the window handle

onGetFile

protected static void onGetFile(String url,
                                String extension,
                                int hwnd,
                                long visualID)
Called when the viewer requires to access a file referenced by a URL PViewGetFile is used to perform the transfer

Parameters:
url - the url required
extension - the file extension
hwnd - the window handle
visualID - the visual identifier of a component

onSetStatusText

protected static void onSetStatusText(int hwnd,
                                      String msg)
Called when a status message is produced from the viewer Emits PViewEvent.MESSAGE

Parameters:
hwnd - the window handle
msg - the viewer message

onProbeCoord

protected static void onProbeCoord(int hwnd,
                                   String coord)
Called when a co-ordinate is to be return from a probe Emits PViewEvent.PROBE

Parameters:
hwnd - the window handle
coord - the probed co-ordinates

onComponentLoad

protected static void onComponentLoad(int hwnd,
                                      long visualID)
Called when a component is loaded Emits PViewEvent.NODE_LOADED, and caches the reference between the url and file

Parameters:
hwnd - the window handle
visualID - the visual identifier of a component

onComponentUnload

protected static void onComponentUnload(int hwnd,
                                        long visualID)
Called when a component is un-loaded Emits PViewEvent.NODE_UNLOADED

Parameters:
hwnd - the window handle
visualID - the visual identifier of a component

onComponentVisible

protected static void onComponentVisible(int hwnd,
                                         long visualID,
                                         short vis)
Called when a component is un-loaded Emits PViewEvent.NODE_HIDDEN or PViewEvent.VIEWED

Parameters:
hwnd - the window handle
visualID - the visual identifier of a component
vis - 0 - Hidden, 1 - made visible

signalFileArrived

protected void signalFileArrived(String url,
                                 String localPath)
Call back to the viewer to inform it that the file has arrived when a GetFile request was made.

Parameters:
url - the url requested
localPath - the filname of the file in the cache