public class Panel
extends com.jme3.scene.Node
"Panels" are often thought about in 2D terms but the Lemur default Panel is not limited to 2D. It's behavior depends entirely on the background component, which could be a simple 2D quad using a QuadComponent or something more complicated that is fully 3D.
By default, Lemur GUI elements are setup so that their local translation determines the position of their top-left corner in x/y space. In other words, the y-axis acts a little differently than other axes in that it grows down instead of up. Within an element, the coordinate system is still the standard JME coordinate system. It's just how the elements are are arranged relative to their own local translation that is different. This makes multi-element layouts more sensible or consistent with other GUI libraries.
Note: the layout code currently assumes that rotation and scale are their default values.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EFFECT_CLOSE |
static java.lang.String |
EFFECT_OPEN |
static java.lang.String |
ELEMENT_ID |
static java.lang.String |
LAYER_BACKGROUND |
static java.lang.String |
LAYER_BORDER |
static java.lang.String |
LAYER_INSETS |
batchHint, controls, cullHint, frustrumIntersects, key, localLights, localOverrides, localTransform, name, parent, queueBucket, queueDistance, refreshFlags, RF_BOUND, RF_CHILD_LIGHTLIST, RF_LIGHTLIST, RF_MATPARAM_OVERRIDE, RF_TRANSFORM, shadowMode, userData, worldBound, worldLights, worldOverrides, worldTransform
Modifier | Constructor and Description |
---|---|
|
Panel() |
protected |
Panel(boolean applyStyles,
ElementId elementId,
java.lang.String style)
This is the constructure that subclasses should call as it allows
them to bypass the default style application and apply
styles themselves.
|
protected |
Panel(boolean applyStyles,
float width,
float height,
ElementId elementId,
java.lang.String style) |
|
Panel(ElementId elementId,
java.lang.String style) |
|
Panel(float width,
float height) |
|
Panel(float width,
float height,
com.jme3.math.ColorRGBA backgroundColor) |
|
Panel(float width,
float height,
com.jme3.math.ColorRGBA backgroundColor,
java.lang.String style) |
|
Panel(float width,
float height,
ElementId elementId,
java.lang.String style) |
|
Panel(float width,
float height,
java.lang.String style) |
|
Panel(java.lang.String style) |
Modifier and Type | Method and Description |
---|---|
void |
addEffect(java.lang.String effectName,
Effect<? super Panel> effect)
Adds the specified effect to this GUI element.
|
void |
addMouseListener(MouseListener l) |
float |
getAlpha()
Returns an estimate of the current alpha multiplier for the child
components.
|
GuiComponent |
getBackground() |
GuiComponent |
getBorder() |
protected EffectControl<Panel> |
getEffectControl()
Provides convenient access to the EffectControl...
|
java.util.Map<java.lang.String,Effect<? super Panel>> |
getEffects()
Returns a read-only view of the entire map of effects for this GUI element.
|
ElementId |
getElementId() |
Insets3f |
getInsets() |
InsetsComponent |
getInsetsComponent() |
com.jme3.math.Vector3f |
getPreferredSize() |
com.jme3.math.Vector3f |
getSize() |
java.lang.String |
getStyle() |
boolean |
hasEffect(java.lang.String effectName)
Returns true if this GUI element has the specified effect
configured.
|
static void |
initializeDefaultStyles(Attributes attrs) |
Effect<? super Panel> |
removeEffect(java.lang.String effectName)
Removes a previously registered effect if it exists.
|
void |
removeMouseListener(MouseListener l) |
boolean |
runEffect(java.lang.String effectName)
Runs the specified effect if configured for this GUI element.
|
void |
setAlpha(float alpha)
Sets the alpha multiplier for all ColoredComponents in this
panels component stack, including things like QuadBackgroundComponent,
TextComponent, etc..
|
void |
setAlpha(float alpha,
boolean recursive)
Sets the alpha multiplier for all ColoredComponents in this
panels component stack, including things like QuadBackgroundComponent,
TextComponent, etc..
|
void |
setBackground(GuiComponent bg) |
void |
setBorder(GuiComponent bg) |
protected void |
setChildAlpha(com.jme3.scene.Spatial child,
float alpha) |
void |
setEffects(java.util.Map<java.lang.String,Effect<? super Panel>> map)
Adds multiple effects at once through a stylable attribute.
|
void |
setInsets(Insets3f i) |
void |
setInsetsComponent(InsetsComponent ic) |
void |
setPreferredSize(com.jme3.math.Vector3f size) |
void |
setSize(com.jme3.math.Vector3f size) |
java.lang.String |
toString() |
attachChild, attachChildAt, breadthFirstTraversal, clone, cloneFields, collideWith, deepClone, depthFirstTraversal, descendantMatches, descendantMatches, descendantMatches, detachAllChildren, detachChild, detachChildAt, detachChildNamed, getChild, getChild, getChildIndex, getChildren, getQuantity, getTriangleCount, getVertexCount, hasChild, oldDeepClone, read, setLightListRefresh, setLodLevel, setMaterial, setMatParamOverrideRefresh, setModelBound, setParent, setTransformRefresh, swapChildren, updateGeometricState, updateLogicalState, updateModelBound, updateWorldBound, write
addControl, addLight, addMatParamOverride, breadthFirstTraversal, center, checkCulling, clearMatParamOverrides, clone, forceRefresh, getBatchHint, getControl, getControl, getCullHint, getKey, getLastFrustumIntersection, getLocalBatchHint, getLocalCullHint, getLocalLightList, getLocalMatParamOverrides, getLocalQueueBucket, getLocalRotation, getLocalScale, getLocalShadowMode, getLocalToWorldMatrix, getLocalTransform, getLocalTranslation, getName, getNumControls, getParent, getQueueBucket, getShadowMode, getUserData, getUserDataKeys, getWorldBound, getWorldLightList, getWorldMatParamOverrides, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, jmeClone, localToWorld, lookAt, matches, move, move, oldClone, removeControl, removeControl, removeFromParent, removeLight, removeMatParamOverride, rotate, rotate, rotateUpTo, runControlRender, scale, scale, setBatchHint, setBoundRefresh, setCullHint, setKey, setLastFrustumIntersection, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalScale, setLocalTransform, setLocalTranslation, setLocalTranslation, setName, setQueueBucket, setRequiresUpdates, setShadowMode, setUserData, updateMatParamOverrides, updateWorldLightList, updateWorldTransforms, worldToLocal
public static final java.lang.String ELEMENT_ID
public static final java.lang.String LAYER_BACKGROUND
public static final java.lang.String LAYER_INSETS
public static final java.lang.String LAYER_BORDER
public static final java.lang.String EFFECT_OPEN
public static final java.lang.String EFFECT_CLOSE
public Panel()
public Panel(java.lang.String style)
public Panel(ElementId elementId, java.lang.String style)
public Panel(float width, float height)
public Panel(float width, float height, ElementId elementId, java.lang.String style)
public Panel(float width, float height, com.jme3.math.ColorRGBA backgroundColor)
public Panel(float width, float height, com.jme3.math.ColorRGBA backgroundColor, java.lang.String style)
public Panel(float width, float height, java.lang.String style)
protected Panel(boolean applyStyles, float width, float height, ElementId elementId, java.lang.String style)
protected Panel(boolean applyStyles, ElementId elementId, java.lang.String style)
public ElementId getElementId()
public java.lang.String getStyle()
public void setSize(com.jme3.math.Vector3f size)
public com.jme3.math.Vector3f getSize()
@StyleAttribute(value="preferredSize", lookupDefault=false) public void setPreferredSize(com.jme3.math.Vector3f size)
public com.jme3.math.Vector3f getPreferredSize()
public void addMouseListener(MouseListener l)
public void removeMouseListener(MouseListener l)
public static void initializeDefaultStyles(Attributes attrs)
@StyleAttribute(value="background", lookupDefault=false) public void setBackground(GuiComponent bg)
public GuiComponent getBackground()
@StyleAttribute(value="border", lookupDefault=false) public void setBorder(GuiComponent bg)
public GuiComponent getBorder()
@StyleAttribute(value="insets", lookupDefault=false) public void setInsets(Insets3f i)
public Insets3f getInsets()
@StyleAttribute(value="insetsComponent", lookupDefault=false) public void setInsetsComponent(InsetsComponent ic)
public InsetsComponent getInsetsComponent()
@StyleAttribute(value="alpha", lookupDefault=false) public void setAlpha(float alpha)
public void setAlpha(float alpha, boolean recursive)
protected void setChildAlpha(com.jme3.scene.Spatial child, float alpha)
public float getAlpha()
protected EffectControl<Panel> getEffectControl()
public boolean runEffect(java.lang.String effectName)
public void addEffect(java.lang.String effectName, Effect<? super Panel> effect)
public Effect<? super Panel> removeEffect(java.lang.String effectName)
public boolean hasEffect(java.lang.String effectName)
@StyleAttribute(value="effects", lookupDefault=false) public void setEffects(java.util.Map<java.lang.String,Effect<? super Panel>> map)
public java.util.Map<java.lang.String,Effect<? super Panel>> getEffects()
public java.lang.String toString()
toString
in class com.jme3.scene.Spatial