public class FXDefaultSelectionHandlePartFactory extends java.lang.Object implements IHandlePartFactory<javafx.scene.Node>
Modifier and Type | Field and Description |
---|---|
static double |
CREATION_HANDLE_MINIMUM_SEGMENT_LENGTH
The minimum segment length so that creation handles are shown.
|
static double |
CREATION_HANDLE_MINIMUM_SEGMENT_LENGTH_ORTHOGONAL
The minimum segment length so that creation handles are shown for
orthogonal connections.
|
static java.lang.String |
SELECTION_HANDLES_GEOMETRY_PROVIDER
The role name for the
Provider<IGeometry> that will be
used to generate selection handles. |
Constructor and Description |
---|
FXDefaultSelectionHandlePartFactory() |
Modifier and Type | Method and Description |
---|---|
java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> |
createHandleParts(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targets,
IBehavior<javafx.scene.Node> contextBehavior,
java.util.Map<java.lang.Object,java.lang.Object> contextMap)
Creates specific
IHandlePart s for the given targets. |
protected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> |
createMultiSelectionHandleParts(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targets,
IBehavior<javafx.scene.Node> contextBehavior,
java.util.Map<java.lang.Object,java.lang.Object> contextMap)
Creates handle parts for a multi selection.
|
protected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> |
createSingleSelectionHandleParts(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> target,
IBehavior<javafx.scene.Node> contextBehavior,
java.util.Map<java.lang.Object,java.lang.Object> contextMap)
Creates handle parts for a single selection.
|
protected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> |
createSingleSelectionHandlePartsForCurve(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> target,
IBehavior<javafx.scene.Node> contextBehavior,
java.util.Map<java.lang.Object,java.lang.Object> contextMap,
com.google.inject.Provider<BezierCurve[]> segmentsProvider)
Creates handle parts for a single selection of which the handle geometry
is an
ICurve . |
protected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> |
createSingleSelectionHandlePartsForPolygonalOutline(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> target,
IBehavior<javafx.scene.Node> contextBehavior,
java.util.Map<java.lang.Object,java.lang.Object> contextMap,
com.google.inject.Provider<BezierCurve[]> segmentsProvider)
|
protected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> |
createSingleSelectionHandlePartsForRectangularOutline(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> target,
IBehavior<javafx.scene.Node> contextBehavior,
java.util.Map<java.lang.Object,java.lang.Object> contextMap,
com.google.inject.Provider<BezierCurve[]> segmentsProvider)
Creates handle parts for a single selection of which the handle geometry
is a
Rectangle . |
public static final java.lang.String SELECTION_HANDLES_GEOMETRY_PROVIDER
Provider<IGeometry>
that will be
used to generate selection handles.public static final double CREATION_HANDLE_MINIMUM_SEGMENT_LENGTH
public static final double CREATION_HANDLE_MINIMUM_SEGMENT_LENGTH_ORTHOGONAL
public java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> createHandleParts(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targets, IBehavior<javafx.scene.Node> contextBehavior, java.util.Map<java.lang.Object,java.lang.Object> contextMap)
IHandlePartFactory
IHandlePart
s for the given targets. As
additional information might be needed by the IHandlePartFactory
to identify the creation context, the initiating contextBehavior
is expected to pass in a reference to itself as well as a
contextMap.
The contextMap may either directly contain the additional information needed by the factory, or it may be used as a reference to identify the creation context, in case the factory needs to query back the initiating contextBehavior for such information.
This mechanism is needed because all IBehavior
s are expected to
be stateless, so only the information within the contextMap will
allow the contextBehavior to identify the respective creation
context. A contract between a (concrete) IBehavior
and a
(concrete) IHandlePartFactory
that is based on such a query may
be realized as follows:
List createHandleParts(List targets, IBehavior contextBehavior, Map<Object, Object> contextMap) { if (contextBehavior instanceof ConcreteBehavior) { SomeAdditionalInformation i = ((ConcreteBehavior) contextBehavior) .giveSomeAdditionalInformation(contextMap); ... } }
createHandleParts
in interface IHandlePartFactory<javafx.scene.Node>
targets
- The target IVisualPart
s for which handles are to be
created.contextBehavior
- The context IBehavior
which initiates the creation of
feedback.contextMap
- A map in which the state-less context IBehavior
) may
place additional context information for the creation process.
It may either directly contain additional information needed
by the IHandlePartFactory
, or may be passed back by
the IHandlePartFactory
to the calling context
IBehavior
to query such kind of information (in which
case it will allow the context IBehavior
to identify
the creation context).IHandlePart
s that can be used to manipulate the
given targets.protected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> createMultiSelectionHandleParts(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targets, IBehavior<javafx.scene.Node> contextBehavior, java.util.Map<java.lang.Object,java.lang.Object> contextMap)
targets
- The target IVisualPart
s for which handles are to be
created.contextBehavior
- The context IBehavior
which initiates the creation of
feedback.contextMap
- A map in which the state-less context IBehavior
) may
place additional context information for the creation process.
It may either directly contain additional information needed
by the IHandlePartFactory
, or may be passed back by
the IHandlePartFactory
to the calling context
IBehavior
to query such kind of information (in which
case it will allow the context IBehavior
to identify
the creation context).IHandlePart
s that can be used to manipulate the
given targets.protected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> createSingleSelectionHandleParts(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> target, IBehavior<javafx.scene.Node> contextBehavior, java.util.Map<java.lang.Object,java.lang.Object> contextMap)
target
- The target IVisualPart
for which handles are to be
created.contextBehavior
- The context IBehavior
which initiates the creation of
feedback.contextMap
- A map in which the state-less context IBehavior
) may
place additional context information for the creation process.
It may either directly contain additional information needed
by the IHandlePartFactory
, or may be passed back by
the IHandlePartFactory
to the calling context
IBehavior
to query such kind of information (in which
case it will allow the context IBehavior
to identify
the creation context).IHandlePart
s that can be used to manipulate the
given targets.protected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> createSingleSelectionHandlePartsForCurve(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> target, IBehavior<javafx.scene.Node> contextBehavior, java.util.Map<java.lang.Object,java.lang.Object> contextMap, com.google.inject.Provider<BezierCurve[]> segmentsProvider)
ICurve
.target
- The target IVisualPart
for which handles are to be
created.contextBehavior
- The context IBehavior
which initiates the creation of
feedback.contextMap
- A map in which the state-less context IBehavior
) may
place additional context information for the creation process.
It may either directly contain additional information needed
by the IHandlePartFactory
, or may be passed back by
the IHandlePartFactory
to the calling context
IBehavior
to query such kind of information (in which
case it will allow the context IBehavior
to identify
the creation context).segmentsProvider
- A provider for the segments of the handle geometry for which
handles are to be created.IHandlePart
s that can be used to manipulate the
given targets.protected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> createSingleSelectionHandlePartsForPolygonalOutline(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> target, IBehavior<javafx.scene.Node> contextBehavior, java.util.Map<java.lang.Object,java.lang.Object> contextMap, com.google.inject.Provider<BezierCurve[]> segmentsProvider)
IShape
but not a Rectangle
.target
- The target IVisualPart
for which handles are to be
created.contextBehavior
- The context IBehavior
which initiates the creation of
feedback.contextMap
- A map in which the state-less context IBehavior
) may
place additional context information for the creation process.
It may either directly contain additional information needed
by the IHandlePartFactory
, or may be passed back by
the IHandlePartFactory
to the calling context
IBehavior
to query such kind of information (in which
case it will allow the context IBehavior
to identify
the creation context).segmentsProvider
- A provider for the segments of the handle geometry for which
handles are to be created.IHandlePart
s that can be used to manipulate the
given targets.protected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> createSingleSelectionHandlePartsForRectangularOutline(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> target, IBehavior<javafx.scene.Node> contextBehavior, java.util.Map<java.lang.Object,java.lang.Object> contextMap, com.google.inject.Provider<BezierCurve[]> segmentsProvider)
Rectangle
.target
- The target IVisualPart
for which handles are to be
created.contextBehavior
- The context IBehavior
which initiates the creation of
feedback.contextMap
- A map in which the state-less context IBehavior
) may
place additional context information for the creation process.
It may either directly contain additional information needed
by the IHandlePartFactory
, or may be passed back by
the IHandlePartFactory
to the calling context
IBehavior
to query such kind of information (in which
case it will allow the context IBehavior
to identify
the creation context).segmentsProvider
- A provider for the segments of the handle geometry for which
handles are to be created.IHandlePart
s that can be used to manipulate the
given targets.Copyright (c) 2014 itemis AG and others. All rights reserved.