public class RenderState
extends java.lang.Object
Constructor and Description |
---|
RenderState() |
Modifier and Type | Method and Description |
---|---|
boolean |
canScrollDown()
Returns whether scrolling down is possible.
|
boolean |
canScrollUp()
Returns whether scrolling up is possible.
|
int |
getHeight()
Returns the height of the viewable area.
|
int |
getScrollPos()
Returns the location of the view area in pixels.
|
int |
getTopIndex()
Returns the index of the first line to display.
|
int |
getTopOffset()
Returns the number of pixels to shift the first displayed line.
|
void |
linesAdded(@NotNull Buffer buffer)
Some lines have been added to the buffer.
|
void |
linesRemoved(@NotNull Buffer buffer,
@NotNull java.util.Collection<Line> lines)
Some lines have been removed from the buffer.
|
void |
linesReplaced(@NotNull Buffer buffer)
Some lines have been replaced at the end of the buffer.
|
boolean |
mustRepaint()
Returns whether the view should be repainted even if no other values have
changed.
|
void |
scrollTo(@NotNull Buffer buffer,
int y)
Scrolls to the given pixel location.
|
void |
scrollToBottom(@NotNull Buffer buffer)
Sets the view area to the bottom-most value.
|
void |
setHeight(@NotNull Buffer buffer,
int h)
Sets the viewable height in pixel.
|
void |
update(@NotNull Buffer buffer,
int oldBufferHeight)
Updates the internal state after the buffer has changed.
|
public void setHeight(@NotNull @NotNull Buffer buffer, int h)
buffer
- the displayed bufferh
- the viewable heightpublic void update(@NotNull @NotNull Buffer buffer, int oldBufferHeight)
buffer
- the bufferoldBufferHeight
- the buffer height before the changepublic void linesAdded(@NotNull @NotNull Buffer buffer)
buffer
- the displayed bufferpublic void linesReplaced(@NotNull @NotNull Buffer buffer)
buffer
- the displayed bufferpublic void linesRemoved(@NotNull @NotNull Buffer buffer, @NotNull @NotNull java.util.Collection<Line> lines)
buffer
- the displayed bufferlines
- the number of lines that have been removedpublic int getHeight()
public int getTopIndex()
public int getTopOffset()
public int getScrollPos()
public boolean canScrollUp()
public boolean canScrollDown()
public boolean mustRepaint()
false
in the second call (if no other changes happen
concurrently).public void scrollTo(@NotNull @NotNull Buffer buffer, int y)
buffer
- the displayed buffery
- the new locationpublic void scrollToBottom(@NotNull @NotNull Buffer buffer)
buffer
- the displayed buffer