Class TLspCompositeEditor
java.lang.Object
com.luciad.view.lightspeed.editor.TLspCompositeEditor
- All Implemented Interfaces:
ILspEditor
- Direct Known Subclasses:
TLspShapeEditor
Composite editor for ILspEditor
objects.
When an object is being edited by this editor, all editing related tasks are delegated to the first compatible editor found.
In case of delegate based editors (i.e. editors that delegate to another editor), it is both valid and recommended to have the composite editor be the delegate of the editor. So for shapelists and extruded shapes, the following construction is perfectly valid:
//We create a composite editor that can handle circles, extruded circles, shapeslists with circles //and shapelists with extruded circles in them: TLspCompositeEditor compositeEditor = new TLspCompositeEditor(); //Create and add shapelist editor with composite editor as delegate. compositeEditor.addEditor(new TLspShapeListEditor(compositeEditor)); //Create and add extruded editor with composite editor as delegate. compositeEditor.addEditor(new TLspExtrudedShapeEditor(compositeEditor)); //Create and add a circle editor compositeEditor.addEditor(new TLspCircleEditor());
- Since:
- 2012.0
-
Constructor Summary
ConstructorDescriptionTLspCompositeEditor
(ILspEditor... aEditors) Creates a newTLspCompositeEditor
, composed of the given list of editors. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEditor
(ILspEditor aEditor) Adds the given editor to the list of editors.void
addEditor
(ILspEditor aEditor, int aIndex) Adds the given editor to the list of editors.boolean
canEdit
(TLspEditContext aContext) Returnstrue
if one of the editors this composite is composed of can edit the given object.boolean
canPerformOperation
(TLspEditOperation aOperation, TLspEditContext aContext) Determines whether or not the editor knows how to apply the given edit operation to the supplied geometry.edit
(TLspEditOperation aOperation, ELspInteractionStatus aInteractionStatus, TLspEditContext aContext) Applies an interaction obtained from a handle to the object being edited.getCreateHandle
(TLspEditContext aContext) Returns a handle that is used to create the given object.getEditHandles
(TLspEditContext aContext) Returns a set of handles for editing the given object.Gets the list of editors this composite editor delegates to.void
removeEditor
(ILspEditor aEditor) Removes the given editor from this composite.
-
Constructor Details
-
TLspCompositeEditor
Creates a newTLspCompositeEditor
, composed of the given list of editors.- Parameters:
aEditors
- a list of delegate editors.
-
-
Method Details
-
addEditor
Adds the given editor to the list of editors.- Parameters:
aEditor
- the editor to add
-
addEditor
Adds the given editor to the list of editors. The editor is added at the given index. When an object is being edited by this editor, all editing related tasks are delegated to the first compatible editor found.- Parameters:
aEditor
- the editor to addaIndex
- the index at which to add the editor.
-
removeEditor
Removes the given editor from this composite.- Parameters:
aEditor
- the editor to remove.
-
getEditors
Gets the list of editors this composite editor delegates to. The returned list is an unmodifiable list. Adding or removing editors should be done using other methods (addEditor
andremoveEditor
).- Returns:
- the list of editors
-
canEdit
Returnstrue
if one of the editors this composite is composed of can edit the given object.- Specified by:
canEdit
in interfaceILspEditor
- Parameters:
aContext
- provides context information to the editor- Returns:
true
if the above conditions are met,false
otherwise.
-
edit
public TLspEditOperationResult edit(TLspEditOperation aOperation, ELspInteractionStatus aInteractionStatus, TLspEditContext aContext) Description copied from interface:ILspEditor
Applies an interaction obtained from a handle to the object being edited.- Specified by:
edit
in interfaceILspEditor
- Parameters:
aOperation
- describes the edit that should occur. This is usually generated by the handles. It is up to the concrete editor to determine how to handle this event.aInteractionStatus
- the interaction statusaContext
- the edit context- Returns:
- information about the result of the operation
-
canPerformOperation
Description copied from interface:ILspEditor
Determines whether or not the editor knows how to apply the given edit operation to the supplied geometry.- Specified by:
canPerformOperation
in interfaceILspEditor
- Parameters:
aOperation
- the operation to be appliedaContext
- the edit context- Returns:
- whether or not the editor can apply the given operation
-
getCreateHandle
Returns a handle that is used to create the given object. The returned handle is used by the controller to initialize the other of the object. Typically the returned handle is an instance ofALspCreateHandle
which is a specialized handle implementation used for creating an object. By default, this method returns anALspCreateHandle
capable of creating the given object, if one of the editors this composite is composed of can create the given object.- Specified by:
getCreateHandle
in interfaceILspEditor
- Parameters:
aContext
- provides context information such as the layer for which the object is being created- Returns:
- an edit handle, or
null
if creation should not be allowed. - See Also:
-
getEditHandles
Returns a set of handles for editing the given object. These handles will be able to generate edit operations, that are passed to theedit
method. As a way to communicate with this method, handles will copy their properties to the edit operation properties. The default behavior of this method is as follows. If one of the editors this composite is composed of can edit the given object, it delegate to itsgetEditHandles
method. Otherwise an empty list is returned.- Specified by:
getEditHandles
in interfaceILspEditor
- Parameters:
aContext
- provides context information such as the layer for which the object is being edited- Returns:
- the edit handles to edit the given object, or an empty list if it should not be possible to edit the given object.
- See Also:
-