 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.button;
31 import java.awt.Color;
32 import java.awt.Dimension;
34 import java.awt.Graphics;
35 import java.awt.Image;
36 import java.awt.image.BufferedImage;
37 import org.jetbrains.annotations.NotNull;
38 import org.jetbrains.annotations.Nullable;
126 protected AbstractButton2(@NotNull
final TooltipManager tooltipManager, @NotNull
final GUIElementListener elementListener, @NotNull
final String
name, @NotNull
final BufferedImage
imageUp, @NotNull
final BufferedImage
imageDown, @Nullable
final String
text, @Nullable
final Font
font, @Nullable
final Color
color,
final int textX,
final int textY,
final boolean autoRepeat, @NotNull
final CommandList commandList, @NotNull
final GuiFactory guiFactory, @NotNull
final NewCharModel newCharModel) {
128 final int preferredWidth =
imageUp.getWidth();
129 if (preferredWidth !=
imageDown.getWidth()) {
130 throw new IllegalArgumentException(
"preferredWidth="+preferredWidth+
", imageWidth="+
imageDown.getWidth());
132 final int preferredHeight =
imageUp.getHeight();
133 if (preferredHeight !=
imageDown.getHeight()) {
134 throw new IllegalArgumentException(
"preferredHeight="+preferredHeight+
", imageHeight="+
imageDown.getHeight());
143 preferredSize =
new Dimension(preferredWidth, preferredHeight);
148 super.paintComponent(g);
171 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
General information for creating new characters.
final GuiFactory guiFactory
The global GuiFactory instance.
final GUIElementListener elementListener
The GUIElementListener to notify.
Information for displaying tooltips.
Factory for creating Gui instances.
A list of GUICommand instances.
final String name
The name of this element.
final TooltipManager tooltipManager
The TooltipManager to update.
Listener for GUIElement related events.