Package org.eclipse.gef.mvc.fx.parts
Class AbstractSegmentHandlePart<N extends javafx.scene.Node>
java.lang.Object
org.eclipse.gef.mvc.fx.parts.AbstractVisualPart<V>
org.eclipse.gef.mvc.fx.parts.AbstractHandlePart<N>
org.eclipse.gef.mvc.fx.parts.AbstractSegmentHandlePart<N>
- Type Parameters:
N- The type of visual used by this handle. Needs to be a sub-type ofNode.
- All Implemented Interfaces:
Comparable<AbstractSegmentHandlePart<? extends javafx.scene.Node>>,IActivatable,IAdaptable,IAdaptable.Bound<IViewer>,IDisposable,IHandlePart<N>,IVisualPart<N>
- Direct Known Subclasses:
CircleSegmentHandlePart,RectangleSegmentHandlePart,SquareSegmentHandlePart
public abstract class AbstractSegmentHandlePart<N extends javafx.scene.Node>
extends AbstractHandlePart<N>
implements Comparable<AbstractSegmentHandlePart<? extends javafx.scene.Node>>
An
AbstractSegmentHandlePart is bound to a segment of a poly-bezier
handle geometry, represented by an array of BezierCurves. The
segmentIndex of the AbstractSegmentHandlePart identifies that segment
(0, 1, 2, ...). The segmentParameter specifies the position of this handle
part on the segment (0 = start, 0.5 = mid, 1 = end).-
Property Summary
Properties inherited from class org.eclipse.gef.mvc.fx.parts.AbstractVisualPart
active, adaptable, adapters, anchoragesUnmodifiable, anchoredsUnmodifiable, childrenUnmodifiable, parent, refreshVisualProperties inherited from interface org.eclipse.gef.common.activate.IActivatable
activeProperties inherited from interface org.eclipse.gef.common.adapt.IAdaptable
adaptersProperties inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
adaptableProperties inherited from interface org.eclipse.gef.mvc.fx.parts.IVisualPart
anchoragesUnmodifiable, anchoredsUnmodifiable, childrenUnmodifiable, parent, refreshVisual -
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_PROPERTYFields inherited from interface org.eclipse.gef.common.adapt.IAdaptable
ADAPTERS_PROPERTYFields inherited from interface org.eclipse.gef.mvc.fx.parts.IVisualPart
ANCHORAGES_PROPERTY, ANCHOREDS_PROPERTY, CHILDREN_PROPERTY, PARENT_PROPERTY, REFRESH_VISUAL_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(AbstractSegmentHandlePart<? extends javafx.scene.Node> o) voiddoRefreshVisual(N visual) Refreshes this part's visualization based on this part's content.protected BezierCurveReturns theBezierCurveat which this handle part is anchored (depending on segment index), ornullif thatBezierCurvecannot be determined.protected javafx.scene.paint.ColorReturns theColorthat is used to fill connected handles.protected javafx.scene.paint.ColorReturns theColorthat is used to fill insertion handles.protected javafx.scene.paint.ColorReturns theColorthat is used to fill movement handles.protected PointgetPosition(BezierCurve segment) Returns the position of thisAbstractSegmentHandleParton the given segment using the segment parameter that is assigned to this part.intReturns the number of segments that are provided to this part.intThe segmentIndex specifies the segment of the IGeometry provided by the handle geometry provider on which this selection handle part is positioned.doubleThe segmentParameter is a value between 0 and 1.protected BezierCurve[]Returns theBezierCurves that are provided to this part in the coordinate system of theScene.protected javafx.scene.paint.ColorReturns theColorthat is used to stroke handles.voidsetSegmentIndex(int segmentIndex) Sets the segment index and refreshes the visual.voidsetSegmentParameter(double segmentParameter) Sets the segment parameter and refreshes the visual.voidsetSegmentsProvider(Provider<BezierCurve[]> segmentsProvider) Sets theProvider<BezierCurve[]>for this part to the given value.protected voidupdateLocation(N visual) Computes the location for this part and relocates its visual to that location.Methods inherited from class org.eclipse.gef.mvc.fx.parts.AbstractHandlePart
doAddChildVisual, doAttachToAnchorageVisual, doDetachFromAnchorageVisual, doRemoveChildVisualMethods 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, doCreateVisual, 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, unsetAdapterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.gef.common.activate.IActivatable
activate, activeProperty, deactivate, isActiveMethods inherited from interface org.eclipse.gef.common.adapt.IAdaptable
adaptersProperty, getAdapter, getAdapter, getAdapter, getAdapterKey, getAdapters, getAdapters, getAdapters, setAdapter, setAdapter, setAdapter, setAdapter, unsetAdapterMethods inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
adaptableProperty, getAdaptable, setAdaptableMethods inherited from interface org.eclipse.gef.common.dispose.IDisposable
disposeMethods 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
-
Constructor Details
-
AbstractSegmentHandlePart
public AbstractSegmentHandlePart()
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<N extends javafx.scene.Node>
-
doRefreshVisual
Description copied from class:AbstractVisualPartRefreshes this part's visualization based on this part's content.- Specified by:
doRefreshVisualin classAbstractVisualPart<N extends javafx.scene.Node>- Parameters:
visual- This part's visual.
-
getBezierSegmentInParent
Returns theBezierCurveat which this handle part is anchored (depending on segment index), ornullif thatBezierCurvecannot be determined.- Returns:
- The
BezierCurveat which this handle part is anchored, ornullif thatBezierCurvecannot be determined.
-
getConnectedFill
protected javafx.scene.paint.Color getConnectedFill()Returns theColorthat is used to fill connected handles.- Returns:
- The
Colorthat is used to fill connected handles.
-
getInsertFill
protected javafx.scene.paint.Color getInsertFill()Returns theColorthat is used to fill insertion handles.- Returns:
- The
Colorthat is used to fill insertion handles.
-
getMoveFill
protected javafx.scene.paint.Color getMoveFill()Returns theColorthat is used to fill movement handles.- Returns:
- The
Colorthat is used to fill movement handles.
-
getPosition
Returns the position of thisAbstractSegmentHandleParton the given segment using the segment parameter that is assigned to this part.- Parameters:
segment- TheBezierCurveon which the position is evaluated.- Returns:
- The position of this part on the given segment using the segment parameter of this part.
-
getSegmentCount
public int getSegmentCount()Returns the number of segments that are provided to this part.- Returns:
- The number of segments that are provided to this part.
-
getSegmentIndex
public int getSegmentIndex()The segmentIndex specifies the segment of the IGeometry provided by the handle geometry provider on which this selection handle part is positioned. For a shape geometry, segments are determined by theIShape.getOutlineSegments()method. For a curve geometry, segments are determined by theICurve.toBezier()method. The exact position on the segment is specified by thesegmentParameter.- Returns:
- segmentIndex
-
getSegmentParameter
public double getSegmentParameter()The segmentParameter is a value between 0 and 1. It determines the final point on the segment which this selection handle part belongs to.- Returns:
- segmentParameter
-
getSegmentsInScene
Returns theBezierCurves that are provided to this part in the coordinate system of theScene.- Returns:
- The
BezierCurves that are provided to this part in the coordinate system of theScene.
-
getStroke
protected javafx.scene.paint.Color getStroke()Returns theColorthat is used to stroke handles.- Returns:
- The
Colorthat is used to stroke handles.
-
setSegmentIndex
public void setSegmentIndex(int segmentIndex) Sets the segment index and refreshes the visual.- Parameters:
segmentIndex- The segment index to set.- See Also:
-
setSegmentParameter
public void setSegmentParameter(double segmentParameter) Sets the segment parameter and refreshes the visual.- Parameters:
segmentParameter- The segment parameter to set.- See Also:
-
setSegmentsProvider
Sets theProvider<BezierCurve[]>for this part to the given value.- Parameters:
segmentsProvider- The newProvider<BezierCurve[]>for this part.
-
updateLocation
Computes the location for this part and relocates its visual to that location. The visual is made invisible if this part has an invalid index (out of bounds), i.e. when no location can be computed.- Parameters:
visual- This part's visual for convenience.
-