Package org.eclipse.gef.mvc.fx.parts
Class PartUtils
java.lang.Object
org.eclipse.gef.mvc.fx.parts.PartUtils
Provides utilities needed in the context of 
IVisualParts.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic <T extends IVisualPart<? extends javafx.scene.Node>>
 List<T>filterParts(Collection<? extends IVisualPart<? extends javafx.scene.Node>> parts, Class<T> type) Searches the given collection ofIVisualParts for elements of the specified type.static <T extends IVisualPart<? extends javafx.scene.Node>>
 List<T>filterParts(Collection<? extends IVisualPart<? extends javafx.scene.Node>> parts, Predicate<? super IVisualPart<? extends javafx.scene.Node>> filter) Searches the given collection ofIVisualParts for elements of the specified type.static List<IVisualPart<? extends javafx.scene.Node>>getAnchoreds(Collection<? extends IVisualPart<? extends javafx.scene.Node>> anchorages) Collects the anchoreds of all givenIVisualParts.static Set<IVisualPart<? extends javafx.scene.Node>>getAnchoreds(IVisualPart<? extends javafx.scene.Node> anchorage, String role) Collects the anchoreds of the givenIVisualPartwhich are registered under the specified role.static RectanglegetUnionedVisualBoundsInScene(Collection<? extends IVisualPart<? extends javafx.scene.Node>> parts) Returns the unioned visual bounds of the givenIVisualParts in the coordinate system of theScene.static IViewerretrieveViewer(IDomain domain, javafx.scene.Node target) static IVisualPart<? extends javafx.scene.Node>retrieveVisualPart(IViewer viewer, javafx.scene.Node target) Returns the firstIVisualPartin the visual hierarchy of the givenNode.
- 
Constructor Details- 
PartUtilspublic PartUtils()
 
- 
- 
Method Details- 
filterPartspublic static <T extends IVisualPart<? extends javafx.scene.Node>> List<T> filterParts(Collection<? extends IVisualPart<? extends javafx.scene.Node>> parts, Class<T> type) Searches the given collection ofIVisualParts for elements of the specified type.- Type Parameters:
- T- The type of returned elements.
- Parameters:
- parts- The collection of parts which is filtered.
- type- The type of returned elements.
- Returns:
- A list of all elements of the specified type.
 
- 
filterPartspublic static <T extends IVisualPart<? extends javafx.scene.Node>> List<T> filterParts(Collection<? extends IVisualPart<? extends javafx.scene.Node>> parts, Predicate<? super IVisualPart<? extends javafx.scene.Node>> filter) Searches the given collection ofIVisualParts for elements of the specified type.- Type Parameters:
- T- The type of returned elements.
- Parameters:
- parts- The collection of parts which is filtered.
- filter- The type of returned elements.
- Returns:
- A list of all elements of the specified type.
 
- 
getAnchoredspublic static List<IVisualPart<? extends javafx.scene.Node>> getAnchoreds(Collection<? extends IVisualPart<? extends javafx.scene.Node>> anchorages) Collects the anchoreds of all givenIVisualParts.- Parameters:
- anchorages- The collection of- IVisualParts for which the anchoreds are collected.
- Returns:
- A list of all the anchoreds of all the given IVisualParts.
 
- 
getAnchoredspublic static Set<IVisualPart<? extends javafx.scene.Node>> getAnchoreds(IVisualPart<? extends javafx.scene.Node> anchorage, String role) Collects the anchoreds of the givenIVisualPartwhich are registered under the specified role.- Parameters:
- anchorage- The- IVisualPartfor which the anchoreds are collected.
- role- The role under which the anchoreds have to be registered to be collected.
- Returns:
- A list of the anchoreds of the given IVisualPartwhich are registered under the specified role.
 
- 
getUnionedVisualBoundsInScenepublic static Rectangle getUnionedVisualBoundsInScene(Collection<? extends IVisualPart<? extends javafx.scene.Node>> parts) Returns the unioned visual bounds of the givenIVisualParts in the coordinate system of theScene.- Parameters:
- parts- The- IVisualParts for which the unioned bounds are computed.
- Returns:
- The unioned visual bounds of the given IVisualParts in the coordinate system of theScene.
 
- 
retrieveViewer
- 
retrieveVisualPartpublic static IVisualPart<? extends javafx.scene.Node> retrieveVisualPart(IViewer viewer, javafx.scene.Node target) Returns the firstIVisualPartin the visual hierarchy of the givenNode. If noIVisualPartcan be found within the visual hierarchy of theNode, theIRootPartof the givenIVieweris returned.- Parameters:
- viewer- The- IViewerin which the- IVisualPartis searched.
- target- The- Nodefor which the corresponding- IVisualPartis to be returned.
- Returns:
- The first IVisualPartin the visual hierarchy of the givenNode, or theIRootPartof the givenIViewer.
 
 
-