|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jv.object.PsObject
|
+--jv.viewer.PvViewer
Manages the 3d-display, control window, and list of projects. Central class in JavaView and usually created at the beginning of an applet or application.
Add one, or more, projects PjProject
via method calls addProject. Once a project has been
registered this way, it may be selected by
selectProject(String)
to become the active project, i.e. its geometry is rendered in the
display getDisplay() and its panels
are accessible via the control window which can be shown via
showPanel(int).
The default 3d-display is be obtained from PvViewer by
getDisplay() for inclusion in a container,
e.g. inside an applet or standalone frame.
The control window may be slightly configured by
showPanel(int). It is created whenever a panel
is requested, i.e. initially there are no inspector panels allocated.
PsViewerIf.PsViewerIf,
PjProject,
addProject(java.lang.String, java.lang.String, java.lang.String, java.lang.String[]),
selectProject(java.lang.String), Serialized Form| Field Summary | |
protected int[] |
m_aboutSize
Size of about dialog. |
protected int[] |
m_animationSize
Size of animation dialog. |
protected java.applet.Applet |
m_applet
Current applet used for parameter parsing. |
protected int[] |
m_consoleSize
Size of console window. |
protected jv.viewer.PvControl |
m_control
Seperate frame with control panel, invoked via F1 key |
protected boolean |
m_controlShow
Switches visibility of control panel. |
protected int[] |
m_controlSize
Size of control window. |
protected PgGeometryIf |
m_currentGeometry
Currently selected geometry in display. |
protected PjProject |
m_currentProject
Currently selected project. |
protected PvDisplayIf |
m_display
Currently active display, receives keyboard events. |
protected java.util.Hashtable |
m_displayList
Contains all registered displays with name and display instance. |
protected int[] |
m_exportBounds
Size of frame with exported geometry data. |
protected java.lang.String |
m_exportDirName
Name of directory which was last selected in the export file browser, only for applications. |
protected java.awt.Frame |
m_frame
Current frame used as major parent frame for all further frames. |
protected java.util.Hashtable |
m_frameList
List of frame windows of JavaView. |
protected java.util.Hashtable |
m_geometryCategory
Contains all registered geometries with category and class name. |
protected java.util.Hashtable |
m_geometryClass
Contains all registered geometries with name and full class name. |
protected jv.viewer.PvDisplayHelp |
m_help
Help dialog |
protected int[] |
m_helpSize
Size of help dialog. |
protected java.lang.String |
m_imageDirName
Name of directory which was last selected in the image file browser, only for applications. |
protected java.lang.String |
m_importDirName
Name of directory which was last selected in the import file browser, only for applications. |
protected PjImportModel_Dialog |
m_importModelDialog
Model import dialog |
protected int[] |
m_importModelSize
Size of dialog for importing a model. |
protected PsJavaView |
m_jvRsrc
Current resources used in JavaView session. |
protected PvDisplayIf |
m_mainDisplay
Main display to be associated when 'New Project' is chosen. |
protected int[] |
m_newProjectSize
Size of dialog for loading a new project. |
protected java.lang.String[][] |
m_parm
Parsed applet parameter. |
protected java.util.Hashtable |
m_projectCategory
Contains all registered projects with category and name. |
protected java.util.Hashtable |
m_projectClass
Contains all registered projects with name and full class name. |
protected java.util.Hashtable |
m_projectList
Contains all registered projects with name and project instance. |
protected java.util.Hashtable |
m_projectParms
Contains all registered projects with name and parameter array |
protected java.lang.String |
m_serialDirName
Name of directory which was last selected in the export file browser, only for applications. |
| Fields inherited from class jv.object.PsObject |
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, m_infoPanel, m_name, m_panelList, m_parent, m_tag, m_updateList, NUM_TAGS |
| Constructor Summary | |
PvViewer()
Constructor for JavaView's display and project manager if JavaView runs inside another program. |
|
PvViewer(java.applet.Applet applet,
java.awt.Frame frame)
Constructor for JavaView's display and project manager JavaView runs in an applet or as standalone application. |
|
| Method Summary | |
boolean |
addDisplay(java.lang.String name,
PvDisplayIf display)
Register a new display under a name. |
protected boolean |
addFrame(java.lang.String name,
java.awt.Frame frame)
Register a new frame. |
boolean |
addGeometry(java.lang.String category,
java.lang.String name,
java.lang.String className)
Registers the name and class of a geometry class in the viewer in given category. |
boolean |
addProject(PjProject aProject)
Registers name and instance of a project in the viewer. |
boolean |
addProject(java.lang.String name,
java.lang.String className,
java.lang.String[] parmList)
Registers the name and class of a project in the viewer in default category. |
boolean |
addProject(java.lang.String category,
java.lang.String name,
java.lang.String className,
java.lang.String[] parmList)
Registers the name and class of a project in the viewer in given category. |
void |
addProjects()
Parses and adds all projects mentioned in the applet's parmInfo or Html page. |
protected void |
deserialize()
|
void |
destroy()
Called from an applet.destroy() method to perform clean-up when applet gets destroyed. |
void |
enableMenu(int menuId,
boolean cond)
Enable/disable menu entries in menu bar of control window. |
boolean |
enablePanel(int aPanel,
boolean cond)
Enable or disable menu entry of panel. |
java.lang.String |
export(int aDialog)
Deprecated. use export(int aDialog, String fileName) |
boolean |
export(int aDialog,
java.lang.String fileName)
Export geometries of active display without opening a dialog. |
boolean |
export(int aDialog,
java.lang.String fileName,
int width,
int height)
Export image file of currently active display with specified image size. |
java.applet.Applet |
getApplet()
Get current applet. |
PjProject |
getCurrentProject()
Get currently selected project. |
PsDialog |
getDialog(int aDialog)
Get dialog window. |
PvDisplayIf |
getDisplay()
Get currently selected 3d-display, for example, for inclusion in an applet. |
PvDisplayIf |
getDisplay(java.lang.String name)
Get a registered display from PvViewer for inclusion in an applet or in a container. |
java.awt.Frame |
getFrame()
Get current frame if running as application. |
java.awt.Frame |
getFrame(java.lang.String name)
Get a registered frame from PvViewer. |
PgGeometryIf |
getGeometry(java.lang.String name)
Get geometry with given name. |
int |
getNumDisplays()
Get number of registered displays. |
int |
getNumFrames()
Get number of registered frame. |
java.awt.Panel |
getPanel(int aPanel)
Make panels available outside our environment, i.e. outside control panel and outside our direct influence. |
protected static int |
getPanelId(java.lang.String aPanel)
Convert menu string to integer identifying the panel in position in panel array. |
java.lang.String |
getParameter(java.lang.String parmLabel)
Get value of applet parameter. |
PjProject |
getProject(java.lang.String name)
Get project instance with given name. |
java.util.Hashtable |
getProjectClasses()
Get hashtable with name and class of projects registered in PvViewer. |
java.util.Hashtable |
getProjectInstances()
Get hashtable with name and instance of projects allocated in PvViewer. |
PvDisplayIf |
getSelectedDisplay()
Get currently selected display. |
java.lang.String |
hasDisplay(PvDisplayIf disp)
Determine whether a display is registered in the viewer. |
boolean |
hasDisplay(java.lang.String name)
Check for a registered display by name. |
protected boolean |
hasFrame(java.lang.String name)
Check for a registered frame. |
boolean |
hasProject(java.lang.String name)
Check existence of a project instance with given name. |
boolean |
hideDialog(int aDialog)
Hides visible dialogs. |
void |
init()
Creates an empty hashtable for all added projects, creates a display, and a nearly empty control window. |
void |
keyPressed(java.awt.event.KeyEvent event)
Receives function key and strg-key events to show and hide panels. |
void |
keyReleased(java.awt.event.KeyEvent event)
Event currently not handled. |
void |
keyTyped(java.awt.event.KeyEvent event)
Event currently not handled. |
java.lang.String |
newDisplay()
Create a new AWT display inside a new frame. |
PvDisplayIf |
newDisplay(java.lang.String name)
Deprecated. Use method newDisplay(String, boolean) |
PvDisplayIf |
newDisplay(java.lang.String name,
boolean bFrame)
Create a new empty AWT display which is optionally placed inside a new frame. |
void |
printParameter()
Print all parameters and values to console. |
boolean |
removeDisplay(java.lang.String name)
Remove a registered display from list of registered displays. |
protected java.awt.Frame |
removeFrame(java.lang.String name)
Remove a registered frame from list of registered frames. |
boolean |
removeProject(java.lang.String aName)
Removes a registered project and dispose it. |
boolean |
selectDisplay(java.lang.String name)
Select a registered display to become the active display. |
protected boolean |
selectFrame(java.lang.String name)
Select a registered frame to become the active frame. |
boolean |
selectProject(java.lang.String aName)
Selects a project to become the active project. |
protected void |
serialize(java.lang.String name)
|
void |
setGeometry(PgGeometryIf geom)
Set current geometry whose inspector panels are display inside the control panel. |
boolean |
showDialog(int aDialog)
Show dialogs as separate frames. |
boolean |
showPanel(int aPanel)
Make panels visible. |
void |
start()
Depending on applet parameter show control panel and call start method of current project. |
void |
stop()
Dispose open dialogs and invoke stop method of projects. |
protected void |
submit()
Generate submission form and geometry files for submission of a model to the electronic model library. |
boolean |
update(java.lang.Object object)
Just a dummy routine to catch update() calls of stand-alone projects. |
void |
windowActivated(java.awt.event.WindowEvent event)
Select display if window is instance of class Frame containing a display. |
void |
windowClosed(java.awt.event.WindowEvent event)
No method body, just declared to fulfill interface WindowListener. |
void |
windowClosing(java.awt.event.WindowEvent event)
Exit the application, or, if run as applet, close window. |
void |
windowDeactivated(java.awt.event.WindowEvent event)
No method body, just declared to fulfill interface WindowListener. |
void |
windowDeiconified(java.awt.event.WindowEvent event)
No method body, just declared to fulfill interface WindowListener. |
void |
windowIconified(java.awt.event.WindowEvent event)
No method body, just declared to fulfill interface WindowListener. |
void |
windowOpened(java.awt.event.WindowEvent event)
No method body, just declared to fulfill interface WindowListener. |
| Methods inherited from class jv.object.PsObject |
addInspector, addUpdateListener, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, toString, updatePanels |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected PsJavaView m_jvRsrc
protected java.applet.Applet m_applet
protected java.awt.Frame m_frame
protected java.lang.String[][] m_parm
protected java.util.Hashtable m_displayList
protected PvDisplayIf m_mainDisplay
protected PvDisplayIf m_display
protected jv.viewer.PvControl m_control
protected boolean m_controlShow
protected transient jv.viewer.PvDisplayHelp m_help
protected transient PjImportModel_Dialog m_importModelDialog
protected int[] m_controlSize
protected int[] m_aboutSize
protected int[] m_helpSize
protected int[] m_consoleSize
protected int[] m_animationSize
protected int[] m_newProjectSize
protected int[] m_importModelSize
protected int[] m_exportBounds
protected java.lang.String m_imageDirName
protected java.lang.String m_importDirName
protected java.lang.String m_exportDirName
protected java.lang.String m_serialDirName
protected java.util.Hashtable m_geometryCategory
protected java.util.Hashtable m_geometryClass
protected java.util.Hashtable m_projectCategory
protected java.util.Hashtable m_projectList
protected java.util.Hashtable m_projectClass
protected java.util.Hashtable m_projectParms
protected PjProject m_currentProject
protected PgGeometryIf m_currentGeometry
protected java.util.Hashtable m_frameList
| Constructor Detail |
public PvViewer()
applet - Parent appletframe - Parent framePsConfig.init(Applet, PsViewerIf, Frame)
public PvViewer(java.applet.Applet applet,
java.awt.Frame frame)
PsConfig at a
central place.
This constructor should be used if JavaView is runs inside an applet or as standalone application.
Applications and applet should invoke the start()
method which shows the control panel if requested and invokess the
start method of the current project. On exit, applications should
call the stop() method to stop any running animations.
applet - Parent appletframe - Parent framePsConfig.init(Applet, PsViewerIf, Frame)| Method Detail |
public void init()
init in class PsObjectpublic java.applet.Applet getApplet()
getApplet in interface PvViewerIfpublic java.awt.Frame getFrame()
getFrame in interface PvViewerIfpublic java.lang.String getParameter(java.lang.String parmLabel)
Reads parameters from the applet's HTML page, and from command line of applications.
Format on Html page: .
Format on command line: javaview label=some_value.
If the parameter is not found then an empty String "" is return. This behavior was introduced to avoid null pointer checks in application programs.
getParameter in interface PvViewerIfApplet.getParameterInfo(),
Applet.getParameter(String),
PsMainFrame.PsMainFrame(Component, String, String []),
PsMainFrame.PsMainFrame(Component, String []),
PsMainFrame.PsMainFrame(String, String [])public void printParameter()
Applet.getParameter(String)
public boolean addGeometry(java.lang.String category,
java.lang.String name,
java.lang.String className)
category - Unique name of category used to group geometrysname - Unique name of geometry, used for identification and selectionclassName - Class name of geometry, used for creationPvViewer#addGeometry(PgGeometryIf)public PgGeometryIf getGeometry(java.lang.String name)
PvViewer#addGeometry(PgGeometry),
PvViewer#addGeometry(String, String, String [])public void addProjects()
addProject(java.lang.String, java.lang.String, java.lang.String, java.lang.String[])
public boolean addProject(java.lang.String category,
java.lang.String name,
java.lang.String className,
java.lang.String[] parmList)
addProject in interface PsViewerIfcategory - Unique name of category used to group projectsname - Unique name of project, used for identification and selectionclassName - Class name of project, used for creationparmList - List of parameters, may be null.PsViewerIf#addProject(String, String, String []),
addProject(PjProject),
PsViewerIf#selectProject(String)
public boolean addProject(java.lang.String name,
java.lang.String className,
java.lang.String[] parmList)
addProject in interface PvViewerIfname - Unique name of project, used for identification and selectionclassName - Class name of project, used for creationparmList - List of parameters, may be null.PsViewerIf.addProject(String, String, String, String []),
PsViewerIf#addProject(PjProject),
PsViewerIf#selectProject(String)public boolean addProject(PjProject aProject)
addProject in interface PvViewerIfaddProject(String, String, String []),
selectProject(String)public boolean hasProject(java.lang.String name)
hasProject in interface PvViewerIfgetProject(String)public PjProject getCurrentProject()
getProject(String)public PjProject getProject(java.lang.String name)
getProject in interface PvViewerIfaddProject(PjProject),
addProject(String, String, String [])public java.util.Hashtable getProjectClasses()
getProjectInstances()public java.util.Hashtable getProjectInstances()
getProjectClasses()public boolean removeProject(java.lang.String aName)
removeProject in interface PvViewerIfjv.project.PvViewerIfPvViewerIf.addProject(PjProject),
PvViewerIf.getProject(String),
PvViewerIf.hasProject(String),
PvViewerIf.selectProject(String)public boolean selectProject(java.lang.String aName)
Current display of PvViewer is added and selected in project. The
method start() of the project
is invoked to start, e.g. animations.
The project is made the current project in the control panel, if control
frame exists already.
selectProject in interface PvViewerIfaddProject(PjProject),
addProject(String, String, String [])public void setGeometry(PgGeometryIf geom)
setGeometry in interface PvViewerIfpublic boolean update(java.lang.Object object)
update in class PsObjectPjProjectpublic boolean showDialog(int aDialog)
PsViewerIf.showDialog in interface PvViewerIfint - Name of dialog to be shownPsViewerIf,
hideDialog(int)
public boolean export(int aDialog,
java.lang.String fileName,
int width,
int height)
PsViewerIf.export in interface PsViewerIfaDialog - Id of a dialog determining the file formatfileName - Full file namewidth - width of imageheight - height of image, or -1 to keep aspect ratio.
public boolean export(int aDialog,
java.lang.String fileName)
PsViewerIf.export in interface PsViewerIfaDialog - ID of dialog determining the file formatfileName - Full file namepublic java.lang.String export(int aDialog)
PsViewerIf.aDialog - ID of dialog which determines the file formatprotected void submit()
public PsDialog getDialog(int aDialog)
jv.object.PsViewerIf#ANIMATION,
jv.object.PsViewerIf#CONSOLE.
See static variables in PsViewerIf.getDialog in interface PvViewerIfint - Name of dialogPsViewerIf,
hideDialog(int),
showDialog(int)public boolean hideDialog(int aDialog)
jv.object.PsViewerIf#ANIMATION,
jv.object.PsViewerIf#CONSOLE,
jv.object.PsViewerIf#CONTROL,
jv.object.PsViewerIf#HELP.
See static variables in PsViewerIf.hideDialog in interface PvViewerIfString - Name of dialog to be hiddenshowDialog(int)
public void enableMenu(int menuId,
boolean cond)
int - Id of menu to enable/disable, PsViewerIf.boolean - If true, enables this menu entry; if false, disables it.PsViewerIfpublic PvDisplayIf getDisplay()
getDisplay in interface PvViewerIfnewDisplay(String)public java.lang.String newDisplay()
Projection mode is used as in current display.
Note: Method is currently only used by PvDisplay, and method is included in the interface jv.project.PvViewerIf to separate PvDisplay from PvViewer.
newDisplay in interface PvViewerIfnewDisplay(String)public PvDisplayIf newDisplay(java.lang.String name)
newDisplay in interface PvViewerIfName - of new display. If name is null, then default name is chosen.getDisplay()
public PvDisplayIf newDisplay(java.lang.String name,
boolean bFrame)
If a frame is allocated then the frame is not displayed and must be made visible in the application. The idea behind "not showing the frame" is as follows: if the frame is shown immediately then PvViewer must use a default window size and position. If the user would like to adjust this size, then he can do so only after the frame is already visible. Therefore, I do not show the frame in order to avoid instantaneous resizing.
The display is added to the center of the frame.
The frame may be obtained from the display via
PvDisplayIf#getFrame().
newDisplay in interface PvViewerIfname - Name of new display. If name is null, then default name is chosen.bFrame - If true then allocate a frame and add display to center.newDisplay(String),
PvDisplayIf.getFrame()public PvDisplayIf getDisplay(java.lang.String name)
getDisplay in interface PvViewerIfnull if not found.addDisplay(String, PvDisplayIf),
getDisplay(),
selectDisplay(String)public int getNumDisplays()
getNumDisplays in interface PvViewerIfpublic java.lang.String hasDisplay(PvDisplayIf disp)
hasDisplay in interface PvViewerIfnull.hasDisplay(String)public boolean hasDisplay(java.lang.String name)
hasDisplay in interface PvViewerIftrue if registered display found.addDisplay(String, PvDisplayIf),
getDisplay(String)
public boolean addDisplay(java.lang.String name,
PvDisplayIf display)
This viewer is registered as parent and key listener of the display.
addDisplay in interface PvViewerIffalse if same name already exists.getDisplay(String),
selectDisplay(String)public boolean removeDisplay(java.lang.String name)
This viewer is removed as key listener of the display.
removeDisplay in interface PvViewerIffalse if display does not exists.addDisplay(String, PvDisplayIf),
getDisplay(String)public boolean selectDisplay(java.lang.String name)
The first selected display becomes the main display to which 'New Projects' are loaded.
selectDisplay in interface PvViewerIffalse if display does not exists.addDisplay(String, PvDisplayIf),
getDisplay(String)public PvDisplayIf getSelectedDisplay()
public java.awt.Frame getFrame(java.lang.String name)
null if not found.addFrame(String, Frame),
selectFrame(String)public int getNumFrames()
protected boolean hasFrame(java.lang.String name)
true if registered frame found.addFrame(String, Frame),
getFrame(String)
protected boolean addFrame(java.lang.String name,
java.awt.Frame frame)
false if same name already exists.getFrame(String),
selectFrame(String)protected java.awt.Frame removeFrame(java.lang.String name)
false if frame does not exists.addFrame(String, Frame),
getFrame(String)protected boolean selectFrame(java.lang.String name)
false if frame does not exists.addFrame(String, Frame),
getFrame(String)public void windowOpened(java.awt.event.WindowEvent event)
windowOpened in interface java.awt.event.WindowListenerpublic void windowClosed(java.awt.event.WindowEvent event)
windowClosed in interface java.awt.event.WindowListenerpublic void windowDeiconified(java.awt.event.WindowEvent event)
windowDeiconified in interface java.awt.event.WindowListenerpublic void windowIconified(java.awt.event.WindowEvent event)
windowIconified in interface java.awt.event.WindowListenerpublic void windowDeactivated(java.awt.event.WindowEvent event)
windowDeactivated in interface java.awt.event.WindowListenerpublic void windowActivated(java.awt.event.WindowEvent event)
windowActivated in interface java.awt.event.WindowListenerpublic void windowClosing(java.awt.event.WindowEvent event)
windowClosing in interface java.awt.event.WindowListenerpublic boolean showPanel(int aPanel)
getPanel(int) then
a call to showPanel is void and returns false.showPanel in interface PvViewerIfint - Id of panel to be shown, see PsViewerIf for possible valuestrue if success, false if panel not found or
used outside via method getPanel(int).getPanel(int)
public boolean enablePanel(int aPanel,
boolean cond)
enablePanel in interface PvViewerIfint - Id of panel to be enabled, see PsViewerIf for possible valuesboolean - If true, enables this panel's menu entry; if false, disables it.true if panel exists, otherwise false.showPanel(int)public java.awt.Panel getPanel(int aPanel)
showPanel(int). Menu entries will be disabled but still visible.getPanel in interface PvViewerIfint - Id of requested panel, see PsViewerIf for possible valuesshowPanel(int)protected static int getPanelId(java.lang.String aPanel)
public void keyTyped(java.awt.event.KeyEvent event)
keyTyped in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent event)
keyReleased in interface java.awt.event.KeyListenerpublic void keyPressed(java.awt.event.KeyEvent event)
keyPressed in interface java.awt.event.KeyListenerpublic void destroy()
destroy in interface PvViewerIfpublic void start()
start in interface PvViewerIfjv.project.PvViewerIfPjProject.start()public void stop()
stop in interface PvViewerIfjv.project.PvViewerIfPjProject.stop()protected void serialize(java.lang.String name)
protected void deserialize()
|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||