Class GUIProgressBar<T>
java.lang.Object
com.blackrook.gui.GUIObject
com.blackrook.gui.object.GUIPanel
com.blackrook.gui.object.GUIGlassPanel
com.blackrook.gui.object.GUIProgressBar<T>
- Type Parameters:
T-
- All Implemented Interfaces:
GUIValueField<T>
Implementation of a progress bar.
How much the bar is "filled" is according to the attached model and the current value on the bar. All child components on this bar are inert and do not respond to input, nor can be focused.
A transition type can be set on the bar, for animating the bar as it changes.
NOTE: The "thumb" object on the bar is NOT VISIBLE (setVisible(false)) by default!
This object and its descendants return specific theme keys depending on the current state of the bar.
Thumb:
| Horizontal | THEME_KEY_PROGRESS_THUMB_HORIZONTAL |
| Horizontal Inverse | THEME_KEY_PROGRESS_THUMB_HORIZONTAL_INVERSE |
| Vertical | THEME_KEY_PROGRESS_THUMB_VERTICAL |
| Vertical Inverse | THEME_KEY_PROGRESS_THUMB_VERTICAL_INVERSE |
Full Bar:
| Horizontal | THEME_KEY_PROGRESS_FULL_HORIZONTAL |
| Horizontal Inverse | THEME_KEY_PROGRESS_FULL_HORIZONTAL_INVERSE |
| Vertical | THEME_KEY_PROGRESS_FULL_VERTICAL |
| Vertical Inverse | THEME_KEY_PROGRESS_FULL_VERTICAL_INVERSE |
Empty Bar:
| Horizontal | THEME_KEY_PROGRESS_EMPTY_HORIZONTAL |
| Horizontal Inverse | THEME_KEY_PROGRESS_EMPTY_HORIZONTAL_INVERSE |
| Vertical | THEME_KEY_PROGRESS_EMPTY_VERTICAL |
| Vertical Inverse | THEME_KEY_PROGRESS_EMPTY_VERTICAL_INVERSE |
- Author:
- Matthew Tropiano
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class GUIObject
GUIObject.ScaleType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected TCurrent value.static final StringThe name given to the empty bar.protected GUIObjectInternal object for the empty bar.static final StringThe name given to the full bar.protected GUIObjectInternal object for the full bar.protected RangeModel<T> Bar model.protected GUIProgressBar.StyleBar style.static final StringTheme key for empty bar, horizontal.static final StringTheme key for empty bar, horizontal inverse.static final StringTheme key for empty bar, vertical.static final StringTheme key for empty bar, vertical inverse.static final StringTheme key for full bar, horizontal.static final StringTheme key for full bar, horizontal inverse.static final StringTheme key for full bar, vertical.static final StringTheme key for full bar, vertical inverse.static final StringTheme key for thumb, horizontal.static final StringTheme key for thumb, horizontal inverse.static final StringTheme key for thumb, vertical.static final StringTheme key for thumb, vertical inverse.static final StringThe name given to the thumb between the "full" and "empty" bars.protected GUIObjectInternal object for the thumb.protected longTransition time (time units).protected GUIEasingTypeTransition type.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_UNKNOWNFields inherited from interface GUIValueField
EVENT_VALUE_CHANGE -
Constructor Summary
ConstructorsConstructorDescriptionGUIProgressBar(RangeModel<T> model, GUIProgressBar.Style style) Creates a new progress bar using the provided model and style. -
Method Summary
Modifier and TypeMethodDescriptiongetStyle()longgetValue()This uses a special layout; to preserve it, this throws UnsupportedOperationException.voidsetTransitionTime(long transitionTime) Sets the current transition time in time units.voidsetTransitionType(GUIEasingType transitionType) Sets the current transition type.Sets this field's value.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
-
THEME_KEY_PROGRESS_THUMB_HORIZONTAL
Theme key for thumb, horizontal.- See Also:
-
THEME_KEY_PROGRESS_FULL_HORIZONTAL
Theme key for full bar, horizontal.- See Also:
-
THEME_KEY_PROGRESS_EMPTY_HORIZONTAL
Theme key for empty bar, horizontal.- See Also:
-
THEME_KEY_PROGRESS_THUMB_HORIZONTAL_INVERSE
Theme key for thumb, horizontal inverse.- See Also:
-
THEME_KEY_PROGRESS_FULL_HORIZONTAL_INVERSE
Theme key for full bar, horizontal inverse.- See Also:
-
THEME_KEY_PROGRESS_EMPTY_HORIZONTAL_INVERSE
Theme key for empty bar, horizontal inverse.- See Also:
-
THEME_KEY_PROGRESS_THUMB_VERTICAL
Theme key for thumb, vertical.- See Also:
-
THEME_KEY_PROGRESS_FULL_VERTICAL
Theme key for full bar, vertical.- See Also:
-
THEME_KEY_PROGRESS_EMPTY_VERTICAL
Theme key for empty bar, vertical.- See Also:
-
THEME_KEY_PROGRESS_THUMB_VERTICAL_INVERSE
Theme key for thumb, vertical inverse.- See Also:
-
THEME_KEY_PROGRESS_FULL_VERTICAL_INVERSE
Theme key for full bar, vertical inverse.- See Also:
-
THEME_KEY_PROGRESS_EMPTY_VERTICAL_INVERSE
Theme key for empty bar, vertical inverse.- See Also:
-
THUMB_NAME
The name given to the thumb between the "full" and "empty" bars.- See Also:
-
FULL_NAME
-
EMPTY_NAME
-
style
Bar style. -
transitionType
Transition type. -
transitionTime
protected long transitionTimeTransition time (time units). -
model
Bar model. -
thumbObject
Internal object for the thumb. -
fullBarObject
Internal object for the full bar. -
emptyBarObject
Internal object for the empty bar. -
currentValue
Current value.
-
-
Constructor Details
-
GUIProgressBar
Creates a new progress bar using the provided model and style.- Parameters:
model- the value model.style- the desired style.
-
-
Method Details
-
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.
-
getTransitionType
- Returns:
- the current transition type.
-
setTransitionType
Sets the current transition type. This is the transition used when a value changes.- Parameters:
transitionType- the transition type.
-
getTransitionTime
public long getTransitionTime()- Returns:
- the current transition time in time units.
-
setTransitionTime
public void setTransitionTime(long transitionTime) Sets the current transition time in time units.- Parameters:
transitionTime- the transition time.
-
getThumbObject
- Returns:
- a reference to the thumb object.
-
getFullBarObject
- Returns:
- a reference to the full bar object.
-
getEmptyBarObject
- Returns:
- a reference to the empty bar object.
-
getStyle
- Returns:
- the current slider style.
-
getValue
- Specified by:
getValuein interfaceGUIValueField<T>- Returns:
- this field's current value.
-
setValue
Description copied from interface:GUIValueFieldSets this field's value. This must accept any object, and attempt to set the correct value based on it. This object must fire anGUIValueField.EVENT_VALUE_CHANGEevent if it changes from its current value.- Specified by:
setValuein interfaceGUIValueField<T>- Parameters:
value- the value to set.- Returns:
- itself, to chain calls.
-