JavaView® v2.12

jv.viewer
Class PvViewer

java.lang.Object
  |
  +--jv.object.PsObject
        |
        +--jv.viewer.PvViewer
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, java.awt.event.KeyListener, PsUpdateIf, PsViewerIf, PvViewerIf, java.io.Serializable, java.awt.event.WindowListener

public final class PvViewer
extends PsObject
implements PvViewerIf, java.awt.event.KeyListener, java.awt.event.WindowListener, java.io.Serializable

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.

Version:
13.10.99, 2.51 revised (sk) byu export added.
19.06.99, 2.50 revised (kp) PvControl not longer created during startup but when panel requested.
12.06.99, 2.21 revised (kp) Subset of methods extracted to PsViewerIf.
20.05.99, 2.20 revised (kp) m_animationPanel and m_console no longer handled here.
26.01.99, 2.10 revised (kp) m_currentGeometry no longer handled, moved to project.
16.11.98, 2.00 revised (kp) Major revision.
00.00.97, 1.00 created (kp)
Author:
Konrad Polthier
See Also:
PsViewerIf, PjProject, addProject(java.lang.String, java.lang.String, java.lang.String, java.lang.String[]), selectProject(java.lang.String), 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
 
Fields inherited from interface jv.object.PsViewerIf
ABOUT, ABOUT_APPLET, ADD_GEOMETRY, ADD_PROJECT, ANIMATION, CAMERA, CONFIG, CONSOLE, CONTROL, DISPLAY, EXPORT_BYU, EXPORT_EPS, EXPORT_FE, EXPORT_GIF, EXPORT_GIF_ANIM, EXPORT_JVD, EXPORT_JVX, EXPORT_JVX_SMALL, EXPORT_MGS, EXPORT_MPL, EXPORT_OBJ, EXPORT_OFF, EXPORT_PPM, EXPORT_PPM_ANIM, EXPORT_PS, EXPORT_VRML, EXPORT_XML, HELP, IMPORT_DISK, IMPORT_VGP, INFO, MATERIAL, MENU_FILE, MENU_FILE_ADD, MENU_FILE_ADD_GEOMETRY, MENU_FILE_ADD_PROJECT, MENU_FILE_CLOSE, MENU_FILE_EXIT, MENU_FILE_EXPORT, MENU_FILE_EXPORT_BYU, MENU_FILE_EXPORT_FE, MENU_FILE_EXPORT_GIF, MENU_FILE_EXPORT_JVD, MENU_FILE_EXPORT_JVX, MENU_FILE_EXPORT_JVX_SMALL, MENU_FILE_EXPORT_MGS, MENU_FILE_EXPORT_MPL, MENU_FILE_EXPORT_OBJ, MENU_FILE_EXPORT_OFF, MENU_FILE_EXPORT_PPM, MENU_FILE_EXPORT_VRML, MENU_FILE_IMPORT, MENU_FILE_IMPORT_DISK, MENU_FILE_IMPORT_VGP, MENU_FILE_NEW, MENU_FILE_NEW_DISPLAY, MENU_FILE_NEW_GEOMETRY, MENU_FILE_NEW_PROJECT, MENU_FILE_PRINT, MENU_FILE_PRINT_EPS, MENU_FILE_PRINT_PS, MENU_FILE_SUBMIT, MENU_HELP, MENU_HELP_ABOUT, MENU_HELP_APPLET, MENU_HELP_FONTS, MENU_HELP_RSRC, MENU_HELP_SYSTEM, MENU_HELP_VIEWER, MENU_INSPECTOR, MENU_INSPECTOR_CAMERA, MENU_INSPECTOR_DISPLAY, MENU_INSPECTOR_OBJECT, MENU_INSPECTOR_OBJECT_CONFIG, MENU_INSPECTOR_OBJECT_INFO, MENU_INSPECTOR_OBJECT_MATERIAL, MENU_INSPECTOR_OBJECT_TEXTURE, MENU_INSPECTOR_PROJECT, MENU_METHOD, MENU_WINDOW, MENU_WINDOW_ANIMATION, MENU_WINDOW_CONSOLE, MENU_WINDOW_NETWORK, NEW_GEOMETRY, NEW_PROJECT, OBJECT, PROJECT, RSRC, TEXTURE
 
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 disp)
          Register a new display under a name.
 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.
 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 or display setting 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[] getDisplays()
          Get array of registered displays.
 java.awt.Frame getFrame()
          Get current frame if running as application.
 PgGeometryIf getGeometry(java.lang.String name)
          Get geometry with given name.
 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.
 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.
 boolean hasDisplay(PvDisplayIf disp)
          Determine whether a display is registered in the viewer.
 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(PvDisplayIf disp)
          Remove a registered display from list of registered displays.
 boolean removeProject(java.lang.String aName)
          Removes a registered project and dispose it.
 boolean selectDisplay(PvDisplayIf disp)
          Select a registered display to become the active display.
 boolean selectProject(java.lang.String aName)
          Selects a project to become the active project.
 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.
 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, assureInspector, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PvViewer

