Package com.spinyowl.legui.component
Class ScrollablePanel
java.lang.Object
com.spinyowl.legui.component.Component
com.spinyowl.legui.component.ScrollablePanel
- All Implemented Interfaces:
Viewport,Serializable
- Direct Known Subclasses:
SelectBox.SelectBoxScrollablePanel
Panel with scroll bars. Default container layout is null.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.ScrollablePanel(float x, float y, float width, float height) Constructor with position and size parameters.ScrollablePanel(org.joml.Vector2f position, org.joml.Vector2f size) Constructor with position and size parameters. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns animation of scrollable panel.Returns container which should used to add components to scrollable panel.Returns horizontal scrollbar.Returns vertical scrollbar.org.joml.Vector2forg.joml.Vector2finthashCode()booleanbooleanbooleanvoidsetAnimation(Animation animation) Used to set scrollable panel animation.voidsetAutoResize(boolean autoResize) voidsetContainer(Component container) Used to set container which should used to add components to scrollable panel.voidsetHorizontalScrollBar(ScrollBar horizontalScrollBar) Used to set horizontal scroll bar.voidsetHorizontalScrollBarHeight(float height) voidsetHorizontalScrollBarVisible(boolean enabled) voidsetSize(float width, float height) Used to set size vector.voidsetSize(org.joml.Vector2f size) Used to set size vector.voidsetVerticalScrollBar(ScrollBar verticalScrollBar) Used to set vertical scroll bar.voidsetVerticalScrollBarVisible(boolean enabled) voidsetVerticalScrollBarWidth(float width) toString()Methods inherited from class com.spinyowl.legui.component.Component
add, add, addAll, clearChildComponents, containerIterator, contains, containsAll, count, forEach, getAbsolutePosition, getChildComponents, getFocusedStyle, getFrame, getHoveredStyle, getIntersector, getLayer, getListenerMap, getMetadata, getParent, getPosition, getPressedStyle, getSize, getStyle, getTabIndex, getTooltip, indexOfChild, intersects, isEmpty, isEnabled, isFocusable, isFocused, isHovered, isPressed, isTabFocusable, isVisible, keepRendering, keepRendering, parallelStream, remove, remove, removeAll, removeIf, setEnabled, setFocusable, setFocused, setHovered, setIntersector, setListenerMap, setParent, setPosition, setPosition, setPressed, setStyle, setTabFocusable, setTabIndex, setTooltip, stream
-
Constructor Details
-
ScrollablePanel
public ScrollablePanel()Default constructor. Used to create component instance without any parameters.Also if you want to make it easy to use with Json marshaller/unmarshaller component should contain empty constructor.
-
ScrollablePanel
public ScrollablePanel(float x, float y, float width, float height) Constructor with position and size parameters.- Parameters:
x- x position position in parent component.y- y position position in parent component.width- width of component.height- height of component.
-
ScrollablePanel
public ScrollablePanel(org.joml.Vector2f position, org.joml.Vector2f size) Constructor with position and size parameters.- Parameters:
position- position position in parent component.size- size of component.
-
-
Method Details
-
getAnimation
Returns animation of scrollable panel.- Returns:
- animation.
-
setAnimation
Used to set scrollable panel animation. Automatically starts animation.- Parameters:
animation- scroll bar animation to set.
-
setSize
public void setSize(float width, float height) Description copied from class:ComponentUsed to set size vector. -
setSize
public void setSize(org.joml.Vector2f size) Description copied from class:ComponentUsed to set size vector. -
getVerticalScrollBar
Returns vertical scrollbar.- Returns:
- vertical scrollbar.
-
setVerticalScrollBar
Used to set vertical scroll bar.- Parameters:
verticalScrollBar- vertical scroll bar to set.
-
getHorizontalScrollBar
Returns horizontal scrollbar.- Returns:
- horizontal scrollbar.
-
setHorizontalScrollBar
Used to set horizontal scroll bar.- Parameters:
horizontalScrollBar- horizontal scroll bar to set.
-
isHorizontalScrollBarVisible
public boolean isHorizontalScrollBarVisible() -
setHorizontalScrollBarVisible
public void setHorizontalScrollBarVisible(boolean enabled) -
isVerticalScrollBarVisible
public boolean isVerticalScrollBarVisible() -
setVerticalScrollBarVisible
public void setVerticalScrollBarVisible(boolean enabled) -
setHorizontalScrollBarHeight
public void setHorizontalScrollBarHeight(float height) -
setVerticalScrollBarWidth
public void setVerticalScrollBarWidth(float width) -
getContainer
Returns container which should used to add components to scrollable panel.- Returns:
- container which should used to add components to scrollable panel.
-
setContainer
Used to set container which should used to add components to scrollable panel.- Parameters:
container- container which should used to add components to scrollable panel.
-
equals
-
toString
-
hashCode
public int hashCode() -
getViewport
-
getViewportSize
public org.joml.Vector2f getViewportSize()- Specified by:
getViewportSizein interfaceViewport
-
getViewportViewSize
public org.joml.Vector2f getViewportViewSize()- Specified by:
getViewportViewSizein interfaceViewport
-
isAutoResize
public boolean isAutoResize() -
setAutoResize
public void setAutoResize(boolean autoResize)
-