Package org.eclipse.gef.mvc.fx.behaviors
Class SnappingBehavior
- java.lang.Object
-
- org.eclipse.gef.mvc.fx.behaviors.AbstractBehavior
-
- org.eclipse.gef.mvc.fx.behaviors.SnappingBehavior
-
- All Implemented Interfaces:
IActivatable
,IAdaptable.Bound<IVisualPart<? extends javafx.scene.Node>>
,IBehavior
public class SnappingBehavior extends AbstractBehavior
TheSnappingBehavior
is responsible for creating and removing feedback and handles in response toSnappingModel
changes.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
IAdaptable.Bound.Impl<T extends IAdaptable>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SNAPPING_FEEDBACK_PART_FACTORY
Defines the role for theIFeedbackPartFactory
that is used to generate snap-to feedback.-
Fields inherited from interface org.eclipse.gef.common.activate.IActivatable
ACTIVE_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description SnappingBehavior()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doActivate()
PostAbstractBehavior.activate()
hook that may be overwritten to e.g. register listeners.protected void
doDeactivate()
PreAbstractBehavior.deactivate()
hook that may be overwritten to e.g. unregister listeners.protected IFeedbackPartFactory
getFeedbackPartFactory(IViewer viewer)
Returns theIFeedbackPartFactory
for selection feedback.protected void
onSnappingLocationsChanged(java.util.List<? extends SnappingModel.SnappingLocation> oldValue, java.util.List<? extends SnappingModel.SnappingLocation> newValue)
Callback method that is called in response toSnappingModel
changes.-
Methods inherited from class org.eclipse.gef.mvc.fx.behaviors.AbstractBehavior
activate, activeProperty, adaptableProperty, addAnchoreds, addAnchoreds, addFeedback, addFeedback, addHandles, addHandles, clearFeedback, clearHandles, deactivate, getAdaptable, getFeedback, getFeedback, getFeedbackPartFactory, getFeedbackPerTargetSet, getHandlePartFactory, getHandlePartFactory, getHandles, getHandles, getHandlesPerTargetSet, getHost, hasFeedback, hasFeedback, hasHandles, hasHandles, isActive, removeAnchoreds, removeFeedback, removeFeedback, removeFeedback, removeHandles, removeHandles, removeHandles, setAdaptable, updateHandles, updateHandles
-
-
-
-
Field Detail
-
SNAPPING_FEEDBACK_PART_FACTORY
public static final java.lang.String SNAPPING_FEEDBACK_PART_FACTORY
Defines the role for theIFeedbackPartFactory
that is used to generate snap-to feedback.- See Also:
- Constant Field Values
-
-
Method Detail
-
doActivate
protected void doActivate()
Description copied from class:AbstractBehavior
PostAbstractBehavior.activate()
hook that may be overwritten to e.g. register listeners.- Overrides:
doActivate
in classAbstractBehavior
-
doDeactivate
protected void doDeactivate()
Description copied from class:AbstractBehavior
PreAbstractBehavior.deactivate()
hook that may be overwritten to e.g. unregister listeners.- Overrides:
doDeactivate
in classAbstractBehavior
-
getFeedbackPartFactory
protected IFeedbackPartFactory getFeedbackPartFactory(IViewer viewer)
Returns theIFeedbackPartFactory
for selection feedback.- Overrides:
getFeedbackPartFactory
in classAbstractBehavior
- Parameters:
viewer
- TheIViewer
for which to determine theIFeedbackPartFactory
for thisIBehavior
.- Returns:
- The
IFeedbackPartFactory
for selection feedback.
-
onSnappingLocationsChanged
protected void onSnappingLocationsChanged(java.util.List<? extends SnappingModel.SnappingLocation> oldValue, java.util.List<? extends SnappingModel.SnappingLocation> newValue)
Callback method that is called in response toSnappingModel
changes.- Parameters:
oldValue
- AList
containing theSnappingModel.SnappingLocation
s previously stored in theSnappingModel
.newValue
- AList
containing theSnappingModel.SnappingLocation
s currently stored in theSnappingModel
.
-
-