public PvViewer()
Constructor for JavaView's display and project manager if JavaView runs inside another program.
Parameters:
applet - Parent applet
frame - Parent frame
See Also:
PsConfig.init(Applet, PsViewerIf, Frame)

PvViewer

public 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. If JavaView runs as applet then the applet is queried for system properties to be stored in 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.

Parameters:
applet - Parent applet
frame - Parent frame
See Also:
PsConfig.init(Applet, PsViewerIf, Frame)
Method Detail

init

public void init()
Creates an empty hashtable for all added projects, creates a display, and a nearly empty control window. Registers display in control window.
Overrides:
init in class PsObject

getApplet

public java.applet.Applet getApplet()
Get current applet. If running as application method returns applet inside frame.
Specified by:
getApplet in interface PvViewerIf

getFrame

public java.awt.Frame getFrame()
Get current frame if running as application.
Specified by:
getFrame in interface PvViewerIf

getParameter

public java.lang.String getParameter(java.lang.String parmLabel)
Get value of applet parameter. Calling this method avoids multiple getParameter(String) calls.
The first call to getParameter(String) tries to read all parameters specified in m_applet.m_info from Html page.

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.

Specified by:
getParameter in interface PvViewerIf
Returns:
value of string if string found, else an empty String "".
See Also:
Applet.getParameterInfo(), Applet.getParameter(String), PsMainFrame.PsMainFrame(Component, String, String []), PsMainFrame.PsMainFrame(Component, String []), PsMainFrame.PsMainFrame(String, String [])

printParameter

public void printParameter()
Print all parameters and values to console.
See Also:
Applet.getParameter(String)

addGeometry

public 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. Later the geometry must be selected by name to be instantiated and to become the active geometry in the viewer.
Parameters:
category - Unique name of category used to group geometrys
name - Unique name of geometry, used for identification and selection
className - Class name of geometry, used for creation
See Also:
PvViewer#addGeometry(PgGeometryIf)

getGeometry

public PgGeometryIf getGeometry(java.lang.String name)
Get geometry with given name. If geometry is not found in geometry list but there exists a class registered under the same name, then try to create a geometry instance from this geometry class.
See Also:
PvViewer#addGeometry(PgGeometry), PvViewer#addGeometry(String, String, String [])

addProjects

public void addProjects()
Parses and adds all projects mentioned in the applet's parmInfo or Html page. Their names are added to the list of projects accessible via menu FILE->LOAD
See Also:
addProject(java.lang.String, java.lang.String, java.lang.String, java.lang.String[])

addProject

public 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. Later the project must be selected by name to be instantiated and to become the active project in the environment. This method allows to pass a list of parameter strings to the project which may be parsed by the project, e.g. used to receive initial values from an Html page.
Specified by:
addProject in interface PsViewerIf
Parameters:
category - Unique name of category used to group projects
name - Unique name of project, used for identification and selection
className - Class name of project, used for creation
parmList - List of parameters, may be null.
See Also:
PsViewerIf#addProject(String, String, String []), addProject(PjProject), PsViewerIf#selectProject(String)

addProject

public 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. Later the project must be selected by name to be instantiated and to become the active project in the environment. This method allows to pass a list of parameter strings to the project which may be parsed by the project, e.g. used to receive initial values from an Html page.
Specified by:
addProject in interface PvViewerIf
Parameters:
name - Unique name of project, used for identification and selection
className - Class name of project, used for creation
parmList - List of parameters, may be null.
See Also:
PsViewerIf.addProject(String, String, String, String []), PsViewerIf#addProject(PjProject), PsViewerIf#selectProject(String)

