Class Shape
- java.lang.Object
-
- com.jogamp.graph.ui.Shape
-
- Direct Known Subclasses:
GraphShape
,Group
public abstract class Shape extends Object
Generic Shape, potentially using a Graph viaGraphShape
or other means of representing content.A shape includes the following build-in user-interactions - drag shape w/ 1-pointer click, see
setDraggable(boolean)
- resize shape w/ 1-pointer click and drag in 1/4th bottom-left and bottom-right corner, seesetResizable(boolean)
.A shape is expected to have its 0/0 origin in its bottom-left corner, otherwise the drag-zoom sticky-edge will not work as expected.
A shape's
getBounds()
includes its optionalgetPadding()
and optionalgetBorderThickness()
.GraphUI is GPU based and resolution independent.
GraphUI is intended to become an immediate- and retained-mode API.
Default colors (toggle-off is full color): - non-toggle: 0.6 * color, static -> 0.6 - pressed: 0.8 * color, static -> 0.5 - toggle-off: 1.0 * color, static -> 0.6 - toggle-on: 0.8 * color
- See Also:
Scene
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Shape.DrawListener
Shape
draw listener action returning a boolean valuestatic class
Shape.EventInfo
Shape
event info for propagatedNEWTEvent
s containing reference ofthe intended shape
as well as therotated relative position
to this shape.static class
Shape.ForwardKeyListener
ForwardKeyListener
, to be attached to a key event source forwarded to the receiver set at constructor.static class
Shape.ForwardMouseListener
ForwardShape.MouseGestureListener
, to be attached to a mouse event source forwarded to the receiver set at constructor.static interface
Shape.Listener
GeneralShape
listener actionstatic class
Shape.MouseGestureAdapter
Convenient adapter combining dummy implementation forMouseListener
andGestureHandler.GestureListener
static interface
Shape.MouseGestureListener
CombiningMouseListener
andGestureHandler.GestureListener
static interface
Shape.MoveListener
Shape
move listenerstatic interface
Shape.PointerListener
Shape
pointer listener, e.g.static interface
Shape.Visitor1
GeneralShape
visitorstatic interface
Shape.Visitor2
GeneralShape
visitor
-
Field Summary
Fields Modifier and Type Field Description static Comparator<Shape>
ZAscendingComparator
static Comparator<Shape>
ZDescendingComparator
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Shape
addActivationListener(Shape.Listener l)
Add user callback to be notified when shape is activated (pointer-over and/or click) or de-activated (pointer left).Shape
addKeyListener(KeyListener l)
Shape
addMouseListener(Shape.MouseGestureListener l)
void
applyMatToMv(com.jogamp.math.util.PMVMatrix4f pmv)
Applies the internalMatrix4f
to the givenmodelview matrix
, i.e.void
clear(GL2ES2 gl, RegionRenderer renderer)
Clears all data and reset all states as if this instance was newly createdvoid
destroy(GL2ES2 gl, RegionRenderer renderer)
Destroys all datavoid
draw(GL2ES2 gl, RegionRenderer renderer)
Renders the shape.void
drawToSelect(GL2ES2 gl, RegionRenderer renderer)
Experimental selection draw command used byScene
.com.jogamp.math.Vec4f
getActiveColorMod()
Returns modulation color whenisActive()
.float
getAdjustedZ()
com.jogamp.math.Vec4f
getBorderColor()
float
getBorderThickness()
Returns the border thickness, see#setBorder(float, Padding)
.com.jogamp.math.geom.AABBox
getBounds()
Returns the unscaled boundingAABBox
for this shape, borrowing internal instance.com.jogamp.math.geom.AABBox
getBounds(GLProfile glp)
Returns the unscaled boundingAABBox
for this shape.com.jogamp.math.Vec4f
getColor()
Returns base-color w/o color channel, will be modulated w/getPressedColorMod()
,getToggleOnColorMod()
,getToggleOffColorMod()
andgetActiveColorMod()
.int
getID()
Return the optional symbolic ID for this shape.com.jogamp.math.Matrix4f
getMat()
Returns the internalMatrix4f
reference.com.jogamp.math.Matrix4f
getMat(com.jogamp.math.Matrix4f out)
Returns a copy of the internalMatrix4f
toout
.String
getName()
Return the optional symbolic name for this shape, defaults to `noname`.Padding
getPadding()
Returns unscaledPadding
of this shape, which is included in unscaledgetBounds()
and also includes the border.Group
getParent()
Returns the last parent containerGroup
this shape has been added to ornull
.float[]
getPixelPerShapeUnit(int[] shapeSizePx, float[] pixPerShape)
Retrieve pixel per scaled shape-coordinate unit, i.e.float[]
getPixelPerShapeUnit(Scene scene, com.jogamp.math.util.PMVMatrix4f pmv, float[] pixPerShape)
Retrieve pixel per scaled shape-coordinate unit, i.e.float[]
getPixelPerShapeUnit(com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, float[] pixPerShape)
Retrieve pixel per scaled shape-coordinate unit, i.e.com.jogamp.math.Vec3f
getPosition()
Returns positionVec3f
reference, i.e.com.jogamp.math.Vec4f
getPressedColorMod()
Returns modulation color whenisPressed()
.com.jogamp.math.Quaternion
getRotation()
ReturnsQuaternion
for rotation.com.jogamp.math.Vec3f
getRotationPivot()
Return unscaled rotation originVec3f
reference, aka pivot.com.jogamp.math.Vec3f
getScale()
Returns scaleVec3f
reference.float
getScaledDepth()
float
getScaledHeight()
Returns the scaled height of the boundingAABBox
for this shape.float
getScaledWidth()
Returns the scaled width of the boundingAABBox
for this shape.String
getSubString()
com.jogamp.math.Recti
getSurfacePort(com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, com.jogamp.math.Recti surfacePort)
Retrieve surface (view) port of this shape, i.e.int[]
getSurfaceSize(Scene.PMVMatrixSetup pmvMatrixSetup, com.jogamp.math.Recti viewport, com.jogamp.math.util.PMVMatrix4f pmv, int[] surfaceSize)
Retrieve surface (view) size in pixels of this shape.int[]
getSurfaceSize(Scene scene, com.jogamp.math.util.PMVMatrix4f pmv, int[] surfaceSize)
Retrieve surface (view) size in pixels of this shape.int[]
getSurfaceSize(com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, int[] surfaceSize)
Retrieve surface (view) size in pixels of this shape.com.jogamp.math.Vec4f
getToggleOffColorMod()
Returns modulation color when notisToggleOn()
.com.jogamp.math.Vec4f
getToggleOnColorMod()
Returns modulation color whenisToggleOn()
.Tooltip
getTooltip()
boolean
hasBorder()
Returns true if a border has been enabled via#setBorder(float, Padding)
.abstract 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
hasPadding()
Returns true ifsetPaddding(Padding)
added a nonPadding.zeroSize()
spacing to this shape.boolean
isActivable()
Returns if this shape is allowed to be activated, i.e becomeisActive()
.boolean
isActive()
Returns true of this shape is activeboolean
isDiscarded()
Returns whether this shape is discarded in lastdraw(GL2ES2, RegionRenderer)
, i.e.boolean
isDraggable()
Returns if this shape is draggable, a user interaction.boolean
isFixedARatioResize()
Returns if aspect-ratio shall be kept at resize, ifisResizable()
.boolean
isGroup()
Returns true if this shape denotes aGroup
, otherwise false.boolean
isInteractive()
Returns if this shape allows user interaction in general, seesetInteractive(boolean)
boolean
isMatIdentity()
Returns true ifgetMat()
has not been mutated, i.e.boolean
isPressed()
boolean
isResizable()
Returns if this shape is resizable, a user interaction.boolean
isToggleable()
Returns true if this shape is toggable, i.e.boolean
isToggleOn()
Returns true this shape's toggle state.boolean
isVisible()
Returns true if this shape is setvisible
by the user, otherwise false.void
markShapeDirty()
Marks the shape dirty, causing nextdraw()
to recreate the Graph shape and reset the region.void
markStateDirty()
Marks the rendering state dirty, causing nextdraw()
to notify the Graph region to reselect shader and repaint potentially used FBOs.Shape
move(float dtx, float dty, float dtz)
Move about scaled distance.Shape
move(com.jogamp.math.Vec3f dt)
Move about scaled distance.Shape
moveTo(float tx, float ty, float tz)
Move to scaled position.Shape
moveTo(com.jogamp.math.Vec3f t)
Move to scaled position.void
onClicked(Shape.PointerListener l)
Set user callback to be notified when shape is clicked.void
onDraw(Shape.DrawListener l)
Set a user one-shot initializer callback or customdraw(GL2ES2, RegionRenderer)
hook.void
onHover(Shape.PointerListener l)
Set user callback to be notified when a pointer/mouse is moving over this shapevoid
onMove(Shape.MoveListener l)
Set user callback to be notified when shape ismove(Vec3f)
'ed.void
onToggle(Shape.Listener l)
Set user callback to be notified when shapetoggle()
'ed.void
receiveKeyEvents(Shape source)
void
receiveMouseEvents(Shape source)
ForwardShape.MouseGestureListener
events to thisShape
fromsource
using aShape.ForwardMouseListener
.Shape
removeActivationListener(Shape.Listener l)
Shape
removeKeyListener(KeyListener l)
Shape
removeMouseListener(Shape.MouseGestureListener l)
void
removeToolTip()
void
runSynced(Runnable action)
Perform givenRunnable
action synchronizedShape
scale(float sx, float sy, float sz)
Multiply current scale factor by given scale.Shape
scale(com.jogamp.math.Vec3f s)
Multiply current scale factor by given scale.Shape
setActivable(boolean v)
Set whether this shape is allowed to be activated, i.e becomeisActive()
.Shape
setActiveColorMod(com.jogamp.math.Vec4f c)
Enable active color, modulationgetColor()
ifisActive()
with passingc != null
, disable with passingc == null
.Shape
setBorder(float thickness)
Sets the thickness of the border, which is included ingetBounds()
and is outside ofgetPadding()
.Shape
setBorderColor(float r, float g, float b, float a)
Set border color.Shape
setBorderColor(com.jogamp.math.Vec4f c)
Set border color.Shape
setColor(float r, float g, float b, float a)
Set base color.Shape
setColor(com.jogamp.math.Vec4f c)
Set base color.Shape
setDiscarded(boolean v)
Set whether this shape is discarded in lastdraw(GL2ES2, RegionRenderer)
, i.e.Shape
setDragAndResizable(boolean v)
Set whether this shape is draggable and resizable.Shape
setDraggable(boolean draggable)
Set whether this shape is draggable, i.e.Shape
setFixedARatioResize(boolean v)
Sets whether aspect-ratio shall be kept at resize, ifisResizable()
.Shape
setID(int id)
Set a symbolic ID for this shape for identification.Shape
setInteractive(boolean v)
Set whether this shape is interactive in general, i.e.Shape
setName(String name)
Set a symbolic name for this shape for identification.Shape
setPaddding(Padding padding)
Sets the unscaled padding for this shape, which is included in unscaledgetBounds()
and also includes the border.com.jogamp.math.util.PMVMatrix4f
setPMVMatrix(Scene.PMVMatrixSetup pmvMatrixSetup, com.jogamp.math.Recti viewport, com.jogamp.math.util.PMVMatrix4f pmv)
com.jogamp.math.util.PMVMatrix4f
setPMVMatrix(Scene scene, com.jogamp.math.util.PMVMatrix4f pmv)
Shape
setPressed(boolean b)
Shape
setPressedColorMod(float r, float g, float b, float a)
Set pressed color, modulatinggetColor()
ifisPressed()
.Shape
setResizable(boolean resizable)
Set whether this shape is resizable, i.e.Shape
setRotation(com.jogamp.math.Quaternion q)
Sets the rotationQuaternion
.Shape
setRotationPivot(float px, float py, float pz)
Set unscaled rotation origin, aka pivot.Shape
setRotationPivot(com.jogamp.math.Vec3f pivot)
Set unscaled rotation origin, aka pivot.Shape
setScale(float sx, float sy, float sz)
Set scale factor to given scale.Shape
setScale(com.jogamp.math.Vec3f s)
Set scale factor to given scale.Shape
setToggle(boolean v)
Set this shape's toggle state, default is off.Shape
setToggleable(boolean toggleable)
Set this shape toggleable, default is off.Shape
setToggleOffColorMod(float r, float g, float b, float a)
Shape
setToggleOnColorMod(float r, float g, float b, float a)
Tooltip
setToolTip(Tooltip newTooltip)
Set's a newTooltip
for this shape.Shape
setVisible(boolean v)
Enable (default) or disable this shape's visibility.int[]
shapeToWinCoord(Scene.PMVMatrixSetup pmvMatrixSetup, com.jogamp.math.Recti viewport, com.jogamp.math.Vec3f objPos, com.jogamp.math.util.PMVMatrix4f pmv, int[] glWinPos)
Map given object coordinate relative to this shape to window coordinates.int[]
shapeToWinCoord(Scene scene, com.jogamp.math.Vec3f objPos, com.jogamp.math.util.PMVMatrix4f pmv, int[] glWinPos)
Map given object coordinate relative to this shape to window coordinates.int[]
shapeToWinCoord(com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, com.jogamp.math.Vec3f objPos, int[] glWinPos)
Map given object coordinate relative to this shape to window coordinates.Shape
toggle()
String
toString()
void
updateMat()
Updates the internalMatrix4f
with local position, rotation and scale.Shape
validate(GL2ES2 gl)
Validates the shape's underlyingGLRegion
.Shape
validate(GL2ES2 gl, GLProfile glp)
Shape
validate(GLProfile glp)
Validates the shape's underlyingGLRegion
w/o a currentGL2ES2
objectcom.jogamp.math.Vec3f
winToShapeCoord(Scene.PMVMatrixSetup pmvMatrixSetup, com.jogamp.math.Recti viewport, int glWinX, int glWinY, com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Vec3f objPos)
Map given gl-window-coordinates to object coordinates relative to this shape and its z-coordinate.com.jogamp.math.Vec3f
winToShapeCoord(Scene scene, int glWinX, int glWinY, com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Vec3f objPos)
Map given gl-window-coordinates to object coordinates relative to this shape and its z-coordinate.com.jogamp.math.Vec3f
winToShapeCoord(com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, int glWinX, int glWinY, com.jogamp.math.Vec3f objPos)
Map given gl-window-coordinates to object coordinates relative to this shape and its z-coordinate.
-
-
-
Field Detail
-
ZAscendingComparator
public static Comparator<Shape> ZAscendingComparator
-
ZDescendingComparator
public static Comparator<Shape> ZDescendingComparator
-
-
Method Detail
-
getParent
public Group getParent()
Returns the last parent containerGroup
this shape has been added to ornull
.Since a shape can be added to multiple container (DAG), usability of this information depends on usage.
-
setID
public final Shape setID(int id)
Set a symbolic ID for this shape for identification. Default is -1 for noname.
-
getID
public final int getID()
Return the optional symbolic ID for this shape.
-
setName
public Shape setName(String name)
Set a symbolic name for this shape for identification. Default is `noname`.
-
getName
public final String getName()
Return the optional symbolic name for this shape, defaults to `noname`.
-
isGroup
public boolean isGroup()
Returns true if this shape denotes aGroup
, otherwise false.
-
isVisible
public final boolean isVisible()
Returns true if this shape is setvisible
by the user, otherwise false. Defaults to true.Note that invisible shapes are not considered for picking/activation.
- See Also:
isInteractive()
-
setVisible
public final Shape setVisible(boolean v)
Enable (default) or disable this shape's visibility.Note that invisible shapes are not considered for picking/activation.
This visibility flag is toggled by the user only.
-
setPaddding
public final Shape setPaddding(Padding padding)
Sets the unscaled padding for this shape, which is included in unscaledgetBounds()
and also includes the border. Default is zero.Method issues
markShapeDirty()
.- Parameters:
padding
- distance of shape to the border, i.e. padding- Returns:
- this shape for chaining
- See Also:
getPadding()
,hasPadding()
,markShapeDirty()
-
getPadding
public Padding getPadding()
Returns unscaledPadding
of this shape, which is included in unscaledgetBounds()
and also includes the border. Default is zero.- See Also:
setPaddding(Padding)
,hasPadding()
-
hasPadding
public boolean hasPadding()
Returns true ifsetPaddding(Padding)
added a nonPadding.zeroSize()
spacing to this shape.
-
setBorder
public final Shape setBorder(float thickness)
Sets the thickness of the border, which is included ingetBounds()
and is outside ofgetPadding()
. Default is zero for no border.Method issues
markShapeDirty()
.- Parameters:
thickness
- border thickness, zero for no border- Returns:
- this shape for chaining
- See Also:
setBorderColor(Vec4f)
,markShapeDirty()
-
hasBorder
public final boolean hasBorder()
Returns true if a border has been enabled via#setBorder(float, Padding)
.
-
getBorderThickness
public final float getBorderThickness()
Returns the border thickness, see#setBorder(float, Padding)
.
-
clear
public final void clear(GL2ES2 gl, RegionRenderer renderer)
Clears all data and reset all states as if this instance was newly created- Parameters:
gl
- currentGL2ES2
instance used to release GPU resourcesrenderer
-RegionRenderer
used to release GPU resources
-
destroy
public final void destroy(GL2ES2 gl, RegionRenderer renderer)
Destroys all data- Parameters:
gl
- currentGL2ES2
instance used to release GPU resourcesrenderer
-RegionRenderer
used to release GPU resources
-
onDraw
public final void onDraw(Shape.DrawListener l)
Set a user one-shot initializer callback or customdraw(GL2ES2, RegionRenderer)
hook.#run(Shape, GL2ES2, RegionRenderer)
is called atdraw(GL2ES2, RegionRenderer)
and if returningtrue
, the listener will be removed. Otherwise kept calling.This instrument allows the user either to be signaled when initialization of this
Shape
is completed, or just too hook-up customdraw(GL2ES2, RegionRenderer)
actions.- Parameters:
l
- callback, which shall return true to be removed, i.e. user initialization is done.
-
onHover
public final void onHover(Shape.PointerListener l)
Set user callback to be notified when a pointer/mouse is moving over this shape
-
onMove
public final void onMove(Shape.MoveListener l)
Set user callback to be notified when shape ismove(Vec3f)
'ed.
-
onToggle
public final void onToggle(Shape.Listener l)
Set user callback to be notified when shapetoggle()
'ed.This is usually the case when clicked, see
onClicked(PointerListener)
.Use
isToggleOn()
to retrieve the state.
-
onClicked
public final void onClicked(Shape.PointerListener l)
Set user callback to be notified when shape is clicked.Usually shape is
toggle()
'ed when clicked, seeonToggle(Listener)
. However, in case shape is notisToggleable()
this is the last resort.
-
addActivationListener
public final Shape addActivationListener(Shape.Listener l)
Add user callback to be notified when shape is activated (pointer-over and/or click) or de-activated (pointer left).Use
isActive()
to retrieve the state.
-
removeActivationListener
public final Shape removeActivationListener(Shape.Listener l)
-
moveTo
public final Shape moveTo(float tx, float ty, float tz)
Move to scaled position. Position ends up in PMVMatrix4f unmodified. NoShape.MoveListener
notification will occur.
-
moveTo
public final Shape moveTo(com.jogamp.math.Vec3f t)
Move to scaled position. Position ends up in PMVMatrix4f unmodified. NoShape.MoveListener
notification will occur.
-
move
public final Shape move(float dtx, float dty, float dtz)
Move about scaled distance. Position ends up in PMVMatrix4f unmodified. NoShape.MoveListener
notification will occur.
-
move
public final Shape move(com.jogamp.math.Vec3f dt)
Move about scaled distance. Position ends up in PMVMatrix4f unmodified. NoShape.MoveListener
notification will occur.
-
getPosition
public final com.jogamp.math.Vec3f getPosition()
Returns positionVec3f
reference, i.e. scaled translation as set viaor {@link #move(float, float, float)}
.
-
getRotation
public final com.jogamp.math.Quaternion getRotation()
ReturnsQuaternion
for rotation.
-
setRotation
public final Shape setRotation(com.jogamp.math.Quaternion q)
Sets the rotationQuaternion
.- Returns:
- this shape for chaining
-
getRotationPivot
public final com.jogamp.math.Vec3f getRotationPivot()
Return unscaled rotation originVec3f
reference, aka pivot. Null if not set viasetRotationPivot(float, float, float)
.- See Also:
updateMat()
-
setRotationPivot
public final Shape setRotationPivot(float px, float py, float pz)
Set unscaled rotation origin, aka pivot. Usually thegetBounds()
center and should be set whilevalidateImpl(GL2ES2, GLProfile)
.- Returns:
- this shape for chaining
-
setRotationPivot
public final Shape setRotationPivot(com.jogamp.math.Vec3f pivot)
Set unscaled rotation origin, aka pivot. Usually thegetBounds()
center and should be set whilevalidateImpl(GL2ES2, GLProfile)
.- Parameters:
pivot
- rotation origin- Returns:
- this shape for chaining
-
setScale
public final Shape setScale(com.jogamp.math.Vec3f s)
Set scale factor to given scale.- See Also:
scale(Vec3f)
,getScale()
-
setScale
public final Shape setScale(float sx, float sy, float sz)
Set scale factor to given scale.- See Also:
scale(float, float, float)
,getScale()
-
scale
public final Shape scale(com.jogamp.math.Vec3f s)
Multiply current scale factor by given scale.- See Also:
setScale(Vec3f)
,getScale()
-
scale
public final Shape scale(float sx, float sy, float sz)
Multiply current scale factor by given scale.- See Also:
setScale(float, float, float)
,getScale()
-
getScale
public final com.jogamp.math.Vec3f getScale()
Returns scaleVec3f
reference.
-
markShapeDirty
public final void markShapeDirty()
Marks the shape dirty, causing nextdraw()
to recreate the Graph shape and reset the region.
-
markStateDirty
public final void markStateDirty()
Marks the rendering state dirty, causing nextdraw()
to notify the Graph region to reselect shader and repaint potentially used FBOs.
-
getBounds
public final com.jogamp.math.geom.AABBox getBounds()
Returns the unscaled boundingAABBox
for this shape, borrowing internal instance. The returnedAABBox
will cover the unscaled shape as well as its optionalgetPadding()
and optionalgetBorderThickness()
. The returnedAABBox
is only valid after an initial call todraw(..)
orvalidate(GL2ES2)
.- See Also:
getBounds(GLProfile)
-
getScaledWidth
public final float getScaledWidth()
Returns the scaled width of the boundingAABBox
for this shape. The returned width will cover the scaled shape as well as its optional scaledgetPadding()
and optional scaledgetBorderThickness()
. The returned width is only valid after an initial call todraw(..)
orvalidate(GL2ES2)
.- See Also:
getBounds()
-
getScaledHeight
public final float getScaledHeight()
Returns the scaled height of the boundingAABBox
for this shape. The returned height will cover the scaled shape as well as its optional scaledgetPadding()
and optional scaledgetBorderThickness()
. The returned height is only valid after an initial call todraw(..)
orvalidate(GL2ES2)
.- See Also:
getBounds()
-
getScaledDepth
public final float getScaledDepth()
-
getBounds
public final com.jogamp.math.geom.AABBox getBounds(GLProfile glp)
Returns the unscaled boundingAABBox
for this shape. This variant differs fromgetBounds()
as it returns a validAABBox
even beforedraw(..)
and having an OpenGL instance available.- See Also:
getBounds()
-
drawToSelect
public void drawToSelect(GL2ES2 gl, RegionRenderer renderer)
Experimental selection draw command used byScene
.
-
draw
public void draw(GL2ES2 gl, RegionRenderer renderer)
Renders the shape.applyMatToMv(PMVMatrix4f)
is expected to be completed beforehand.- Parameters:
gl
- the current GL objectrenderer
-RegionRenderer
which might be used for Graph Curve Rendering, also source ofRegionRenderer.getMatrix()
andRegionRenderer.getViewport()
.
-
validate
public final Shape validate(GL2ES2 gl)
Validates the shape's underlyingGLRegion
.If the region is dirty, it gets
cleared
and is reused.- Parameters:
gl
- currentGL2ES2
object- See Also:
validate(GLProfile)
-
validate
public final Shape validate(GLProfile glp)
Validates the shape's underlyingGLRegion
w/o a currentGL2ES2
objectIf the region is dirty a new region is created and the old one gets pushed to a dirty-list to get disposed when a GL context is available.
- See Also:
validate(GL2ES2)
-
validate
public final Shape validate(GL2ES2 gl, GLProfile glp)
- See Also:
validate(GL2ES2)
,validate(GLProfile)
-
applyMatToMv
public final void applyMatToMv(com.jogamp.math.util.PMVMatrix4f pmv)
Applies the internalMatrix4f
to the givenmodelview matrix
, i.e.pmv.mulMv( getMat() )
.Calls
In caseupdateMat()
if dirty.isMatIdentity()
istrue
, implementation is a no-operation.- Parameters:
pmv
- the matrix- See Also:
isMatIdentity()
,updateMat()
,getMat()
,PMVMatrix4f.mulMv(Matrix4f)
-
getMat
public final com.jogamp.math.Matrix4f getMat()
Returns the internalMatrix4f
reference.Calls
updateMat()
if dirty.- See Also:
getMat(Matrix4f)
,applyMatToMv(PMVMatrix4f)
,updateMat()
-
getMat
public final com.jogamp.math.Matrix4f getMat(com.jogamp.math.Matrix4f out)
- See Also:
getMat()
,applyMatToMv(PMVMatrix4f)
,updateMat()
-
isMatIdentity
public final boolean isMatIdentity()
Returns true ifgetMat()
has not been mutated, i.e. contains identity.- See Also:
updateMat()
-
updateMat
public final void updateMat()
Updates the internalMatrix4f
with local position, rotation and scale.- Scale shape from its center position
- Rotate shape around optional scaled pivot, see
#setRotationPivot(float[])
), otherwise rotate around its scaled center (default)
Shape's origin should be bottom-left @ 0/0 to have build-in drag-zoom work properly.
SetsisMatIdentity()
totrue
if neither position, scale or rotate is performed, otherwise tofalse
.Called by
applyMatToMv(PMVMatrix4f)
,getMat()
andgetMat(Matrix4f)
if internal matrix is dirty.After any mutating operations, .e.g
move(float, float, float)
etc, the internal matrix is marked dirty.
-
setPMVMatrix
public final com.jogamp.math.util.PMVMatrix4f setPMVMatrix(Scene.PMVMatrixSetup pmvMatrixSetup, com.jogamp.math.Recti viewport, com.jogamp.math.util.PMVMatrix4f pmv)
- Parameters:
pmvMatrixSetup
-Scene.PMVMatrixSetup
tosetup
givenPMVMatrix4f
pmv
.viewport
- used viewport forPMVMatrix4f.mapObjToWin(Vec3f, Recti, Vec3f)
pmv
- a newPMVMatrix4f
which willbe setup
,shape-transformed
and can be reused by the caller.- Returns:
- the given
PMVMatrix4f
for chaining - See Also:
Scene.PMVMatrixSetup.set(PMVMatrix4f, Recti)
,applyMatToMv(PMVMatrix4f)
,setPMVMatrix(Scene, PMVMatrix4f)
-
setPMVMatrix
public final com.jogamp.math.util.PMVMatrix4f setPMVMatrix(Scene scene, com.jogamp.math.util.PMVMatrix4f pmv)
- Parameters:
scene
-Scene
to retrieveScene.PMVMatrixSetup
and the viewport.pmv
- a newPMVMatrix4f
which willbe setup
,shape-transformed
and can be reused by the caller.- Returns:
- the given
PMVMatrix4f
for chaining - See Also:
Scene.PMVMatrixSetup.set(PMVMatrix4f, Recti)
,applyMatToMv(PMVMatrix4f)
,setPMVMatrix(com.jogamp.graph.ui.Scene.PMVMatrixSetup, Recti, PMVMatrix4f)
-
getSurfacePort
public final com.jogamp.math.Recti getSurfacePort(com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, com.jogamp.math.Recti surfacePort)
Retrieve surface (view) port of this shape, i.e. lower x/y position and size.The given
PMVMatrix4f
has to be setup properly for this object, i.e. itsGLMatrixFunc.GL_PROJECTION
andGLMatrixFunc.GL_MODELVIEW
for the surrounding scene including this shape'sapplyMatToMv(PMVMatrix4f)
. SeesetPMVMatrix(Scene, PMVMatrix4f)
.- Parameters:
pmv
- well formedPMVMatrix4f
, e.g. could have been setup viasetPMVMatrix(Scene, PMVMatrix4f)
.viewport
- the int[4] viewportsurfacePort
- Recti target surface port- Returns:
- given Recti
surfacePort
for successfulgluProject(..)
operation, otherwisenull
-
getSurfaceSize
public final int[] getSurfaceSize(com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, int[] surfaceSize)
Retrieve surface (view) size in pixels of this shape.The given
PMVMatrix4f
has to be setup properly for this object, i.e. itsGLMatrixFunc.GL_PROJECTION
andGLMatrixFunc.GL_MODELVIEW
for the surrounding scene including this shape'sapplyMatToMv(PMVMatrix4f)
. SeesetPMVMatrix(Scene, PMVMatrix4f)
.- Parameters:
pmv
- well formedPMVMatrix4f
, e.g. could have been setup viasetPMVMatrix(Scene, PMVMatrix4f)
.viewport
- the int[4] viewportsurfaceSize
- int[2] target surface size- Returns:
- given int[2]
surfaceSize
in pixels for successfulgluProject(..)
operation, otherwisenull
- See Also:
getSurfaceSize(com.jogamp.graph.ui.Scene.PMVMatrixSetup, Recti, PMVMatrix4f, int[])
,getSurfaceSize(Scene, PMVMatrix4f, int[])
-
getSurfaceSize
public final int[] getSurfaceSize(Scene.PMVMatrixSetup pmvMatrixSetup, com.jogamp.math.Recti viewport, com.jogamp.math.util.PMVMatrix4f pmv, int[] surfaceSize)
Retrieve surface (view) size in pixels of this shape.The given
PMVMatrix4f
will besetup
properly for this shape including this shape'sapplyMatToMv(PMVMatrix4f)
.- Parameters:
pmvMatrixSetup
-Scene.PMVMatrixSetup
tosetup
givenPMVMatrix4f
pmv
.viewport
- used viewport forgluProject(..)
pmv
- a newPMVMatrix4f
which willbe setup
,shape-transformed
and can be reused by the caller.surfaceSize
- int[2] target surface size- Returns:
- given int[2]
surfaceSize
in pixels for successfulgluProject(..)
operation, otherwisenull
- See Also:
getSurfaceSize(PMVMatrix4f, Recti, int[])
,getSurfaceSize(Scene, PMVMatrix4f, int[])
-
getSurfaceSize
public final int[] getSurfaceSize(Scene scene, com.jogamp.math.util.PMVMatrix4f pmv, int[] surfaceSize)
Retrieve surface (view) size in pixels of this shape.The given
PMVMatrix4f
will besetup
properly for this shape including this shape'sapplyMatToMv(PMVMatrix4f)
.- Parameters:
scene
-Scene
to retrieveScene.PMVMatrixSetup
and the viewport.pmv
- a newPMVMatrix4f
which willbe setup
,shape-transformed
and can be reused by the caller.surfaceSize
- int[2] target surface size- Returns:
- given int[2]
surfaceSize
in pixels for successfulgluProject(..)
operation, otherwisenull
- See Also:
getSurfaceSize(PMVMatrix4f, Recti, int[])
,getSurfaceSize(com.jogamp.graph.ui.Scene.PMVMatrixSetup, Recti, PMVMatrix4f, int[])
-
getPixelPerShapeUnit
public final float[] getPixelPerShapeUnit(int[] shapeSizePx, float[] pixPerShape)
Retrieve pixel per scaled shape-coordinate unit, i.e. [px]/[obj].- Parameters:
shapeSizePx
- int[2] shape size in pixel as retrieved via e.g.getSurfaceSize(com.jogamp.graph.ui.Scene.PMVMatrixSetup, Recti, PMVMatrix4f, int[])
pixPerShape
- float[2] pixel scaled per shape-coordinate unit result storage- Returns:
- given float[2]
pixPerShape
- See Also:
getPixelPerShapeUnit(Scene, PMVMatrix4f, float[])
,getSurfaceSize(com.jogamp.graph.ui.Scene.PMVMatrixSetup, Recti, PMVMatrix4f, int[])
,getScaledWidth()
,getScaledHeight()
-
getPixelPerShapeUnit
public final float[] getPixelPerShapeUnit(com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, float[] pixPerShape)
Retrieve pixel per scaled shape-coordinate unit, i.e. [px]/[obj].The given
PMVMatrix4f
has to be setup properly for this object, i.e. itsGLMatrixFunc.GL_PROJECTION
andGLMatrixFunc.GL_MODELVIEW
for the surrounding scene including this shape'sapplyMatToMv(PMVMatrix4f)
. SeesetPMVMatrix(Scene, PMVMatrix4f)
.- Parameters:
pmv
- well formedPMVMatrix4f
, e.g. could have been setup viasetPMVMatrix(Scene, PMVMatrix4f)
.viewport
- the int[4] viewportpixPerShape
- float[2] pixel per scaled shape-coordinate unit result storage- Returns:
- given float[2]
pixPerShape
for successfulgluProject(..)
operation, otherwisenull
- See Also:
getPixelPerShapeUnit(int[], float[])
,getSurfaceSize(Scene, PMVMatrix4f, int[])
,getScaledWidth()
,getScaledHeight()
-
getPixelPerShapeUnit
public final float[] getPixelPerShapeUnit(Scene scene, com.jogamp.math.util.PMVMatrix4f pmv, float[] pixPerShape)
Retrieve pixel per scaled shape-coordinate unit, i.e. [px]/[obj].The given
PMVMatrix4f
will besetup
properly for this shape including this shape'sapplyMatToMv(PMVMatrix4f)
.- Parameters:
scene
-Scene
to retrieveScene.PMVMatrixSetup
and the viewport.pmv
- a newPMVMatrix4f
which willbe setup
,shape-transformed
and can be reused by the caller.pixPerShape
- float[2] pixel per scaled shape-coordinate unit result storage- Returns:
- given float[2]
pixPerShape
for successfulgluProject(..)
operation, otherwisenull
- See Also:
getPixelPerShapeUnit(int[], float[])
,getSurfaceSize(Scene, PMVMatrix4f, int[])
,getScaledWidth()
,getScaledHeight()
-
shapeToWinCoord
public final int[] shapeToWinCoord(com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, com.jogamp.math.Vec3f objPos, int[] glWinPos)
Map given object coordinate relative to this shape to window coordinates.The given
PMVMatrix4f
has to be setup properly for this object, i.e. itsGLMatrixFunc.GL_PROJECTION
andGLMatrixFunc.GL_MODELVIEW
for the surrounding scene including this shape'sapplyMatToMv(PMVMatrix4f)
. SeesetPMVMatrix(Scene, PMVMatrix4f)
.- Parameters:
pmv
- well formedPMVMatrix4f
, e.g. could have been setup viasetPMVMatrix(Scene, PMVMatrix4f)
.viewport
- the viewportobjPos
- object position relative to this shape's centerglWinPos
- int[2] target window position of objPos relative to this shape- Returns:
- given int[2]
glWinPos
for successfulgluProject(..)
operation, otherwisenull
- See Also:
#shapeToWinCoord(com.jogamp.graph.ui.Scene.PMVMatrixSetup, Recti, float[], PMVMatrix4f, int[])
,#shapeToWinCoord(Scene, float[], PMVMatrix4f, int[])
-
shapeToWinCoord
public final int[] shapeToWinCoord(Scene.PMVMatrixSetup pmvMatrixSetup, com.jogamp.math.Recti viewport, com.jogamp.math.Vec3f objPos, com.jogamp.math.util.PMVMatrix4f pmv, int[] glWinPos)
Map given object coordinate relative to this shape to window coordinates.The given
PMVMatrix4f
will besetup
properly for this shape including this shape'sapplyMatToMv(PMVMatrix4f)
.- Parameters:
pmvMatrixSetup
-Scene.PMVMatrixSetup
tosetup
givenPMVMatrix4f
pmv
.viewport
- used viewport forPMVMatrix4f.mapObjToWin(Vec3f, Recti, Vec3f)
objPos
- object position relative to this shape's centerpmv
- a newPMVMatrix4f
which willbe setup
,shape-transformed
and can be reused by the caller.glWinPos
- int[2] target window position of objPos relative to this shape- Returns:
- given int[2]
glWinPos
for successfulgluProject(..)
operation, otherwisenull
- See Also:
#shapeToWinCoord(PMVMatrix4f, Recti, float[], int[])
,#shapeToWinCoord(Scene, float[], PMVMatrix4f, int[])
-
shapeToWinCoord
public final int[] shapeToWinCoord(Scene scene, com.jogamp.math.Vec3f objPos, com.jogamp.math.util.PMVMatrix4f pmv, int[] glWinPos)
Map given object coordinate relative to this shape to window coordinates.The given
PMVMatrix4f
will besetup
properly for this shape including this shape'sapplyMatToMv(PMVMatrix4f)
.- Parameters:
scene
-Scene
to retrieveScene.PMVMatrixSetup
and the viewport.objPos
- object position relative to this shape's centerpmv
- a newPMVMatrix4f
which willbe setup
,shape-transformed
and can be reused by the caller.glWinPos
- int[2] target window position of objPos relative to this shape- Returns:
- given int[2]
glWinPos
for successfulgluProject(..)
operation, otherwisenull
- See Also:
#shapeToWinCoord(PMVMatrix4f, Recti, float[], int[])
,#shapeToWinCoord(com.jogamp.graph.ui.Scene.PMVMatrixSetup, Recti, float[], PMVMatrix4f, int[])
-
winToShapeCoord
public final com.jogamp.math.Vec3f winToShapeCoord(com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Recti viewport, int glWinX, int glWinY, com.jogamp.math.Vec3f objPos)
Map given gl-window-coordinates to object coordinates relative to this shape and its z-coordinate.The given
PMVMatrix4f
has to be setup properly for this object, i.e. itsGLMatrixFunc.GL_PROJECTION
andGLMatrixFunc.GL_MODELVIEW
for the surrounding scene including this shape'sapplyMatToMv(PMVMatrix4f)
. SeesetPMVMatrix(Scene, PMVMatrix4f)
.- Parameters:
pmv
- well formedPMVMatrix4f
, e.g. could have been setup viasetPMVMatrix(Scene, PMVMatrix4f)
.viewport
- the Rect4i viewportglWinX
- in GL window coordinates, origin bottom-leftglWinY
- in GL window coordinates, origin bottom-leftobjPos
- target object position of glWinX/glWinY relative to this shape- Returns:
- given
objPos
for successfulgluProject(..)
andgluUnProject(..)
operation, otherwisenull
- See Also:
#winToShapeCoord(com.jogamp.graph.ui.Scene.PMVMatrixSetup, Recti, int, int, PMVMatrix4f, float[])
,#winToShapeCoord(Scene, int, int, PMVMatrix4f, float[])
-
winToShapeCoord
public final com.jogamp.math.Vec3f winToShapeCoord(Scene.PMVMatrixSetup pmvMatrixSetup, com.jogamp.math.Recti viewport, int glWinX, int glWinY, com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Vec3f objPos)
Map given gl-window-coordinates to object coordinates relative to this shape and its z-coordinate.The given
PMVMatrix4f
will besetup
properly for this shape including this shape'sapplyMatToMv(PMVMatrix4f)
.- Parameters:
pmvMatrixSetup
-Scene.PMVMatrixSetup
tosetup
givenPMVMatrix4f
pmv
.viewport
- used viewport forPMVMatrix4f.mapWinToObj(float, float, float, Recti, Vec3f)
glWinX
- in GL window coordinates, origin bottom-leftglWinY
- in GL window coordinates, origin bottom-leftpmv
- a newPMVMatrix4f
which willbe setup
,shape-transformed
and can be reused by the caller.objPos
- target object position of glWinX/glWinY relative to this shape- Returns:
- given
objPos
for successfulgluProject(..)
andgluUnProject(..)
operation, otherwisenull
- See Also:
#winToShapeCoord(PMVMatrix4f, Recti, int, int, float[])
,#winToShapeCoord(Scene, int, int, PMVMatrix4f, float[])
-
winToShapeCoord
public final com.jogamp.math.Vec3f winToShapeCoord(Scene scene, int glWinX, int glWinY, com.jogamp.math.util.PMVMatrix4f pmv, com.jogamp.math.Vec3f objPos)
Map given gl-window-coordinates to object coordinates relative to this shape and its z-coordinate.The given
PMVMatrix4f
will besetup
properly for this shape including this shape'sapplyMatToMv(PMVMatrix4f)
.- Parameters:
scene
-Scene
to retrieveScene.PMVMatrixSetup
and the viewport.glWinX
- in GL window coordinates, origin bottom-leftglWinY
- in GL window coordinates, origin bottom-leftpmv
- a newPMVMatrix4f
which willbe setup
,shape-transformed
and can be reused by the caller.objPos
- target object position of glWinX/glWinY relative to this shape- Returns:
- given
objPos
for successfulgluProject(..)
andgluUnProject(..)
operation, otherwisenull
- See Also:
#winToShapeCoord(PMVMatrix4f, Recti, int, int, float[])
,#winToShapeCoord(com.jogamp.graph.ui.Scene.PMVMatrixSetup, Recti, int, int, PMVMatrix4f, float[])
-
getColor
public final com.jogamp.math.Vec4f getColor()
Returns base-color w/o color channel, will be modulated w/getPressedColorMod()
,getToggleOnColorMod()
,getToggleOffColorMod()
andgetActiveColorMod()
.
-
getPressedColorMod
public final com.jogamp.math.Vec4f getPressedColorMod()
Returns modulation color whenisPressed()
.
-
getToggleOnColorMod
public final com.jogamp.math.Vec4f getToggleOnColorMod()
Returns modulation color whenisToggleOn()
.
-
getToggleOffColorMod
public final com.jogamp.math.Vec4f getToggleOffColorMod()
Returns modulation color when notisToggleOn()
.
-
getActiveColorMod
public final com.jogamp.math.Vec4f getActiveColorMod()
Returns modulation color whenisActive()
.
-
setColor
public Shape setColor(float r, float g, float b, float a)
Set base color.Base color w/o color channel, will be modulated w/ pressed- and toggle color
Default RGBA value is 0.60f, 0.60f, 0.60f, 1.0f
Method issues
markShapeDirty()
.- See Also:
markShapeDirty()
-
setColor
public Shape setColor(com.jogamp.math.Vec4f c)
Set base color.Default base-color w/o color channel, will be modulated w/ pressed- and toggle color
Default RGBA value is 0.60f, 0.60f, 0.60f, 1.0f
Method issues
markShapeDirty()
.- See Also:
markShapeDirty()
-
setPressedColorMod
public Shape setPressedColorMod(float r, float g, float b, float a)
Set pressed color, modulatinggetColor()
ifisPressed()
.Default pressed color, modulation -factor w/o color channel, modulated base-color. ~0.65 (due to alpha)
Default RGBA value is 0.70f, 0.70f, 0.70f, 0.8f
-
setToggleOnColorMod
public final Shape setToggleOnColorMod(float r, float g, float b, float a)
Set toggle-on color, modulatinggetColor()
ifisToggleOn()
andsetToggleable(boolean)
Default toggle-on color-factor w/o color channel, modulated base-color. 0.60 * 0.83 ~= 0.50
Default RGBA value is 0.83f, 0.83f, 0.83f, 1.0f
-
setToggleOffColorMod
public final Shape setToggleOffColorMod(float r, float g, float b, float a)
Set toggle-off color, modulatinggetColor()
if !isToggleOn()
andsetToggleable(boolean)
Default toggle-off color-factor w/o color channel, modulated base-color. 0.60 * 1.00 ~= 0.60
Default RGBA value is 1.00f, 1.00f, 1.00f, 1.0f
-
setActiveColorMod
public final Shape setActiveColorMod(com.jogamp.math.Vec4f c)
Enable active color, modulationgetColor()
ifisActive()
with passingc != null
, disable with passingc == null
.Default active color-factor w/o color channel, modulated base-color. 0.60 * 0.25 ~= 0.15
Default is disabled.
-
getBorderColor
public final com.jogamp.math.Vec4f getBorderColor()
-
setBorderColor
public final Shape setBorderColor(float r, float g, float b, float a)
Set border color.Default RGBA value is 0.00f, 0.00f, 0.00f, 1.0f
Method issues
markShapeDirty()
.- See Also:
setBorder(float)
,markShapeDirty()
-
setBorderColor
public final Shape setBorderColor(com.jogamp.math.Vec4f c)
Set border color.Default RGBA value is 0.00f, 0.00f, 0.00f, 1.0f
Method issues
markShapeDirty()
.- See Also:
setBorder(float)
,markShapeDirty()
-
getSubString
public String getSubString()
-
setPressed
public final Shape setPressed(boolean b)
-
isPressed
public final boolean isPressed()
-
setToggleable
public final Shape setToggleable(boolean toggleable)
Set this shape toggleable, default is off.- Parameters:
toggleable
-- See Also:
isInteractive()
-
isToggleable
public boolean isToggleable()
Returns true if this shape is toggable, i.e. rendered w/setToggleOnColorMod(float, float, float, float)
orsetToggleOffColorMod(float, float, float, float)
.- See Also:
isInteractive()
-
setToggle
public final Shape setToggle(boolean v)
Set this shape's toggle state, default is off.- Parameters:
v
-- Returns:
-
toggle
public final Shape toggle()
-
isToggleOn
public final boolean isToggleOn()
Returns true this shape's toggle state.
-
isActive
public final boolean isActive()
Returns true of this shape is active
-
getAdjustedZ
public final float getAdjustedZ()
-
setToolTip
public Tooltip setToolTip(Tooltip newTooltip)
Set's a newTooltip
for this shape.The
Shape
must be setinteractive
to receive the mouse-over signal, i.e. being picked.
-
removeToolTip
public void removeToolTip()
-
getTooltip
public Tooltip getTooltip()
-
setInteractive
public final Shape setInteractive(boolean v)
Set whether this shape is interactive in general, i.e. any user interaction like -isToggleable()
-isDraggable()
-isResizable()
but excluding programmatic changes.- Parameters:
v
- new value forisInteractive()
- See Also:
isInteractive()
,isVisible()
,setDraggable(boolean)
,setResizable(boolean)
,setDragAndResizable(boolean)
-
isInteractive
public final boolean isInteractive()
Returns if this shape allows user interaction in general, seesetInteractive(boolean)
- See Also:
setInteractive(boolean)
,isVisible()
-
setActivable
public final Shape setActivable(boolean v)
Set whether this shape is allowed to be activated, i.e becomeisActive()
.A non activable shape still allows a shape to be dragged or resized, it just can't gain the main focus.
-
isActivable
public final boolean isActivable()
Returns if this shape is allowed to be activated, i.e becomeisActive()
.
-
setDiscarded
public final Shape setDiscarded(boolean v)
Set whether this shape is discarded in lastdraw(GL2ES2, RegionRenderer)
, i.e. culled via frustum or occlusion criteria.
-
isDiscarded
public final boolean isDiscarded()
Returns whether this shape is discarded in lastdraw(GL2ES2, RegionRenderer)
, i.e. culled via frustum or occlusion criteria.
-
setDraggable
public final Shape setDraggable(boolean draggable)
Set whether this shape is draggable, i.e. translated by 1-pointer-click and drag.Default draggable is true.
-
isDraggable
public final boolean isDraggable()
Returns if this shape is draggable, a user interaction.- See Also:
setDraggable(boolean)
-
setResizable
public final Shape setResizable(boolean resizable)
Set whether this shape is resizable, i.e. zoomed by 1-pointer-click and drag in 1/4th bottom-left and bottom-right corner.Default resizable is true.
-
isResizable
public final boolean isResizable()
Returns if this shape is resizable, a user interaction.- See Also:
setResizable(boolean)
-
isFixedARatioResize
public final boolean isFixedARatioResize()
Returns if aspect-ratio shall be kept at resize, ifisResizable()
.- See Also:
setFixedARatioResize(boolean)
-
setFixedARatioResize
public final Shape setFixedARatioResize(boolean v)
Sets whether aspect-ratio shall be kept at resize, ifisResizable()
.- See Also:
isResizable()
,isFixedARatioResize()
-
setDragAndResizable
public final Shape setDragAndResizable(boolean v)
Set whether this shape is draggable and resizable.Default draggable and resizable is true.
-
addMouseListener
public final Shape addMouseListener(Shape.MouseGestureListener l)
-
removeMouseListener
public final Shape removeMouseListener(Shape.MouseGestureListener l)
-
receiveMouseEvents
public void receiveMouseEvents(Shape source)
ForwardShape.MouseGestureListener
events to thisShape
fromsource
using aShape.ForwardMouseListener
.This source
Shape
must besetInteractive(boolean)
to receive and forward the events.This receiver
Shape
must besetInteractive(boolean)
to have the events forwarded.- See Also:
receiveKeyEvents(Shape)
-
addKeyListener
public final Shape addKeyListener(KeyListener l)
-
removeKeyListener
public final Shape removeKeyListener(KeyListener l)
-
receiveKeyEvents
public void receiveKeyEvents(Shape source)
ForwardKeyListener
events to thisShape
fromsource
using aShape.ForwardKeyListener
.This source
Shape
must besetInteractive(boolean)
to receive and forward the events.This receiver
Shape
must besetInteractive(boolean)
to have the events forwarded.- See Also:
receiveMouseEvents(Shape)
-
hasColorChannel
public abstract 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[])
. Otherwise the base color will be modulated and passed to#drawImpl0(GL2ES2, RegionRenderer, float[])
.
-
-