Class DefaultBuffer
java.lang.Object
com.realtime.crossfire.jxclient.gui.log.Buffer
com.realtime.crossfire.jxclient.gui.log.DefaultBuffer
Default
Buffer implementation.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultBuffer(@NotNull Fonts fonts, @NotNull FontRenderContext context, int renderWidth) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected intgetSegmentWidth(@NotNull TextSegment segment, int characters) Returns the width of a prefix of aTextSegment.protected @NotNull TextSegmentnewTextSegment(@NotNull String text, boolean bold, boolean italic, boolean underline, @NotNull FontID fontID, @NotNull Color color, @NotNull Color selectionColor) Creates a new segment.Methods inherited from class com.realtime.crossfire.jxclient.gui.log.Buffer
addBufferListener, addLine, addTextSegment, clear, coordinateToPosition, getLastCount, getLine, getSyncObject, getText, getTotalHeight, lines, mergeLines, prune, removeBufferListener, replaceLine, setRenderWidth, setShowSentCommands, setShowTimestamps, size
-
Constructor Details
-
DefaultBuffer
protected DefaultBuffer(@NotNull @NotNull Fonts fonts, @NotNull @NotNull FontRenderContext context, int renderWidth) Creates a new instance.- Parameters:
fonts- theFontsinstance for looking up fontscontext- theFontRenderContextto userenderWidth- the width to render
-
-
Method Details
-
newTextSegment
@NotNull protected @NotNull TextSegment newTextSegment(@NotNull @NotNull String text, boolean bold, boolean italic, boolean underline, @NotNull @NotNull FontID fontID, @NotNull @NotNull Color color, @NotNull @NotNull Color selectionColor) Description copied from class:BufferCreates a new segment.- Specified by:
newTextSegmentin classBuffer- Parameters:
text- the text to displaybold- whether bold face is enableditalic- whether italic face is enabledunderline- whether underlining is enabledfontID- the font to usecolor- the color to useselectionColor- the selection color to use- Returns:
- the new segment
-
getSegmentWidth
Description copied from class:BufferReturns the width of a prefix of aTextSegment.- Specified by:
getSegmentWidthin classBuffer- Parameters:
segment- the text segmentcharacters- the number of characters in the prefix- Returns:
- the width in pixels
-