public class PartUtils extends Object
IVisualParts.| Constructor and Description |
|---|
PartUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends IVisualPart<? extends Node>> |
filterParts(Collection<? extends IVisualPart<? extends Node>> parts,
Class<T> type)
Searches the given collection of
IVisualParts for elements of the
specified type. |
static <T extends IVisualPart<? extends Node>> |
filterParts(Collection<? extends IVisualPart<? extends Node>> parts,
Predicate<? super IVisualPart<? extends Node>> filter)
Searches the given collection of
IVisualParts for elements of the
specified type. |
static List<IVisualPart<? extends Node>> |
getAnchoreds(Collection<? extends IVisualPart<? extends Node>> anchorages)
Collects the anchoreds of all given
IVisualParts. |
static Set<IVisualPart<? extends Node>> |
getAnchoreds(IVisualPart<? extends Node> anchorage,
String role)
Collects the anchoreds of the given
IVisualPart which are
registered under the specified role. |
static Rectangle |
getUnionedVisualBoundsInScene(Collection<? extends IVisualPart<? extends Node>> parts)
Returns the unioned visual bounds of the given
IVisualParts in
the coordinate system of the Scene. |
static IViewer |
retrieveViewer(IDomain domain,
Node target)
|
static IVisualPart<? extends Node> |
retrieveVisualPart(IViewer viewer,
Node target)
Returns the first
IVisualPart in the visual hierarchy of the
given Node. |
public static <T extends IVisualPart<? extends Node>> List<T> filterParts(Collection<? extends IVisualPart<? extends Node>> parts, Class<T> type)
IVisualParts for elements of the
specified type.T - The type of returned elements.parts - The collection of parts which is filtered.type - The type of returned elements.public static <T extends IVisualPart<? extends Node>> List<T> filterParts(Collection<? extends IVisualPart<? extends Node>> parts, Predicate<? super IVisualPart<? extends Node>> filter)
IVisualParts for elements of the
specified type.T - The type of returned elements.parts - The collection of parts which is filtered.filter - The type of returned elements.public static List<IVisualPart<? extends Node>> getAnchoreds(Collection<? extends IVisualPart<? extends Node>> anchorages)
IVisualParts.anchorages - The collection of IVisualParts for which the anchoreds
are collected.IVisualPart
s.public static Set<IVisualPart<? extends Node>> getAnchoreds(IVisualPart<? extends Node> anchorage, String role)
IVisualPart which are
registered under the specified role.anchorage - The IVisualPart for which the anchoreds are collected.role - The role under which the anchoreds have to be registered to be
collected.IVisualPart which
are registered under the specified role.public static Rectangle getUnionedVisualBoundsInScene(Collection<? extends IVisualPart<? extends Node>> parts)
IVisualParts in
the coordinate system of the Scene.parts - The IVisualParts for which the unioned bounds are
computed.IVisualParts in
the coordinate system of the Scene.public static IVisualPart<? extends Node> retrieveVisualPart(IViewer viewer, Node target)
IVisualPart in the visual hierarchy of the
given Node. If no IVisualPart can be found within the
visual hierarchy of the Node, the IRootPart of the given
IViewer is returned.viewer - The IViewer in which the IVisualPart is
searched.target - The Node for which the corresponding
IVisualPart is to be returned.IVisualPart in the visual hierarchy of the
given Node, or the IRootPart of the given
IViewer.Copyright (c) 2014, 2016 itemis AG and others. All rights reserved.