java.lang.Objectcom.realtime.crossfire.jxclient.gui.log.RenderStateManager
public class RenderStateManager
Encapsulates the state for rendering a Buffer instance.
| Field Summary | |
|---|---|
private Buffer |
buffer
The rendered buffer. |
private BufferListener |
bufferListener
The listener to re-render the window contents after changes. |
private boolean |
lastCanScrollDown
|
private boolean |
lastCanScrollUp
|
private int |
lastScrollPos
The position in pixels of the viewable window. |
private int |
lastTopIndex
The first line of buffer to display. |
private int |
lastTopOffset
The number of pixels to shift the first displayed line. |
private RenderState |
renderState
|
private RenderStateListener |
renderStateListener
The listener to notify about state changes. |
| Constructor Summary | |
|---|---|
RenderStateManager(RenderStateListener renderStateListener,
Buffer buffer)
Create a new instance. |
|
| Method Summary | |
|---|---|
boolean |
canScrollDown()
Whether scrolling down is possible. |
boolean |
canScrollUp()
Whether scrolling up is possible. |
void |
dispose()
|
private void |
fireChanges()
|
int |
getScrollPos()
|
int |
getTopIndex()
Return the first line to render. |
int |
getTopOffset()
Return the pixel offset for the first line to render. |
void |
resetScroll()
Reset the scrolling range to default values. |
void |
scrollDown(int dy)
Scroll down by pixels. |
void |
scrollTo(int y)
Scroll to a location. |
void |
scrollUp(int dy)
Scroll up by pixels. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@NotNull private final Buffer buffer
@NotNull private final BufferListener bufferListener
private boolean lastCanScrollDown
private boolean lastCanScrollUp
private int lastScrollPos
private int lastTopIndex
buffer to display.
private int lastTopOffset
@NotNull private final RenderState renderState
@NotNull private final RenderStateListener renderStateListener
| Constructor Detail |
|---|
public RenderStateManager(@NotNull
RenderStateListener renderStateListener,
@NotNull
Buffer buffer)
renderStateListener - The listener to notify about state changes.buffer - The rendered buffer.| Method Detail |
|---|
public boolean canScrollDown()
public boolean canScrollUp()
public void dispose()
private void fireChanges()
public int getScrollPos()
public int getTopIndex()
public int getTopOffset()
public void resetScroll()
public void scrollDown(int dy)
dy - The number of pixels to scroll.public void scrollTo(int y)
y - The location.public void scrollUp(int dy)
dy - The number of pixels to scroll.