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 () |
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) | |
void | notifyOpen () |
void | resetScroll () |
void | scroll (final int distance) |
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 | setChanged () |
void | setChangedListener (@Nullable final GUIElementChangedListener changedListener) |
void | setDefault (final boolean isDefault) |
void | setIgnore () |
String | toString () |
Private Member Functions | |
void | setIndex (final int index, final boolean forced) |
Private Attributes | |
final CommandQueue | commandQueue |
final CrossfireServerConnection | crossfireServerConnection |
final int | defaultIndex |
final FacesManager | facesManager |
final ItemView | floorView |
int | index = -1 |
final ItemSet | itemSet |
final LocationListener | locationListener |
final Runnable | locationListenerEdt = () -> setIndex(index, true) |
final Image | nextGroupFace |
final Image | prevGroupFace |
Static Private Attributes | |
static final long | serialVersionUID = 1 |
A GUIElement representing an in-game object in the ground view.
Definition at line 45 of file GUIItemFloor.java.
com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.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.
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 |
itemPainter | the item painter for painting the icon |
index | the initial scroll index |
crossfireServerConnection | the connection instance |
floorView | the floor view to use |
itemSet | the item set to use |
facesManager | the faces manager instance to use |
nextGroupFace | the image for "prev group of items" |
prevGroupFace | the image for "next group of items" |
size | the size of the component or 0
|
guiFactory | the global GUI factory instance |
Definition at line 142 of file GUIItemFloor.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.commandQueue, com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.crossfireServerConnection, com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.defaultIndex, com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.elementListener, com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.facesManager, com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.floorView, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.guiFactory, com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.index, com.realtime.crossfire.jxclient.gui.item.GUIItemItem.itemPainter, com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.itemSet, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.name, com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.nextGroupFace, com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.prevGroupFace, com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.setIndex(), and com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipManager.
void com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.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 191 of file GUIItemFloor.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.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.isItemGroupButton(), 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(), and com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.sendExamine().
void com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.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 213 of file GUIItemFloor.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.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, and com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.sendApply().
void com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.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 228 of file GUIItemFloor.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.commandQueue, com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.crossfireServerConnection, com.realtime.crossfire.jxclient.gui.item.GUIItemItem.getItem(), com.realtime.crossfire.jxclient.items.ItemSet.getPlayer(), com.realtime.crossfire.jxclient.items.CfItem.getTag(), com.realtime.crossfire.jxclient.gui.item.GUIItemItem.item, com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.itemSet, 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.queue.CommandQueue.sendMove(), and com.realtime.crossfire.jxclient.gui.misc.Modifiers.SHIFT.
boolean com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.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 169 of file GUIItemFloor.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.floorView, com.realtime.crossfire.jxclient.items.ItemView.getSize(), and com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.index.
void com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.dispose | ( | ) |
Releases all allocated resources.
Reimplemented from com.realtime.crossfire.jxclient.gui.item.GUIItemItem.
Definition at line 159 of file GUIItemFloor.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.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 286 of file GUIItemFloor.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.facesManager, com.realtime.crossfire.jxclient.items.CfItem.getFace(), com.realtime.crossfire.jxclient.faces.Face.getFaceNum(), com.realtime.crossfire.jxclient.items.ItemSet.getOpenContainer(), com.realtime.crossfire.jxclient.faces.FacesManager.getOriginalImageIcon(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.index, com.realtime.crossfire.jxclient.items.CfItem.isItemGroupButton(), com.realtime.crossfire.jxclient.gui.item.GUIItemItem.item, com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.itemSet, com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.nextGroupFace, and com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.prevGroupFace.
int com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.getIndex | ( | ) |
Returns the slot index.
Reimplemented from com.realtime.crossfire.jxclient.gui.item.GUIItemItem.
Definition at line 251 of file GUIItemFloor.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.index.
|
protected |
Returns whether this element should be drawn as "selected".
Reimplemented from com.realtime.crossfire.jxclient.gui.item.GUIItemItem.
Definition at line 306 of file GUIItemFloor.java.
void com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.notifyOpen | ( | ) |
Called each time the enclosing dialog is opened (or raised).
Implements com.realtime.crossfire.jxclient.gui.gui.GUIElement.
Definition at line 165 of file GUIItemFloor.java.
void com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.resetScroll | ( | ) |
Resets the scroll index to the default value.
Implements com.realtime.crossfire.jxclient.gui.scrollable.GUIScrollable.
Definition at line 186 of file GUIItemFloor.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.defaultIndex, and com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.setIndex().
void com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.scroll | ( | final int | distance | ) |
Scrolls the element.
distance | the distance to scroll |
Implements com.realtime.crossfire.jxclient.gui.scrollable.GUIScrollable.
Definition at line 181 of file GUIItemFloor.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.index, and com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.setIndex().
|
private |
Set the floor tile to display.
index | the floor tile |
forced | if unset, do nothing if the is unchanged; if set, always render the item |
Definition at line 261 of file GUIItemFloor.java.
References com.realtime.crossfire.jxclient.items.ItemView.addLocationListener(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.floorView, com.realtime.crossfire.jxclient.items.ItemView.getItem(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.index, com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.locationListener, com.realtime.crossfire.jxclient.items.ItemView.removeLocationListener(), and com.realtime.crossfire.jxclient.gui.item.GUIItemItem.setItem().
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.dispose(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.GUIItemFloor(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.resetScroll(), and com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.scroll().
void com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.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 278 of file GUIItemFloor.java.
References com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.floorView, com.realtime.crossfire.jxclient.items.ItemView.getItem(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.index, and com.realtime.crossfire.jxclient.gui.item.GUIItemItem.setItemNoListeners().
void com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.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 301 of file GUIItemFloor.java.
|
private |
The command queue for sending commands.
Definition at line 56 of file GUIItemFloor.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.button3Clicked(), and com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.GUIItemFloor().
|
private |
The connection instance.
Definition at line 62 of file GUIItemFloor.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.button1Clicked(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.button2Clicked(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.button3Clicked(), and com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.GUIItemFloor().
|
private |
The default scroll index.
Definition at line 97 of file GUIItemFloor.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.GUIItemFloor(), and com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.resetScroll().
|
private |
The FacesManager instance to use.
Definition at line 80 of file GUIItemFloor.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.getFace(), and com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.GUIItemFloor().
|
private |
The floor view to watch.
Definition at line 68 of file GUIItemFloor.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.canScroll(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.GUIItemFloor(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.setIndex(), and com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.setIndexNoListeners().
|
private |
The currently shown index. It is the item's index for ground view, and +1 for container view; index 0 for container view is the container itself.
Definition at line 103 of file GUIItemFloor.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.canScroll(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.getFace(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.getIndex(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.GUIItemFloor(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.scroll(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.setIndex(), and com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.setIndexNoListeners().
|
private |
The ItemSet to use.
Definition at line 74 of file GUIItemFloor.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.button3Clicked(), com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.getFace(), and com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.GUIItemFloor().
|
private |
The LocationListener used to detect items added to or removed from this floor tile.
Definition at line 110 of file GUIItemFloor.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.setIndex().
|
private |
Called from locationListener but runs on the EDT.
Definition at line 123 of file GUIItemFloor.java.
|
private |
The face to substitute into "Click here for next group of items".
Definition at line 86 of file GUIItemFloor.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.getFace(), and com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.GUIItemFloor().
|
private |
The face to substitute into "Click here for previous group of items".
Definition at line 92 of file GUIItemFloor.java.
Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.getFace(), and com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.GUIItemFloor().
|
staticprivate |
The serial version UID.
Definition at line 50 of file GUIItemFloor.java.