Class ALspDynamicCreateHandle
java.lang.Object
com.luciad.view.lightspeed.editor.handle.ALspHandle
com.luciad.view.lightspeed.editor.handle.ALspEditHandle
com.luciad.view.lightspeed.editor.handle.ALspCreateHandle
com.luciad.view.lightspeed.editor.handle.ALspDynamicCreateHandle
A create handle that dynamically adds handles. This is useful when the list of handles is not known
a-priori. An example of an
editor that uses a dynamic create handle is the
TLsp2DPointListEditor
,
where a new handle is constructed whenever a new point is added to the point list under
creation. Since the number of points in the list is unknown beforehand, a static
create handle cannot be used.
This class can be extended by implementing createNewEditHandle
. Since hasNext
always returns true
by
default, requestsDeactivation
can be used to end the creation.
Implementations of this class typically respond to TLspNextCreateStepEvent
that is used to programmatically end a dynamic creation step (see also
TLspCreateController.finish()
.
- Since:
- 2012.0
-
Field Summary
Fields inherited from class com.luciad.view.lightspeed.editor.handle.ALspHandle
PRIORITY_2D_CONTOUR, PRIORITY_2D_POINT, PRIORITY_2D_SHAPE, PRIORITY_3D_CONTOUR, PRIORITY_3D_POINT, PRIORITY_3D_SHAPE, PRIORITY_MULTIPLE_SHAPES
-
Constructor Summary
ModifierConstructorDescriptionprotected
ALspDynamicCreateHandle
(Object aDomainObject) Creates a new dynamic create handle for the given object. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ALspEditHandle
createNewEditHandle
(AWTEvent aEvent, TLspEditContext aEditContext) This method creates the next handle that should be used by this create handle.protected ALspEditHandle
createNewEditHandle
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofcreateNewEditHandle(AWTEvent, TLspEditContext)
.protected boolean
hasNext
(AWTEvent aEvent, TLspEditContext aEditContext) Checks whether there is a next handle to be used in the creation process.protected boolean
hasNext
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofALspCreateHandle.hasNext(AWTEvent, TLspEditContext)
.next
(AWTEvent aEvent, TLspEditContext aEditContext) Creates a new handle by callingcreateNewEditHandle
, and sets the appropriate properties.next
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofALspCreateHandle.next(AWTEvent, TLspEditContext)
.Methods inherited from class com.luciad.view.lightspeed.editor.handle.ALspCreateHandle
deactivate, deactivate, getActiveHandle, getCursor, getPreviousHandles, getStyleTargetProviders, handleAWTEvent, handleFXEvent, hasPrevious, hasPrevious, isActive, previous, previous, removePreviousHandle, requestsDeactivation, requestsDeactivation, requestsFocus, requestsFocus
Methods inherited from class com.luciad.view.lightspeed.editor.handle.ALspEditHandle
getGeometry
Methods inherited from class com.luciad.view.lightspeed.editor.handle.ALspHandle
getCursorFX, getPriority, getProperties, setCursor, setCursorFX, setPriority
-
Constructor Details
-
ALspDynamicCreateHandle
Creates a new dynamic create handle for the given object.- Parameters:
aDomainObject
- the object to create.
-
-
Method Details
-
createNewEditHandle
protected abstract ALspEditHandle createNewEditHandle(AWTEvent aEvent, TLspEditContext aEditContext) This method creates the next handle that should be used by this create handle. This method is called fromnext
.- Parameters:
aEvent
- the eventaEditContext
- the edit context.- Returns:
- a new handle, should never be
null
.
-
createNewEditHandle
JavaFX equivalent ofcreateNewEditHandle(AWTEvent, TLspEditContext)
.- Parameters:
aEvent
- the eventaEditContext
- the edit context.- Since:
- 2020.0
-
hasNext
Checks whether there is a next handle to be used in the creation process. By default this method always returnstrue
. In order to stop the creation process, this method can be overridden, or more conveniently,requestsDeactivation
can be implemented to end the creation process when needed.- Specified by:
hasNext
in classALspCreateHandle
- Parameters:
aEvent
- the eventaEditContext
- the edit context- Returns:
true
if another handle is available,false
otherwise.
-
hasNext
Description copied from class:ALspCreateHandle
JavaFX equivalent ofALspCreateHandle.hasNext(AWTEvent, TLspEditContext)
.- Overrides:
hasNext
in classALspCreateHandle
- Parameters:
aEvent
- the eventaEditContext
- the edit context- Returns:
true
if another handle is available,false
otherwise.
-
next
Creates a new handle by callingcreateNewEditHandle
, and sets the appropriate properties.- Specified by:
next
in classALspCreateHandle
- Parameters:
aEvent
- event that initiated a transition to the next handleaEditContext
- the edit context- Returns:
- the next handle.
- See Also:
-
next
Description copied from class:ALspCreateHandle
JavaFX equivalent ofALspCreateHandle.next(AWTEvent, TLspEditContext)
.- Overrides:
next
in classALspCreateHandle
- Parameters:
aEvent
- the eventaEditContext
- the edit context- Returns:
- the next handle.
-