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 interface
Group.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 ofShape
s w/oGroup.Layout
.Group(Group.Layout l)
Create a group ofShape
s 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 void
addShape(Shape s)
Adds aShape
.void
addShapes(Collection<? extends Shape> shapes)
boolean
contains(Shape s)
Group
disableTopLevelWidget()
Disables top-level widget behavior as potentially set viaenableTopLevelWidget(Scene)
.Group
enableTopLevelWidget(Scene scene)
Enables top-level widget behavior for this group, default is disabled.com.jogamp.math.geom.AABBox
getBounds(com.jogamp.math.util.PMVMatrix4f pmv, Shape shape)
ReturnsAABBox
dimension of givenShape
from this container's perspective, i.e.com.jogamp.math.geom.Frustum
getClipMvFrustum()
ReturnssetClipMvFrustum(Frustum)
valueboolean
getClipOnBounds()
ReturnssetClipOnBounds(boolean)
valuecom.jogamp.math.Vec3f
getFixedSize()
Returns borrowed fixed size instance, seesetFixedSize(Vec3f)
andsetFixedSize(Vec2f)
.com.jogamp.math.Vec2f
getFixedSize(com.jogamp.math.Vec2f out)
Returns givenVec2f
instance set with 2 dimensions, seesetFixedSize(Vec2f)
.Group.Layout
getLayout()
Return currentGroup.Layout
.boolean
getRelayoutOnDirtyShapes()
List<Shape>
getRenderedShapes()
Returnsadded shapes
which are rendered and sorted by z-axis in ascending order toward z-near.Shape
getShapeByID(int id)
Shape
getShapeByIdx(int id)
Shape
getShapeByName(String name)
int
getShapeCount()
Returns number ofShape
s, seeContainer.getShapes()
.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, float[])
.boolean
isCullingEnabled()
Return whetherProject-Modelview (PMv) frustum culling
orGroup's Modelview (Mv) frustum clipping
is enabled for this container.boolean
isGroup()
Returns true if this shape denotes aGroup
, otherwise false.boolean
isOutside(com.jogamp.math.util.PMVMatrix4f pmv, Shape shape)
Returns whether the givenShape
is completely outside of this container.boolean
isOutside2(com.jogamp.math.Matrix4f mvCont, Shape shape, com.jogamp.math.util.PMVMatrix4f pmvShape)
Returns whether the givenShape
is completely outside of this container.boolean
isPMvCullingEnabled()
Return whetherProject-Modelview (PMv) frustum culling
is enabled for this container.boolean
isTopLevelWidget()
Returns whether#setTopLevelWidget(boolean)
is enabled or disabled.void
removeAllShapes(GL2ES2 gl, RegionRenderer renderer)
Removes all contained shapes withShape.destroy(GL2ES2, RegionRenderer)
.Shape
removeShape(Shape s)
Removes given shape, w/oShape.destroy(GL2ES2, RegionRenderer)
.boolean
removeShape(GL2ES2 gl, RegionRenderer renderer, Shape s)
Removes given shape withShape.destroy(GL2ES2, RegionRenderer)
, if contained.void
removeShapes(GL2ES2 gl, RegionRenderer renderer, Collection<? extends Shape> shapes)
Removes all given shapes withShape.destroy(GL2ES2, RegionRenderer)
.void
removeShapes(Collection<? extends Shape> shapes)
Removes all given shapes, w/oShape.destroy(GL2ES2, RegionRenderer)
.boolean
replaceShape(Shape remove, Shape replacement)
Group
setClipMvFrustum(com.jogamp.math.geom.Frustum v)
Group
setClipOnBounds(boolean v)
Enable Modelview (Mv)Frustum
clipping onShape.getBounds()
for this group and its shapes as follows DiscardShape
rendering
if not intersectingclip-box
. Otherwise perform pixel-accurate clipping inside the shader toclip-box
.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)
.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)
.Group
setLayout(Group.Layout l)
SetGroup.Layout
.void
setPMvCullingEnabled(boolean v)
Enable or disableProject-Modelview (PMv) frustum
culling perShape
for this container.void
setRelayoutOnDirtyShapes(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
, maybenull
fixedSize
- optional fixed size forsetFixedSize(Vec2f)
s
- optionalShape
foraddShape(Shape)
-
-
Method Detail
-
isGroup
public final boolean isGroup()
Description copied from class:Shape
Returns 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 givenVec2f
instance set with 2 dimensions, seesetFixedSize(Vec2f)
.
-
setClipOnBounds
public Group setClipOnBounds(boolean v)
Enable Modelview (Mv)Frustum
clipping onShape.getBounds()
for this group and its shapes as follows- Discard
Shape
rendering
if 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 functionalFrustum
operation.- 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)Frustum
clipping on explicit given pre-multiplied w/ Mv-matrixclip-box
for this group and its shapes as follows- Discard
Shape
rendering
if 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 functionalFrustum
operation.- Parameters:
v
-Frustum
pre-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:Container
Returns number ofShape
s, seeContainer.getShapes()
.- Specified by:
getShapeCount
in interfaceContainer
-
getRenderedShapes
public List<Shape> getRenderedShapes()
Description copied from interface:Container
Returnsadded shapes
which are rendered and sorted by z-axis in ascending order toward z-near.The rendered shapes are
visible
and 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:
getRenderedShapes
in 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
remove
is contained and replaced byreplacement
, otherwise false.
-
removeShape
public Shape removeShape(Shape s)
Description copied from interface:Container
Removes given shape, w/oShape.destroy(GL2ES2, RegionRenderer)
.- Specified by:
removeShape
in interfaceContainer
- Returns:
- the removed shape or null if not contained
-
removeShapes
public void removeShapes(Collection<? extends Shape> shapes)
Description copied from interface:Container
Removes all given shapes, w/oShape.destroy(GL2ES2, RegionRenderer)
.- Specified by:
removeShapes
in interfaceContainer
-
removeShape
public boolean removeShape(GL2ES2 gl, RegionRenderer renderer, Shape s)
Description copied from interface:Container
Removes given shape withShape.destroy(GL2ES2, RegionRenderer)
, if contained.- Specified by:
removeShape
in 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:Container
Removes all given shapes withShape.destroy(GL2ES2, RegionRenderer)
.- Specified by:
removeShapes
in interfaceContainer
-
removeAllShapes
public void removeAllShapes(GL2ES2 gl, RegionRenderer renderer)
Description copied from interface:Container
Removes all contained shapes withShape.destroy(GL2ES2, RegionRenderer)
.- Specified by:
removeAllShapes
in interfaceContainer
-
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, float[])
. Otherwise the base color will be modulated and passed to#drawImpl0(GL2ES2, RegionRenderer, float[])
.- Specified by:
hasColorChannel
in classShape
-
setPMvCullingEnabled
public final void setPMvCullingEnabled(boolean v)
Description copied from interface:Container
Enable or disableProject-Modelview (PMv) frustum
culling perShape
for this container. Default is disabled.- Specified by:
setPMvCullingEnabled
in interfaceContainer
-
isPMvCullingEnabled
public final boolean isPMvCullingEnabled()
Description copied from interface:Container
Return whetherProject-Modelview (PMv) frustum culling
is enabled for this container.- Specified by:
isPMvCullingEnabled
in interfaceContainer
-
isCullingEnabled
public final boolean isCullingEnabled()
Description copied from interface:Container
Return whetherProject-Modelview (PMv) frustum culling
orGroup's Modelview (Mv) frustum clipping
is enabled for this container. Default is disabled.- Specified by:
isCullingEnabled
in interfaceContainer
-
isOutside
public final boolean isOutside(com.jogamp.math.util.PMVMatrix4f pmv, Shape shape)
Description copied from interface:Container
Returns whether the givenShape
is 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:
isOutside
in interfaceContainer
- Parameters:
pmv
- currentPMVMatrix4f
of this containershape
- theShape
to 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:Container
Returns whether the givenShape
is 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:
isOutside2
in interfaceContainer
- Parameters:
mvCont
- copy of the model-view {@link Matrix4f) of this containershape
- theShape
to testpmvShape
- currentPMVMatrix4f
of 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 thisGroup
gets 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:
getShapeByIdx
in interfaceContainer
-
getShapeByID
public Shape getShapeByID(int id)
- Specified by:
getShapeByID
in interfaceContainer
-
getShapeByName
public Shape getShapeByName(String name)
- Specified by:
getShapeByName
in 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:
getSubString
in classShape
-
-