addProject

public boolean addProject(PjProject aProject)
Registers name and instance of a project in the viewer. Later the project must be selected by name to become the active project in the environment. This method has no slot to pass a parameter list to the project since it is assumed the project instance has been set up by the user somewhere else.
Specified by:
addProject in interface PvViewerIf
See Also:
addProject(String, String, String []), selectProject(String)

hasProject

public boolean hasProject(java.lang.String name)
Check existence of a project instance with given name. If project is not found in project list, return false. Note, this method queries for instances of projects and not for project class names.
Specified by:
hasProject in interface PvViewerIf
See Also:
getProject(String)

getCurrentProject

public PjProject getCurrentProject()
Get currently selected project.
See Also:
getProject(String)

getProject

public PjProject getProject(java.lang.String name)
Get project instance with given name. If project is not found in project list but there exists a class registered under the same name, then try to create a project instance from this project class.
Specified by:
getProject in interface PvViewerIf
See Also:
addProject(PjProject), addProject(String, String, String [])

getProjectClasses

public java.util.Hashtable getProjectClasses()
Get hashtable with name and class of projects registered in PvViewer. The key is the project's unique long name, and the value is the project's class.
See Also:
getProjectInstances()

getProjectInstances

public java.util.Hashtable getProjectInstances()
Get hashtable with name and instance of projects allocated in PvViewer. The key is the project's unique long name, and the value is an instance of the project. If the project has not yet been selected, then the instance does not exist.
See Also:
getProjectClasses()

removeProject

public boolean removeProject(java.lang.String aName)
Removes a registered project and dispose it. Project must be added again for further use.
Specified by:
removeProject in interface PvViewerIf
Following copied from interface: jv.project.PvViewerIf
See Also:
PvViewerIf.addProject(PjProject), PvViewerIf.getProject(String), PvViewerIf.hasProject(String), PvViewerIf.selectProject(String)

selectProject

public boolean selectProject(java.lang.String aName)
Selects a project to become the active project. Selection may be done via a direct call or interactively by choosing from the menu FILE->LOAD. Each project must be added to the viewer before it becomes selectable. If project was added by name then project is instantiated.

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.

Specified by:
selectProject in interface PvViewerIf
See Also:
addProject(PjProject), addProject(String, String, String [])

setGeometry

public void setGeometry(PgGeometryIf geom)
Set current geometry whose inspector panels are display inside the control panel.
Specified by:
setGeometry in interface PvViewerIf

update

public boolean update(java.lang.Object object)
Just a dummy routine to catch update() calls of stand-alone projects. Instead of letting a project ask itself whether it has a parent other than this PvViewer we just let it update its parent even if we do not react if the parent is this PvViewer.
Overrides:
update in class PsObject
See Also:
PjProject

showDialog

public boolean showDialog(int aDialog)
Show dialogs as separate frames. Possible arguments jv.object.PsViewerIf.ABOUT etc.
Possible arguments for dialogs are PsViewerIf.ABOUT, PsViewerIf.EXPORT_PS etc, see static variables in PsViewerIf.
Specified by:
showDialog in interface PvViewerIf
Parameters:
int - Name of dialog to be shown
Returns:
Dialog true if success, false if dialog class not found.
See Also:
PsViewerIf, hideDialog(int)

export

public boolean export(int aDialog,
                      java.lang.String fileName,
                      int width,
                      int height)
Export image file of currently active display with specified image size. Possible arguments for dialogs are PsViewerIf.EXPORT_PS etc, see static variables EXPORT_[type] in PsViewerIf.
Specified by:
export in interface PsViewerIf
Parameters:
aDialog - Id of a dialog determining the file format
fileName - Full file name
width - width of image
height - height of image, or -1 to keep aspect ratio.
Returns:
boolean true if success, false if string data could not be generated.

export

public boolean export(int aDialog,
                      java.lang.String fileName)
Export geometries of active display or display setting without opening a dialog. If a file format allows a single geometry only then the currently active geometry is exported, otherwise all visible geometries are exported. Possible arguments for file formats are PsViewerIf.EXPORT_PS etc, see static variables EXPORT_[type] in PsViewerIf.
Specified by:
export in interface PsViewerIf
Parameters:
aDialog - ID of dialog determining the file format
fileName - Full file name
Returns:
boolean true if success, false if string data could not be generated.

