00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 package com.realtime.crossfire.jxclient.gui.log;
00023
00024 import com.realtime.crossfire.jxclient.gui.gui.GUIElementListener;
00025 import com.realtime.crossfire.jxclient.gui.gui.TooltipManager;
00026 import java.awt.Color;
00027 import java.awt.Image;
00028 import org.jetbrains.annotations.NotNull;
00029 import org.jetbrains.annotations.Nullable;
00030
00035 public class GUILabelLog extends GUILog {
00036
00040 private static final long serialVersionUID = 1;
00041
00045 @NotNull
00046 private final Parser parser = new Parser();
00047
00051 @NotNull
00052 private final Color defaultColor;
00053
00065 public GUILabelLog(@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @Nullable final Image backgroundImage, @NotNull final Fonts fonts, @NotNull final Color defaultColor) {
00066 super(tooltipManager, elementListener, name, backgroundImage, fonts);
00067 this.defaultColor = defaultColor;
00068 }
00069
00074 public void updateText(@NotNull final CharSequence string) {
00075 final Buffer buffer = getBuffer();
00076 buffer.clear();
00077 parser.parse(string, defaultColor, buffer);
00078 scrollTo(0);
00079 }
00080
00081 }