Crossfire JXClient, Trunk
TextButtonFactory.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.skin.factory;
24 
34 import java.awt.Color;
35 import java.awt.Font;
36 import org.jetbrains.annotations.NotNull;
37 
42 public class TextButtonFactory {
43 
47  @NotNull
48  private final ButtonImages up;
49 
53  @NotNull
54  private final ButtonImages down;
55 
59  @NotNull
60  private final Font font;
61 
65  @NotNull
66  private final Color color;
67 
71  @NotNull
72  private final Color colorSelected;
73 
77  @NotNull
78  private final Color colorDisabled;
79 
83  @NotNull
84  private final GuiFactory guiFactory;
85 
89  @NotNull
90  private final NewCharModel newCharModel;
91 
95  @NotNull
97 
110  public TextButtonFactory(@NotNull final ButtonImages up, @NotNull final ButtonImages down, @NotNull final Font font, @NotNull final Color color, @NotNull final Color colorSelected, @NotNull final Color colorDisabled, @NotNull final GuiFactory guiFactory, @NotNull final NewCharModel newCharModel, @NotNull final KeybindingsManager keybindingsManager) {
111  this.up = up;
112  this.down = down;
113  this.font = font;
114  this.color = color;
115  this.colorSelected = colorSelected;
116  this.colorDisabled = colorDisabled;
117  this.guiFactory = guiFactory;
118  this.newCharModel = newCharModel;
119  this.keybindingsManager = keybindingsManager;
120  }
121 
133  @NotNull
134  public AbstractGUIElement newTextButton(@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final String text, final boolean autoRepeat, @NotNull final CommandList commandList) {
135  return new GUITextButton(tooltipManager, elementListener, name, up, down, text, font, color, colorSelected, colorDisabled, autoRepeat, commandList, guiFactory, newCharModel, keybindingsManager);
136  }
137 
138 }
com.realtime.crossfire.jxclient
com.realtime.crossfire.jxclient.skin.skin
Definition: DefaultJXCSkin.java:23
com.realtime.crossfire.jxclient.skin.factory.TextButtonFactory.font
final Font font
Definition: TextButtonFactory.java:60
com.realtime.crossfire.jxclient.gui.commandlist.CommandList
Definition: CommandList.java:34
com.realtime.crossfire.jxclient.skin
com.realtime.crossfire.jxclient.gui.label
Definition: AbstractLabel.java:23
com.realtime.crossfire.jxclient.skin.skin.GuiFactory
Definition: GuiFactory.java:41
com.realtime.crossfire.jxclient.gui.commandlist
Definition: CommandList.java:23
com.realtime.crossfire.jxclient.skin.factory.TextButtonFactory.TextButtonFactory
TextButtonFactory(@NotNull final ButtonImages up, @NotNull final ButtonImages down, @NotNull final Font font, @NotNull final Color color, @NotNull final Color colorSelected, @NotNull final Color colorDisabled, @NotNull final GuiFactory guiFactory, @NotNull final NewCharModel newCharModel, @NotNull final KeybindingsManager keybindingsManager)
Definition: TextButtonFactory.java:110
com.realtime.crossfire.jxclient.gui.keybindings
Definition: InvalidKeyBindingException.java:23
com.realtime.crossfire.jxclient.gui.button.ButtonImages
Definition: ButtonImages.java:35
com.realtime.crossfire.jxclient.skin.factory.TextButtonFactory.up
final ButtonImages up
Definition: TextButtonFactory.java:48
com.realtime.crossfire.jxclient.skin.factory.TextButtonFactory.guiFactory
final GuiFactory guiFactory
Definition: TextButtonFactory.java:84
com.realtime.crossfire.jxclient.skin.factory.TextButtonFactory
Definition: TextButtonFactory.java:42
com.realtime.crossfire.jxclient.gui
com.realtime.crossfire.jxclient.gui.button
Definition: AbstractButton.java:23
com.realtime.crossfire.jxclient.gui.gui.TooltipManager
Definition: TooltipManager.java:33
com.realtime.crossfire.jxclient.skin.factory.TextButtonFactory.colorDisabled
final Color colorDisabled
Definition: TextButtonFactory.java:78
com.realtime.crossfire.jxclient.gui.label.NewCharModel
Definition: NewCharModel.java:43
com.realtime.crossfire.jxclient.gui.gui
Definition: AbstractGUIElement.java:23
com.realtime.crossfire.jxclient.skin.factory.TextButtonFactory.down
final ButtonImages down
Definition: TextButtonFactory.java:54
com.realtime.crossfire
com.realtime
com
com.realtime.crossfire.jxclient.skin.factory.TextButtonFactory.color
final Color color
Definition: TextButtonFactory.java:66
com.realtime.crossfire.jxclient.skin.factory.TextButtonFactory.keybindingsManager
final KeybindingsManager keybindingsManager
Definition: TextButtonFactory.java:96
com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement
Definition: AbstractGUIElement.java:37
com.realtime.crossfire.jxclient.skin.factory.TextButtonFactory.colorSelected
final Color colorSelected
Definition: TextButtonFactory.java:72
com.realtime.crossfire.jxclient.skin.factory.TextButtonFactory.newCharModel
final NewCharModel newCharModel
Definition: TextButtonFactory.java:90
com.realtime.crossfire.jxclient.gui.button.GUITextButton
Definition: GUITextButton.java:57
com.realtime.crossfire.jxclient.skin.factory.TextButtonFactory.newTextButton
AbstractGUIElement newTextButton(@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final String text, final boolean autoRepeat, @NotNull final CommandList commandList)
Definition: TextButtonFactory.java:134
com.realtime.crossfire.jxclient.gui.gui.GUIElementListener
Definition: GUIElementListener.java:32
com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager
Definition: KeybindingsManager.java:40