Class SelectionManager
java.lang.Object
com.j3d.engine.interact.selection.SelectionManager
Manages the selection of GObjects within a collection of Layers and Things.
Provides functionality to filter and retrieve selected objects based on various criteria.
- Author:
- Lehlogonolo Poole
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty SelectionManager with no selected GObjects.SelectionManager(ArrayList<Layer> objects, SelectionQuery selectionQuery) Constructs a SelectionManager and initializes the selection based on the provided layers and a Selection object. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()exclude(SelectionManager other) Excludes the selected GObjects from another SelectionManager from this one.Filters the currently selected GObjects based on a given predicate.Returns the currently selected GObjects.include(SelectionManager other) Includes the selected GObjects from another SelectionManager into this one.booleanChecks if no GObjects are currently selected.
-
Field Details
-
selected
-
selectionMouseOwner
-
-
Constructor Details
-
SelectionManager
Constructs a SelectionManager and initializes the selection based on the provided layers and a Selection object.- Parameters:
objects- An ArrayList of Layer objects to iterate through for potential selections.selectionQuery- A Selection object defining the criteria for initial selection.
-
SelectionManager
public SelectionManager()Constructs an empty SelectionManager with no selected GObjects.
-
-
Method Details
-
isNothingSelected
public boolean isNothingSelected()Checks if no GObjects are currently selected.- Returns:
- true if no GObjects are selected, false otherwise.
-
include
Includes the selected GObjects from another SelectionManager into this one.Typically used when the SelectionType is
SelectionType.INCLUDE.- Parameters:
other- The other SelectionManager whose selected GObjects are to be included.- Returns:
- This SelectionManager instance, allowing for method chaining.
-
exclude
Excludes the selected GObjects from another SelectionManager from this one.Typically used when the SelectionType is
SelectionType.EXCLUDE.- Parameters:
other- The other SelectionManager whose selected GObjects are to be excluded.- Returns:
- This SelectionManager instance, allowing for method chaining.
-
filter
Filters the currently selected GObjects based on a given predicate.- Parameters:
predicate- The predicate to apply for filtering. Objects for which the predicate returns true will be removed.- Returns:
- This SelectionManager instance, allowing for method chaining.
-
getSelected
Returns the currently selected GObjects.- Returns:
- An ArrayList of GObjects that are currently selected.
-
clear
public void clear()
-