public class RenderStateManager
extends java.lang.Object
Buffer
instance.Constructor and Description |
---|
RenderStateManager(@NotNull RenderStateListener renderStateListener,
@NotNull Buffer buffer)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canScrollDown()
Returns whether scrolling down is possible.
|
boolean |
canScrollUp()
Returns whether scrolling up is possible.
|
void |
dispose()
Destroys this instance.
|
int |
getHeight()
Returns the height of the viewable area.
|
int |
getScrollPos()
Returns the location of the view area in pixels.
|
int |
getTopIndex()
Returns the first line to render.
|
int |
getTopOffset()
Returns the number of pixels to shift the first displayed line.
|
void |
resetScroll()
Resets the scrolling range to default values.
|
void |
scrollDown(int dy)
Scrolls down by pixels.
|
void |
scrollTo(int y)
Scrolls to a location.
|
void |
scrollUp(int dy)
Scrolls up by pixels.
|
void |
setHeight(int height)
Sets the viewable height in pixel.
|
void |
update(int oldBufferHeight)
Updates the internal state after the buffer has changed.
|
public RenderStateManager(@NotNull @NotNull RenderStateListener renderStateListener, @NotNull @NotNull Buffer buffer)
renderStateListener
- the listener to notify about state changesbuffer
- the rendered bufferpublic void setHeight(int height)
height
- the viewable heightpublic void update(int oldBufferHeight)
oldBufferHeight
- the buffer height before the changepublic void dispose()
public int getHeight()
public int getTopIndex()
public int getTopOffset()
public int getScrollPos()
public void resetScroll()
public void scrollUp(int dy)
dy
- the number of pixels to scrollpublic void scrollDown(int dy)
dy
- the number of pixels to scrollpublic void scrollTo(int y)
y
- the locationpublic boolean canScrollUp()
public boolean canScrollDown()