public class DefaultTargetPolicyResolver extends java.lang.Object implements ITargetPolicyResolver
DefaultTargetPolicyResolver
is an ITargetPolicyResolver
that works in two stages:
getTargetPolicies(ITool, Node, Class)
method.Constructor and Description |
---|
DefaultTargetPolicyResolver() |
Modifier and Type | Method and Description |
---|---|
<T extends IPolicy<javafx.scene.Node>> |
getTargetPolicies(ITool<javafx.scene.Node> contextTool,
javafx.scene.Node target,
java.lang.Class<T> policyClass)
Determines and prioritizes all policies of the specified type for the
given target
Node that are to be notified about an input event
that was directed at the Node . |
<T extends IPolicy<javafx.scene.Node>> |
getTargetPolicies(ITool<javafx.scene.Node> contextTool,
javafx.scene.Node target,
IViewer<javafx.scene.Node> viewer,
java.lang.Class<T> policyClass)
Determines and prioritizes all policies of the specified type for the
given
IViewer and target Node that are to be notified
about an input event that was directed at the Node . |
public <T extends IPolicy<javafx.scene.Node>> java.util.List<? extends T> getTargetPolicies(ITool<javafx.scene.Node> contextTool, javafx.scene.Node target, java.lang.Class<T> policyClass)
Node
that are to be notified about an input event
that was directed at the Node
.
This strategy works in two stages:
IVisualPart
that controls a Node
within the
parent hierarchy of the given target Node
is used as the target
part. If no target part can be found, the root part is used as the target
part.
Beginning at the root part, and walking down the visual part hierarchy, all policies of the specified type are collected. The policies that are registered on one part are (lexicographically) sorted by their role, so that the target policy selection is deterministic.
For example, when you have 3 parts, the root part, an intermediate part, and a leaf part, the target policy selection for a policy of type X could yield the following results:
getTargetPolicies
in interface ITargetPolicyResolver
T
- Type parameter specifying the type of policy that is
collected.contextTool
- The ITool
for which to determine target policies.target
- The target Node
that received an input event.policyClass
- The type of the policies to return.public <T extends IPolicy<javafx.scene.Node>> java.util.List<? extends T> getTargetPolicies(ITool<javafx.scene.Node> contextTool, javafx.scene.Node target, IViewer<javafx.scene.Node> viewer, java.lang.Class<T> policyClass)
IViewer
and target Node
that are to be notified
about an input event that was directed at the Node
.
This strategy works in two stages:
IVisualPart
that controls a Node
within the
parent hierarchy of the given target Node
is used as the target
part. If no target part can be found, the root part is used as the target
part.
Beginning at the root part, and walking down the visual part hierarchy, all policies of the specified type are collected. The policies that are registered on one part are (lexicographically) sorted by their role, so that the target policy selection is deterministic.
For example, when you have 3 parts, the root part, an intermediate part, and a leaf part, the target policy selection for a policy of type X could yield the following results:
getTargetPolicies
in interface ITargetPolicyResolver
T
- Type parameter specifying the type of policy that is
collected.contextTool
- The ITool
for which to determine target policies.target
- The target Node
that received an input event.viewer
- The IViewer
that contains the given target
Node
.policyClass
- The type of the policies to return.Copyright (c) 2014 itemis AG and others. All rights reserved.