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.GUIItemFloor Class Reference
Inheritance diagram for com.realtime.crossfire.jxclient.gui.item.GUIItemFloor:
Inheritance graph
Collaboration diagram for com.realtime.crossfire.jxclient.gui.item.GUIItemFloor:
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 ()
 
 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 ()
 

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, 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
 

Detailed Description

A GUIElement representing an in-game object in the ground view.

Author
Andreas Kirschbaum

Definition at line 45 of file GUIItemFloor.java.

Constructor & Destructor Documentation

◆ GUIItemFloor()

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.

Parameters
tooltipManagerthe tooltip manager to update
elementListenerthe element listener to notify
commandQueuethe command queue for sending commands
namethe name of this element
itemPainterthe item painter for painting the icon
indexthe initial scroll index
crossfireServerConnectionthe connection instance
floorViewthe floor view to use
itemSetthe item set to use
facesManagerthe faces manager instance to use
nextGroupFacethe image for "prev group of items"
prevGroupFacethe image for "next group of items"
sizethe size of the component or
0
for undefined
guiFactorythe 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.

Here is the call graph for this function:

Member Function Documentation

◆ button1Clicked()

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

◆ button2Clicked()

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

◆ button3Clicked()

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

◆ canScroll()

boolean com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.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 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.

Here is the call graph for this function:

◆ dispose()

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

Here is the call graph for this function:

◆ getFace()

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

◆ getIndex()

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

Returns the slot index.

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.

◆ isSelected()

boolean com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.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 306 of file GUIItemFloor.java.

◆ notifyOpen()

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.

◆ resetScroll()

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

Here is the call graph for this function:

◆ scroll()

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

Scrolls the element.

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

Here is the call graph for this function:

◆ setIndex()

void com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.setIndex ( final int  index,
final boolean  forced 
)
private

◆ setIndexNoListeners()

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

Sets the slot index to display without registering listeners for updates.

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

Here is the call graph for this function:

◆ setSelected()

void com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.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 301 of file GUIItemFloor.java.

Member Data Documentation

◆ commandQueue

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

◆ crossfireServerConnection

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

◆ defaultIndex

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

◆ facesManager

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

◆ floorView

final ItemView com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.floorView
private

◆ index

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

◆ itemSet

final ItemSet com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.itemSet
private

◆ locationListener

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

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

◆ locationListenerEdt

final Runnable com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.locationListenerEdt = () -> setIndex(index, true)
private

Called from locationListener but runs on the EDT.

Definition at line 123 of file GUIItemFloor.java.

◆ nextGroupFace

final Image com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.nextGroupFace
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().

◆ prevGroupFace

final Image com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.prevGroupFace
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().

◆ serialVersionUID

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

The serial version UID.

Definition at line 50 of file GUIItemFloor.java.


The documentation for this class was generated from the following file:
com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.locationListenerEdt
final Runnable locationListenerEdt
Definition: GUIItemFloor.java:123
com.realtime.crossfire.jxclient.gui.item.GUIItemFloor.index
int index
Definition: GUIItemFloor.java:103