 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.log;
31 import java.awt.Color;
32 import org.jetbrains.annotations.NotNull;
49 private final Color @NotNull []
colors = {
113 @SuppressWarnings(
"ZeroLengthArrayAllocation")
128 public void commandQueryReceived(@NotNull
final String prompt,
final int queryType) {
144 public void commandDrawextinfoReceived(
final int color,
final int type,
final int subtype, @NotNull
final String message) {
171 public void commandDrawinfoReceived(@NotNull
final String text,
final int type) {
173 final int messageType =
switch (type) {
221 }
catch (
final ArrayIndexOutOfBoundsException ignored) {
235 }
catch (
final ArrayIndexOutOfBoundsException ignored) {
245 public void setColor(
final int index, @NotNull
final Color color) {
267 private CharSequence
addMessageTypePrefix(
final int type,
final int subtype,
final int color, @NotNull
final CharSequence message) {
static String getColorName(final int index)
Returns the name of a color index.
static final int MSG_SUBTYPE_NONE
static final int NUM_COLORS
The number of supported colors.
final CrossfireServerConnection crossfireServerConnection
The CrossfireServerConnection to monitor.
void removeCrossfireDrawextinfoListener(@NotNull CrossfireDrawextinfoListener listener)
Removes the given listener from the list of objects listening to the drawextinfo S->C messages.
Interface for listeners interested in drawinfo messages received from the Crossfire server.
MessageBufferUpdater(@NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final Buffer buffer, @NotNull final Color defaultColor, @NotNull final Color selectionColor)
Creates a new instance.
static final int MSG_SUBTYPE_JXCLIENT_QUERY
A query message has been received.
static final int MSG_TYPE_JXCLIENT
Internally used drawextinfo message type: a message has been generated by the client.
void dispose()
Releases resources.
void removeCrossfireQueryListener(@NotNull CrossfireQueryListener listener)
Removes the given listener from the list of objects listening to the query S->C messages.
A set of message types or type/subtypes.
void removeCrossfireDrawinfoListener(@NotNull CrossfireDrawinfoListener listener)
Removes the given listener from the list of objects listening to the drawinfo S->C messages.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
Adds drawinfo, drawextinfo, and query messages to a Buffer instance.
final Buffer buffer
The buffer to update.
Parser for parsing drawextinfo messages received from a Crossfire server to update a Buffer instance.
final Color defaultColor
The color to use for invalid colors indices.
Color findColor(final int index)
Converts a Crossfire color index to a Color instance.
Encapsulates the message type numbers for drawextinfo messages.
MessageTypes types
The types to show.
CharSequence addMessageTypePrefix(final int type, final int subtype, final int color, @NotNull final CharSequence message)
Adds a message type prefix to a message if printMessageTypes is set.
static String toString(final int type, final int subtype)
Returns a string representation of a message type.
int NDI_RED
A message color.
static final int MSG_TYPE_MISC
drawextinfo message type: message that does not fit in any other category.
final CrossfireQueryListener crossfireQueryListener
The CrossfireQueryListener registered to receive query commands.
final CrossfireDrawextinfoListener crossfireDrawextinfoListener
The CrossfireDrawextinfoListener registered to receive drawextinfo commands.
void parse(@NotNull final CharSequence text, final int type, final int subtype, @NotNull final Color defaultColor, @NotNull final Buffer buffer)
Parses a text message.
final CrossfireDrawinfoListener crossfireDrawinfoListener
The CrossfireDrawinfoListener registered to receive drawinfo commands.
void setTypes(@NotNull final MessageTypes types)
Sets the message types to show.
Manages the contents of the contents of a log window.
void setColor(final int index, @NotNull final Color color)
Sets a color mapping.
Interface for listeners interested in query messages received from the Crossfire server.
boolean isTypeShown(final int type, final int subtype)
Returns whether a message type should be shown.
Interface for listeners interested in drawextinfo messages received from the Crossfire server.
final Parser parser
The Parser instance for parsing drawextinfo messages.
final Color[] colors
Maps color index to color.
static final String[] COLOR_NAMES
The colors names corresponding to colors.
void parseWithoutMediaTags(@NotNull final CharSequence text, final int type, final int subtype, @NotNull final Color color, @NotNull final Buffer buffer)
Parses a plain text message without media tags.
boolean printMessageTypes
Whether message types are included in the buffer output.
static final int MSG_TYPE_COMMUNICATION
drawextinfo message type: communication between players.