Package com.luciad.view.lightspeed.editor


package com.luciad.view.lightspeed.editor
Provides support for interactive editing of domain objects in a model. The main interface in this package is ILspEditor. Editors are used by TLspEditController to define different editing behavior for different types of domain objects.

The default TLspShapeEditor supports all available ILcdShape implementations by aggregating the individual editors that are available for each type of shape. These individual editors are also available in the API for customization purposes. When writing a custom editor for an entirely new type of shape, most users will want to extend the abstract base class ALspEditor.

The working of an editor is as follows:

  • The edit controller asks the editor to provide a set of edit handles for a given domain object.
  • An edit handle is a widget that is associated with some part or property of a domain object. A polygon, for instance, would typically have an edit handle on each of its vertices, each of which is visualized as a small dot and which can be dragged around by the user to move the corresponding vertex to another location.
  • While the object is in an editable state, the controller forwards input events (e.g. mouse events) to the edit handles by invoking their handleAWTEvent() method. The handle produces a TLspEditHandleResult, which describes at a higher level the action that the user performed. If the handle was able to meaningfully interpret the user's input, the edit handle result will contain one or more TLspEditOperations.
  • The editor is asked to apply the given edit operations to the domain object being edited, via a call to edit().

An edit operation does not refer back to its originating handle directly. Editors can, however, assign properties to their handles, which the handle copies back into its edit operations. These properties are key/value pairs that the editor is completely free to choose. This allows editors to inject semantic information into handles without having to override handle implementations. The editors available in the LuciadLightspeed API employ the following convention for these properties:

  • Each editor defines an internal enumeration type called PropertyKeys which lists the values that the editor uses as keys for its handle properties;
  • The documentation of each element in this enumeration lists the type of the property value.

The editor package has a number of subpackages:

Since:
2012.0