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

Public Member Functions

 TestBuffer (final int maxLines, final int renderWidth, final int fontHeight)
 
- 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 ()
 

Protected Member Functions

int getSegmentWidth (@NotNull final TextSegment segment, final int characters)
 
TextSegment newTextSegment (@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)
 
- Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.log.Buffer
 Buffer (final int maxLines, final int renderWidth)
 

Private Attributes

final int fontHeight
 

Detailed Description

A Buffer implementation for tests.

Definition at line 11 of file TestBuffer.java.

Constructor & Destructor Documentation

◆ TestBuffer()

com.realtime.crossfire.jxclient.gui.log.TestBuffer.TestBuffer ( final int  maxLines,
final int  renderWidth,
final int  fontHeight 
)

Creates a new instance.

Parameters
maxLinesthe maximum number of lines the buffer can hold
renderWidththe width to render
fontHeightthe height of the font in pixels

Definition at line 24 of file TestBuffer.java.

References com.realtime.crossfire.jxclient.gui.log.TestBuffer.fontHeight, com.realtime.crossfire.jxclient.gui.log.Buffer.maxLines, and com.realtime.crossfire.jxclient.gui.log.Buffer.renderWidth.

Member Function Documentation

◆ getSegmentWidth()

int com.realtime.crossfire.jxclient.gui.log.TestBuffer.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 36 of file TestBuffer.java.

◆ newTextSegment()

TextSegment com.realtime.crossfire.jxclient.gui.log.TestBuffer.newTextSegment ( @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 
)
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 31 of file TestBuffer.java.

References com.realtime.crossfire.jxclient.gui.log.TestBuffer.fontHeight.

Member Data Documentation

◆ fontHeight

final int com.realtime.crossfire.jxclient.gui.log.TestBuffer.fontHeight
private

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