public class FXDefaultFeedbackPartFactory extends java.lang.Object implements IFeedbackPartFactory<javafx.scene.Node>
FXDefaultFeedbackPartFactory
is an IFeedbackPartFactory
implementation that is parameterized by Node
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HOVER_FEEDBACK_GEOMETRY_PROVIDER
The role name for the
Provider<IGeometry> that will be
used to generate hover feedback. |
static java.lang.String |
SELECTION_FEEDBACK_GEOMETRY_PROVIDER
The role name for the
Provider<IGeometry> that will be
used to generate selection feedback. |
static java.lang.String |
SELECTION_LINK_FEEDBACK_GEOMETRY_PROVIDER
The role name for the
Provider<IGeometry> that will be
used to generate selection link feedback. |
Constructor and Description |
---|
FXDefaultFeedbackPartFactory() |
Modifier and Type | Method and Description |
---|---|
java.util.List<IFeedbackPart<javafx.scene.Node,? extends javafx.scene.Node>> |
createFeedbackParts(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
IFeedbackPart s for the given targets. |
protected java.util.List<IFeedbackPart<javafx.scene.Node,? extends javafx.scene.Node>> |
createHoverFeedbackParts(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targets,
HoverBehavior<javafx.scene.Node> hoverBehavior,
java.util.Map<java.lang.Object,java.lang.Object> contextMap)
Creates
FXHoverFeedbackPart s for the given targets. |
protected IFeedbackPart<javafx.scene.Node,? extends javafx.scene.Node> |
createLinkFeedbackPart(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> anchored,
IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> anchorage,
java.lang.String anchorageRole)
Creates a dotted feedback-line between an anchored part and its
anchorage.
|
protected java.util.List<IFeedbackPart<javafx.scene.Node,? extends javafx.scene.Node>> |
createSelectionFeedbackParts(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
FXSelectionFeedbackPart s and
FXSelectionLinkFeedbackPart s for the targets. |
public static final java.lang.String SELECTION_FEEDBACK_GEOMETRY_PROVIDER
Provider<IGeometry>
that will be
used to generate selection feedback.public static final java.lang.String SELECTION_LINK_FEEDBACK_GEOMETRY_PROVIDER
Provider<IGeometry>
that will be
used to generate selection link feedback.public static final java.lang.String HOVER_FEEDBACK_GEOMETRY_PROVIDER
Provider<IGeometry>
that will be
used to generate hover feedback.public java.util.List<IFeedbackPart<javafx.scene.Node,? extends javafx.scene.Node>> createFeedbackParts(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)
IFeedbackPartFactory
IFeedbackPart
s for the given targets. As
additional information might be needed by the
IFeedbackPartFactory
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) IFeedbackPartFactory
that is based on such a query may
be realized as follows:
List createFeedbackParts(List targets, IBehavior contextBehavior, Map<Object, Object> contextMap) { if (contextBehavior instanceof ConcreteBehavior) { SomeAdditionalInformation i = ((ConcreteBehavior) contextBehavior) .giveSomeAdditionalInformation(contextMap); ... } }
createFeedbackParts
in interface IFeedbackPartFactory<javafx.scene.Node>
targets
- The target IVisualPart
s for which feedback is 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 IFeedbackPartFactory
, or may be passed back by
the IFeedbackPartFactory
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).IFeedbackPart
s that are to be used to indicate
feedback for the given targets.protected java.util.List<IFeedbackPart<javafx.scene.Node,? extends javafx.scene.Node>> createHoverFeedbackParts(java.util.List<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> targets, HoverBehavior<javafx.scene.Node> hoverBehavior, java.util.Map<java.lang.Object,java.lang.Object> contextMap)
FXHoverFeedbackPart
s for the given targets.targets
- The list of IVisualPart
s for which hover feedback is
generated.hoverBehavior
- The HoverBehavior
that initiated the feedback
creation.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 IFeedbackPart<javafx.scene.Node,? extends javafx.scene.Node> createLinkFeedbackPart(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> anchored, IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> anchorage, java.lang.String anchorageRole)
anchored
- The anchored IVisualPart
.anchorage
- The anchorage IVisualPart
.anchorageRole
- The role under which the anchorage is stored at the anchored.IFeedbackPart
for this anchor link, or
null
if no feedback should be rendered.protected java.util.List<IFeedbackPart<javafx.scene.Node,? extends javafx.scene.Node>> createSelectionFeedbackParts(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)
FXSelectionFeedbackPart
s and
FXSelectionLinkFeedbackPart
s for the targets.targets
- The list of IVisualPart
s for which selection feedback
is created.selectionBehavior
- The SelectionBehavior
that initiated the feedback
creation.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.