export

public java.lang.String export(int aDialog)
Deprecated. use export(int aDialog, String fileName)

Export geometries of active display to a string without opening a dialog. If a file format allows a single geometry only then the currently active geometry is exported, otherwise all visible geometries are exported. Possible arguments for file formats are PsViewerIf.EXPORT_PS etc, see static variables EXPORT_[type] in PsViewerIf.
Parameters:
aDialog - ID of dialog which determines the file format
Returns:
boolean true if success, false if string data could not be generated.

getDialog

public PsDialog getDialog(int aDialog)
Get dialog window. Possible arguments jv.object.PsViewerIf.ABOUT,...
Possible arguments for dialogs are currently jv.object.PsViewerIf#ANIMATION, jv.object.PsViewerIf#CONSOLE. See static variables in PsViewerIf.
Specified by:
getDialog in interface PvViewerIf
Parameters:
int - Name of dialog
Returns:
Dialog
See Also:
PsViewerIf, hideDialog(int), showDialog(int)

hideDialog

public boolean hideDialog(int aDialog)
Hides visible dialogs. Possible arguments for dialogs are currently jv.object.PsViewerIf#ANIMATION, jv.object.PsViewerIf#CONSOLE, jv.object.PsViewerIf#CONTROL, jv.object.PsViewerIf#HELP. See static variables in PsViewerIf.
Specified by:
hideDialog in interface PvViewerIf
Parameters:
String - Name of dialog to be hidden
Returns:
boolean true if success, false if dialog not found
See Also:
showDialog(int)

enableMenu

public void enableMenu(int menuId,
                       boolean cond)
Enable/disable menu entries in menu bar of control window.
Parameters:
int - Id of menu to enable/disable, PsViewerIf.
boolean - If true, enables this menu entry; if false, disables it.
See Also:
PsViewerIf

newDisplay

public java.lang.String newDisplay()
Create a new AWT display inside a new frame. Method is invoked from menus, name of display is automatically chosen. All geometries of currently selected display are added to new display. Display becomes the selected display in viewer.

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.

Specified by:
newDisplay in interface PvViewerIf
Returns:
Automatically chosen name of new display
See Also:
newDisplay(String)

newDisplay

public PvDisplayIf newDisplay(java.lang.String name)
Deprecated. Use method newDisplay(String, boolean)

Create a new empty AWT display inside a new frame. The frame is shown at a default position and with default size. The display becomes the selected display in this viewer.
Specified by:
newDisplay in interface PvViewerIf
Parameters:
Name - of new display. If name is null, then default name is chosen.
Returns:
New display
See Also:
getDisplay()

newDisplay

public PvDisplayIf newDisplay(java.lang.String name,
                              boolean bFrame)
Create a new empty AWT display which is optionally placed inside a new frame. The display becomes the selected display in this viewer.

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().

Specified by:
newDisplay in interface PvViewerIf
Parameters:
name - 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.
Returns:
New display
See Also:
newDisplay(String), PvDisplayIf.getFrame()

getDisplay

public PvDisplayIf getDisplay()
Get currently selected 3d-display, for example, for inclusion in an applet. If no display exists, then an instance of PvDisplay is allocated and returned. This method is a convenient shortcut to create an instance of PvDisplay and register and select it in the viewer.
Specified by:
getDisplay in interface PvViewerIf
Returns:
PvDisplayIf the currently selected 3d-display
See Also:
newDisplay(String)

getDisplays

public PvDisplayIf[] getDisplays()
Get array of registered displays.
Specified by:
getDisplays in interface PvViewerIf
Returns:
array of registered displays

hasDisplay

public boolean hasDisplay(PvDisplayIf disp)
Determine whether a display is registered in the viewer.
Specified by:
hasDisplay in interface PvViewerIf
Returns:
false if display is not registered.
See Also:
#hasDisplay(String)

addDisplay

public boolean addDisplay(java.lang.String name,
                          PvDisplayIf disp)
Register a new display under a name. Name must be unique among displays. Name will become the name of the display which can be obtained with display#getName().

This viewer is registered as parent and key listener of the display.

Specified by:
addDisplay in interface PvViewerIf
Returns:
false if same name already exists.
See Also:
#getDisplay(String), #selectDisplay(String)

removeDisplay

