Class TLspStaticCreateHandle
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.TLspStaticCreateHandle
A handle used to create objects. This create handle implementation can be used when the
list of handles is known at construction time. An example of an editor that uses a static
create handle is
TLspCircleEditor
.
For instance when creating a TLcdLonLatCircle
, the number and type of handles
is fixed and known a-priori.
The handle delegates input events to a list of other handles from which always one is active.
When this active handle in the list becomes inactive, the next handle is automatically activated.
If the last handle in the list becomes inactive, the create handle itself becomes inactive as
well.- 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
ConstructorDescriptionTLspStaticCreateHandle
(Object aDomainObject, Collection<ALspEditHandle> aHandles) Creates a new static creation handle for the given object, delegating to the given collection of handles. -
Method Summary
Modifier and TypeMethodDescriptionReturns the handles to which this create handle delegates.int
Returns the index of the next handle.Returns all style target providers components of the currently active handle and previously used handles.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 ofhasNext(AWTEvent, TLspEditContext)
.next
(AWTEvent aEvent, TLspEditContext aEditContext) Makes the next handle the active handle.next
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofnext(AWTEvent, TLspEditContext)
.protected boolean
requestsDeactivation
(AWTEvent aEvent, TLspEditContext aEditContext) Checks whether the create handle should be deactivated.protected boolean
requestsDeactivation
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofrequestsDeactivation(AWTEvent, TLspEditContext)
.void
setNextHandleIndex
(int aIndex) Sets the next handle index.Methods inherited from class com.luciad.view.lightspeed.editor.handle.ALspCreateHandle
deactivate, deactivate, getActiveHandle, getCursor, getPreviousHandles, handleAWTEvent, handleFXEvent, hasPrevious, hasPrevious, isActive, previous, previous, removePreviousHandle, 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
-
TLspStaticCreateHandle
Creates a new static creation handle for the given object, delegating to the given collection of handles.- Parameters:
aDomainObject
- the domain object.aHandles
- a collection of delegate handles.
-
-
Method Details
-
getHandles
Returns the handles to which this create handle delegates. This list should not be modified.- Returns:
- the handles to which this create handle delegates.
-
setNextHandleIndex
public void setNextHandleIndex(int aIndex) Sets the next handle index. The next handle index indicates which handle will be active the next timenext
is called. By default the first handle (with index 0) is the next handle. However, in some cases a number of handles is not used during creation but are still added to the create handle to be painted to yield a consistent number of handles during creation and editing.- Parameters:
aIndex
- the index of the handle that will be active next. Must be in the[0,
interval.handles size
[
-
getNextHandleIndex
public int getNextHandleIndex()Returns the index of the next handle.- Returns:
- the index of the next handle.
- See Also:
-
hasNext
Checks whether there is a next handle to be used in the creation process. By default, this method returnstrue
if the next handle index<
the number of handles.- Specified by:
hasNext
in classALspCreateHandle
- Parameters:
aEvent
- the eventaEditContext
- the edit context- Returns:
true
if another handle is available,false
otherwise.
-
hasNext
JavaFX equivalent ofhasNext(AWTEvent, TLspEditContext)
.- Overrides:
hasNext
in classALspCreateHandle
- Parameters:
aEvent
- the eventaEditContext
- the edit context- Returns:
true
if another handle is available,false
otherwise.- Since:
- 2020.0
-
next
Makes the next handle the active handle. By default, this method returns the handle at the next handle index.- Specified by:
next
in classALspCreateHandle
- Parameters:
aEvent
- the eventaEditContext
- the edit context- Returns:
- the next handle.
-
next
JavaFX equivalent ofnext(AWTEvent, TLspEditContext)
.- Overrides:
next
in classALspCreateHandle
- Parameters:
aEvent
- the eventaEditContext
- the edit context- Returns:
- the next handle.
- Since:
- 2020.0
-
requestsDeactivation
Checks whether the create handle should be deactivated. This is the case if the current handle is the last handle and it is not active. Subclasses can implement this method to perform additional checks on the input event and for example request deactivation when the right mouse button is clicked. The result of having this method return true is that the currently active handle (if any) is invoked one more time, and the resulting TLspEditHandleResult will contain a ELspInteractionStatus.FINISHED as an interaction status. Note that this create handle automatically deactivates ifhasNext
returnsfalse
, regardless of this method. This method should be considered an "early-out". By default, this method returnsfalse
.- Specified by:
requestsDeactivation
in classALspCreateHandle
- Parameters:
aEvent
- the eventaEditContext
- the edit context for this request- Returns:
- true if deactivation is requested, false otherwise.
-
requestsDeactivation
JavaFX equivalent ofrequestsDeactivation(AWTEvent, TLspEditContext)
.- Overrides:
requestsDeactivation
in classALspCreateHandle
- Parameters:
aEvent
- the eventaEditContext
- the edit context for this request- Returns:
- true if deactivation is requested, false otherwise.
- Since:
- 2020.0
-
getStyleTargetProviders
Description copied from class:ALspCreateHandle
Returns all style target providers components of the currently active handle and previously used handles.- Overrides:
getStyleTargetProviders
in classALspCreateHandle
- Parameters:
aType
- the handle component type for which the visual representations are to be retrieved- Returns:
- the combined collection of visual handle components of the active handle, and possibly of all previously used handles
-