Crossfire JXClient, Trunk
Protected Member Functions | Private Attributes | Static Private Attributes | List of all members
com.realtime.crossfire.jxclient.gui.log.DefaultBuffer Class Reference
Inheritance diagram for com.realtime.crossfire.jxclient.gui.log.DefaultBuffer:
Inheritance graph
Collaboration diagram for com.realtime.crossfire.jxclient.gui.log.DefaultBuffer:
Collaboration graph

Protected Member Functions

 DefaultBuffer (@NotNull final Fonts fonts, @NotNull final FontRenderContext context, final int renderWidth)
 
int getSegmentWidth (@NotNull final TextSegment segment, final int characters)
 
TextSegment newTextSegment (final @NotNull String text, final boolean bold, final boolean italic, final boolean underline, final @NotNull FontID fontID, final @NotNull Color color, final @NotNull Color selectionColor)
 
- Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.log.Buffer
 Buffer (final int maxLines, final int renderWidth)
 

Private Attributes

final FontRenderContext context
 
final Fonts fonts
 

Static Private Attributes

static final int MAX_LINES = 1000
 

Additional Inherited Members

- Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.log.Buffer
void addBufferListener (@NotNull final BufferListener listener)
 
void addLine (@NotNull final Line line)
 
void addTextSegment (@NotNull final Line line, @NotNull final String text, final boolean bold, final boolean italic, final boolean underline, @NotNull final FontID fontID, @NotNull final Color color, @NotNull final Color selectionColor)
 
void clear ()
 
int coordinateToPosition (final int x, final int y)
 
int getLastCount ()
 
Line getLine (final int line)
 
Object getSyncObject ()
 
String getText (final int beginSelection, final int endSelection)
 
int getTotalHeight ()
 
Iterable< Linelines (final int line)
 
boolean mergeLines (@NotNull final String text, final int type, final int subtype, @Nullable final Color color)
 
void prune ()
 
void removeBufferListener (@NotNull final BufferListener listener)
 
void replaceLine (@NotNull final Line line)
 
void setRenderWidth (final int renderWidth)
 
void setShowSentCommands (final boolean showSentCommands)
 
void setShowTimestamps (final boolean showTimestamps)
 
int size ()
 

Detailed Description

Default Buffer implementation.

Definition at line 13 of file DefaultBuffer.java.

Constructor & Destructor Documentation

◆ DefaultBuffer()

com.realtime.crossfire.jxclient.gui.log.DefaultBuffer.DefaultBuffer ( @NotNull final Fonts  fonts,
@NotNull final FontRenderContext  context,
final int  renderWidth 
)
protected

Creates a new instance.

Parameters
fontsthe
Fonts
instance for looking up fonts
contextthe
FontRenderContext
to use
renderWidththe width to render

Definition at line 38 of file DefaultBuffer.java.

References com.realtime.crossfire.jxclient.gui.log.DefaultBuffer.context, com.realtime.crossfire.jxclient.gui.log.DefaultBuffer.fonts, com.realtime.crossfire.jxclient.gui.log.DefaultBuffer.MAX_LINES, and com.realtime.crossfire.jxclient.gui.log.Buffer.renderWidth.

Member Function Documentation

◆ getSegmentWidth()

int com.realtime.crossfire.jxclient.gui.log.DefaultBuffer.getSegmentWidth ( @NotNull final TextSegment  segment,
final int  characters 
)
protected

Returns the width of a prefix of a TextSegment.

Parameters
segmentthe text segment
charactersthe number of characters in the prefix
Returns
the width in pixels

Reimplemented from com.realtime.crossfire.jxclient.gui.log.Buffer.

Definition at line 56 of file DefaultBuffer.java.

References com.realtime.crossfire.jxclient.gui.log.DefaultBuffer.context.

◆ newTextSegment()

TextSegment com.realtime.crossfire.jxclient.gui.log.DefaultBuffer.newTextSegment ( final @NotNull String  text,
final boolean  bold,
final boolean  italic,
final boolean  underline,
final @NotNull FontID  fontID,
final @NotNull Color  color,
final @NotNull Color  selectionColor 
)
protected

Creates a new segment.

Parameters
textthe text to display
boldwhether bold face is enabled
italicwhether italic face is enabled
underlinewhether underlining is enabled
fontIDthe font to use
colorthe color to use
selectionColorthe selection color to use
Returns
the new segment

Reimplemented from com.realtime.crossfire.jxclient.gui.log.Buffer.

Definition at line 46 of file DefaultBuffer.java.

References com.realtime.crossfire.jxclient.gui.log.DefaultBuffer.context, com.realtime.crossfire.jxclient.gui.log.DefaultBuffer.fonts, com.realtime.crossfire.jxclient.gui.log.Fonts.getFont(), and com.realtime.crossfire.jxclient.gui.log.Buffer.size().

Here is the call graph for this function:

Member Data Documentation

◆ context

final FontRenderContext com.realtime.crossfire.jxclient.gui.log.DefaultBuffer.context
private

◆ fonts

final Fonts com.realtime.crossfire.jxclient.gui.log.DefaultBuffer.fonts
private

◆ MAX_LINES

final int com.realtime.crossfire.jxclient.gui.log.DefaultBuffer.MAX_LINES = 1000
staticprivate

The maximum number of lines the buffer can hold.

Definition at line 18 of file DefaultBuffer.java.

Referenced by com.realtime.crossfire.jxclient.gui.log.DefaultBuffer.DefaultBuffer().


The documentation for this class was generated from the following file: