|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jv.object.PsObject
|
+--jv.project.PjProject
Central control class whose subclasses are application specific user projects. Projects might compute surfaces, load geometries from file, or solve differential equations. They are specialized classes making use of all the functionality available in JavaView. Projects can be used as building blocks in other projects.
The advantage of wrapping an application inside a project rather than an applet is the fact, that projects are considered as building blocks respectively modules in JavaView, which can be used by other projects to perform specific tasks. Although applets usually wrap an application but they contain too many presentation specific functionality to serve as reusable modules. An alternative to JavaView projects is the use of Java beans.
Subclasses are usually instantiated at following occasions:
PvViewer as current project.
This mainly determines the initial functionality of the applet.
If projects are registered in PvViewer, then PvViewer
registers itself as parent of the project. This happens e.g. in cases 1. and 3. above,
In case 2. the container project may, for example, register itself as parent.
When the project is selected in PvViewer by
selectProject(String), then that
method in turn registers a default display and invokes the start()
method of this project.
A project has a main geometry, although it may have more geometries and even a network
of geometries. It may have associated displays (might not be true in future),
it may have an associated animation to receive update(time) events,
and it may receive pick events from an associated PvDisplay.
A project may have an animation object which handles the projects animations.
If a project has an animation object, then the animation panel is shown
when the project's start() method is invoked during loading
of the project. Only one animation object may be set in a project, but a
user might register the project in other animation objects. Use
setAnimation(PsAnimation) to register an
animation.
To be able to access the global viewer the project must either be registered in PvViewer using addProject() or the viewer should be set directly using setViewer().
getAnimationPanel() added.PsTimeListenerIf,
PsAnimation,
PvDisplay,
PvViewer, Serialized Form| Fields inherited from class jv.object.PsObject |
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, NUM_TAGS |
| Constructor Summary | |
PjProject(java.lang.String aName)
Constructor with unique name. |
|
| Method Summary | |
boolean |
addDisplay(PvDisplayIf display)
Register a new display, e.g. to be deleted when project is removed. |
boolean |
addGeometry(PgGeometryIf aGeometry)
Register new geometry in project and the selected display. |
boolean |
addGeometry(PgGeometryIf aGeometry,
boolean bUpdateDisplay)
Register new geometry in project and the selected display, but do not update the display if not requested. |
void |
dispose()
Disconnect all links to other classes and prepare for deletion. |
void |
dragDisplay(PvPickEvent pos)
Drag a location in the display with 2d display and 3d world coordinates. |
void |
dragInitial(PvPickEvent pos)
Drag an arbitrary point along a geometry, point may lie inside an element. |
void |
dragVertex(PgGeometryIf geom,
int vertexIndex,
PdVector vertex)
Drag a picked vertex of a geometry. |
void |
fitDisplays()
Scale the current camera in all displays such that geometry fills the display. |
PsAnimation |
getAnimation()
Get the animation object of the project which handles the projects animations. |
PvDisplayIf |
getDisplay()
Get currently selected display. |
java.util.Enumeration |
getDisplays()
Get all registered displays as enumeration. |
PgGeometryIf |
getGeometry()
Get currently selected geometry of project. |
PgGeometryIf |
getGeometry(int anInd)
Get a registered geometry with given index. |
int |
getNumGeometries()
Get number of registered geometries of project. |
java.lang.String |
getParameter(java.lang.String parmLabel)
Get project parameter. |
PvViewerIf |
getViewer()
Get viewer. |
boolean |
hasAnimation()
Check whether this project is registered as listener of an animation object. |
boolean |
hasDisplay(PvDisplayIf display)
Check for a registered display. |
void |
init()
Initialize and reset project, stops the running animation if any. |
boolean |
isEnabledAutoFit()
Determine flag which determines whether scenery is scaled to fit display when start() is called. |
void |
markVertices(PvPickEvent markBox)
Mark a set of vertices of a geometry within a given bounding box. |
void |
pickDisplay(PvPickEvent pos)
Get a location in the display with 2d display and 3d world coordinates. |
void |
pickInitial(PvPickEvent pos)
Pick an arbitrary point on a geometry, point may lie inside an element. |
void |
pickVertex(PgGeometryIf geom,
int vertexIndex,
PdVector vertex)
Get a picked vertex of a geometry. |
boolean |
removeDisplay(PvDisplayIf display)
Remove a registered display from list of registered displays. |
void |
removeGeometries()
Remove all registered geometries from project and registered displays. |
void |
removeGeometry(PgGeometryIf aGeometry)
Remove previously registered geometry from project and the selected display. |
boolean |
selectDisplay(PvDisplayIf disp)
Select a display to become the default display to which geometries are added. |
void |
selectGeometry(PgGeometryIf aGeometry)
Select registered geometry in the project and in the selected display. |
void |
setAnimation(PsAnimation anAnimation)
Assign the animation object where this listener is registered. |
void |
setDisplay(PvDisplayIf disp)
Register display, and add all geometries of project to display. |
void |
setEnabledAutoFit(boolean flag)
Set flag which determines whether scenery is scaled to fit display when start() is called. |
void |
setParameter(java.lang.String[][] parm)
Set project parameter. |
boolean |
setTime(PsTimeEvent time)
Empty method, must be overwritten by subclasses to update dynamic object. |
void |
setViewer(PvViewerIf viewer)
Set viewer for direct access to central dialogs, windows, and projects of JavaView. |
void |
start()
Method is invoked during loading of a project in JavaView. |
void |
stop()
Stop all animations and auto-rotation in display. |
void |
unmarkVertices(PvPickEvent markBox)
Unmark a set of vertices of a geometry within a given bounding box. |
| Methods inherited from class jv.object.PsObject |
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, toString, update, updatePanels |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jv.anim.PsTimeListenerIf |
getName |
| Methods inherited from interface jv.project.PvPickListenerIf |
getName |
| Methods inherited from interface jv.object.PsUpdateIf |
getFather, getName, setParent, update |
| Constructor Detail |
public PjProject(java.lang.String aName)
| Method Detail |
public void init()
init in class PsObjectpublic void dispose()
public void start()
If a project has an animation object, then the animation panel is shown
when the project's this start() method is invoked during loading
of the project. Use setAnimation(PsAnimation)
to register an animation.
If auto fit is enabled then scenery is scaled to fit in each display.
PvViewerIf.start(),
#isEnabledAutoFit(boolean)public void stop()
PvViewerIf.stop()public boolean isEnabledAutoFit()
start() is called. On default, auto fit is enabled.setEnabledAutoFit(boolean)public void setEnabledAutoFit(boolean flag)
start() is called. On default, auto fit is enabled.#isEnabledAutoFit(boolean)public PvViewerIf getViewer()
PsViewerIf,
PvViewer.PvViewer(Applet, Frame)public void setViewer(PvViewerIf viewer)
getViewer(),
PvViewerIf,
PvViewer.PvViewer(Applet, Frame)public java.lang.String getParameter(java.lang.String parmLabel)
public void setParameter(java.lang.String[][] parm)
public void pickDisplay(PvPickEvent pos)
pickDisplay in interface PvPickListenerIfpos - Pick event issued by the displayPvPickListenerIfpublic void dragDisplay(PvPickEvent pos)
pickDisplay() and should be overwritten.dragDisplay in interface PvPickListenerIfpos - Pick event issued by the displayPvPickListenerIfpublic void pickInitial(PvPickEvent pos)
pickInitial in interface PvPickListenerIfpos - Pick event issued by the displayPvPickListenerIfpublic void dragInitial(PvPickEvent pos)
pickInitial() and should be overwritten.dragInitial in interface PvPickListenerIfpos - Pick event issued by the displayPvPickListenerIf
public void pickVertex(PgGeometryIf geom,
int vertexIndex,
PdVector vertex)
pickVertex in interface PvPickListenerIfgeom - Picked geometry on which vertex liesindex - Index of vertex in vertex array of geometryvertex - 3d coordinates of vertex positionPvPickListenerIf
public void dragVertex(PgGeometryIf geom,
int vertexIndex,
PdVector vertex)
pickVertex() and should be overwritten.dragVertex in interface PvPickListenerIfgeom - Picked geometry on which vertex liesindex - Index of vertex in vertex array of geometryvertex - 3d coordinates of vertex positionPvPickListenerIfpublic void markVertices(PvPickEvent markBox)
markVertices in interface PvPickListenerIfmarkBox - contains four coplanar points on the bounding prism, and direction of prism.public void unmarkVertices(PvPickEvent markBox)
unmarkVertices in interface PvPickListenerIfmarkBox - contains four coplanar points on the bounding prism, and direction of prism.public boolean addGeometry(PgGeometryIf aGeometry)
aGeometry - geometry to be added to this project and the current display.false if geometry was null or already registered in project.
public boolean addGeometry(PgGeometryIf aGeometry,
boolean bUpdateDisplay)
Even if the geometry was previously added to this project, this method re-registers in the display since it might have been deleted in the display.
The update of the display is performed only if the argument geometry is not already registered in the display.
aGeometry - geometry to be added to this project and the current display.bUpdateDisplay - flag whether display shall be updated when geometry is added.false if geometry was null or already registered in project.public void removeGeometry(PgGeometryIf aGeometry)
public void selectGeometry(PgGeometryIf aGeometry)
selectGeometry in interface PvPickListenerIfpublic void removeGeometries()
public int getNumGeometries()
addGeometry(PgGeometryIf)public PgGeometryIf getGeometry(int anInd)
addGeometry(PgGeometryIf)public PgGeometryIf getGeometry()
selectGeometry(PgGeometryIf)public PsAnimation getAnimation()
setAnimation(PsAnimation).getAnimation in interface PsTimeListenerIfhasAnimation(),
setAnimation(PsAnimation)public boolean hasAnimation()
hasAnimation in interface PsTimeListenerIfgetAnimation(),
setAnimation(PsAnimation)public void setAnimation(PsAnimation anAnimation)
If this project has an animation object assigned in its constructor or
init() method, then the animation panel is shown when the project's
start() method is invoked during loading of the project.
Only one animation object may be assigned to this listener. Subsequent assignments will replace the previous assignment.
setAnimation in interface PsTimeListenerIfgetAnimation(),
hasAnimation()public boolean setTime(PsTimeEvent time)
setTime in interface PsTimeListenerIfpublic void fitDisplays()
public void setDisplay(PvDisplayIf disp)
Project registers itself as pick listener of the display.
For example, method is called from PvViewer when display exists and project is selected, or when default display is requested from PvViewer from somewhere else.
addDisplay(PvDisplayIf)public PvDisplayIf getDisplay()
selectDisplay(PvDisplayIf)public boolean selectDisplay(PvDisplayIf disp)
For example, method is called from PvViewer when display exists and project is selected, or when default display is requested from PvViewer from somewhere else.
setDisplay(PvDisplayIf)public boolean addDisplay(PvDisplayIf display)
Note: project is not registered as pick listener in display neither are any geometries automatically registered in display. This should all be done by hand.
false if instance already registered.getDisplays()public java.util.Enumeration getDisplays()
null if no displays found.addDisplay(PvDisplayIf)public boolean hasDisplay(PvDisplayIf display)
true if registered display found.addDisplay(PvDisplayIf),
getDisplays()public boolean removeDisplay(PvDisplayIf display)
Display - false if display does not exists.addDisplay(PvDisplayIf)
|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||