public boolean removeDisplay(PvDisplayIf disp)
Remove a registered display from list of registered displays.

This viewer is removed as key listener of the display.

Specified by:
removeDisplay in interface PvViewerIf
Returns:
false if display is not registered.
See Also:
addDisplay(String, PvDisplayIf), #getDisplay(String)

selectDisplay

public boolean selectDisplay(PvDisplayIf disp)
Select a registered display to become the active display.

The first selected display becomes the main display to which 'New Projects' are loaded.

Specified by:
selectDisplay in interface PvViewerIf
Returns:
false if display is not registered.
See Also:
addDisplay(String, PvDisplayIf), #getDisplay(String)

getSelectedDisplay

public PvDisplayIf getSelectedDisplay()
Get currently selected display.

getNumFrames

public int getNumFrames()
Get number of registered frame. Number is used for automatic numbering when creating new frames from menu.
Returns:
number of registered frames

windowOpened

public void windowOpened(java.awt.event.WindowEvent event)
No method body, just declared to fulfill interface WindowListener.
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent event)
No method body, just declared to fulfill interface WindowListener.
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent event)
No method body, just declared to fulfill interface WindowListener.
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent event)
No method body, just declared to fulfill interface WindowListener.
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent event)
No method body, just declared to fulfill interface WindowListener.
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent event)
Select display if window is instance of class Frame containing a display.
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent event)
Exit the application, or, if run as applet, close window.
Specified by:
windowClosing in interface java.awt.event.WindowListener

showPanel

public boolean showPanel(int aPanel)
Make panels visible. They appear either inside the control window or as separate frames, e.g. the control window appears as frame, and project, display, camera, and object panels as panels inside control frame. If panel has already been requested by a call to getPanel(int) then a call to showPanel is void and returns false.
Specified by:
showPanel in interface PvViewerIf
Parameters:
int - Id of panel to be shown, see PsViewerIf for possible values
Returns:
Panel true if success, false if panel not found or used outside via method getPanel(int).
See Also:
getPanel(int)

enablePanel

public boolean enablePanel(int aPanel,
                           boolean cond)
Enable or disable menu entry of panel.
Specified by:
enablePanel in interface PvViewerIf
Parameters:
int - Id of panel to be enabled, see PsViewerIf for possible values
boolean - If true, enables this panel's menu entry; if false, disables it.
Returns:
boolean true if panel exists, otherwise false.
See Also:
showPanel(int)

getPanel

public java.awt.Panel getPanel(int aPanel)
Make panels available outside our environment, i.e. outside control panel and outside our direct influence. E.g. an applet may include a panel or it may create a seperate frame for the panel.
If a panel is requested via this method, then it will no longer be selectable via its menu entry in the control window neither by a call to method showPanel(int). Menu entries will be disabled but still visible.
Specified by:
getPanel in interface PvViewerIf
Parameters:
int - Id of requested panel, see PsViewerIf for possible values
Returns:
Panel Requested panel if it exists, otherwise null.
See Also:
showPanel(int)

keyTyped

public void keyTyped(java.awt.event.KeyEvent event)
Event currently not handled.
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent event)
Event currently not handled.
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent event)
Receives function key and strg-key events to show and hide panels. The original F1 key is received by the display and has forward it. The F2 key is received by the control window when pressed right after the F1 key since input focus passes over to control window once it opens. If display receives focus again then F2 arrives here.
Specified by:
keyPressed in interface java.awt.event.KeyListener

destroy

public void destroy()
Called from an applet.destroy() method to perform clean-up when applet gets destroyed. Here we just close and dispose all control windows.
Specified by:
destroy in interface PvViewerIf

start

public void start()
Depending on applet parameter show control panel and call start method of current project. Method should be called sometimes after the viewer has been created and projects have been registered in order to invoke the start method of the current project. Usually, this method is invoked when the start method of an applet is called.
Specified by:
start in interface PvViewerIf
Following copied from interface: jv.project.PvViewerIf
See Also:
PjProject.start()

stop

public void stop()
Dispose open dialogs and invoke stop method of projects. E.g. close control window if shown, and stop running animations.
Specified by:
stop in interface PvViewerIf
Following copied from interface: jv.project.PvViewerIf
See Also:
PjProject.stop()

JavaView® v2.12

The software JavaView® is copyright protected. All Rights Reserved.