public class FXDefaultHandlePartFactory extends java.lang.Object implements IHandlePartFactory<javafx.scene.Node>
FXDefaultHandlePartFactory
is an IHandlePartFactory
implementation that is parameterized by Node
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HOVER_HANDLES_GEOMETRY_PROVIDER
The role name for the
Provider<IGeometry> that will be
used to generate hover handles. |
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 |
---|
FXDefaultHandlePartFactory() |
Modifier and Type | Method and Description |
---|---|
protected IHandlePart<javafx.scene.Node,? extends javafx.scene.Node> |
createBoundsSelectionCornerHandlePart(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targets,
java.util.Map<java.lang.Object,java.lang.Object> contextMap,
com.google.inject.Provider<BezierCurve[]> segmentsProvider,
int segmentIndex,
double segmentParameter)
Creates an
FXRectangleSegmentHandlePart for one corner of the
bounds of a multi selection. |
protected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> |
createBoundsSelectionHandleParts(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targets,
com.google.inject.Provider<? extends IGeometry> handleGeometryProvider,
java.util.Map<java.lang.Object,java.lang.Object> contextMap)
Creates handle parts for a multi selection.
|
protected IHandlePart<javafx.scene.Node,? extends javafx.scene.Node> |
createCurveSelectionHandlePart(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> targetPart,
com.google.inject.Provider<BezierCurve[]> segmentsProvider,
int segmentCount,
int segmentIndex,
double segmentParameter)
Creates an
IHandlePart for the specified segment vertex of the
IGeometry provided by the given handleGeometryProvider. |
protected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> |
createCurveSelectionHandleParts(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> targetPart,
com.google.inject.Provider<BezierCurve[]> segmentsProvider,
java.util.Map<java.lang.Object,java.lang.Object> contextMap)
Generate handles for the end/join points of the individual beziers.
|
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>> |
createHoverHandleParts(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> target,
HoverBehavior<javafx.scene.Node> contextBehavior,
java.util.Map<java.lang.Object,java.lang.Object> contextMap)
Creates hover handle parts for the given (hovered) target
IVisualPart . |
protected IHandlePart<javafx.scene.Node,? extends javafx.scene.Node> |
createHoverSegmentHandlePart(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> target,
com.google.inject.Provider<BezierCurve[]> hoverHandlesSegmentsInSceneProvider,
int segmentCount,
int segmentIndex,
java.util.Map<java.lang.Object,java.lang.Object> contextMap)
Creates an
FXCircleSegmentHandlePart for the given (hovered)
target IVisualPart . |
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,
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>> |
createSelectionHandleParts(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targets,
SelectionBehavior<javafx.scene.Node> selectionBehavior,
java.util.Map<java.lang.Object,java.lang.Object> contextMap)
Creates handle parts for a selection.
|
protected IHandlePart<javafx.scene.Node,? extends javafx.scene.Node> |
createSelectionSegmentHandlePart(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> target,
com.google.inject.Provider<BezierCurve[]> segmentsProvider,
int segmentCount,
int segmentIndex,
java.util.Map<java.lang.Object,java.lang.Object> contextMap)
Creates an
IHandlePart for the specified vertex of the
IGeometry provided by the given handleGeometryProvider. |
protected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> |
createSingleSelectionHandleParts(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> target,
java.util.Map<java.lang.Object,java.lang.Object> contextMap)
Creates handle parts for a single selection.
|
protected java.util.Collection<? extends IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> |
createTightBoundsSelectionHandleParts(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targetParts,
com.google.inject.Provider<BezierCurve[]> segmentsProvider,
java.util.Map<java.lang.Object,java.lang.Object> contextMap)
Creates
FXRectangleSegmentHandlePart s for the segments provided
by the given segments provider. |
public static final java.lang.String SELECTION_HANDLES_GEOMETRY_PROVIDER
Provider<IGeometry>
that will be
used to generate selection handles.public static final java.lang.String HOVER_HANDLES_GEOMETRY_PROVIDER
Provider<IGeometry>
that will be
used to generate hover handles.protected IHandlePart<javafx.scene.Node,? extends javafx.scene.Node> createBoundsSelectionCornerHandlePart(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targets, java.util.Map<java.lang.Object,java.lang.Object> contextMap, com.google.inject.Provider<BezierCurve[]> segmentsProvider, int segmentIndex, double segmentParameter)
FXRectangleSegmentHandlePart
for one corner of the
bounds of a multi selection. The selection bounds geometry can be
obtained from the given provider as a poly-bezier, i.e. an array of
BezierCurve
s. The position of the handle part to create is
represented via segment index and parameter, where the index refers to
the respective BezierCurve
segment, and the parameter (0 = start,
0.5 = mid, 1 = end) to the relative position w.r.t. to the indexed
segment.targets
- The selected IVisualPart
s that form the multi
selection, for which feedback handles are to be created.contextMap
- May contain additional information needed for the creation or
to identify the creation context, when querying back such
information from the context IBehavior
that initiated
the creation.segmentsProvider
- A provider that delivers the selection geometry as a
poly-bezier, represented as an array of BezierCurve
s.segmentIndex
- The index of the poly-bezier segment at which the handle is to
be placed.segmentParameter
- The parameter that identifies the position within the segment
(0 = start, 0.5 = mid, 1 = end).IHandlePart
for the specified corner of the bounds of
the multi selectionprotected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> createBoundsSelectionHandleParts(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targets, com.google.inject.Provider<? extends IGeometry> handleGeometryProvider, java.util.Map<java.lang.Object,java.lang.Object> contextMap)
targets
- A list containing the IVisualPart
s that are part of
the multi selection.handleGeometryProvider
- The Provider<IGeometry>
that provides the
selection bounds geometry.contextMap
- A map in which the state-less SelectionBehavior
may
place additional context information for the creation process.
It may either directly contain additional information needed
by this factory, or may be passed back by the factory to the
calling SelectionBehavior
to query such kind of
information (in which case it will allow the
SelectionBehavior
to identify the creation context).protected IHandlePart<javafx.scene.Node,? extends javafx.scene.Node> createCurveSelectionHandlePart(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> targetPart, com.google.inject.Provider<BezierCurve[]> segmentsProvider, int segmentCount, int segmentIndex, double segmentParameter)
IHandlePart
for the specified segment vertex of the
IGeometry
provided by the given handleGeometryProvider.targetPart
- The IVisualPart
which is selected.segmentsProvider
- Provides BezierCurve
s from which the handle part can
retrieve its location.segmentCount
- The number of segments that existsegmentIndex
- Index of the segment of the provided BezierCurve
s
where the handle part will be located.segmentParameter
- Parameter between 0 and 1 that specifies the location on the
segment.IHandlePart
for the specified segment vertex of the
provided BezierCurve
sprotected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> createCurveSelectionHandleParts(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> targetPart, com.google.inject.Provider<BezierCurve[]> segmentsProvider, java.util.Map<java.lang.Object,java.lang.Object> contextMap)
targetPart
- The IVisualPart
which is selected.segmentsProvider
- Provides an IGeometry
for which IHandlePart
s
are to be created.contextMap
- Stores context information as an IBehavior
is
stateless.IHandlePart
s for the given target part.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>> createHoverHandleParts(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> target, HoverBehavior<javafx.scene.Node> contextBehavior, java.util.Map<java.lang.Object,java.lang.Object> contextMap)
IVisualPart
.target
- The (hovered) target IVisualPart
for which hover
handles are created.contextBehavior
- The HoverBehavior
that initiated the creation process.contextMap
- A map in which the state-less HoverBehavior
may place
additional context information for the creation process. It
may either directly contain additional information needed by
this factory, or may be passed back by the factory to the
calling HoverBehavior
to query such kind of
information (in which case it will allow the
HoverBehavior
to identify the creation context).protected IHandlePart<javafx.scene.Node,? extends javafx.scene.Node> createHoverSegmentHandlePart(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> target, com.google.inject.Provider<BezierCurve[]> hoverHandlesSegmentsInSceneProvider, int segmentCount, int segmentIndex, java.util.Map<java.lang.Object,java.lang.Object> contextMap)
FXCircleSegmentHandlePart
for the given (hovered)
target IVisualPart
. The segments provider and segment
index determine the position of the hover handle.target
- The (hovered) target IVisualPart
.hoverHandlesSegmentsInSceneProvider
- The Provider<BezierCurve[]>
that is used to
determine the handle's position.segmentCount
- The number of segments returned by the segments provider.segmentIndex
- The segment index on which the created handle part is located.contextMap
- A map in which the state-less HoverBehavior
may place
additional context information for the creation process. It
may either directly contain additional information needed by
this factory, or may be passed back by the factory to the
calling HoverBehavior
to query such kind of
information (in which case it will allow the
HoverBehavior
to identify the creation context).FXCircleSegmentHandlePart
for the given target at the
specified position.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, java.util.Map<java.lang.Object,java.lang.Object> contextMap)
targets
- The list of IVisualPart
s for which handles are
created.contextMap
- A map in which the state-less SelectionBehavior
may
place additional context information for the creation process.
It may either directly contain additional information needed
by this factory, or may be passed back by the factory to the
calling SelectionBehavior
to query such kind of
information (in which case it will allow the
SelectionBehavior
to identify the creation context).protected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> createSelectionHandleParts(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targets, SelectionBehavior<javafx.scene.Node> selectionBehavior, java.util.Map<java.lang.Object,java.lang.Object> contextMap)
targets
- The list of IVisualPart
s for which handles are
created.selectionBehavior
- The SelectionBehavior
that initiated the creation
process.contextMap
- A map in which the state-less SelectionBehavior
may
place additional context information for the creation process.
It may either directly contain additional information needed
by this factory, or may be passed back by the factory to the
calling SelectionBehavior
to query such kind of
information (in which case it will allow the
SelectionBehavior
to identify the creation context).protected IHandlePart<javafx.scene.Node,? extends javafx.scene.Node> createSelectionSegmentHandlePart(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> target, com.google.inject.Provider<BezierCurve[]> segmentsProvider, int segmentCount, int segmentIndex, java.util.Map<java.lang.Object,java.lang.Object> contextMap)
IHandlePart
for the specified vertex of the
IGeometry
provided by the given handleGeometryProvider.target
- IVisualPart
for which a selection handle is created.segmentsProvider
- Provides the BezierCurve
s from which the handle can
retrieve its location.segmentCount
- Number of segments.segmentIndex
- Index of the segment where the handle is located.contextMap
- Stores context information as an IBehavior
is
stateless.IHandlePart
for the specified vertex of the
IGeometry
provided by the handleGeometryProviderprotected java.util.List<IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> createSingleSelectionHandleParts(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> target, java.util.Map<java.lang.Object,java.lang.Object> contextMap)
target
- The IVisualPart
for which handles are created.contextMap
- A map in which the state-less SelectionBehavior
may
place additional context information for the creation process.
It may either directly contain additional information needed
by this factory, or may be passed back by the factory to the
calling SelectionBehavior
to query such kind of
information (in which case it will allow the
SelectionBehavior
to identify the creation context).protected java.util.Collection<? extends IHandlePart<javafx.scene.Node,? extends javafx.scene.Node>> createTightBoundsSelectionHandleParts(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targetParts, com.google.inject.Provider<BezierCurve[]> segmentsProvider, java.util.Map<java.lang.Object,java.lang.Object> contextMap)
FXRectangleSegmentHandlePart
s for the segments provided
by the given segments provider.targetParts
- A list containing the IVisualPart
s for which handles
are created.segmentsProvider
- The Provider<BezierCurve[]>
that is used to
determine the handles's positions.contextMap
- A map in which the state-less SelectionBehavior
may
place additional context information for the creation process.
It may either directly contain additional information needed
by this factory, or may be passed back by the factory to the
calling SelectionBehavior
to query such kind of
information (in which case it will allow the
SelectionBehavior
to identify the creation context).Copyright (c) 2014 itemis AG and others. All rights reserved.