 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.misc;
32 import java.awt.Dimension;
33 import java.awt.Graphics;
34 import java.awt.Image;
35 import java.awt.Transparency;
36 import java.awt.image.BufferedImage;
37 import org.jetbrains.annotations.NotNull;
38 import org.jetbrains.annotations.Nullable;
99 public void resetBefore() {
104 public void resetAfter() {
109 public void statChanged(
final int statNo,
final int value) {
110 if (statNo ==
stat) {
116 public void simpleWeaponSpeedChanged(
final boolean simpleWeaponSpeed) {
121 public void titleChanged(@NotNull
final String title) {
126 public void godNameChanged(@NotNull
final String godName) {
131 public void rangeChanged(@NotNull
final String range) {
136 public void activeSkillChanged(@NotNull
final String activeSkill) {
141 public void experienceChanged(
final long exp) {
146 public void experienceNextLevelChanged(
final long expNextLevel) {
166 public GUIPictureStat(@NotNull
final TooltipManager tooltipManager, @NotNull
final GUIElementListener elementListener, @NotNull
final String
name,
final int stat, @Nullable
final BufferedImage
imageInactive, @Nullable
final BufferedImage
imageActive,
final int preferredWidth,
final int preferredHeight, @NotNull
final Stats stats, @NotNull
final GuiFactory guiFactory, @NotNull
final String
tooltipText) {
169 throw new IllegalArgumentException(
"neither imageInactive nor imageActive is set");
175 preferredSize =
new Dimension(preferredWidth, preferredHeight);
189 super.paintComponent(g);
192 g.drawImage(image, 0, 0,
null);
198 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
205 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
212 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
233 if (this.active ==
active) {
Dimension getPreferredSize()
void setActive(final boolean active)
Updates active.
final int stat
The stat to display.
final StatsListener statsListener
The StatsListener registered to be notified about stat changes.
final Stats stats
The Stats instance to use.
final Image imageActive
The picture to paint when the stat is not 0.
Abstract base class for GUI elements to be shown in Guis.
final GUIElementListener elementListener
The GUIElementListener to notify.
void removeCrossfireStatsListener(@NotNull final StatsListener statsListener)
Removes a StatsListener to be notified about stat changes.
static final long serialVersionUID
The serial version UID.
void addCrossfireStatsListener(@NotNull final StatsListener statsListener)
Adds a StatsListener to be notified about stat changes.
A AbstractGUIElement that displays a picture depending on the value of a stat.
boolean active
Whether the active image is shown.
final String tooltipText
The tooltip text to show.
This is the representation of all the statistics of a player, like its speed or its experience.
Dimension getMinimumSize()
final GuiFactory guiFactory
The global GuiFactory instance.
void paintComponent(@NotNull final Graphics g)
TooltipText newTooltipText(@Nullable final String tooltipText)
Creates a TooltipText instance relative to this instance.
Information for displaying tooltips.
Factory for creating Gui instances.
final String name
The name of this element.
Dimension getMaximumSize()
final Dimension preferredSize
The preferred size of this component.
final TooltipManager tooltipManager
The TooltipManager to update.
void dispose()
Releases all allocated resources.
TooltipText getTooltip()
Returns the current tooltip text.
Interface for listeners interested in changes of Stats instances.
final Image imageInactive
The picture to paint when the stat is 0.
GUIPictureStat(@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, final int stat, @Nullable final BufferedImage imageInactive, @Nullable final BufferedImage imageActive, final int preferredWidth, final int preferredHeight, @NotNull final Stats stats, @NotNull final GuiFactory guiFactory, @NotNull final String tooltipText)
Creates a new instance.
void notifyOpen()
Called each time the enclosing dialog is opened (or raised).
Listener for GUIElement related events.