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 ofShapes, optionally utilizing aGroup.Layout.- See Also:
Scene,Shape,Group.Layout
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceGroup.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 voidaddShape(Shape s)voidaddShapes(Collection<? extends Shape> shapes)booleancontains(Shape s)booleanforAll(Shape.Visitor1 v)Traverses through the graph and applyShape.Visitor1.visit(Shape)for each, stop if it returns true.booleanforAll(PMVMatrix pmv, Shape.Visitor2 v)Traverses through the graph and applyShape.Visitor2.visit(Shape, PMVMatrix)for each, stop if it returns true.booleanforOne(PMVMatrix pmv, Shape shape, Runnable action)Traverses through the graph up untilshapeand applyactionon it.booleanforSortedAll(Comparator<Shape> sortComp, PMVMatrix pmv, Shape.Visitor2 v)Traverses through the graph and applyVisitor#visit(Shape, PMVMatrix)for each, stop if it returns true.AABBoxgetBounds(PMVMatrix pmv, Shape shape)Group.LayoutgetLayout()Return currentGroup.Layout.List<Shape>getShapes()StringgetSubString()booleanhasColorChannel()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[]).booleanisFrustumCullingEnabled()Return whetherfrustum cullingis enabled.voidremoveAllShapes()Removes all contained shapes, w/odestroyingthem.voidremoveAllShapes(GL2ES2 gl, RegionRenderer renderer)Removes all given shapes and destroys them.ShaperemoveShape(int idx)Removes shape at given index, w/odestroyingthem.ShaperemoveShape(Shape s)Removes given shape, keeps it alive.voidremoveShape(GL2ES2 gl, RegionRenderer renderer, Shape s)Removes given shape and destroy it.voidremoveShapes(GL2ES2 gl, RegionRenderer renderer, Collection<? extends Shape> shapes)Removes all given shapes and destroys them.voidremoveShapes(Collection<? extends Shape> shapes)Removes all given shapes, keeps them alive.voidsetFrustumCullingEnabled(boolean v)Enable or disablePMVMatrix.getFrustum()culling perShape.GroupsetLayout(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 basedGLRegionUIShape.Default is non-interactive, see
Shape.setInteractive(boolean).
-
Group
public Group(Group.Layout l)
Create a Graph basedGLRegionUIShapew/ 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:
removeShapein interfaceContainer- Returns:
- the removed shape or null if not contained
-
removeShape
public Shape removeShape(int idx)
Description copied from interface:ContainerRemoves shape at given index, w/odestroyingthem.- Specified by:
removeShapein 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:
removeShapesin 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:ContainerRemoves all contained shapes, w/odestroyingthem.- Specified by:
removeAllShapesin interfaceContainer
-
removeAllShapes
public void removeAllShapes(GL2ES2 gl, RegionRenderer renderer)
Removes all given shapes and destroys them.
-
hasColorChannel
public boolean hasColorChannel()
Description copied from class:ShapeReturns 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:
hasColorChannelin classShape
-
setFrustumCullingEnabled
public final void setFrustumCullingEnabled(boolean v)
Description copied from interface:ContainerEnable or disablePMVMatrix.getFrustum()culling perShape. Default is disabled.- Specified by:
setFrustumCullingEnabledin interfaceContainer
-
isFrustumCullingEnabled
public final boolean isFrustumCullingEnabled()
Description copied from interface:ContainerReturn whetherfrustum cullingis enabled.- Specified by:
isFrustumCullingEnabledin interfaceContainer
-
getSubString
public String getSubString()
- Overrides:
getSubStringin classShape
-
forOne
public boolean forOne(PMVMatrix pmv, Shape shape, Runnable action)
Description copied from interface:ContainerTraverses through the graph up untilshapeand applyactionon it.
-
forAll
public boolean forAll(Shape.Visitor1 v)
Description copied from interface:ContainerTraverses through the graph and applyShape.Visitor1.visit(Shape)for each, stop if it returns true.- Specified by:
forAllin 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:ContainerTraverses through the graph and applyShape.Visitor2.visit(Shape, PMVMatrix)for each, stop if it returns true.- Specified by:
forAllin 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:ContainerTraverses through the graph and applyVisitor#visit(Shape, PMVMatrix)for each, stop if it returns true. EachContainerlevel is sorted usingsortComp- Specified by:
forSortedAllin interfaceContainer- Returns:
- true to signal operation complete and to stop traversal, i.e.
Shape.Visitor2.visit(Shape, PMVMatrix)returned true, otherwise false
-
-