Package com.jogamp.graph.ui
Class Group
- java.lang.Object
-
- com.jogamp.graph.ui.Shape
-
- com.jogamp.graph.ui.Group
-
- All Implemented Interfaces:
Container
public class Group extends Shape implements Container
Group ofShape
s, optionally utilizing aGroup.Layout
.- See Also:
Scene
,Shape
,Group.Layout
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Group.Layout
-
Nested classes/interfaces inherited from class com.jogamp.graph.ui.Shape
Shape.EventInfo, Shape.Listener, Shape.ListenerBool, Shape.MouseGestureAdapter, Shape.MouseGestureListener, Shape.Visitor1, Shape.Visitor2
-
-
Field Summary
-
Fields inherited from class com.jogamp.graph.ui.Shape
ZAscendingComparator
-
-
Constructor Summary
Constructors Constructor Description Group()
Group(Group.Layout l)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addShape(Shape s)
void
addShapes(Collection<? extends Shape> shapes)
boolean
contains(Shape s)
boolean
forAll(Shape.Visitor1 v)
Traverses through the graph and applyShape.Visitor1.visit(Shape)
for each, stop if it returns true.boolean
forAll(PMVMatrix pmv, Shape.Visitor2 v)
Traverses through the graph and applyShape.Visitor2.visit(Shape, PMVMatrix)
for each, stop if it returns true.boolean
forOne(PMVMatrix pmv, Shape shape, Runnable action)
Traverses through the graph up untilshape
and applyaction
on it.boolean
forSortedAll(Comparator<Shape> sortComp, PMVMatrix pmv, Shape.Visitor2 v)
Traverses through the graph and applyVisitor#visit(Shape, PMVMatrix)
for each, stop if it returns true.AABBox
getBounds(PMVMatrix pmv, Shape shape)
Group.Layout
getLayout()
Return currentGroup.Layout
.List<Shape>
getShapes()
String
getSubString()
boolean
hasColorChannel()
Returns true if implementation uses an extra color channel or texture which will be modulated with the passed rgba color#drawImpl0(GL2ES2, RegionRenderer, int[], float[])
.boolean
isFrustumCullingEnabled()
Return whetherfrustum culling
is enabled.void
removeAllShapes()
Removes all contained shapes, w/odestroying
them.void
removeAllShapes(GL2ES2 gl, RegionRenderer renderer)
Removes all given shapes and destroys them.Shape
removeShape(int idx)
Removes shape at given index, w/odestroying
them.Shape
removeShape(Shape s)
Removes given shape, keeps it alive.void
removeShape(GL2ES2 gl, RegionRenderer renderer, Shape s)
Removes given shape and destroy it.void
removeShapes(GL2ES2 gl, RegionRenderer renderer, Collection<? extends Shape> shapes)
Removes all given shapes and destroys them.void
removeShapes(Collection<? extends Shape> shapes)
Removes all given shapes, keeps them alive.void
setFrustumCullingEnabled(boolean v)
Enable or disablePMVMatrix.getFrustum()
culling perShape
.Group
setLayout(Group.Layout l)
SetGroup.Layout
.-
Methods inherited from class com.jogamp.graph.ui.Shape
addMouseListener, clear, destroy, draw, drawToSelect, getBorderColor, getBorderThickness, getBounds, getBounds, getColor, getName, getPadding, getPixelPerShapeUnit, getPixelPerShapeUnit, getPosition, getRotation, getRotationPivot, getScale, getScaledHeight, getScaledWidth, getSurfacePort, getSurfaceSize, getSurfaceSize, getSurfaceSize, hasBorder, hasPadding, isDraggable, isEnabled, isInteractive, isPressed, isResizable, isToggleable, isToggleOn, markShapeDirty, markStateDirty, move, move, moveTo, moveTo, onClicked, onInit, onMove, onToggle, removeMouseListener, scale, setBorder, setBorderColor, setBorderColor, setColor, setColor, setDragAndResizeable, setDraggable, setEnabled, setInteractive, setName, setPaddding, setPressed, setPressedColorMod, setResizable, setRotationPivot, setRotationPivot, setScale, setToggle, setToggleable, setToggleOffColorMod, setToggleOnColorMod, setTransform, shapeToWinCoord, shapeToWinCoord, shapeToWinCoord, toggle, toString, validate, validate, winToShapeCoord, winToShapeCoord, winToShapeCoord
-
-
-
-
Constructor Detail
-
Group
public Group()
Create a Graph basedGLRegion
UIShape
.Default is non-interactive, see
Shape.setInteractive(boolean)
.
-
Group
public Group(Group.Layout l)
Create a Graph basedGLRegion
UIShape
w/ givenGroup.Layour
.Default is non-interactive, see
Shape.setInteractive(boolean)
.
-
-
Method Detail
-
getLayout
public Group.Layout getLayout()
Return currentGroup.Layout
.
-
setLayout
public Group setLayout(Group.Layout l)
SetGroup.Layout
.
-
removeShape
public Shape removeShape(Shape s)
Removes given shape, keeps it alive.- Specified by:
removeShape
in interfaceContainer
- Returns:
- the removed shape or null if not contained
-
removeShape
public Shape removeShape(int idx)
Description copied from interface:Container
Removes shape at given index, w/odestroying
them.- Specified by:
removeShape
in interfaceContainer
- Returns:
- the removed shape
-
removeShape
public void removeShape(GL2ES2 gl, RegionRenderer renderer, Shape s)
Removes given shape and destroy it.
-
addShapes
public void addShapes(Collection<? extends Shape> shapes)
-
removeShapes
public void removeShapes(Collection<? extends Shape> shapes)
Removes all given shapes, keeps them alive.- Specified by:
removeShapes
in interfaceContainer
-
removeShapes
public void removeShapes(GL2ES2 gl, RegionRenderer renderer, Collection<? extends Shape> shapes)
Removes all given shapes and destroys them.
-
removeAllShapes
public void removeAllShapes()
Description copied from interface:Container
Removes all contained shapes, w/odestroying
them.- Specified by:
removeAllShapes
in interfaceContainer
-
removeAllShapes
public void removeAllShapes(GL2ES2 gl, RegionRenderer renderer)
Removes all given shapes and destroys them.
-
hasColorChannel
public boolean hasColorChannel()
Description copied from class:Shape
Returns true if implementation uses an extra color channel or texture which will be modulated with the passed rgba color#drawImpl0(GL2ES2, RegionRenderer, int[], float[])
. Otherwise the base color will be modulated and passed to#drawImpl0(GL2ES2, RegionRenderer, int[], float[])
.- Specified by:
hasColorChannel
in classShape
-
setFrustumCullingEnabled
public final void setFrustumCullingEnabled(boolean v)
Description copied from interface:Container
Enable or disablePMVMatrix.getFrustum()
culling perShape
. Default is disabled.- Specified by:
setFrustumCullingEnabled
in interfaceContainer
-
isFrustumCullingEnabled
public final boolean isFrustumCullingEnabled()
Description copied from interface:Container
Return whetherfrustum culling
is enabled.- Specified by:
isFrustumCullingEnabled
in interfaceContainer
-
getSubString
public String getSubString()
- Overrides:
getSubString
in classShape
-
forOne
public boolean forOne(PMVMatrix pmv, Shape shape, Runnable action)
Description copied from interface:Container
Traverses through the graph up untilshape
and applyaction
on it.
-
forAll
public boolean forAll(Shape.Visitor1 v)
Description copied from interface:Container
Traverses through the graph and applyShape.Visitor1.visit(Shape)
for each, stop if it returns true.- Specified by:
forAll
in interfaceContainer
- Returns:
- true to signal operation complete and to stop traversal, i.e.
Shape.Visitor1.visit(Shape)
returned true, otherwise false
-
forAll
public boolean forAll(PMVMatrix pmv, Shape.Visitor2 v)
Description copied from interface:Container
Traverses through the graph and applyShape.Visitor2.visit(Shape, PMVMatrix)
for each, stop if it returns true.- Specified by:
forAll
in interfaceContainer
- Returns:
- true to signal operation complete and to stop traversal, i.e.
Shape.Visitor2.visit(Shape, PMVMatrix)
returned true, otherwise false
-
forSortedAll
public boolean forSortedAll(Comparator<Shape> sortComp, PMVMatrix pmv, Shape.Visitor2 v)
Description copied from interface:Container
Traverses through the graph and applyVisitor#visit(Shape, PMVMatrix)
for each, stop if it returns true. EachContainer
level is sorted usingsortComp
- Specified by:
forSortedAll
in interfaceContainer
- Returns:
- true to signal operation complete and to stop traversal, i.e.
Shape.Visitor2.visit(Shape, PMVMatrix)
returned true, otherwise false
-
-