"JavaView v4.00.003"

Package jv.object

Most basic package of JavaView containing the base classes PsObject and PsPanel.

See: Description

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:

  1. The object updates its state and calls super.update().
  2. 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:

  1. 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).
  2. 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.

"JavaView v4.00.003"


The software JavaView is copyright protected. All Rights Reserved.