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

public class ScrollablePanel extends Component implements Viewport
Panel with scroll bars. Default container layout is null.
See Also:
  • 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

      public Animation getAnimation()
      Returns animation of scrollable panel.
      Returns:
      animation.
    • setAnimation

      public void setAnimation(Animation animation)
      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: Component
      Used to set size vector.
      Overrides:
      setSize in class Component
      Parameters:
      width - width to set.
      height - height to set.
    • setSize

      public void setSize(org.joml.Vector2f size)
      Description copied from class: Component
      Used to set size vector.
      Overrides:
      setSize in class Component
      Parameters:
      size - size vector.
    • getVerticalScrollBar

      public ScrollBar getVerticalScrollBar()
      Returns vertical scrollbar.
      Returns:
      vertical scrollbar.
    • setVerticalScrollBar

      public void setVerticalScrollBar(ScrollBar verticalScrollBar)
      Used to set vertical scroll bar.
      Parameters:
      verticalScrollBar - vertical scroll bar to set.
    • getHorizontalScrollBar

      public ScrollBar getHorizontalScrollBar()
      Returns horizontal scrollbar.
      Returns:
      horizontal scrollbar.
    • setHorizontalScrollBar

      public void setHorizontalScrollBar(ScrollBar horizontalScrollBar)
      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

      public Component getContainer()
      Returns container which should used to add components to scrollable panel.
      Returns:
      container which should used to add components to scrollable panel.
    • setContainer

      public void setContainer(Component container)
      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

      public boolean equals(Object o)
      Overrides:
      equals in class Component
    • toString

      public String toString()
      Overrides:
      toString in class Component
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Component
    • getViewport

      public Component getViewport()
    • getViewportSize

      public org.joml.Vector2f getViewportSize()
      Specified by:
      getViewportSize in interface Viewport
    • getViewportViewSize

      public org.joml.Vector2f getViewportViewSize()
      Specified by:
      getViewportViewSize in interface Viewport
    • isAutoResize

      public boolean isAutoResize()
    • setAutoResize

      public void setAutoResize(boolean autoResize)