Crossfire JXClient, Trunk
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-2017,2019-2023 Andreas Kirschbaum
20  * Copyright (C) 2010-2012,2014-2018,2020-2023 Nicolas Weeger
21  */
22 
23 package com.realtime.crossfire.jxclient.gui.log;
24 
31 import java.awt.Color;
32 import java.awt.Image;
33 import org.jetbrains.annotations.NotNull;
34 import org.jetbrains.annotations.Nullable;
35 
40 public class GUIMessageLog extends GUILog {
41 
45  private static final long serialVersionUID = 1;
46 
50  @NotNull
52 
67  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, @NotNull final Color selectionColor, @NotNull final GuiFactory guiFactory) {
69  messageBufferUpdater = new MessageBufferUpdater(crossfireServerConnection, getBuffer(), defaultColor, selectionColor);
70  }
71 
72  @Override
73  public void dispose() {
74  super.dispose();
76  }
77 
78  @Nullable
79  @Override
81  return null;
82  }
83 
84  @Override
85  public void notifyOpen() {
86  }
87 
93  public void setColor(final int index, @NotNull final Color color) {
94  messageBufferUpdater.setColor(index, color);
95  }
96 
101  public void setTypes(@NotNull final MessageTypes types) {
103  }
104 
105 }
com.realtime.crossfire.jxclient
com.realtime.crossfire.jxclient.skin.skin
Definition: DefaultJXCSkin.java:23
com.realtime.crossfire.jxclient.server
com.realtime.crossfire.jxclient.gui.log.MessageBufferUpdater.dispose
void dispose()
Releases resources.
Definition: MessageBufferUpdater.java:206
com.realtime.crossfire.jxclient.skin
com.realtime.crossfire.jxclient.gui.log.GUILog
Abstract base class for gui elements implementing text fields.
Definition: GUILog.java:55
com.realtime.crossfire.jxclient.protocol.MessageTypes
A set of message types or type/subtypes.
Definition: MessageTypes.java:31
com.realtime.crossfire.jxclient.gui.log.GUILog.getBuffer
Buffer getBuffer()
Returns the Buffer instance containing the text messages.
Definition: GUILog.java:310
com.realtime.crossfire.jxclient.gui.log.GUIMessageLog.serialVersionUID
static final long serialVersionUID
The serial version UID.
Definition: GUIMessageLog.java:45
com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
Definition: CrossfireServerConnection.java:37
com.realtime.crossfire.jxclient.gui.log.MessageBufferUpdater
Adds drawinfo, drawextinfo, and query messages to a Buffer instance.
Definition: MessageBufferUpdater.java:38
com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.elementListener
final GUIElementListener elementListener
The GUIElementListener to notify.
Definition: AbstractGUIElement.java:89
com.realtime.crossfire.jxclient.gui.log.GUIMessageLog.notifyOpen
void notifyOpen()
Called each time the enclosing dialog is opened (or raised).
Definition: GUIMessageLog.java:85
com.realtime.crossfire.jxclient.gui.log.GUIMessageLog
A gui element implementing the message window.
Definition: GUIMessageLog.java:40
com.realtime.crossfire.jxclient.protocol
Definition: MagicMap.java:23
com.realtime.crossfire.jxclient.gui.log.GUIMessageLog.GUIMessageLog
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, @NotNull final Color selectionColor, @NotNull final GuiFactory guiFactory)
Creates a new instance.
Definition: GUIMessageLog.java:67
com.realtime.crossfire.jxclient.gui.log.GUIMessageLog.messageBufferUpdater
final MessageBufferUpdater messageBufferUpdater
The message buffer updater for updating getBuffer().
Definition: GUIMessageLog.java:51
com.realtime.crossfire.jxclient.gui.log.MessageBufferUpdater.setTypes
void setTypes(@NotNull final MessageTypes types)
Sets the message types to show.
Definition: MessageBufferUpdater.java:253
com.realtime.crossfire.jxclient.gui
com.realtime.crossfire.jxclient.gui.log.MessageBufferUpdater.setColor
void setColor(final int index, @NotNull final Color color)
Sets a color mapping.
Definition: MessageBufferUpdater.java:245
com.realtime.crossfire.jxclient.gui.log.GUIMessageLog.dispose
void dispose()
Releases all allocated resources.
Definition: GUIMessageLog.java:73
com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.guiFactory
final GuiFactory guiFactory
The global GuiFactory instance.
Definition: AbstractGUIElement.java:48
com.realtime.crossfire.jxclient.server.crossfire
Definition: AbstractCrossfireServerConnection.java:23
com.realtime.crossfire.jxclient.gui.gui.TooltipText
Information for displaying tooltips.
Definition: TooltipText.java:31
com.realtime.crossfire.jxclient.skin.skin.GuiFactory
Factory for creating Gui instances.
Definition: GuiFactory.java:41
com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.name
final String name
The name of this element.
Definition: AbstractGUIElement.java:77
com.realtime.crossfire.jxclient.gui.gui
Definition: AbstractGUIElement.java:23
com.realtime.crossfire.jxclient.gui.log.Fonts
Manage a set of fonts.
Definition: Fonts.java:32
com.realtime.crossfire
com.realtime.crossfire.jxclient.gui.gui.TooltipManager
Manages the tooltip display.
Definition: TooltipManager.java:33
com.realtime
com
com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipManager
final TooltipManager tooltipManager
The TooltipManager to update.
Definition: AbstractGUIElement.java:83
com.realtime.crossfire.jxclient.gui.log.GUILog.backgroundImage
final Image backgroundImage
The background image drawn below the text contents.
Definition: GUILog.java:90
com.realtime.crossfire.jxclient.gui.log.GUIMessageLog.getTooltip
TooltipText getTooltip()
Returns the current tooltip text.
Definition: GUIMessageLog.java:80
com.realtime.crossfire.jxclient.gui.log.GUIMessageLog.setTypes
void setTypes(@NotNull final MessageTypes types)
Sets the message types to show.
Definition: GUIMessageLog.java:101
com.realtime.crossfire.jxclient.gui.gui.GUIElementListener
Listener for GUIElement related events.
Definition: GUIElementListener.java:32
com.realtime.crossfire.jxclient.gui.log.GUIMessageLog.setColor
void setColor(final int index, @NotNull final Color color)
Sets a color mapping.
Definition: GUIMessageLog.java:93