Class TLcdGXYTouchSelectEditController
- All Implemented Interfaces:
ILcdUndoableSource,ILcdAWTEventListener,ILcdStatusSource,ILcdGXYChainableController,ILcdGXYController,Serializable
A touch controller combining selection and editing behaviour.
This controller uses two controller models: TLcdGXYSelectControllerModel2 for
selection and TLcdGXYMultiPointEditControllerModel for editing. The default constructor
configures the controller for single-touch editing. Refer to the other constructors for how to
set up multi-touch editing.
Besides select and edit behaviour it also has support for touch-and-hold detection. When a touch-and-hold is detected, the touch-and-hold action is triggered. When the input point causing the touch-and-hold is removed, the post touch-and-hold action is triggered.
A typical use case for the touch-and-hold action is to display a context menu.
This controller only tries to handle TLcdTouchPoints which are not-consumed, and marks the
TLcdTouchPoints it uses as consumed, similar to the ALcdGXYTouchChainableController.
- Since:
- 10.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor supporting selecting and single-touch editing for a standard selection model and edit model.TLcdGXYTouchSelectEditController(int aMaximalNumberOfInputPoints) Creates a controller capable of editing with multiple points.TLcdGXYTouchSelectEditController(TLcdGXYSelectControllerModel2 aSelectControllerModel, TLcdGXYMultiPointEditControllerModel aEditControllerModel, int aMaximalNumberOfEditPoints) Creates a new controller which supports selecting and editing, using the given select and edit controller models. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUndoableListener(ILcdUndoableListener aUndoableListener) Adds a listener to this source, so this listener is notified when something undoable has happened.voidThis method will append the passed controller to the end of the chain.protected inteditHowMode(List<Point> aFrom, List<Point> aTo) Returns the edit-how mode.protected inteditWhatMode(List<Point> aFrom, List<Point> aTo, int aEditHow) Returns the edit-what mode.Returns theTLcdGXYMultiPointEditControllerModelused for the editing operations.Returns theILcdGXYViewthe controller is interacting with.Returns the color used to paint the halo around the selection rectangle.intReturns the thickness of the halo drawn around the selection rectangle.intReturns the current threshold for move events.Returns a reference to the controller that is located after this one in a chain, or null if this controller is the last element of the chain.Returns the action which will be triggered when the input point which caused a touch-and-hold is removed.Returns the color used to paint the selection rectangle.intReturns the line width used to draw the selection rectangle.Returns theTLcdGXYSelectControllerModel2used for the selection operations.Returns the snappables.Returns the action which is triggered when a touch-and-hold is detected.intReturns the time a touch must remain immobile (within the move threshold) to cause a touch and hold.Returns the icon used to indicate the touch-and-hold.voidhandleAWTEvent(AWTEvent aEvent) This is method is called when the target of the listener has a new AWTEvent available.booleanThis method indicates whether or not this controller will drag a rectangle and select all objects, interacting with the rectangle, or select objects on a TOUCH_DOWN event.booleanReturns whether or not the selection rectangle (when in drag rectangle mode) will be drawn with a halo.booleanThis method indicates whether the object being edited is painted in a temporary state and only changed when a touch point is removed or created, or whether the object is instantly edited while the touch point(s) are moved.voidEnables the controller to give visual feedback on the current user interactions.protected voidThe specific implementation ofpaintfor this controller.voidremoveUndoableListener(ILcdUndoableListener aUndoableListener) Removes the specified listener so it is no longer notified.protected ILcdGXYViewXYWorldTransformationConvenience method to retrieve theILcdGXYViewXYWorldTransformationfor theILcdGXYViewthis controller interacts with.protected intselectByWhatMode(Rectangle aSelectionBounds, int aInputMode) Returns the mode that defines by what objects can be selected: by their bodies, their labels, ...protected intselectHowMode(Rectangle aSelectionBounds, int aInputMode, int aSelectByWhatMode) Returns the mode that defines how the objects involved in the selection should interact with the existing selection, for example add them, remove them, toggle their selection state, etc.voidsetDragRectangle(boolean aDrag) This method can be used to toggle between selecting by dragging a rectangle, and selecting by a single touch.voidsetEditControllerModel(TLcdGXYMultiPointEditControllerModel aEditControllerModel) Sets theTLcdGXYMultiPointEditControllerModelused for the edit operations.protected voidsetGXYView(ILcdGXYView aGXYView) Sets theILcdGXYViewthe controller is interacting with.voidsetHaloColor(Color aHaloColor) Sets the color used to paint the halo around the selection rectangle.voidsetHaloEnabled(boolean aHaloEnabled) Enables or disables the halo effect when drawing the selection rectangle.voidsetHaloThickness(int aHaloThickness) Sets the thickness of the halo drawn around the selection rectangle.voidsetInstantEditing(boolean aInstantEditing) The method can be used to activate or deactivate instant editing.voidsetMoveThreshold(int aMoveThreshold) Sets the threshold for move events.voidThis method sets the next controller in the chain for this controller.voidsetPostTouchAndHoldAction(ILcdAction aPostTouchAndHoldAction) Sets the action which will be triggered when the input point which caused a touch-and-hold is removed.voidsetRectangleColor(Color aRectangleColor) Sets the color used to paint the selection rectangle.voidsetRectangleLineWidth(int aRectangleLineWidth) Sets the line width used to draw the selection rectangle.voidsetSelectControllerModel(TLcdGXYSelectControllerModel2 aSelectControllerModel) Sets theTLcdGXYSelectControllerModel2.voidsetSnappables(ILcdGXYLayerSubsetList aSnappables) Sets the set of objects that are used as candidates-to-snap-to while editing other objects.voidsetTouchAndHoldAction(ILcdAction aTouchAndHoldAction) Sets the action which is triggered when a touch-and-hold is detected.voidsetTouchAndHoldDelay(int aTouchAndHoldDelay) Sets the time a touch must remain immobile (within the move threshold) to cause a touch and hold.voidsetTouchAndHoldIcon(ILcdIcon aTouchAndHoldIcon) Sets the icon which will be used to indicate a touch-and-hold.voidstartInteraction(ILcdGXYView aGXYView) Sets up the controller to receive input through the view passed.protected voidstartInteractionImpl(ILcdGXYView aGXYView) The specific implementation ofstartInteractionfor this controller.voidterminateInteraction(ILcdGXYView aGXYView) Releases a few items.protected voidterminateInteractionImpl(ILcdGXYView aGXYView) The specific implementation ofterminateInteractionfor this controller.Methods inherited from class com.luciad.view.gxy.controller.ALcdGXYChainableController
addStatusListener, removeStatusListenerMethods inherited from class com.luciad.view.gxy.controller.ALcdGXYController
asGXYController, fireStatusEvent, getCursor, getIcon, getName, getShortDescription, isTraceOn, registerInstance, setClassTraceOn, setCursor, setIcon, setName, setShortDescription, setTraceOn, viewRepaintMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.view.gxy.ILcdGXYController
getCursor, getIcon, getLayered, getName, getShortDescription, viewRepaint
-
Constructor Details
-
TLcdGXYTouchSelectEditController
public TLcdGXYTouchSelectEditController()Default constructor supporting selecting and single-touch editing for a standard selection model and edit model.- See Also:
-
TLcdGXYTouchSelectEditController
public TLcdGXYTouchSelectEditController(int aMaximalNumberOfInputPoints) Creates a controller capable of editing with multiple points. It will use a standard selection model and edit model.- Parameters:
aMaximalNumberOfInputPoints- the maximal number of input points that will be used to edit- See Also:
-
TLcdGXYTouchSelectEditController
public TLcdGXYTouchSelectEditController(TLcdGXYSelectControllerModel2 aSelectControllerModel, TLcdGXYMultiPointEditControllerModel aEditControllerModel, int aMaximalNumberOfEditPoints) Creates a new controller which supports selecting and editing, using the given select and edit controller models.- Parameters:
aSelectControllerModel- the selection model. Must not benull.aEditControllerModel- the edit model. May benull. When set tonull, this controller will no longer try to edit and only perform selection.aMaximalNumberOfEditPoints- the maximal number of input points that will be used to edit
-
-
Method Details
-
isHaloEnabled
public boolean isHaloEnabled()Returns whether or not the selection rectangle (when in drag rectangle mode) will be drawn with a halo.- Returns:
- true is the halo is enabled, false otherwise
- See Also:
-
setHaloEnabled
public void setHaloEnabled(boolean aHaloEnabled) Enables or disables the halo effect when drawing the selection rectangle.- Parameters:
aHaloEnabled- if true the halo will be enabled, if false disabled.- See Also:
-
getRectangleLineWidth
public int getRectangleLineWidth()Returns the line width used to draw the selection rectangle.- Returns:
- the width used to paint the selection rectangle.
- See Also:
-
setRectangleLineWidth
public void setRectangleLineWidth(int aRectangleLineWidth) Sets the line width used to draw the selection rectangle.- Parameters:
aRectangleLineWidth- the line width that will be used to draw the selection rectangle.- See Also:
-
getRectangleColor
Returns the color used to paint the selection rectangle.- Returns:
- the color used to paint the selection rectangle.
- See Also:
-
setRectangleColor
Sets the color used to paint the selection rectangle.- Parameters:
aRectangleColor- the color that will be used to paint the selection rectangle.- See Also:
-
getHaloColor
Returns the color used to paint the halo around the selection rectangle.- Returns:
- the color used to paint the halo around the selection rectangle.
- See Also:
-
setHaloColor
Sets the color used to paint the halo around the selection rectangle.- Parameters:
aHaloColor- the color that will be used to paint the halo around the selection rectangle.- See Also:
-
getHaloThickness
public int getHaloThickness()Returns the thickness of the halo drawn around the selection rectangle.- Returns:
- the thickness of the halo drawn around the selection rectangle.
- See Also:
-
setHaloThickness
public void setHaloThickness(int aHaloThickness) Sets the thickness of the halo drawn around the selection rectangle.- Parameters:
aHaloThickness- the thickness of the halo that will be drawn around the selection rectangle.- See Also:
-
handleAWTEvent
Description copied from interface:ILcdAWTEventListenerThis is method is called when the target of the listener has a new AWTEvent available.- Specified by:
handleAWTEventin interfaceILcdAWTEventListener- Parameters:
aEvent- The event to be handled.
-
getGXYView
Description copied from class:ALcdGXYControllerReturns theILcdGXYViewthe controller is interacting with.- Overrides:
getGXYViewin classALcdGXYController- Returns:
- the
ILcdGXYViewthe controller is interacting with, or null if the view is not interacting with a view
-
setGXYView
Description copied from class:ALcdGXYControllerSets theILcdGXYViewthe controller is interacting with.This method is called when
ILcdGXYView.setGXYControlleris used to set anILcdGXYControlleractive on anILcdGXYView.- Overrides:
setGXYViewin classALcdGXYController- Parameters:
aGXYView- the view the controller is interacting with- See Also:
-
retrieveGXYViewXYWorldTransformation
Description copied from class:ALcdGXYControllerConvenience method to retrieve theILcdGXYViewXYWorldTransformationfor theILcdGXYViewthis controller interacts with. The default implementation returns the view's own transformation.- Overrides:
retrieveGXYViewXYWorldTransformationin classALcdGXYController- Returns:
- a
ILcdGXYViewXYWorldTransformationfor theILcdGXYViewthis controller interacts with.
-
startInteraction
Description copied from class:ALcdGXYChainableControllerSets up the controller to receive input through the view passed.All
ILcdGXYViewimplementations that support interaction call this method when the controller has been made active withsetGXYControlleron the view, so this method shouldn't normally be called directly. Note that most view implementations add the controller as listener if appropriate before calling this method.Sets the cursor on the view and sets the view for which this controller is now active. Sends out a status event based on the
short description.This method also calls
ALcdGXYChainableController.startInteraction(com.luciad.view.gxy.ILcdGXYView)on the next controller. OverrideALcdGXYChainableController.startInteractionImpl(com.luciad.view.gxy.ILcdGXYView)if you want to add your own behavior to this controller.- Specified by:
startInteractionin interfaceILcdGXYController- Overrides:
startInteractionin classALcdGXYChainableController- Parameters:
aGXYView- theILcdGXYViewthisILcdGXYControllerwill interact with.- See Also:
-
startInteractionImpl
Description copied from class:ALcdGXYChainableControllerThe specific implementation ofstartInteractionfor this controller.- Overrides:
startInteractionImplin classALcdGXYChainableController- Parameters:
aGXYView- the view to start interaction with.
-
terminateInteraction
Description copied from class:ALcdGXYChainableControllerReleases a few items. Can be redefined but this 'super' method should be called too.This method also calls
ALcdGXYChainableController.terminateInteraction(com.luciad.view.gxy.ILcdGXYView)on the next controller. OverrideALcdGXYChainableController.terminateInteractionImpl(com.luciad.view.gxy.ILcdGXYView)if you want to add your own behavior to this controller.- Specified by:
terminateInteractionin interfaceILcdGXYController- Overrides:
terminateInteractionin classALcdGXYChainableController- Parameters:
aGXYView- theILcdGXYViewthisILcdGXYControllerinteracted with.- See Also:
-
terminateInteractionImpl
Description copied from class:ALcdGXYChainableControllerThe specific implementation ofterminateInteractionfor this controller.- Overrides:
terminateInteractionImplin classALcdGXYChainableController- Parameters:
aGXYView- the view to terminate interaction with.
-
paint
Description copied from class:ALcdGXYChainableControllerEnables the controller to give visual feedback on the current user interactions. Note that the controller is responsible for repainting the view.Empty implementation. Redefine this method to render on the Graphics on which the view is rendered.
This method also calls
ALcdGXYChainableController.paint(java.awt.Graphics)on the next controller. OverrideALcdGXYChainableController.paintImpl(java.awt.Graphics)if you want to add your own behavior to this controller.- Specified by:
paintin interfaceILcdGXYController- Overrides:
paintin classALcdGXYChainableController- Parameters:
aGraphics- the Graphics on which the view was rendered.- See Also:
-
paintImpl
Description copied from class:ALcdGXYChainableControllerThe specific implementation ofpaintfor this controller.- Overrides:
paintImplin classALcdGXYChainableController- Parameters:
aGraphics- the graphics to be used for painting.
-
setNextGXYController
Description copied from interface:ILcdGXYChainableControllerThis method sets the next controller in the chain for this controller. You can set null if you want the chain to end. This method does not start or terminate any interaction. If you need to replace a controller while it's being used you are responsible for properly terminating and starting it yourself.- Specified by:
setNextGXYControllerin interfaceILcdGXYChainableController- Overrides:
setNextGXYControllerin classALcdGXYChainableController- Parameters:
aNext- the reference to the controller that will be the next element in the chain- See Also:
-
getNextGXYController
Description copied from interface:ILcdGXYChainableControllerReturns a reference to the controller that is located after this one in a chain, or null if this controller is the last element of the chain.- Specified by:
getNextGXYControllerin interfaceILcdGXYChainableController- Overrides:
getNextGXYControllerin classALcdGXYChainableController- Returns:
- a reference to the next controller.
- See Also:
-
appendGXYController
Description copied from interface:ILcdGXYChainableControllerThis method will append the passed controller to the end of the chain. The controller will be the stored as the next controller in the last element of the current chain.- Specified by:
appendGXYControllerin interfaceILcdGXYChainableController- Overrides:
appendGXYControllerin classALcdGXYChainableController- Parameters:
aEnd- the controller to be appended to the end of the chain.
-
addUndoableListener
Description copied from interface:ILcdUndoableSourceAdds a listener to this source, so this listener is notified when something undoable has happened.- Specified by:
addUndoableListenerin interfaceILcdUndoableSource- Parameters:
aUndoableListener- The listener to be notified when something undoable has happened.
-
removeUndoableListener
Description copied from interface:ILcdUndoableSourceRemoves the specified listener so it is no longer notified.- Specified by:
removeUndoableListenerin interfaceILcdUndoableSource- Parameters:
aUndoableListener- The listener to remove.
-
selectByWhatMode
Returns the mode that defines by what objects can be selected: by their bodies, their labels, ...
The default value is a bit-wise or of
TLcdGXYSelectControllerModel2.SELECT_BY_WHAT_BODIES_ON_CLICK,TLcdGXYSelectControllerModel2.SELECT_BY_WHAT_BODIES_ON_DRAG_CONTAINS,TLcdGXYSelectControllerModel2.SELECT_BY_WHAT_LABELS_ON_CLICKandTLcdGXYSelectControllerModel2.SELECT_BY_WHAT_LABELS_ON_DRAG_CONTAINS.- Parameters:
aSelectionBounds- The selection rectangle, in view coordinates (pixels). This could for example be the rectangle the user dragged on the map, or a one pixel wide rectangle for a click.aInputMode- EitherTLcdGXYSelectControllerModel2.INPUT_MODE_POINTorTLcdGXYSelectControllerModel2.INPUT_MODE_RECTANGLE, indicating if this selection change originated from a click or from a drag.- Returns:
- The select-by-what mode, a bit-wise or of the constants defined in the TLcdGXYSelectControllerModel2 class that start with
SELECT_BY.
-
selectHowMode
Returns the mode that defines how the objects involved in the selection should interact with the existing selection, for example add them, remove them, toggle their selection state, etc.
The default implementation returns
TLcdGXYSelectControllerModel2.SELECT_HOW_FIRST_TOUCHED.- Parameters:
aSelectionBounds- The selection rectangle, in view coordinates (pixels). This could for example be the rectangle the user dragged on the map, or a one pixel wide rectangle for a touch.aInputMode- EitherTLcdGXYSelectControllerModel2.INPUT_MODE_POINTorTLcdGXYSelectControllerModel2.INPUT_MODE_RECTANGLE, indicating if this selection change originated from a click or from a drag.aSelectByWhatMode- The select-by-what mode, for example the result of the methodselectByWhatMode. It is a bit-wise or of the constants in the TLcdGXYSelectControllerModel2 class that start withSELECT_BY.- Returns:
- The select-how mode, a bit-wise or of the constants in the TLcdGXYSelectControllerModel2 class that start with
SELECT_HOW.
-
editWhatMode
Returns the edit-what mode. This mode indicates what the edit should do: should the labels be edited, or the objects themselves?
This method returns
TLcdGXYMultiPointEditControllerModel.EDIT_WHAT_LABELSif one or more labels are touched. If none of the labels is touched, it will check whether an object is touched, and returnTLcdGXYMultiPointEditControllerModel.EDIT_WHAT_OBJECTSif this is the case. If none of the previous conditions is met, it will returnTLcdGXYMultiPointEditControllerModel.EDIT_WHAT_NO_CHANGE.This method calls the editingCandidates method with all the input points of
aFromandaTo.Touched is defined as returning true when calling
ILcdGXYPainter.isTouched(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)orILcdGXYLabelPainter2.isLabelTouched(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)for every input point.A possible customization of this method is to return
TLcdGXYMultiPointEditControllerModel.EDIT_WHAT_FIRST_TOUCHED_LABELinstead ofTLcdGXYMultiPointEditControllerModel.EDIT_WHAT_LABELSwhen a label is touched.- Parameters:
aFrom- A list with point(s) where the edit originated. Should have the same length asaTo, and the order of the points in both lists should be the same, e.g. the location of the first point ofaFromwhen the edit terminated should be passed as the first point inaTo.aTo- A list with point(s) where the edit terminated (so far). Should have the same length asaFrom, and the order of the points in both list should be the same, e.g. the location of the first point ofaFromwhen the edit terminated should be passed as the first point inaTo.aEditHow- The edit-how mode: one of the constants in the TLcdGXYMultiPointEditControllerModel class that start withEDIT_HOW.- Returns:
- one of the constants in the TLcdGXYMultiPointEditControllerModel class that start with
EDIT_WHAT.
-
editHowMode
Returns the edit-how mode. This mode indicates how the edit should behave: should the editing candidates be translated or reshaped? This method should be overridden if a different behaviour is desired.
The default implementation returns
Please note that the actual meaning of reshaping and translating is defined by the implementation ofTLcdGXYMultiPointEditControllerModel.EDIT_HOW_TRANSLATING.ILcdGXYPainter/ILcdGXYEditorthat is used.- Parameters:
aFrom- A list with point(s) where the edit originated. Should have the same length asaTo, and the order of the points in both lists should be the same, e.g. the location of the first point ofaFromwhen the edit terminated should be passed as the first point inaTo.aTo- A list with point(s) where the edit terminated (so far). Should have the same length asaFrom, and the order of the points in both list should be the same, e.g. the location of the first point ofaFromwhen the edit terminated should be passed as the first point inaTo.- Returns:
- One of the constants in
TLcdGXYMultiPointEditControllerModelthat start withEDIT_HOW.
-
getSelectControllerModel
Returns theTLcdGXYSelectControllerModel2used for the selection operations.- Returns:
- the
TLcdGXYSelectControllerModel2. - See Also:
-
setSelectControllerModel
Sets theTLcdGXYSelectControllerModel2. This allows for instance to disable selection by touching labels etc... Please refer toTLcdGXYSelectControllerModel2for more information.- Parameters:
aSelectControllerModel- The select controller model to set. Must not benull- See Also:
-
getEditControllerModel
Returns the
TLcdGXYMultiPointEditControllerModelused for the editing operations.- Returns:
- the
TLcdGXYMultiPointEditControllerModel - See Also:
-
setEditControllerModel
Sets theTLcdGXYMultiPointEditControllerModelused for the edit operations. This allows to customize the editing logic, such as which objects should be edited, etc. . Please refer toTLcdGXYMultiPointEditControllerModelfor more information.- Parameters:
aEditControllerModel- The edit controller model to set. May benull. When set tonull, this controller will no longer try to edit and only perform selection.- See Also:
-
setSnappables
Sets the set of objects that are used as candidates-to-snap-to while editing other objects. Set to
Please refer to the developer guide for more information about snapping.nullto disable snapping.- Parameters:
aSnappables- the list of objects that are candidates to snap to.- See Also:
-
getSnappables
Returns the snappables.
- Returns:
- the snappables.
- See Also:
-
setMoveThreshold
public void setMoveThreshold(int aMoveThreshold) Sets the threshold for move events.
Only MOVED events describing a move of the point to a location further then the threshold in either the X or Y direction from its previous location should be considered by this controller.
For example, when the threshold is set to 5, and the point is currently located at location (A,B), all move events should not be considered by this controller until the point is moved to a new location (A+x, B+y) where the absolute value of x and/or y must at least be 5.
The new value of the threshold will not affect any events which arrived at the controller prior to the change in threshold.
The default value for this property is 0, which means every move of a tracked input point will be handled.
- Parameters:
aMoveThreshold- the threshold for move events. Must be positive.- See Also:
-
getMoveThreshold
public int getMoveThreshold()Returns the current threshold for move events.
Only TOUCH_POINT_MOVED events describing a move of the point to a location further then the threshold in either the X or Y direction from its previous location should be considered by this controller.
For example, when the threshold is set to 5, and the point is currently located at location (A,B), all move events should not be considered by this controller until the point is moved to a new location (A+x, B+y) where the absolute value of x and/or y must at least be 5.
The default value for this property is 10.
- Returns:
- the current threshold for move events
- See Also:
-
isDragRectangle
public boolean isDragRectangle()This method indicates whether or not this controller will drag a rectangle and select all objects, interacting with the rectangle, or select objects on a TOUCH_DOWN event.- Returns:
- true if drag rectangle mode is active, and false if object are selected by a touch.
-
setDragRectangle
public void setDragRectangle(boolean aDrag) This method can be used to toggle between selecting by dragging a rectangle, and selecting by a single touch.- Parameters:
aDrag- true indicates selecting by dragging a rectangle, false indicates selecting the object you touch.
-
getTouchAndHoldAction
Returns the action which is triggered when a touch-and-hold is detected.- Returns:
- the action which is triggered when a touch-and-hold is detected. The default value is
null - See Also:
-
setTouchAndHoldAction
Sets the action which is triggered when a touch-and-hold is detected.
A typical use case is to display a context-menu on a touch-and-hold.
- Parameters:
aTouchAndHoldAction- the action to trigger when a touch-and-hold is detected. May benull- See Also:
-
getTouchAndHoldIcon
Returns the icon used to indicate the touch-and-hold.- Returns:
- the icon used to indicate the touch-and-hold. The default value is
null - See Also:
-
setTouchAndHoldIcon
Sets the icon which will be used to indicate a touch-and-hold. It is painted at the input location from the moment the touch-and-hold action is executed until the post touch-and-hold action is executed.
When the view is an instance of
Component, it is passed to theILcdIcon.paintIcon(java.awt.Component, java.awt.Graphics, int, int)method. This allows for animated icons. In such case, the animated icon should callComponent.repaint()every time it changes.- Parameters:
aTouchAndHoldIcon- the icon. May benull.- See Also:
-
getPostTouchAndHoldAction
Returns the action which will be triggered when the input point which caused a touch-and-hold is removed.- Returns:
- the action which will be triggered when the input point which caused a touch-and-hold
is removed. The default value is
null - See Also:
-
setPostTouchAndHoldAction
Sets the action which will be triggered when the input point which caused a touch-and-hold is removed.- Parameters:
aPostTouchAndHoldAction- the action which will be triggered when the input point which caused a touch-and-hold is removed. May benull
-
getTouchAndHoldDelay
public int getTouchAndHoldDelay()Returns the time a touch must remain immobile (within the move threshold) to cause a touch and hold.- Returns:
- the time it takes for a touch and hold to occur.
- See Also:
-
setTouchAndHoldDelay
public void setTouchAndHoldDelay(int aTouchAndHoldDelay) Sets the time a touch must remain immobile (within the move threshold) to cause a touch and hold. The default value is 1000.- Parameters:
aTouchAndHoldDelay- the time it will take for a touch and hold to occur.- See Also:
-
isInstantEditing
public boolean isInstantEditing()This method indicates whether the object being edited is painted in a temporary state and only changed when a touch point is removed or created, or whether the object is instantly edited while the touch point(s) are moved.
The default value for this property is
false.- Returns:
trueif this controller instantly edits objects, without painting them in a temporary state,falseotherwise.- See Also:
-
setInstantEditing
public void setInstantEditing(boolean aInstantEditing) The method can be used to activate or deactivate instant editing. When instant editing is enabled objects will be edited whenever a touch point is moved. When it is disabled, objects will be edited only when the touch points are removed or created, and will be painted in a temporary state. When enabling instant editing, take into account:- performance may suffer, the view invalidates the layer that is edited, and as a result this layer has to be repainted.
- no snap targets will be visible, snapping will still work but with less feedback.
- when dragging a handle over another handle, it's possible that the second handle is edited instead of the first
The recommended value for multi-editing is
true.- Parameters:
aInstantEditing- when true instant editing will be enabled, when false disabled.- See Also:
-