Crossfire JXClient, Trunk  R20561
GUIMessageLog.java
Go to the documentation of this file.
1 /*
2  * This file is part of JXClient, the Fullscreen Java Crossfire Client.
3  *
4  * JXClient is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * JXClient is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with JXClient; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * Copyright (C) 2005-2008 Yann Chachkoff.
19  * Copyright (C) 2006-2011 Andreas Kirschbaum.
20  */
21 
22 package com.realtime.crossfire.jxclient.gui.log;
23 
27 import java.awt.Color;
28 import java.awt.Image;
29 import org.jetbrains.annotations.NotNull;
30 import org.jetbrains.annotations.Nullable;
31 
36 public class GUIMessageLog extends GUILog {
37 
41  private static final long serialVersionUID = 1;
42 
46  @NotNull
48 
61  public GUIMessageLog(@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final CrossfireServerConnection crossfireServerConnection, @Nullable final Image backgroundImage, @NotNull final Fonts fonts, @NotNull final Color defaultColor) {
62  super(tooltipManager, elementListener, name, backgroundImage, fonts);
63  messageBufferUpdater = new MessageBufferUpdater(crossfireServerConnection, getBuffer(), defaultColor);
64  }
65 
69  @Override
70  public void dispose() {
71  super.dispose();
72  messageBufferUpdater.dispose();
73  }
74 
80  public void setColor(final int index, @NotNull final Color color) {
81  messageBufferUpdater.setColor(index, color);
82  }
83 
88  public void setTypes(final int types) {
89  messageBufferUpdater.setTypes(types);
90  }
91 
92 }
void setColor(final int index, @NotNull final Color color)
Sets a color mapping.
final TooltipManager tooltipManager
The TooltipManager to update.
void setTypes(final int types)
Sets the message types to show.
GUIMessageLog(@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final CrossfireServerConnection crossfireServerConnection, @Nullable final Image backgroundImage, @NotNull final Fonts fonts, @NotNull final Color defaultColor)
Creates a new instance.
final MessageBufferUpdater messageBufferUpdater
The message buffer updater for updating buffer.
A gui element implementing the message window.
static final long serialVersionUID
The serial version UID.
final GUIElementListener elementListener
The GUIElementListener to notify.
final Image backgroundImage
The background image drawn below the text contents.
Definition: GUILog.java:77
final Fonts fonts
The Fonts instance for looking up fonts.
Definition: GUILog.java:83
void dispose()
Releases all allocated resources.
void setColor(final int index, @NotNull final Color color)
Sets a color mapping.
Buffer getBuffer()
Returns the Buffer instance containing the text messages.
Definition: GUILog.java:251
void setTypes(final int types)
Sets the message types to show.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
Abstract base class for gui elements implementing text fields.
Definition: GUILog.java:48
Adds drawinfo, drawextinfo, and query messages to a Buffer instance.