Class Group
- java.lang.Object
-
- com.jogamp.graph.ui.Shape
-
- com.jogamp.graph.ui.Group
-
-
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.DrawListener, Shape.EventInfo, Shape.ForwardKeyListener, Shape.ForwardMouseListener, Shape.Listener, Shape.MouseGestureAdapter, Shape.MouseGestureListener, Shape.MoveListener, Shape.PointerListener, Shape.Visitor1, Shape.Visitor2
-
-
Field Summary
-
Fields inherited from class com.jogamp.graph.ui.Shape
ZAscendingComparator, ZDescendingComparator
-
-
Constructor Summary
Constructors Constructor Description Group()Create a group ofShapes w/oGroup.Layout.Group(Group.Layout l)Create a group ofShapes w/ givenGroup.Layout.Group(String name, Group.Layout l, com.jogamp.math.Vec2f fixedSize, Shape s)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddShape(Shape s)Adds aShape.voidaddShapes(Collection<? extends Shape> shapes)booleancontains(Shape s)GroupdisableTopLevelWidget()Disables top-level widget behavior as potentially set viaenableTopLevelWidget(Scene).GroupenableTopLevelWidget(Scene scene)Enables top-level widget behavior for this group, default is disabled.com.jogamp.math.geom.AABBoxgetBounds(com.jogamp.math.util.PMVMatrix4f pmv, Shape shape)ReturnsAABBoxdimension of givenShapefrom this container's perspective, i.e.com.jogamp.math.geom.FrustumgetClipMvFrustum()ReturnssetClipMvFrustum(Frustum)valuebooleangetClipOnBounds()ReturnssetClipOnBounds(boolean)valuecom.jogamp.math.Vec3fgetFixedSize()Returns borrowed fixed size instance, seesetFixedSize(Vec3f)andsetFixedSize(Vec2f).com.jogamp.math.Vec2fgetFixedSize(com.jogamp.math.Vec2f out)Returns givenVec2finstance set with 2 dimensions, seesetFixedSize(Vec2f).Group.LayoutgetLayout()Return currentGroup.Layout.booleangetRelayoutOnDirtyShapes()List<Shape>getRenderedShapes()Returnsadded shapeswhich are rendered and sorted by z-axis in ascending order toward z-near.ShapegetShapeByID(int id)ShapegetShapeByIdx(int id)ShapegetShapeByName(String name)intgetShapeCount()Returns number ofShapes, seeContainer.getShapes().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, float[]).booleanisCullingEnabled()Return whetherProject-Modelview (PMv) frustum cullingorGroup's Modelview (Mv) frustum clippingis enabled for this container.booleanisGroup()Returns true if this shape denotes aGroup, otherwise false.booleanisOutside(com.jogamp.math.util.PMVMatrix4f pmv, Shape shape)Returns whether the givenShapeis completely outside of this container.booleanisOutside2(com.jogamp.math.Matrix4f mvCont, Shape shape, com.jogamp.math.util.PMVMatrix4f pmvShape)Returns whether the givenShapeis completely outside of this container.booleanisPMvCullingEnabled()Return whetherProject-Modelview (PMv) frustum cullingis enabled for this container.booleanisTopLevelWidget()Returns whether#setTopLevelWidget(boolean)is enabled or disabled.voidremoveAllShapes(GL2ES2 gl, RegionRenderer renderer)Removes all contained shapes withShape.destroy(GL2ES2, RegionRenderer).ShaperemoveShape(Shape s)Removes given shape, w/oShape.destroy(GL2ES2, RegionRenderer).booleanremoveShape(GL2ES2 gl, RegionRenderer renderer, Shape s)Removes given shape withShape.destroy(GL2ES2, RegionRenderer), if contained.voidremoveShapes(GL2ES2 gl, RegionRenderer renderer, Collection<? extends Shape> shapes)Removes all given shapes withShape.destroy(GL2ES2, RegionRenderer).voidremoveShapes(Collection<? extends Shape> shapes)Removes all given shapes, w/oShape.destroy(GL2ES2, RegionRenderer).booleanreplaceShape(Shape remove, Shape replacement)GroupsetClipMvFrustum(com.jogamp.math.geom.Frustum v)GroupsetClipOnBounds(boolean v)Enable Modelview (Mv)Frustumclipping onShape.getBounds()for this group and its shapes as follows DiscardShaperenderingif not intersectingclip-box. Otherwise perform pixel-accurate clipping inside the shader toclip-box.GroupsetFixedSize(com.jogamp.math.Vec2f v)Enforce size of this group to given 2 dimensions, adjusting the 3D z-axisShape.getBounds()giving room for potential clipping viasetClipOnBounds(boolean)orsetClipMvFrustum(Frustum).GroupsetFixedSize(com.jogamp.math.Vec3f v)Enforce size of this group for all given 3 dimensionsShape.getBounds()without adjusting 3D z-axis likesetFixedSize(Vec2f).GroupsetLayout(Group.Layout l)SetGroup.Layout.voidsetPMvCullingEnabled(boolean v)Enable or disableProject-Modelview (PMv) frustumculling perShapefor this container.voidsetRelayoutOnDirtyShapes(boolean v)Set relayout on dirty shapes mode, defaults to true.-
Methods inherited from class com.jogamp.graph.ui.Shape
addActivationListener, addKeyListener, addMouseListener, applyMatToMv, clear, destroy, draw, drawToSelect, getActiveColorMod, getAdjustedZ, getBorderColor, getBorderThickness, getBounds, getBounds, getColor, getID, getMat, getMat, getName, getPadding, getParent, getPixelPerShapeUnit, getPixelPerShapeUnit, getPixelPerShapeUnit, getPosition, getPressedColorMod, getRotation, getRotationPivot, getScale, getScaledDepth, getScaledHeight, getScaledWidth, getSurfacePort, getSurfaceSize, getSurfaceSize, getSurfaceSize, getToggleOffColorMod, getToggleOnColorMod, getTooltip, hasBorder, hasPadding, isActivable, isActive, isDiscarded, isDraggable, isFixedARatioResize, isInteractive, isMatIdentity, isPressed, isResizable, isToggleable, isToggleOn, isVisible, markShapeDirty, markStateDirty, move, move, moveTo, moveTo, onClicked, onDraw, onHover, onMove, onToggle, receiveKeyEvents, receiveMouseEvents, removeActivationListener, removeKeyListener, removeMouseListener, removeToolTip, runSynced, scale, scale, setActivable, setActiveColorMod, setBorder, setBorderColor, setBorderColor, setColor, setColor, setDiscarded, setDragAndResizable, setDraggable, setFixedARatioResize, setID, setInteractive, setName, setPaddding, setPMVMatrix, setPMVMatrix, setPressed, setPressedColorMod, setResizable, setRotation, setRotationPivot, setRotationPivot, setScale, setScale, setToggle, setToggleable, setToggleOffColorMod, setToggleOnColorMod, setToolTip, setVisible, shapeToWinCoord, shapeToWinCoord, shapeToWinCoord, toggle, toString, updateMat, validate, validate, validate, winToShapeCoord, winToShapeCoord, winToShapeCoord
-
-
-
-
Constructor Detail
-
Group
public Group()
-
Group
public Group(Group.Layout l)
- Parameters:
l- optionalGroup.Layout, maybenull
-
Group
public Group(String name, Group.Layout l, com.jogamp.math.Vec2f fixedSize, Shape s)
- Parameters:
name- optional name forShape.setName(String)l- optionalGroup.Layout, maybenullfixedSize- optional fixed size forsetFixedSize(Vec2f)s- optionalShapeforaddShape(Shape)
-
-
Method Detail
-
isGroup
public final boolean isGroup()
Description copied from class:ShapeReturns true if this shape denotes aGroup, otherwise false.
-
getLayout
public Group.Layout getLayout()
Return currentGroup.Layout.
-
setLayout
public Group setLayout(Group.Layout l)
SetGroup.Layout.
-
setFixedSize
public Group setFixedSize(com.jogamp.math.Vec3f v)
Enforce size of this group for all given 3 dimensionsShape.getBounds()without adjusting 3D z-axis likesetFixedSize(Vec2f).
-
setFixedSize
public Group setFixedSize(com.jogamp.math.Vec2f v)
Enforce size of this group to given 2 dimensions, adjusting the 3D z-axisShape.getBounds()giving room for potential clipping viasetClipOnBounds(boolean)orsetClipMvFrustum(Frustum).- See Also:
setFixedSize(Vec3f)
-
getFixedSize
public com.jogamp.math.Vec3f getFixedSize()
Returns borrowed fixed size instance, seesetFixedSize(Vec3f)andsetFixedSize(Vec2f).
-
getFixedSize
public com.jogamp.math.Vec2f getFixedSize(com.jogamp.math.Vec2f out)
Returns givenVec2finstance set with 2 dimensions, seesetFixedSize(Vec2f).
-
setClipOnBounds
public Group setClipOnBounds(boolean v)
Enable Modelview (Mv)Frustumclipping onShape.getBounds()for this group and its shapes as follows- Discard
Shaperenderingif not intersectingclip-box. - Otherwise perform pixel-accurate clipping inside the shader to
clip-box.
setClipMvFrustum(Frustum)takes precedence oversetClipOnBounds(boolean).With clipping enabled, the 3D z-axis
Shape.getBounds()depth will be slightly increased for functionalFrustumoperation.- Parameters:
v- boolean to toggle clipping- Returns:
- this instance for chaining
- See Also:
setClipMvFrustum(Frustum),setFixedSize(Vec2f),setFixedSize(Vec3f)
- Discard
-
getClipOnBounds
public boolean getClipOnBounds()
ReturnssetClipOnBounds(boolean)value
-
setClipMvFrustum
public Group setClipMvFrustum(com.jogamp.math.geom.Frustum v)
Enable Modelview (Mv)Frustumclipping on explicit given pre-multiplied w/ Mv-matrixclip-boxfor this group and its shapes as follows- Discard
Shaperenderingif not intersectingclip-box. - Otherwise perform pixel-accurate clipping inside the shader to
clip-box.
setClipMvFrustum(Frustum)takes precedence oversetClipOnBounds(boolean).With clipping enabled, the 3D z-axis
Shape.getBounds()depth will be slightly increased for functionalFrustumoperation.- Parameters:
v-Frustumpre-multiplied w/ Mv-matrix- Returns:
- this instance for chaining
- See Also:
setClipOnBounds(boolean),setFixedSize(Vec2f),setFixedSize(Vec3f)
- Discard
-
getClipMvFrustum
public com.jogamp.math.geom.Frustum getClipMvFrustum()
ReturnssetClipMvFrustum(Frustum)value
-
getShapeCount
public int getShapeCount()
Description copied from interface:ContainerReturns number ofShapes, seeContainer.getShapes().- Specified by:
getShapeCountin interfaceContainer
-
getRenderedShapes
public List<Shape> getRenderedShapes()
Description copied from interface:ContainerReturnsadded shapeswhich are rendered and sorted by z-axis in ascending order toward z-near.The rendered shapes are
visibleand not deemed outside of this container due toculling.Only rendered shapes are considered for picking/activation.
The returned list is data-race free, i.e. won't be mutated by the rendering thread as it gets completely replace at each rendering loop using a local volatile reference.
Only when disposing the container, the list gets cleared, hence shall be used in the loop.- Specified by:
getRenderedShapesin interfaceContainer- See Also:
Container.addShape(Shape),Container.isCullingEnabled(),Shape.isVisible(),Container.isOutside(PMVMatrix4f, Shape)
-
replaceShape
public boolean replaceShape(Shape remove, Shape replacement)
- Parameters:
remove- the shape to be replacedreplacement- the replacement shape to be inserted at same position- Returns:
- true if shape
removeis contained and replaced byreplacement, otherwise false.
-
removeShape
public Shape removeShape(Shape s)
Description copied from interface:ContainerRemoves given shape, w/oShape.destroy(GL2ES2, RegionRenderer).- Specified by:
removeShapein interfaceContainer- Returns:
- the removed shape or null if not contained
-
removeShapes
public void removeShapes(Collection<? extends Shape> shapes)
Description copied from interface:ContainerRemoves all given shapes, w/oShape.destroy(GL2ES2, RegionRenderer).- Specified by:
removeShapesin interfaceContainer
-
removeShape
public boolean removeShape(GL2ES2 gl, RegionRenderer renderer, Shape s)
Description copied from interface:ContainerRemoves given shape withShape.destroy(GL2ES2, RegionRenderer), if contained.- Specified by:
removeShapein interfaceContainer- Parameters:
gl- GL2ES2 contexts- the shape to be removed- Returns:
- true if given Shape is removed and destroyed
-
addShapes
public void addShapes(Collection<? extends Shape> shapes)
-
removeShapes
public void removeShapes(GL2ES2 gl, RegionRenderer renderer, Collection<? extends Shape> shapes)
Description copied from interface:ContainerRemoves all given shapes withShape.destroy(GL2ES2, RegionRenderer).- Specified by:
removeShapesin interfaceContainer
-
removeAllShapes
public void removeAllShapes(GL2ES2 gl, RegionRenderer renderer)
Description copied from interface:ContainerRemoves all contained shapes withShape.destroy(GL2ES2, RegionRenderer).- Specified by:
removeAllShapesin interfaceContainer
-
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, float[]). Otherwise the base color will be modulated and passed to#drawImpl0(GL2ES2, RegionRenderer, float[]).- Specified by:
hasColorChannelin classShape
-
setPMvCullingEnabled
public final void setPMvCullingEnabled(boolean v)
Description copied from interface:ContainerEnable or disableProject-Modelview (PMv) frustumculling perShapefor this container. Default is disabled.- Specified by:
setPMvCullingEnabledin interfaceContainer
-
isPMvCullingEnabled
public final boolean isPMvCullingEnabled()
Description copied from interface:ContainerReturn whetherProject-Modelview (PMv) frustum cullingis enabled for this container.- Specified by:
isPMvCullingEnabledin interfaceContainer
-
isCullingEnabled
public final boolean isCullingEnabled()
Description copied from interface:ContainerReturn whetherProject-Modelview (PMv) frustum cullingorGroup's Modelview (Mv) frustum clippingis enabled for this container. Default is disabled.- Specified by:
isCullingEnabledin interfaceContainer
-
isOutside
public final boolean isOutside(com.jogamp.math.util.PMVMatrix4f pmv, Shape shape)Description copied from interface:ContainerReturns whether the givenShapeis completely outside of this container.Note: If method returns false, the box may only be partially inside, i.e. intersects with this container
- Specified by:
isOutsidein interfaceContainer- Parameters:
pmv- currentPMVMatrix4fof this containershape- theShapeto test- See Also:
Container.isOutside2(Matrix4f, Shape, PMVMatrix4f),Shape#isOutside()
-
isOutside2
public boolean isOutside2(com.jogamp.math.Matrix4f mvCont, Shape shape, com.jogamp.math.util.PMVMatrix4f pmvShape)Description copied from interface:ContainerReturns whether the givenShapeis completely outside of this container.Note: If method returns false, the box may only be partially inside, i.e. intersects with this container
- Specified by:
isOutside2in interfaceContainer- Parameters:
mvCont- copy of the model-view {@link Matrix4f) of this containershape- theShapeto testpmvShape- currentPMVMatrix4fof the shape to test- See Also:
Container.isOutside(PMVMatrix4f, Shape),Shape#isOutside()
-
setRelayoutOnDirtyShapes
public void setRelayoutOnDirtyShapes(boolean v)
Set relayout on dirty shapes mode, defaults to true.If relayouting on dirty shape mode is enabler (default),
isShapeDirty()traverses through all shapes updating all dirty states of all its groups provoking a relayout if required.
-
getRelayoutOnDirtyShapes
public boolean getRelayoutOnDirtyShapes()
-
enableTopLevelWidget
public final Group enableTopLevelWidget(Scene scene)
Enables top-level widget behavior for this group, default is disabled.Enabled top-level widget behavior for a group causes
- the whole group to be shown on top on (mouse over) activation of one of its elements
- this group's
Shape.addActivationListener(Listener)to handle all it's elements activation events Shape.isActive()of this group to return true if one of its elements is active
Disable this behavior via
disableTopLevelWidget(), otherwise done atShape.clear(GL2ES2, RegionRenderer)orShape.destroy(GL2ES2, RegionRenderer).- Parameters:
scene- the top-level widget holder where thisGroupgets registered- Returns:
- this group for chaining
- See Also:
disableTopLevelWidget()
-
disableTopLevelWidget
public final Group disableTopLevelWidget()
Disables top-level widget behavior as potentially set viaenableTopLevelWidget(Scene). NOP if not enabled.
-
isTopLevelWidget
public final boolean isTopLevelWidget()
Returns whether#setTopLevelWidget(boolean)is enabled or disabled.
-
getShapeByIdx
public Shape getShapeByIdx(int id)
- Specified by:
getShapeByIdxin interfaceContainer
-
getShapeByID
public Shape getShapeByID(int id)
- Specified by:
getShapeByIDin interfaceContainer
-
getShapeByName
public Shape getShapeByName(String name)
- Specified by:
getShapeByNamein interfaceContainer
-
getBounds
public com.jogamp.math.geom.AABBox getBounds(com.jogamp.math.util.PMVMatrix4f pmv, Shape shape)Description copied from interface:Container
-
getSubString
public String getSubString()
- Overrides:
getSubStringin classShape
-
-