Modifier | Constructor and Description |
---|---|
protected |
DefaultBuffer(@NotNull Fonts fonts,
@NotNull java.awt.font.FontRenderContext context,
int renderWidth)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected int |
getSegmentWidth(@NotNull TextSegment segment,
int characters)
Returns the width of a prefix of a
TextSegment . |
protected @NotNull TextSegment |
newTextSegment(@NotNull java.lang.String text,
boolean bold,
boolean italic,
boolean underline,
@NotNull FontID fontID,
@NotNull java.awt.Color color,
@NotNull java.awt.Color selectionColor)
Creates a new segment.
|
addBufferListener, addLine, addTextSegment, clear, coordinateToPosition, getLastCount, getLine, getSyncObject, getText, getTotalHeight, lines, mergeLines, prune, removeBufferListener, replaceLine, setRenderWidth, setShowSentCommands, setShowTimestamps, size
protected DefaultBuffer(@NotNull @NotNull Fonts fonts, @NotNull @NotNull java.awt.font.FontRenderContext context, int renderWidth)
fonts
- the Fonts
instance for looking up fontscontext
- the FontRenderContext
to userenderWidth
- the width to render@NotNull protected @NotNull TextSegment newTextSegment(@NotNull @NotNull java.lang.String text, boolean bold, boolean italic, boolean underline, @NotNull @NotNull FontID fontID, @NotNull @NotNull java.awt.Color color, @NotNull @NotNull java.awt.Color selectionColor)
Buffer
newTextSegment
in class Buffer
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 useprotected int getSegmentWidth(@NotNull @NotNull TextSegment segment, int characters)
Buffer
TextSegment
.getSegmentWidth
in class Buffer
segment
- the text segmentcharacters
- the number of characters in the prefix