Crossfire JXClient, Trunk
|
Public Member Functions | |
void | button1Clicked (final int modifiers) |
void | button2Clicked (final int modifiers) |
void | button3Clicked (final int modifiers) |
boolean | canScroll (final int distance) |
void | dispose () |
int | getIndex () |
GUIItemInventory (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final CommandQueue commandQueue, final String name, @NotNull final ItemPainter itemPainter, final int index, @NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final FacesManager facesManager, @NotNull final FloorView floorView, @NotNull final ItemView inventoryView, final int size, @NotNull final GuiFactory guiFactory) | |
void | notifyOpen () |
void | resetScroll () |
void | scroll (final int distance) |
void | setChanged () |
void | setIndexNoListeners (final int index) |
void | setSelected (final boolean selected) |
Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.item.GUIItemItem | |
CfItem | getItem () |
Dimension | getMinimumSize () |
Dimension | getPreferredSize () |
TooltipText | getTooltip () |
void | paintComponent (@NotNull final Graphics g) |
Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.item.GUIItem | |
void | activeChanged () |
void | execute () |
void | mouseClicked (@NotNull final MouseEvent e) |
void | setVisible (final boolean aFlag) |
Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement | |
void | activateNextElement () |
void | activatePrevElement () |
boolean | isActive () |
void | mousePressed (@NotNull final MouseEvent e) |
void | setActive (final boolean active) |
void | setNextActive (@NotNull final ActivatableGUIElement next) |
void | setPrevActive (@NotNull final ActivatableGUIElement prev) |
Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement | |
int | getDialogBorderBottom () |
int | getDialogBorderLeft () |
int | getDialogBorderRight () |
int | getDialogBorderTop () |
String | getName () |
void | inhibitListeners () |
boolean | isDefault () |
boolean | isIgnore () |
void | mouseDragged (@NotNull final MouseEvent e) |
void | mouseEntered (@NotNull final MouseEvent e) |
void | mouseExited (@NotNull final MouseEvent e) |
void | mouseMoved (@NotNull final MouseEvent e) |
void | mouseReleased (@NotNull final MouseEvent e) |
void | mouseWheelMoved (final int wheelRotation) |
void | setChangedListener (@Nullable final GUIElementChangedListener changedListener) |
void | setDefault (final boolean isDefault) |
void | setIgnore () |
String | toString () |
Private Member Functions | |
void | setIndex (final int index) |
Private Attributes | |
final CommandQueue | commandQueue |
final CrossfireServerConnection | crossfireServerConnection |
final int | defaultIndex |
final FacesManager | facesManager |
final FloorView | floorView |
int | index = -1 |
final ItemView | inventoryView |
final LocationListener | locationListener |
final Runnable | locationListenerEdt |
boolean | selected |
final Object | sync = new Object() |
Static Private Attributes | |
static final long | serialVersionUID = 1 |
A GUIItem for displaying inventory objects.
Definition at line 46 of file GUIItemInventory.java.
com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.GUIItemInventory | ( | @NotNull final TooltipManager | tooltipManager, |
@NotNull final GUIElementListener | elementListener, | ||
@NotNull final CommandQueue | commandQueue, | ||
final String | name, | ||
@NotNull final ItemPainter | itemPainter, | ||
final int | index, | ||
@NotNull final CrossfireServerConnection | crossfireServerConnection, | ||
@NotNull final FacesManager | facesManager, | ||
@NotNull final FloorView | floorView, | ||
@NotNull final ItemView | inventoryView, | ||
final int | size, | ||
@NotNull final GuiFactory | guiFactory | ||
) |
Creates a new instance.
tooltipManager | the tooltip manager to update |
elementListener | the element listener to notify |
commandQueue | the command queue for sending commands |
name | the name of this element |
index | the default scroll index |
crossfireServerConnection | the connection instance |
itemPainter | the item painter for painting the icon |
facesManager | the faces manager instance to use |
floorView | the floor view to use |
inventoryView | the inventory view to watch |
size | the size of the component or 0
|
guiFactory | the global GUI factory instance |
Definition at line 142 of file GUIItemInventory.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.commandQueue, com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.crossfireServerConnection, com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.defaultIndex, com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.elementListener, com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.facesManager, com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.floorView, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.guiFactory, com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.index, com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.inventoryView, com.realtime.crossfire.jxclient.gui.item.GUIItemItem.itemPainter, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.name, com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setIndex(), and com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipManager.
void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.button1Clicked | ( | final int | modifiers | ) |
Called when the left mouse button was pressed.
modifiers | the input event modifiers |
Reimplemented from com.realtime.crossfire.jxclient.gui.item.GUIItem.
Definition at line 194 of file GUIItemInventory.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.crossfireServerConnection, com.realtime.crossfire.jxclient.gui.misc.Modifiers.CTRL, com.realtime.crossfire.jxclient.gui.item.GUIItemItem.getItem(), com.realtime.crossfire.jxclient.items.CfItem.getTag(), com.realtime.crossfire.jxclient.items.CfItem.isLocked(), com.realtime.crossfire.jxclient.gui.item.GUIItemItem.item, com.realtime.crossfire.jxclient.gui.misc.Modifiers.MASK, com.realtime.crossfire.jxclient.gui.misc.Modifiers.NONE, com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.sendApply(), com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.sendExamine(), com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.sendLock(), com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.sendMark(), and com.realtime.crossfire.jxclient.gui.misc.Modifiers.SHIFT.
void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.button2Clicked | ( | final int | modifiers | ) |
Called when the middle mouse button was pressed.
modifiers | the input event modifiers |
Reimplemented from com.realtime.crossfire.jxclient.gui.item.GUIItem.
Definition at line 220 of file GUIItemInventory.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.crossfireServerConnection, com.realtime.crossfire.jxclient.gui.item.GUIItemItem.getItem(), com.realtime.crossfire.jxclient.items.CfItem.getTag(), com.realtime.crossfire.jxclient.gui.item.GUIItemItem.item, com.realtime.crossfire.jxclient.gui.misc.Modifiers.MASK, com.realtime.crossfire.jxclient.gui.misc.Modifiers.NONE, com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.sendApply(), com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.sendMark(), and com.realtime.crossfire.jxclient.gui.misc.Modifiers.SHIFT.
void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.button3Clicked | ( | final int | modifiers | ) |
Called when the right mouse button was pressed.
modifiers | the input event modifiers |
Reimplemented from com.realtime.crossfire.jxclient.gui.item.GUIItem.
Definition at line 238 of file GUIItemInventory.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.commandQueue, com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.crossfireServerConnection, com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.drawInfo(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.floorView, com.realtime.crossfire.jxclient.items.FloorView.getCurrentFloorTag(), com.realtime.crossfire.jxclient.gui.item.GUIItemItem.getItem(), com.realtime.crossfire.jxclient.items.CfItem.getTag(), com.realtime.crossfire.jxclient.items.CfItem.isLocked(), com.realtime.crossfire.jxclient.gui.item.GUIItemItem.item, com.realtime.crossfire.jxclient.gui.misc.Modifiers.MASK, com.realtime.crossfire.jxclient.server.crossfire.CrossfireDrawinfoListener.NDI_RED, com.realtime.crossfire.jxclient.gui.misc.Modifiers.NONE, com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.sendApply(), com.realtime.crossfire.jxclient.queue.CommandQueue.sendMove(), and com.realtime.crossfire.jxclient.gui.misc.Modifiers.SHIFT.
boolean com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.canScroll | ( | final int | distance | ) |
Returns whether scrolling is possible.
distance | the distance to scroll |
Implements com.realtime.crossfire.jxclient.gui.scrollable.GUIScrollable.
Definition at line 163 of file GUIItemInventory.java.
References com.realtime.crossfire.jxclient.items.ItemView.getSize(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.index, com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.inventoryView, and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.sync.
void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.dispose | ( | ) |
Releases all allocated resources.
Reimplemented from com.realtime.crossfire.jxclient.gui.item.GUIItemItem.
Definition at line 157 of file GUIItemInventory.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setIndex().
|
protected |
Returns the face for a CfItem instance.
item | the item instance |
Reimplemented from com.realtime.crossfire.jxclient.gui.item.GUIItemItem.
Definition at line 315 of file GUIItemInventory.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.facesManager, com.realtime.crossfire.jxclient.items.CfItem.getFace(), com.realtime.crossfire.jxclient.faces.Face.getFaceNum(), com.realtime.crossfire.jxclient.faces.FacesManager.getOriginalImageIcon(), and com.realtime.crossfire.jxclient.gui.item.GUIItemItem.item.
int com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.getIndex | ( | ) |
Returns the slot index.
Reimplemented from com.realtime.crossfire.jxclient.gui.item.GUIItemItem.
Definition at line 276 of file GUIItemInventory.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.index, and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.sync.
|
protected |
Returns whether this element should be drawn as "selected".
Reimplemented from com.realtime.crossfire.jxclient.gui.item.GUIItemItem.
Definition at line 271 of file GUIItemInventory.java.
References com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.isActive(), and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.selected.
void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.notifyOpen | ( | ) |
Called each time the enclosing dialog is opened (or raised).
Implements com.realtime.crossfire.jxclient.gui.gui.GUIElement.
Definition at line 330 of file GUIItemInventory.java.
void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.resetScroll | ( | ) |
Resets the scroll index to the default value.
Implements com.realtime.crossfire.jxclient.gui.scrollable.GUIScrollable.
Definition at line 189 of file GUIItemInventory.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.defaultIndex, and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setIndex().
void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.scroll | ( | final int | distance | ) |
Scrolls the element.
distance | the distance to scroll |
Implements com.realtime.crossfire.jxclient.gui.scrollable.GUIScrollable.
Definition at line 178 of file GUIItemInventory.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.index, com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setChanged(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setIndex(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.sync, and com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipChanged().
void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setChanged | ( | ) |
Records that the contents have changed and must be repainted.
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.
Definition at line 320 of file GUIItemInventory.java.
References com.realtime.crossfire.jxclient.items.ItemView.getItem(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.index, com.realtime.crossfire.jxclient.gui.item.GUIItemItem.setItem(), and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.sync.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.scroll(), and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setSelected().
|
private |
Set the inventory slot to display.
index | the inventory slot |
Definition at line 286 of file GUIItemInventory.java.
References com.realtime.crossfire.jxclient.items.ItemView.addLocationListener(), com.realtime.crossfire.jxclient.items.ItemView.getItem(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.index, com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.inventoryView, com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.locationListener, com.realtime.crossfire.jxclient.items.ItemView.removeLocationListener(), com.realtime.crossfire.jxclient.gui.item.GUIItemItem.setItem(), and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.sync.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.dispose(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.GUIItemInventory(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.resetScroll(), and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.scroll().
void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setIndexNoListeners | ( | final int | index | ) |
Sets the slot index to display without registering listeners for updates.
index | the slot index |
Reimplemented from com.realtime.crossfire.jxclient.gui.item.GUIItemItem.
Definition at line 305 of file GUIItemInventory.java.
References com.realtime.crossfire.jxclient.items.ItemView.getItem(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.index, com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.inventoryView, com.realtime.crossfire.jxclient.gui.item.GUIItemItem.setItemNoListeners(), and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.sync.
void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setSelected | ( | final boolean | selected | ) |
Sets the selected state.
selected | whether this element should be drawn as "selected" |
Reimplemented from com.realtime.crossfire.jxclient.gui.item.GUIItemItem.
Definition at line 261 of file GUIItemInventory.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.selected, and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setChanged().
|
private |
The command queue for sending commands.
Definition at line 57 of file GUIItemInventory.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.button3Clicked(), and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.GUIItemInventory().
|
private |
The server instance.
Definition at line 63 of file GUIItemInventory.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.button1Clicked(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.button2Clicked(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.button3Clicked(), and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.GUIItemInventory().
|
private |
The default scroll index.
Definition at line 86 of file GUIItemInventory.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.GUIItemInventory(), and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.resetScroll().
|
private |
The FacesManager instance to use.
Definition at line 69 of file GUIItemInventory.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.getFace(), and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.GUIItemInventory().
|
private |
The FloorView to use.
Definition at line 75 of file GUIItemInventory.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.button3Clicked(), and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.GUIItemInventory().
|
private |
The inventory slot index.
Definition at line 97 of file GUIItemInventory.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.canScroll(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.getIndex(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.GUIItemInventory(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.scroll(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setChanged(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setIndex(), and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setIndexNoListeners().
|
private |
The inventory view to watch.
Definition at line 81 of file GUIItemInventory.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.canScroll(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.GUIItemInventory(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setIndex(), and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setIndexNoListeners().
|
private |
The ItemListener used to detect items added to or removed from this inventory slot.
Definition at line 109 of file GUIItemInventory.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setIndex().
|
private |
Called from locationListener but runs on the EDT.
Definition at line 122 of file GUIItemInventory.java.
|
private |
If set, paint the element in "selected" state.
Definition at line 102 of file GUIItemInventory.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.isSelected(), and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setSelected().
|
staticprivate |
The serial version UID.
Definition at line 51 of file GUIItemInventory.java.
|
private |
The object used for synchronization on index.
Definition at line 92 of file GUIItemInventory.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.canScroll(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.getIndex(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.scroll(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setChanged(), com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setIndex(), and com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setIndexNoListeners().