com.ptc.wvs.client.pview
Class PViewStructure

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

public class PViewStructure
extends Object

The viewer structure object is currently in a primative form. Its purpose is to keep track of the structure that has been passed to the viewer.

In the future this will
a)track changes in location in the structure
b)allow multiple viewables (sub-structure) to be associated to a single node in the calling application
c)ensure correct visual update on component movement and deletion



Supported API: false

Extendable: false


Field Summary
private  boolean debug
           
private  Vector loaded
           
private  Vector locations
           
private  Vector names
           
private  PViewProxy proxy
           
private  long rootNodeID
           
private  Vector shapesources
           
private  boolean structureLoaded
           
private  Vector visualIDs
           
 
Constructor Summary
(package private) PViewStructure(PViewProxy proxy, boolean debug)
          Create the structure
 
Method Summary
 void componentSelect(long visualID, long select, long reset)
          Visual select on the component
 void dataLoaded(long visualID)
          Sets to true the load state of a element in the structure
private  void dataLoaded(String shapesource)
          Sets to true the load state of a element in the structure
 void deleteComponent(long visualID)
          Visually delete the component and tidy up
 void deselectComponent(long visualID)
          Visual deselect on the component
 void dump()
           
 String getShapeSource(long visualID)
          Find the shapesource assocaited to the component id
 String getStructureNameforID(long visualID)
          Find the name assocaited to the component id
 void hideComponent(long visualID)
          Visually hide the component
 long insertComponent(long parentID, String name, String shapeSource, String idShapeSource, String location, String lengthUnit, String boundingBox, String color, String material)
          Inserts a component into the structure
 long insertComponent(long parentID, String name, String edFileUrl, String idShapeSource, String location, String lengthUnit, String boundingBox, String color, String material, String compID, String linkID)
          Inserts a component into the structure.
 boolean isDataLoaded(long visualID)
          Returns the load state of a component
private  boolean isDataLoaded(String shapesource)
          Returns the load state of a file referenced by a URL
 boolean isDebug()
          Returns the debug state
 boolean isStructureLoaded()
          Returns the loaded state of the structure
 boolean resetStructure(boolean clearCache)
          Resets the structure and all assocaited viewing information
 void selectComponent(long visualID)
          Visual select on the component
 void setDebug(boolean debug)
          Switches debug information on/off
 void setStructureLoaded(boolean loaded)
          Sets is a structure is loaded
 void showComponent(long visualID)
          Visually show the component
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootNodeID

private long rootNodeID

proxy

private PViewProxy proxy

structureLoaded

private boolean structureLoaded

visualIDs

private Vector visualIDs

names

private Vector names

loaded

private Vector loaded

shapesources

private Vector shapesources

locations

private Vector locations

debug

private boolean debug
Constructor Detail

PViewStructure

PViewStructure(PViewProxy proxy,
               boolean debug)
Create the structure

Parameters:
proxy - the viewer proxy
debug - flag
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

resetStructure

public boolean resetStructure(boolean clearCache)
Resets the structure and all assocaited viewing information

Parameters:
clearCache - specifies if the file cache is to be also cleared
Returns:
True if structure successfully reset

setStructureLoaded

public void setStructureLoaded(boolean loaded)
Sets is a structure is loaded

Returns:
loaded state of the structure

isStructureLoaded

public boolean isStructureLoaded()
Returns the loaded state of the structure

Returns:
loaded state

insertComponent

public long insertComponent(long parentID,
                            String name,
                            String shapeSource,
                            String idShapeSource,
                            String location,
                            String lengthUnit,
                            String boundingBox,
                            String color,
                            String material)
Inserts a component into the structure

Parameters:
parentID - the visualID of the parent. 0 if this is the root node
name - displayed during file transfer and in debug messages
location - the component location relative to the parent. x,y,z,ax,ay,az
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

dump

public void dump()

insertComponent

public long insertComponent(long parentID,
                            String name,
                            String edFileUrl,
                            String idShapeSource,
                            String location,
                            String lengthUnit,
                            String boundingBox,
                            String color,
                            String material,
                            String compID,
                            String linkID)
Inserts a component into the structure. This has knowledge of the structure used to update position etc

Parameters:
parentID - the visualID of the parent. 0 if this is the root node
name - displayed during file transfer and in debug messages
edFileUrl - the url to the viewable information, in the case the ed file
location - the component location relative to the parent. x,y,z,ax,ay,az
lengthUnit - the units of the location (typically M for Windchill)
color - the color
material - the material
compID - an identifier to the component
linkID - an identifier to the link
Returns:
the visualID to the component from the viewer

NOT YET IMPLEMENTED


isDataLoaded

public boolean isDataLoaded(long visualID)
Returns the load state of a component

Parameters:
visualID - the id whose data is to be retrieved
Returns:
loaded state

isDataLoaded

private boolean isDataLoaded(String shapesource)
Returns the load state of a file referenced by a URL

Parameters:
shapesource - the file url
Returns:
loaded state

dataLoaded

public void dataLoaded(long visualID)
Sets to true the load state of a element in the structure

Parameters:
visualID - the id of the data

dataLoaded

private void dataLoaded(String shapesource)
Sets to true the load state of a element in the structure

Parameters:
shapesource - the file url

componentSelect

public void componentSelect(long visualID,
                            long select,
                            long reset)
Visual select on the component

Parameters:
visualID - the id of the component

selectComponent

public void selectComponent(long visualID)
Visual select on the component

Parameters:
visualID - the id of the component

deselectComponent

public void deselectComponent(long visualID)
Visual deselect on the component

Parameters:
visualID - the id of the component

showComponent

public void showComponent(long visualID)
Visually show the component

Parameters:
visualID - the id of the component

hideComponent

public void hideComponent(long visualID)
Visually hide the component

Parameters:
visualID - the id of the component

deleteComponent

public void deleteComponent(long visualID)
Visually delete the component and tidy up

Parameters:
visualID - the id of the component

getStructureNameforID

public String getStructureNameforID(long visualID)
Find the name assocaited to the component id

Returns:
the name

getShapeSource

public String getShapeSource(long visualID)
Find the shapesource assocaited to the component id

Returns:
the shapesource