 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.item;
35 import java.awt.Dimension;
36 import java.awt.Graphics;
37 import java.awt.Graphics2D;
38 import java.awt.Image;
39 import org.jetbrains.annotations.NotNull;
40 import org.jetbrains.annotations.Nullable;
88 public void faceUpdated(@NotNull
final Face face) {
122 super.paintComponent(g);
125 if (tmpItem ==
null) {
129 final Graphics2D g2 = (Graphics2D)g;
135 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
142 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
169 if (this.item ==
item) {
173 if (this.item !=
null) {
177 if (this.item !=
null) {
198 public abstract void setSelected(
final boolean selected);
Face getFace()
Returns the face.
Maintains a mapping of face numbers to face data.
abstract void setSelected(final boolean selected)
Sets the selected state.
Paints Crossfire item images.
void tooltipChanged()
Must be called whenever the tooltip may have changed.
void removeFacesManagerListener(@NotNull FacesManagerListener facesManagerListener)
Removes a FacesManagerListener to be notified about updated faces.
GUIItemItem(@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final ItemPainter itemPainter, @NotNull final FacesManager facesManager, @NotNull final GuiFactory guiFactory)
Creates a new instance.
abstract void setIndexNoListeners(final int index)
Sets the slot index to display without registering listeners for updates.
CfItem getItem()
Returns the current item instance.
Dimension getMinimumSize()
TooltipText getTooltip()
Returns the current tooltip text.
void setChanged()
Records that the contents have changed and must be repainted.
Interface for listeners interested in FacesManager events.
void setItem(@Nullable final CfItem item)
Sets the current item instance.
CfItem item
The current item instance.
A GUIElement representing an in-game object.
Manages image information ("faces") needed to display the map view, items, and spell icons.
final ItemPainter itemPainter
The ItemPainter for painting the icon.
abstract Image getFace(@NotNull final CfItem item)
Returns the face for a CfItem instance.
abstract int getIndex()
Returns the slot index.
Interface for listeners for attribute changes of CfItems.
String getTooltipText()
Returns a description suitable for a tooltip text.
final FacesManager facesManager
The FacesManager instance to use.
void addFacesManagerListener(@NotNull FacesManagerListener facesManagerListener)
Adds a FacesManagerListener to be notified about updated faces.
Dimension getPreferredSize()
A GUIElement instance representing an in-game item.
Interface defining an abstract GUI element.
The representation of a Crossfire Item, client-side.
void paintComponent(@NotNull final Graphics g)
final GuiFactory guiFactory
The global GuiFactory instance.
void addCfItemModifiedListener(@NotNull final CfItemListener listener)
Add a.
TooltipText newTooltipText(@Nullable final String tooltipText)
Creates a TooltipText instance relative to this instance.
final GUIElementListener elementListener
The GUIElementListener to notify.
void paint(@NotNull final Graphics2D g, @NotNull final CfItem item, final boolean selected, @NotNull final Image face, final int w, final int h)
Paints an CfItem.
void setItemNoListeners(@Nullable final CfItem item)
Sets the current item instance without registering listeners for updates.
Information for displaying tooltips.
Factory for creating Gui instances.
final String name
The name of this element.
void dispose()
Releases all allocated resources.
final CfItemListener itemListener
The CfItemListener used to detect attribute changes of the displayed item.
static final long serialVersionUID
The serial version UID.
final FacesManagerListener facesManagerListener
The FacesManagerListener registered to detect updated faces.
final TooltipManager tooltipManager
The TooltipManager to update.
Dimension getMinimumSize()
Returns the minimal size needed to display this item.
abstract boolean isSelected()
Returns whether this element should be drawn as "selected".
Listener for GUIElement related events.