public class UI2dScrollContext extends UI2dContext
UI2dContainer.ArrowKeyFocus, UI2dContainer.Layout
bottomMargin, height, leftMargin, rightMargin, textAlignHorizontal, textAlignVertical, textOffsetX, textOffsetY, topMargin, width, x, y
children, hasFocus, mousePressContextMenu, visible
Constructor and Description |
---|
UI2dScrollContext(UI ui,
float x,
float y,
float w,
float h) |
Modifier and Type | Method and Description |
---|---|
float |
getScrollHeight() |
float |
getScrollWidth() |
float |
getScrollX() |
float |
getScrollY() |
protected void |
onMouseWheel(MouseEvent e,
float mx,
float my,
float delta)
Subclasses override to receive mouse events
|
protected void |
onResize()
Subclasses may override this method, invoked when the component is resized
|
UI2dContainer |
setContentSize(float w,
float h) |
UI2dScrollContext |
setHorizontalScrollingEnabled(boolean horizontalScrollingEnabled) |
UI2dScrollContext |
setMaxHeight(float maxHeight)
Sets a maximum height on the scroll container.
|
UI2dScrollContext |
setScrollHeight(float scrollHeight) |
UI2dScrollContext |
setScrollSize(float scrollWidth,
float scrollHeight) |
UI2dScrollContext |
setScrollWidth(float scrollWidth) |
UI2dScrollContext |
setScrollX(float scrollX) |
UI2dScrollContext |
setScrollY(float scrollY) |
UI2dScrollContext |
setVerticalScrollingEnabled(boolean verticalScrollingEnabled) |
drawBackground, getGraphics
addChildren, addTopLevelComponent, getChild, getChildren, getContentHeight, getContentTarget, getContentWidth, iterator, newHorizontalContainer, newHorizontalContainer, newHorizontalContainer, newVerticalContainer, newVerticalContainer, newVerticalContainer, onKeyPressed, reflow, removeAllChildren, setArrowKeyFocus, setChildMargin, setChildSpacing, setChildSpacing, setContentHeight, setContentTarget, setContentWidth, setLayout, setMinHeight, setMinWidth, setPadding, setPadding, setPadding
addToContainer, addToContainer, breakTextToWidth, clipTextToWidth, contains, drawBorder, drawFocus, drawFocusCorners, drawFocusCorners, getBackgroundColor, getBorderColor, getBorderRounding, getBorderWeight, getContainer, getFocusColor, getFocusSize, getFont, getFontColor, getHeight, getNextSibling, getParent, getPrevSibling, getWidth, getX, getY, hasBackground, hasBorder, hasFont, hasFontColor, isMappable, redraw, removeFromContainer, setBackground, setBackgroundColor, setBorder, setBorderColor, setBorderRounding, setBorderWeight, setBottomMargin, setContainerIndex, setDescription, setFocusBackground, setFocusBackgroundColor, setFocusColor, setFocusCorners, setFont, setFontColor, setFontColor, setHeight, setLeftMargin, setMappable, setMargin, setMargin, setMargin, setPosition, setPosition, setPosition, setPosition, setRightMargin, setSize, setTextAlignment, setTextAlignment, setTextOffset, setTopMargin, setVisible, setWidth, setX, setY
addLoopTask, beginDraw, blur, bringToFront, consumeKeyEvent, consumeMousePress, consumeMouseWheelEvent, endDraw, focus, getDescription, getFocusedChild, getLX, getUI, hasDirectFocus, hasFocus, isVisible, keyEventConsumed, loop, mousePressConsumed, onBlur, onDraw, onFocus, onUIResize, removeLoopTask, toggleVisible
onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragged, onMouseMoved, onMouseOut, onMouseOver, onMousePressed, onMouseReleased
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public UI2dScrollContext(UI ui, float x, float y, float w, float h)
public UI2dScrollContext setMaxHeight(float maxHeight)
maxHeight
- Maximum height before scrolling kicks inpublic UI2dContainer setContentSize(float w, float h)
setContentSize
in class UI2dContainer
public UI2dScrollContext setScrollSize(float scrollWidth, float scrollHeight)
public float getScrollHeight()
public UI2dScrollContext setScrollHeight(float scrollHeight)
public float getScrollWidth()
public UI2dScrollContext setScrollWidth(float scrollWidth)
public UI2dScrollContext setHorizontalScrollingEnabled(boolean horizontalScrollingEnabled)
public UI2dScrollContext setVerticalScrollingEnabled(boolean verticalScrollingEnabled)
protected void onResize()
UI2dComponent
onResize
in class UI2dContext
public float getScrollX()
public float getScrollY()
public UI2dScrollContext setScrollX(float scrollX)
public UI2dScrollContext setScrollY(float scrollY)
protected void onMouseWheel(MouseEvent e, float mx, float my, float delta)
UIEventHandler
onMouseWheel
in class UIEventHandler
e
- Mouse eventmx
- x-coordinatemy
- y-coordinatedelta
- Amount of wheel movementLX library by Mark C. Slee. © 2012-2020