public class FXPartUtils
extends java.lang.Object
FXPartUtils
class contains utility methods for the identification
of possible event targets (
getTargetPart(Collection, Node, Class, boolean)
) and the computation
of collective bounds (getUnionedVisualBoundsInScene(Collection)
).Constructor and Description |
---|
FXPartUtils() |
Modifier and Type | Method and Description |
---|---|
static <T extends IPolicy<javafx.scene.Node>> |
getTargetPart(java.util.Collection<IViewer<javafx.scene.Node>> viewers,
javafx.scene.Node visual,
java.lang.Class<T> supportedPolicy,
boolean searchHierarchy)
Returns the first
IVisualPart in the given list of viewers, for
which both of the following properties hold:
Supports the specified policy (which may be null ). |
static Rectangle |
getUnionedVisualBoundsInScene(java.util.Collection<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> parts)
Returns the unioned visual bounds of the given
IVisualPart s in
the coordinate system of the Scene . |
public static <T extends IPolicy<javafx.scene.Node>> IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> getTargetPart(java.util.Collection<IViewer<javafx.scene.Node>> viewers, javafx.scene.Node visual, java.lang.Class<T> supportedPolicy, boolean searchHierarchy)
IVisualPart
in the given list of viewers, for
which both of the following properties hold:
null
).null
), the first
visual part that controls a visual in the hierarchy is returned.
When the searchHierarchy is set to false
only the
first visual part is considered.T
- The type of the IPolicy
that should be supported.viewers
- Collection
of all IViewer
s.visual
- Node
visual that received an event.supportedPolicy
- Class of the IPolicy
which has to be supported by the
target part. May be null
to indicate that the
target part does not have to support a specific policy.searchHierarchy
- If set to true
, the full visual part hierarchy
will be searched, otherwise, the direct target part alone is
considered.null
if no
suitable target part can be found.public static Rectangle getUnionedVisualBoundsInScene(java.util.Collection<? extends IVisualPart<javafx.scene.Node,? extends javafx.scene.Node>> parts)
IVisualPart
s in
the coordinate system of the Scene
.parts
- The IVisualPart
s for which the unioned bounds are
computed.IVisualPart
s in
the coordinate system of the Scene
.Copyright (c) 2014 itemis AG and others. All rights reserved.