Package com.ardor3d.extension.ui
Class UIFrame
java.lang.Object
com.ardor3d.scenegraph.Spatial
com.ardor3d.scenegraph.Node
com.ardor3d.extension.ui.UIComponent
com.ardor3d.extension.ui.UIContainer
com.ardor3d.extension.ui.UIFrame
- All Implemented Interfaces:
UIKeyHandler
,Hintable
,Savable
A component similar to an inner frame in Swing. It can be dragged around the screen, minimized, expanded, closed, and
resized. Frames can also have their opacity individually assigned which will affect all elements drawn within them.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enumeration of possible frame chrome buttons. -
Field Summary
Fields inherited from class com.ardor3d.extension.ui.UIContainer
_textureRenderer, STANDIN_TEXTURE_SIZE
Fields inherited from class com.ardor3d.extension.ui.UIComponent
_tooltipPopTime, _tooltipText, DEFAULT_FOREGROUND_COLOR
Fields inherited from class com.ardor3d.scenegraph.Spatial
_controllers, _delegateMap, _dirtyMark, _frustumIntersects, _listener, _localTransform, _name, _parent, _queueDistance, _renderStateList, _sceneHints, _userData, _worldBound, _worldTransform, ON_DIRTY_ATTACHED, ON_DIRTY_BOUNDING, ON_DIRTY_RENDERSTATE, ON_DIRTY_TRANSFORM, ON_DIRTY_TRANSFORM_ONLY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Override to provide an action to take when this component or its top level component are attached to a UIHud.void
close()
Remove this frame from the hud it is attached to.void
Override to provide an action to take just before this component or its top level component are removed from a UIHud.static UIFrame
findParentFrame
(UIComponent component) Recursive convenience method for locating the first UIFrame above a given component.getTitle()
boolean
boolean
boolean
boolean
void
maximize()
void
pack()
Resize the container to fit the minimum size of its content panel.static void
resetTextureRenderer
(Object queueKey) Causes our shared texture renderer - used to draw cached versions of all frames - to be recreated on the next render loop.void
restore()
void
setContentPanel
(UIPanel panel) Replaces the content panel of this frame with a new one.void
setDecorated
(boolean decorated) void
setDraggable
(boolean draggable) void
setDragListener
(DragListener listener) Set a new drag listener on this frame.void
setResizeable
(boolean resizeable) void
Sets the title of this frameMethods inherited from class com.ardor3d.extension.ui.UIContainer
add, clearStandin, contains, contains, detachAllChildren, draw, drawComponent, fireComponentDirty, fireStyleChanged, getLayout, getMinificationFilter, getUIComponent, isDirty, isDoClip, isDrawingStandin, isUseStandin, layout, remove, removeAllComponents, setDirty, setDoClip, setLayout, setMinificationFilter, setUseStandin, updateMinimumSizeFromContents
Methods inherited from class com.ardor3d.extension.ui.UIComponent
addFontStyle, applySkin, cancelTooltipTimer, centerOn, centerOn, clearFontStyle, clearMaximumContentSize, clearMinimumContentSize, compact, fitComponentIn, gainedFocus, getBackdrop, getBorder, getCombinedOpacity, getContentHeight, getContentWidth, getCurrentOpacity, getDefaultFontFamily, getDefaultFontSize, getDefaultFontStyles, getFontStyles, getForegroundColor, getHud, getHudX, getHudY, getKeyFocusTarget, getLayoutData, getLocalComponentHeight, getLocalComponentWidth, getLocalFontStyles, getLocalForegroundColor, getLocalOpacity, getLocalX, getLocalY, getMargin, getMaximumContentHeight, getMaximumContentWidth, getMaximumLocalComponentHeight, getMaximumLocalComponentWidth, getMinimumContentHeight, getMinimumContentWidth, getMinimumLocalComponentHeight, getMinimumLocalComponentWidth, getPadding, getRelativeComponentBounds, getRelativeMaxComponentBounds, getRelativeMinComponentBounds, getTooltipPopTime, getTooltipText, getTopLevelComponent, getTotalBottom, getTotalLeft, getTotalRight, getTotalTop, hasVirginContentArea, insideMargin, isAttachedToHUD, isConsumeKeyEvents, isConsumeMouseEvents, isEnabled, isUseTransparency, isVisible, keyHeld, keyPressed, keyReleased, lostFocus, mouseClicked, mouseDeparted, mouseEntered, mouseMoved, mousePressed, mouseReleased, mouseWheel, postdrawComponent, predrawComponent, requestFocus, setBackdrop, setBorder, setConsumeKeyEvents, setConsumeMouseEvents, setContentHeight, setContentSize, setContentWidth, setDefaultFontFamily, setDefaultFontSize, setDefaultFontStyles, setEnabled, setFontStyles, setForegroundColor, setHudX, setHudXY, setHudY, setKeyFocusTarget, setLayoutData, setLayoutMinimumContentSize, setLocalComponentHeight, setLocalComponentSize, setLocalComponentWidth, setLocalX, setLocalXY, setLocalY, setMargin, setMaximumContentHeight, setMaximumContentSize, setMaximumContentWidth, setMinimumContentHeight, setMinimumContentSize, setMinimumContentWidth, setOpacity, setPadding, setTooltipPopTime, setTooltipText, setUseTransparency, setVirginContentArea, setVisible, updateWorldTransform, updateWorldTransform, validateContentSize
Methods inherited from class com.ardor3d.scenegraph.Node
acceptVisitor, attachChild, attachChildAt, detachChild, detachChildAt, detachChildNamed, getChild, getChild, getChildIndex, getChildren, getClassTag, getNumberOfChildren, hasChild, makeCopy, makeInstanced, propagateDirtyDown, read, sortLights, swapChildren, updateChildren, updateWorldBound, updateWorldRenderStates, write
Methods inherited from class com.ardor3d.scenegraph.Spatial
addController, addTranslation, addTranslation, applyWorldRenderStates, clearControllers, clearDirty, clearDirty, clearRenderState, getController, getControllerCount, getControllers, getCurrentRenderDelegate, getLastFrustumIntersection, getListener, getLocalLastFrustumIntersection, getLocalRenderState, getLocalRenderStates, getName, getParent, getParentHintable, getRenderDelegate, getRotation, getScale, getSceneHints, getTransform, getTranslation, getUserData, getWorldBound, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, isDirty, localToWorld, markDirty, markDirty, onDraw, propagateBoundToRoot, propagateDirtyUp, propagateStatesFromRoot, propageEventUp, removeController, removeController, removeFromParent, setLastFrustumIntersection, setListener, setName, setParent, setRenderDelegate, setRenderState, setRotation, setRotation, setScale, setScale, setScale, setTransform, setTranslation, setTranslation, setUserData, setWorldRotation, setWorldRotation, setWorldScale, setWorldScale, setWorldScale, setWorldTransform, setWorldTranslation, setWorldTranslation, toString, updateControllers, updateGeometricState, updateGeometricState, updateWorldRenderStates, worldToLocal
-
Constructor Details
-
UIFrame
Construct a new UIFrame with the given title and default buttons (CLOSE).- Parameters:
title
- the text to display on the title bar of this frame
-
UIFrame
Construct a new UIFrame with the given title and button.- Parameters:
title
- the text to display on the title bar of this framebuttons
- which buttons we should show in the frame bar.
-
-
Method Details
-
setDecorated
public void setDecorated(boolean decorated) - Parameters:
decorated
- true to show the title and status bars. False to remove both. Undecorated frames have no resize or drag handles, or close buttons, etc.
-
maximize
public void maximize() -
restore
public void restore() -
isDecorated
public boolean isDecorated()- Returns:
- true if this frame is decorated.
-
setResizeable
public void setResizeable(boolean resizeable) - Parameters:
resizeable
- true if we should allow resizing of this frame via a resize handle in the status bar. This does not stop programmatic resizing of this frame.
-
isResizeable
public boolean isResizeable()- Returns:
- true if this frame allows manual resizing.
-
setDraggable
public void setDraggable(boolean draggable) - Parameters:
draggable
- true if we should allow dragging of this frame via a frame bar.
-
isDraggable
public boolean isDraggable()- Returns:
- true if this frame allows dragging.
-
close
public void close()Remove this frame from the hud it is attached to.- Throws:
IllegalStateException
- if frame is not currently attached to a hud.
-
getTitleBar
- Returns:
- this frame's title bar
-
getStatusBar
- Returns:
- this frame's status bar
-
getContentPanel
- Returns:
- the center content panel of this frame.
-
getBasePanel
- Returns:
- the base panel of this frame which holds the content panel and status bar.
-
setContentPanel
Replaces the content panel of this frame with a new one.- Parameters:
panel
- the new content panel.
-
getTitle
- Returns:
- the current title of this frame
-
setTitle
Sets the title of this frame- Parameters:
title
- the new title
-
attachedToHud
public void attachedToHud()Description copied from class:UIComponent
Override to provide an action to take when this component or its top level component are attached to a UIHud.- Overrides:
attachedToHud
in classUIContainer
-
detachedFromHud
public void detachedFromHud()Description copied from class:UIComponent
Override to provide an action to take just before this component or its top level component are removed from a UIHud.- Overrides:
detachedFromHud
in classUIContainer
-
pack
public void pack()Description copied from class:UIComponent
Resize the container to fit the minimum size of its content panel.- Overrides:
pack
in classUIComponent
-
resetTextureRenderer
Causes our shared texture renderer - used to draw cached versions of all frames - to be recreated on the next render loop.- Parameters:
queueKey
- the queue key
-
findParentFrame
Recursive convenience method for locating the first UIFrame above a given component.- Parameters:
component
- the component to look above.- Returns:
- the first UIFrame found above the given component, or null if none.
-
setDragListener
Set a new drag listener on this frame.- Parameters:
listener
- the drag listener. Must not be null.
-
isMaximized
public boolean isMaximized()
-