public class ScrollBar extends Component
Modifier and Type | Field and Description |
---|---|
static float |
MIN_SCROLL_SIZE |
Constructor and Description |
---|
ScrollBar()
Default constructor.
|
ScrollBar(float curValue)
Default constructor with current value parameter.
|
ScrollBar(float x,
float y,
float width,
float height)
Constructor with position and size parameters.
|
ScrollBar(float x,
float y,
float width,
float height,
float curValue)
Constructor with position, size and current value parameters.
|
ScrollBar(org.joml.Vector2f position,
org.joml.Vector2f size)
Constructor with position and size parameters.
|
ScrollBar(org.joml.Vector2f position,
org.joml.Vector2f size,
float curValue)
Constructor with position, size and current value parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addScrollBarChangeValueEventListener(EventListener<ScrollBarChangeValueEvent> eventListener)
Used to add event listener for scroll bar change value event.
|
boolean |
equals(java.lang.Object o) |
org.joml.Vector4f |
getArrowColor()
Returns scrollbar arrow color.
|
float |
getArrowSize()
Returns arrow size.
|
float |
getCurValue()
Returns current state of scrollbar.
|
float |
getMaxValue()
Returns maximum state of scrollbar.
|
float |
getMinValue()
Returns minimum state of scrollbar.
|
Orientation |
getOrientation()
Returns scrollbar orientation.
|
java.util.List<EventListener<ScrollBarChangeValueEvent>> |
getScrollBarChangeValueEvents()
Returns all event listeners for scroll bar change value event.
|
org.joml.Vector4f |
getScrollColor()
Returns scrollbar color.
|
float |
getScrollStep()
Returns scrollbar scroll step (used by mouse scroll event listener).
|
Viewport |
getViewport()
Returns viewport if scrollbar attached to viewport.
|
float |
getVisibleAmount()
|
int |
hashCode() |
boolean |
isArrowsEnabled()
Returns true if arrows enabled.
|
boolean |
isScrolling()
Determines if scroll bar currently scrolling by user.
|
void |
removeScrollBarChangeValueEventListener(EventListener<ScrollBarChangeValueEvent> eventListener)
Used to remove event listener for scroll bar change value event.
|
void |
setArrowColor(org.joml.Vector4f arrowColor)
Used to set scrollbar arrow color.
|
void |
setArrowsEnabled(boolean arrowsEnabled)
Used to enable/disable arrows.
|
void |
setArrowSize(float arrowSize)
Used to set arrow size.
|
void |
setCurValue(float curValue)
Used to set current state of scrollbar.
|
void |
setMaxValue(float maxValue)
Used to set maximum state of scrollbar.
|
void |
setMinValue(float minValue)
Used to set minimum state of scrollbar.
|
void |
setOrientation(Orientation orientation)
Used to set scrollbar orientation.
|
void |
setScrollColor(org.joml.Vector4f scrollColor)
Used to set scrollbar color.
|
void |
setScrolling(boolean scrolling)
Used to set scrolling status.
|
void |
setScrollStep(float scrollStep)
Used to set scrollbar scroll step (used by mouse scroll event listener).
|
void |
setViewport(Viewport viewport)
Used to attach scrollbar to viewport.
|
void |
setVisibleAmount(float visibleAmount)
By default used by event listeners to set visible part of viewport.
|
java.lang.String |
toString() |
add, addAll, clearChilds, containerIterator, contains, containsAll, count, forEach, getAbsolutePosition, getBackgroundColor, getBorder, getChilds, getCornerRadius, getFocusedStrokeColor, getIntersector, getListenerMap, getMetadata, getParent, getPosition, getSize, getTooltip, intersects, isEmpty, isEnabled, isFocused, isHovered, isPressed, isVisible, parallelStream, remove, removeAll, removeIf, setBackgroundColor, setBackgroundColor, setBorder, setCornerRadius, setEnabled, setFocused, setFocusedStrokeColor, setFocusedStrokeColor, setHovered, setIntersector, setListenerMap, setParent, setPosition, setPosition, setPressed, setSize, setSize, setTooltip, setVisible, stream
public static final float MIN_SCROLL_SIZE
public ScrollBar()
Also if you want to make it easy to use with Json marshaller/unmarshaller component should contain empty constructor.
public ScrollBar(float x, float y, float width, float height)
x
- x position position in parent component.y
- y position position in parent component.width
- width of component.height
- height of component.public ScrollBar(org.joml.Vector2f position, org.joml.Vector2f size)
position
- position position in parent component.size
- size of component.public ScrollBar(float curValue)
Also if you want to make it easy to use with Json marshaller/unmarshaller component should contain empty constructor.
curValue
- current scroll bar value to set.public ScrollBar(float x, float y, float width, float height, float curValue)
x
- x position position in parent component.y
- y position position in parent component.width
- width of component.height
- height of component.curValue
- current scroll bar value to set.public ScrollBar(org.joml.Vector2f position, org.joml.Vector2f size, float curValue)
position
- position position in parent component.size
- size of component.curValue
- current scroll bar value to set.public boolean isScrolling()
public void setScrolling(boolean scrolling)
scrolling
- new status to set.public Viewport getViewport()
public void setViewport(Viewport viewport)
Viewport.updateViewport()
method.viewport
- viewport to set.public Orientation getOrientation()
public void setOrientation(Orientation orientation)
orientation
- scrollbar orientation to set.public float getArrowSize()
public void setArrowSize(float arrowSize)
arrowSize
- arrow size to set.public boolean isArrowsEnabled()
public void setArrowsEnabled(boolean arrowsEnabled)
arrowsEnabled
- value to enable/disable arrows.public org.joml.Vector4f getScrollColor()
public void setScrollColor(org.joml.Vector4f scrollColor)
scrollColor
- scrollbar color to set.public org.joml.Vector4f getArrowColor()
public void setArrowColor(org.joml.Vector4f arrowColor)
arrowColor
- scrollbar arrow color to set.public float getVisibleAmount()
public void setVisibleAmount(float visibleAmount)
visibleAmount
- visible size of viewport.public float getMinValue()
public void setMinValue(float minValue)
minValue
- minimum state of scrollbar to set.public float getMaxValue()
public void setMaxValue(float maxValue)
maxValue
- maximum state of scrollbar to set.public float getCurValue()
public void setCurValue(float curValue)
curValue
- current state of scrollbar to set.public float getScrollStep()
public void setScrollStep(float scrollStep)
scrollStep
- scrollbar scroll step to set.public void addScrollBarChangeValueEventListener(EventListener<ScrollBarChangeValueEvent> eventListener)
eventListener
- event listener to add.public java.util.List<EventListener<ScrollBarChangeValueEvent>> getScrollBarChangeValueEvents()
public void removeScrollBarChangeValueEventListener(EventListener<ScrollBarChangeValueEvent> eventListener)
eventListener
- event listener to remove.