Class RenderStateManager
- java.lang.Object
-
- com.realtime.crossfire.jxclient.gui.log.RenderStateManager
-
public class RenderStateManager extends java.lang.ObjectEncapsulates the state for rendering aBufferinstance.
-
-
Constructor Summary
Constructors Constructor Description RenderStateManager(@NotNull RenderStateListener renderStateListener, @NotNull Buffer buffer)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanScrollDown()Returns whether scrolling down is possible.booleancanScrollUp()Returns whether scrolling up is possible.voiddispose()Destroys this instance.intgetScrollPos()Returns the location of the view area in pixels.intgetTopIndex()Returns the first line to render.intgetTopOffset()Returns the number of pixels to shift the first displayed line.voidresetScroll()Resets the scrolling range to default values.voidscrollDown(int dy)Scrolls down by pixels.voidscrollTo(int y)Scrolls to a location.voidscrollUp(int dy)Scrolls up by pixels.voidsetHeight(int height)Sets the viewable height in pixel.
-
-
-
Constructor Detail
-
RenderStateManager
public RenderStateManager(@NotNull @NotNull RenderStateListener renderStateListener, @NotNull @NotNull Buffer buffer)Creates a new instance.- Parameters:
renderStateListener- the listener to notify about state changesbuffer- the rendered buffer
-
-
Method Detail
-
setHeight
public void setHeight(int height)
Sets the viewable height in pixel.- Parameters:
height- the viewable height
-
dispose
public void dispose()
Destroys this instance. Must be called when the instance is not needed anymore.
-
getTopIndex
public int getTopIndex()
Returns the first line to render.- Returns:
- the line index
-
getTopOffset
public int getTopOffset()
Returns the number of pixels to shift the first displayed line.- Returns:
- the pixel offset
-
getScrollPos
public int getScrollPos()
Returns the location of the view area in pixels.- Returns:
- the location
-
resetScroll
public void resetScroll()
Resets the scrolling range to default values.
-
scrollUp
public void scrollUp(int dy)
Scrolls up by pixels.- Parameters:
dy- the number of pixels to scroll
-
scrollDown
public void scrollDown(int dy)
Scrolls down by pixels.- Parameters:
dy- the number of pixels to scroll
-
scrollTo
public void scrollTo(int y)
Scrolls to a location.- Parameters:
y- the location
-
canScrollUp
public boolean canScrollUp()
Returns whether scrolling up is possible.- Returns:
- whether scrolling up is possible
-
canScrollDown
public boolean canScrollDown()
Returns whether scrolling down is possible.- Returns:
- whether scrolling down is possible
-
-