Package jv.object
See: Description
-
Interface Summary Interface Description PsUpdateIf Interface for update mechanism of JavaView.PsViewerIf Interface for a viewer to allow forwarding of keyboard events to central event handlerPvViewer. -
Class Summary Class Description PsActionSupport This class may be used to add the functionality of sending ActionEvents to registered listeners to some class.PsConfig Static configuration class of JavaView with global static variables.PsConsole Console window of JavaView.PsDebug Allows to issue messages and debug information on the console of JavaView, which is different from Java console.PsDialog Basic class for dialogs extending java.awt.Dialog by some minor features.PsMainFrame Mainframe window to hold an applet (of applications) or a display canvas.PsObject Super class in JavaView which implements the update interface and has an info panel.PsPanel Default base class for info panels, and often used instead ofPanel.PsResource Supplies default strings in English for interface labels in menus and dialog.PsStackLayout Layout manager to place components below the previous components similar to a stack.PsUtil Utility to locate and query classes and superclasses, open files, bit manipulations.
Package jv.object Description
Most basic package of JavaView containing the base classes
PsObject and PsPanel.
PsObject is used as base class instead of
java.lang.object, e.g. it implements an update mechanism and offers an inspector
panel. PsPanel is the base class for all inspectors instead of java.awt.Panel,
it implements the same update mechanism as PsObject.
The package PsObjectGui contains a set of base classes of dialogs, widgets and layout managers. PsPanel should also be in PsObjectGui, but PsObject references PsPanel and cyclic package dependencies were avoided.
Info Panels as Inspectors
Each subclass of PsObject may have an associated info panel to be shown in
the HTML page of the applet or inside the control
window or in a separate dialog. The class name of an info panel must follow a
special naming convention: the name of the base class plus "_IP"
appended. Additionally, the info panel must reside in the same directory as the
base class. This allows for automatic inclusion of an info panel, see
getInfoPanel(), e.g. if someone derives from
PgElementSet and write an info panel for his new
subclass then this info panel is automatically inserted in the control window.
Update Mechanism
The update mechanism of JavaView ensures that a modified
object can securely inform its dependend objects about changes. E.g. the update
mechanism ensures that a surface is recomputed if a slider in its info panel is
dragged, or it ensures a repaint of the display once a geometry changes. An
update sequence is initiated by a method call update(event).
Each object may have a parent which it informs on changes. The info panel of an object always has the object as parent, unless a developer deviates from this rule for efficiency reasons.
Calling the update method of an object has the following effects:
- The object updates its state and calls super.update().
- When update reaches the root class PsObject, then PsObject.update()
updates
a.) the info panel of the object if it is currently visible
b.) the parent if it exists.
The event argument of the update method has a special meaning:
- A child passes itself as argument to the update method of its parent to
inform the parent about the sender of the update, e.g. PsObject calls
m_parent.update(this). - If an object has updated its state and its superclasses do not need to
change, then it calls
super.update(null).
For efficiency reasons, modifications inside an info panel sometimes invoke a direct call of the update method of their parent object instead of going up until the root class PsPanel.
A parent dependency is created using
setParent().
If an info panel is created with a call of
getInfoPanel()
then the object is automatically the parent of the info panel.
Each class should overwrite the update method of PsObject if it wants to perform some action when called by its children.
"