Crossfire JXClient, Trunk
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
com.realtime.crossfire.jxclient.gui.item.GUIItemInventory Class Reference
Inheritance diagram for com.realtime.crossfire.jxclient.gui.item.GUIItemInventory:
Inheritance graph
Collaboration diagram for com.realtime.crossfire.jxclient.gui.item.GUIItemInventory:
Collaboration graph

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 ()
 

Protected Member Functions

Image getFace (@NotNull final CfItem item)
 
boolean isSelected ()
 
- Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.item.GUIItemItem
 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)
 
void setItem (@Nullable final CfItem item)
 
void setItemNoListeners (@Nullable final CfItem item)
 
- Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.item.GUIItem
 GUIItem (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final GuiFactory guiFactory)
 
- Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement
 ActivatableGUIElement (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, final boolean opaque, @NotNull final GuiFactory guiFactory)
 
void markInactivePending ()
 
void setInactiveIfPending ()
 
- Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement
 AbstractGUIElement (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, final boolean opaque, @NotNull final GuiFactory guiFactory)
 
TooltipText newTooltipText (@Nullable final String tooltipText)
 
void tooltipChanged ()
 

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
 

Detailed Description

A GUIItem for displaying inventory objects.

Author
Andreas Kirschbaum

Definition at line 46 of file GUIItemInventory.java.

Constructor & Destructor Documentation

◆ GUIItemInventory()

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.

Parameters
tooltipManagerthe tooltip manager to update
elementListenerthe element listener to notify
commandQueuethe command queue for sending commands
namethe name of this element
indexthe default scroll index
crossfireServerConnectionthe connection instance
itemPainterthe item painter for painting the icon
facesManagerthe faces manager instance to use
floorViewthe floor view to use
inventoryViewthe inventory view to watch
sizethe size of the component or
0
for undefined
guiFactorythe 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.

Here is the call graph for this function:

Member Function Documentation

◆ button1Clicked()

void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.button1Clicked ( final int  modifiers)

◆ button2Clicked()

void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.button2Clicked ( final int  modifiers)

◆ button3Clicked()

void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.button3Clicked ( final int  modifiers)

◆ canScroll()

boolean com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.canScroll ( final int  distance)

Returns whether scrolling is possible.

Parameters
distancethe distance to scroll
Returns
whether scrolling is possible

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.

Here is the call graph for this function:

◆ dispose()

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().

Here is the call graph for this function:

◆ getFace()

Image com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.getFace ( @NotNull final CfItem  item)
protected

◆ getIndex()

int com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.getIndex ( )

◆ isSelected()

boolean com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.isSelected ( )
protected

Returns whether this element should be drawn as "selected".

Returns
whether this element is 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.

Here is the call graph for this function:

◆ notifyOpen()

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.

◆ resetScroll()

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().

Here is the call graph for this function:

◆ scroll()

void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.scroll ( final int  distance)

◆ setChanged()

void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setChanged ( )

◆ setIndex()

void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setIndex ( final int  index)
private

◆ setIndexNoListeners()

void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setIndexNoListeners ( final int  index)

◆ setSelected()

void com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setSelected ( final boolean  selected)

Sets the selected state.

Parameters
selectedwhether 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().

Here is the call graph for this function:

Member Data Documentation

◆ commandQueue

final CommandQueue com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.commandQueue
private

◆ crossfireServerConnection

final CrossfireServerConnection com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.crossfireServerConnection
private

◆ defaultIndex

final int com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.defaultIndex
private

◆ facesManager

final FacesManager com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.facesManager
private

◆ floorView

final FloorView com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.floorView
private

◆ index

int com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.index = -1
private

◆ inventoryView

final ItemView com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.inventoryView
private

◆ locationListener

final LocationListener com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.locationListener
private
Initial value:
= new LocationListener() {
@Override
public void locationChanged() {
SwingUtilities.invokeLater(locationListenerEdt);
}
}

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().

◆ locationListenerEdt

final Runnable com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.locationListenerEdt
private
Initial value:
= () -> {
}

Called from locationListener but runs on the EDT.

Definition at line 122 of file GUIItemInventory.java.

◆ selected

boolean com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.selected
private

◆ serialVersionUID

final long com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.serialVersionUID = 1
staticprivate

The serial version UID.

Definition at line 51 of file GUIItemInventory.java.

◆ sync

final Object com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.sync = new Object()
private

The documentation for this class was generated from the following file:
com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.locationListenerEdt
final Runnable locationListenerEdt
Definition: GUIItemInventory.java:122
com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipChanged
void tooltipChanged()
Definition: AbstractGUIElement.java:265
com.realtime.crossfire.jxclient.gui.item.GUIItemInventory.setChanged
void setChanged()
Definition: GUIItemInventory.java:320