Class GUIFrame
java.lang.Object
com.blackrook.gui.GUIObject
com.blackrook.gui.object.GUIPanel
com.blackrook.gui.object.GUIGlassPanel
com.blackrook.gui.object.GUIFrame
A "framed" pane object that already adds the frame
elements around the object, as well as a means to
make the frame resizable around its edges, and draggable
at its top.
- Author:
- Matthew Tropiano
-
Nested Class Summary
Nested classes/interfaces inherited from class GUIObject
GUIObject.ScaleType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of bottom-center panel.static final StringName of bottom-left panel.static final StringName of bottom-right panel.static final StringName of content panel.static final StringName of middle-left panel.static final StringName of middle-right panel.static final StringName of top-center panel.static final StringName of top-left panel.static final StringName of top-right panel.Fields inherited from class GUIObject
absoluteBounds, EVENT_BLUR, EVENT_CHANGE_ENABLE_STATE, EVENT_CHANGE_VISIBLE_STATE, EVENT_FOCUS, EVENT_GAMEPAD_AXIS, EVENT_GAMEPAD_PRESS, EVENT_GAMEPAD_RELEASE, EVENT_GAMEPAD_TAP_PRESS, EVENT_GAMEPAD_TAP_RELEASE, EVENT_GENERIC_INPUT, EVENT_KEY_PRESS, EVENT_KEY_RELEASE, EVENT_KEY_TYPE, EVENT_MOUSE_CLICK, EVENT_MOUSE_DRAG, EVENT_MOUSE_LEAVE, EVENT_MOUSE_MOVE, EVENT_MOUSE_OVER, EVENT_MOUSE_PRESS, EVENT_MOUSE_RELEASE, EVENT_MOUSE_WHEEL, EVENT_NAMED, EVENT_UNKNOWN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected floatcorrectMouseMoveX(float mouseX, float width) Gets the corrected X coordinate for a mouse movement.protected floatcorrectMouseMoveY(float mouseY, float height) Gets the corrected Y coordinate for a mouse movement.voidsetDraggable(boolean draggable) Sets if this is draggable by dragging the mouse at the top center panel.This uses a special layout; to preserve it, this throws UnsupportedOperationException.voidsetResizable(boolean resizable) Sets if this is resizable by dragging the mouse at the edges.Methods inherited from class GUIGlassPanel
getRenderedMethods inherited from class GUIPanel
getThemeKey, setThemeKeyMethods inherited from class GUIObject
addChild, addChild, addName, addToRenderSet, animate, animate, animate, animateAbort, animateDelay, animateFinish, bindAction, callAction, correctPosition, fireEvent, getAbsoluteBounds, getAsQuery, getBounds, getChildrenAsQuery, getColor, getColorNotInherited, getDescendantsAsQuery, getFinalOpacity, getGeneration, getGUI, getLayout, getLayoutAttrib, getNativeBounds, getOpacity, getParent, getParentAsQuery, getRenderAlpha, getRenderBlue, getRenderGreen, getRenderHeight, getRenderPositionX, getRenderPositionY, getRenderRadius, getRenderRed, getRenderRotationZ, getRenderTextureScaleS, getRenderTextureScaleT, getRenderWidth, getScaleType, getSiblingsAsQuery, getTexture, getTheme, getVisible, hasAction, hasName, hasNamePattern, isAnimating, isConstrainedToParent, isEnabled, isFocused, isInert, isVisible, moveDown, moveToBack, moveToFront, moveUp, onGUIChange, releaseFocus, remove, removeChild, removeName, requestFocus, resizeChildren, rotate, setBounds, setBounds, setBoundsByChildren, setColor, setColor, setColorNotInherited, setConstrainToParent, setDimensions, setEnabled, setInert, setLayoutAttrib, setOpacity, setPosition, setRendered, setRotationZ, setScaleType, setTexture, setTheme, setVisible, stretch, toString, translate, unbindAction, unbindAllActions, updateDirty, updateScenePosition, useRenderRadius
-
Field Details
-
TOP_LEFT_NAME
-
TOP_CENTER_NAME
-
TOP_RIGHT_NAME
-
BOTTOM_LEFT_NAME
-
BOTTOM_CENTER_NAME
-
BOTTOM_RIGHT_NAME
-
MIDDLE_LEFT_NAME
-
MIDDLE_RIGHT_NAME
-
CONTENT_NAME
-
-
Constructor Details
-
GUIFrame
public GUIFrame(float thickness) Creates a new GUI panel.- Parameters:
thickness- the thickness of the outer frame in units.
-
GUIFrame
public GUIFrame(float width, float height, float thickness) Creates a new GUI object.- Parameters:
width- its width.height- its height.thickness-
-
GUIFrame
public GUIFrame(float x, float y, float width, float height, float thickness) Creates a new GUI object.- Parameters:
x- its position x.y- its position y.width- its width.height- its height.thickness- the border thickness.
-
-
Method Details
-
correctMouseMoveX
protected float correctMouseMoveX(float mouseX, float width) Gets the corrected X coordinate for a mouse movement.- Parameters:
mouseX- the mouse X coordinate.width- the frame element width.- Returns:
- the resultant value.
-
correctMouseMoveY
protected float correctMouseMoveY(float mouseY, float height) Gets the corrected Y coordinate for a mouse movement.- Parameters:
mouseY- the mouse Y coordinate.height- the frame element height.- Returns:
- the resultant value.
-
setLayout
This uses a special layout; to preserve it, this throws UnsupportedOperationException.- Overrides:
setLayoutin classGUIObject- Parameters:
layout- the layout to use.- Returns:
- itself, to chain calls.
- Throws:
UnsupportedOperationException- if called.
-
setResizable
public void setResizable(boolean resizable) Sets if this is resizable by dragging the mouse at the edges.- Parameters:
resizable-
-
setDraggable
public void setDraggable(boolean draggable) Sets if this is draggable by dragging the mouse at the top center panel.- Parameters:
draggable-
-
getTopLeftPanel
- Returns:
- the reference to the top-left panel in the frame.
-
getTopCenterPanel
- Returns:
- the reference to the top-center panel in the frame.
-
getTopRightPanel
- Returns:
- the reference to the top-right panel in the frame.
-
getBottomLeftPanel
- Returns:
- the reference to the bottom-left panel in the frame.
-
getBottomCenterPanel
- Returns:
- the reference to the bottom-center panel in the frame.
-
getBottomRightPanel
- Returns:
- the reference to the bottom-right panel in the frame.
-
getMiddleLeftPanel
- Returns:
- the reference to the middle-left panel in the frame.
-
getMiddleRightPanel
- Returns:
- the reference to the middle-right panel in the frame.
-
getContentPanel
- Returns:
- the reference to the content (middle) panel in the frame.
-