 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.item;
37 import java.awt.Image;
38 import javax.swing.SwingUtilities;
39 import org.jetbrains.annotations.NotNull;
113 public void locationChanged() {
142 public GUIItemFloor(@NotNull
final TooltipManager tooltipManager, @NotNull
final GUIElementListener elementListener, @NotNull
final CommandQueue commandQueue, @NotNull
final String
name, @NotNull
final ItemPainter itemPainter,
final int index, @NotNull
final CrossfireServerConnection crossfireServerConnection, @NotNull
final ItemView floorView, @NotNull
final ItemSet itemSet, @NotNull
final FacesManager facesManager, @NotNull
final Image
nextGroupFace, @NotNull
final Image
prevGroupFace,
final int size, @NotNull
final GuiFactory guiFactory) {
171 return index >= -distance;
235 if (player ==
null) {
262 if (this.index !=
index) {
263 if (this.index >= 0) {
267 if (this.index >= 0) {
270 }
else if (!forced) {
Face getFace()
Returns the face.
Maintains a mapping of face numbers to face data.
Paints Crossfire item images.
final Image nextGroupFace
The face to substitute into "Click here for next group of items".
void sendApply(int tag)
Sends an "apply" command to the server.
Model class maintaining the CfItems known to the player.
A GUIElement representing an in-game object in the ground view.
final CrossfireServerConnection crossfireServerConnection
The connection instance.
void setIndexNoListeners(final int index)
Sets the slot index to display without registering listeners for updates.
void addLocationListener(int index, @NotNull LocationListener locationListener)
Adds a LocationListener to be notified when the item displayed in a floor slot has changed.
void removeLocationListener(int index, @NotNull LocationListener locationListener)
Removes a LocationListener to be notified when the item displayed in a floor slot has changed.
CfItem getItem()
Returns the current item instance.
void notifyOpen()
Called each time the enclosing dialog is opened (or raised).
ImageIcon getOriginalImageIcon(int faceNum, @Nullable AtomicBoolean returnIsUnknownImage)
Returns the "original" face for a face ID.
int getFaceNum()
Returns the unique face id.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
final CommandQueue commandQueue
The command queue for sending commands.
final Image prevGroupFace
The face to substitute into "Click here for previous group of items".
static final int MASK
The mask for all used modifiers.
final int defaultIndex
The default scroll index.
void dispose()
Releases all allocated resources.
int index
The currently shown index.
void setItem(@Nullable final CfItem item)
Sets the current item instance.
CfItem item
The current item instance.
int getIndex()
Returns the slot index.
void scroll(final int distance)
Scrolls the element.
Manages image information ("faces") needed to display the map view, items, and spell icons.
final ItemPainter itemPainter
The ItemPainter for painting the icon.
void sendExamine(int tag)
Sends an "examine" command to the server.
int getOpenContainer()
Returns the currently opened container.
void sendMove(final int to, final int tag)
Sends a "move" command to the server.
GUIItemFloor(@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final CommandQueue commandQueue, @NotNull final String name, @NotNull final ItemPainter itemPainter, final int index, @NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final ItemView floorView, @NotNull final ItemSet itemSet, @NotNull final FacesManager facesManager, @NotNull final Image nextGroupFace, @NotNull final Image prevGroupFace, final int size, @NotNull final GuiFactory guiFactory)
Creates a new instance.
A GUIElement instance representing an in-game item.
Interface defining an abstract GUI element.
void setIndex(final int index, final boolean forced)
Set the floor tile to display.
The representation of a Crossfire Item, client-side.
boolean isItemGroupButton()
Returns whether this object is a fake object for selecting object groups in the ground view.
Helper functions for keyboard modifiers.
void setSelected(final boolean selected)
Sets the selected state.
boolean canScroll(final int distance)
Returns whether scrolling is possible.
int getTag()
Returns the tag.
CfItem getItem(int index)
Returns the CfItem in a given slot.
static final long serialVersionUID
The serial version UID.
void button2Clicked(final int modifiers)
Called when the middle mouse button was pressed.
Image getFace(@NotNull final CfItem item)
Returns the face for a CfItem instance.
final GuiFactory guiFactory
The global GuiFactory instance.
final ItemSet itemSet
The ItemSet to use.
boolean isSelected()
Returns whether this element should be drawn as "selected".
final GUIElementListener elementListener
The GUIElementListener to notify.
CfItem getPlayer()
Returns the player object this client controls.
void button3Clicked(final int modifiers)
Called when the right mouse button was pressed.
static final int CTRL
The mask for "ctrl".
void setItemNoListeners(@Nullable final CfItem item)
Sets the current item instance without registering listeners for updates.
Interface for listeners interested in changed items.
Factory for creating Gui instances.
final String name
The name of this element.
static final int NONE
The mask for "no modifier".
void resetScroll()
Resets the scroll index to the default value.
final TooltipManager tooltipManager
The TooltipManager to update.
void button1Clicked(final int modifiers)
Called when the left mouse button was pressed.
final ItemView floorView
The floor view to watch.
final Runnable locationListenerEdt
Called from locationListener but runs on the EDT.
static final int SHIFT
The mask for "shift".
int getSize()
Returns the number of items.
final FacesManager facesManager
The FacesManager instance to use.
Maintains the pending (ncom) commands sent to the server.
final LocationListener locationListener
The LocationListener used to detect items added to or removed from this floor tile.
Listener for GUIElement related events.