com.levigo.jadice.swing.tool
Class DefaultToolActivationPolicy
java.lang.Object
com.levigo.jadice.swing.tool.DefaultToolActivationPolicy
- All Implemented Interfaces:
- ToolActivationPolicy
public class DefaultToolActivationPolicy
- extends Object
- implements ToolActivationPolicy
A simple and naive tool activation policy activating the first electable tool (if there is one)
and electing the first feedback to be provided.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultToolActivationPolicy
public DefaultToolActivationPolicy()
electActiveTool
public ToolActivationPolicy.ActivationCandidate electActiveTool(List<ToolActivationPolicy.ActivationCandidate> candidates,
EditEvent event,
ToolManager manager)
- Description copied from interface:
ToolActivationPolicy
- This method is queried by the given
ToolManager
instance with a list of candidate Tools
to be activated (wrapped as ToolActivationPolicy.ActivationCandidate
s) in response to a given
EditEvent
. If the activation policy determines that one of the candidate Tools shall be
auto-activated it must return the corresponding Tool.ActivationRequest
. If no Tool shall be
activated, it must return null
.
- Specified by:
electActiveTool
in interface ToolActivationPolicy
electFeedback
public ToolActivationPolicy.ActivationCandidate electFeedback(List<ToolActivationPolicy.ActivationCandidate> candidates,
EditEvent event,
ToolManager manager)
- Description copied from interface:
ToolActivationPolicy
- This method is queried by the given
ToolManager
instance with a list of candidate Tools
to be activated (wrapped as ToolActivationPolicy.ActivationCandidate
s) in response to a given
EditEvent
. In contrast to ToolActivationPolicy.electActiveTool(List, EditEvent, ToolManager)
this
method is called during the feedback phase. If the activation policy determines that one of the
candidate tools may become activated upon a subsequent mouse pressed or dragged event, it must
return the corresponding Tool.ActivationRequest
. Otherwise it must return null
.
- Specified by:
electFeedback
in interface ToolActivationPolicy
Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.