Package org.eclipse.gef.mvc.fx.parts
Class SnappingFeedbackPart
- java.lang.Object
-
- org.eclipse.gef.mvc.fx.parts.AbstractVisualPart<V>
-
- org.eclipse.gef.mvc.fx.parts.AbstractFeedbackPart<javafx.scene.shape.Line>
-
- org.eclipse.gef.mvc.fx.parts.SnappingFeedbackPart
-
- All Implemented Interfaces:
IActivatable
,IAdaptable
,IAdaptable.Bound<IViewer>
,IDisposable
,IFeedbackPart<javafx.scene.shape.Line>
,IVisualPart<javafx.scene.shape.Line>
public class SnappingFeedbackPart extends AbstractFeedbackPart<javafx.scene.shape.Line>
TheSnappingFeedbackPart
visualizes aSnappingModel.SnappingLocation
by drawing a red line at theSnappingModel.SnappingLocation
through the whole viewport.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable
IAdaptable.Bound<A extends IAdaptable>
-
Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
IAdaptable.Bound.Impl<T extends IAdaptable>
-
-
Field Summary
-
Fields inherited from interface org.eclipse.gef.common.activate.IActivatable
ACTIVE_PROPERTY
-
Fields inherited from interface org.eclipse.gef.common.adapt.IAdaptable
ADAPTERS_PROPERTY
-
Fields inherited from interface org.eclipse.gef.mvc.fx.parts.IVisualPart
ANCHORAGES_PROPERTY, ANCHOREDS_PROPERTY, CHILDREN_PROPERTY, PARENT_PROPERTY, REFRESH_VISUAL_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description SnappingFeedbackPart()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doAttachToAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
Attaches this part's visual to the visual of the given anchorage.protected javafx.scene.shape.Line
doCreateVisual()
Creates this part's visual.protected void
doDetachFromAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
Detaches this part's visual from the visual of the given anchorage.protected void
doRefreshVisual(javafx.scene.shape.Line visual)
Refreshes this part's visualization based on this part's content.SnappingModel.SnappingLocation
getSnappingLocation()
Returns theSnappingModel.SnappingLocation
for which feedback is visualized by thisSnappingFeedbackPart
.protected void
onViewportSizeChanged()
Callback method that is invoked when the viewport size is changed.protected void
onViewportTranslationChanged()
Callback method that is invoked when the viewport translation (scrolling) is changed.void
setSnappingLocation(SnappingModel.SnappingLocation snappingLocation)
Sets theSnappingModel.SnappingLocation
for this feedback part to the given value.-
Methods inherited from class org.eclipse.gef.mvc.fx.parts.AbstractFeedbackPart
doAddChildVisual, doRemoveChildVisual
-
Methods inherited from class org.eclipse.gef.mvc.fx.parts.AbstractVisualPart
activate, activateAdapters, activateChildren, activeProperty, adaptableProperty, adaptersProperty, addChild, addChild, addChildren, addChildren, anchoragesUnmodifiableProperty, anchoredsUnmodifiableProperty, attachAnchored, attachToAnchorage, attachToAnchorage, childrenUnmodifiableProperty, deactivate, deactivateAdapters, deactivateChildren, detachAnchored, detachFromAnchorage, detachFromAnchorage, determineViewer, dispose, doActivate, doDeactivate, getAdaptable, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, getAnchoragesUnmodifiable, getAnchoredsUnmodifiable, getBehaviors, getChildrenUnmodifiable, getHandlers, getParent, getPolicies, getRoot, getVisual, isActive, isRefreshVisual, parentProperty, refreshVisual, refreshVisualProperty, register, registerAtVisualPartMap, removeChild, removeChildren, reorderChild, setAdaptable, setAdapter, setAdapter, setAdapter, setAdapter, setParent, setRefreshVisual, unregister, unregisterFromVisualPartMap, unsetAdapter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.gef.common.activate.IActivatable
activate, activeProperty, deactivate, isActive
-
Methods inherited from interface org.eclipse.gef.common.adapt.IAdaptable
adaptersProperty, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, setAdapter, setAdapter, setAdapter, setAdapter, unsetAdapter
-
Methods inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
adaptableProperty, getAdaptable, setAdaptable
-
Methods inherited from interface org.eclipse.gef.common.dispose.IDisposable
dispose
-
Methods inherited from interface org.eclipse.gef.mvc.fx.parts.IVisualPart
addChild, addChild, addChildren, addChildren, anchoragesUnmodifiableProperty, anchoredsUnmodifiableProperty, attachAnchored, attachToAnchorage, attachToAnchorage, childrenUnmodifiableProperty, detachAnchored, detachFromAnchorage, detachFromAnchorage, getAnchoragesUnmodifiable, getAnchoredsUnmodifiable, getBehaviors, getChildrenUnmodifiable, getHandlers, getParent, getPolicies, getRoot, getViewer, getVisual, isRefreshVisual, parentProperty, refreshVisual, refreshVisualProperty, removeChild, removeChildren, reorderChild, setParent, setRefreshVisual
-
-
-
-
Method Detail
-
doAttachToAnchorageVisual
protected void doAttachToAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
Description copied from class:AbstractVisualPart
Attaches this part's visual to the visual of the given anchorage.- Overrides:
doAttachToAnchorageVisual
in classAbstractFeedbackPart<javafx.scene.shape.Line>
- Parameters:
anchorage
- The anchorageIVisualPart
.role
- The anchorage role.
-
doCreateVisual
protected javafx.scene.shape.Line doCreateVisual()
Description copied from class:AbstractVisualPart
Creates this part's visual.- Specified by:
doCreateVisual
in classAbstractVisualPart<javafx.scene.shape.Line>
- Returns:
- This part's visual.
-
doDetachFromAnchorageVisual
protected void doDetachFromAnchorageVisual(IVisualPart<? extends javafx.scene.Node> anchorage, java.lang.String role)
Description copied from class:AbstractVisualPart
Detaches this part's visual from the visual of the given anchorage.- Overrides:
doDetachFromAnchorageVisual
in classAbstractFeedbackPart<javafx.scene.shape.Line>
- Parameters:
anchorage
- The anchorageIVisualPart
.role
- The anchorage role.
-
doRefreshVisual
protected void doRefreshVisual(javafx.scene.shape.Line visual)
Description copied from class:AbstractVisualPart
Refreshes this part's visualization based on this part's content.- Specified by:
doRefreshVisual
in classAbstractVisualPart<javafx.scene.shape.Line>
- Parameters:
visual
- This part's visual.
-
getSnappingLocation
public SnappingModel.SnappingLocation getSnappingLocation()
Returns theSnappingModel.SnappingLocation
for which feedback is visualized by thisSnappingFeedbackPart
.- Returns:
- The
SnappingModel.SnappingLocation
for which feedback is visualized by thisSnappingFeedbackPart
.
-
onViewportSizeChanged
protected void onViewportSizeChanged()
Callback method that is invoked when the viewport size is changed.
-
onViewportTranslationChanged
protected void onViewportTranslationChanged()
Callback method that is invoked when the viewport translation (scrolling) is changed.
-
setSnappingLocation
public void setSnappingLocation(SnappingModel.SnappingLocation snappingLocation)
Sets theSnappingModel.SnappingLocation
for this feedback part to the given value.- Parameters:
snappingLocation
- The newSnappingModel.SnappingLocation
for this feedback part.
-
-