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.list.GUIItemList< T extends GUIItemItem > Class Template Referenceabstract
Inheritance diagram for com.realtime.crossfire.jxclient.gui.list.GUIItemList< T extends GUIItemItem >:
Inheritance graph
Collaboration diagram for com.realtime.crossfire.jxclient.gui.list.GUIItemList< T extends GUIItemItem >:
Collaboration graph

Public Member Functions

void dispose ()
 
GUIItemItem getSelectedItem ()
 
void mouseClicked (@NotNull final MouseEvent e)
 
- Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.list.GUIList< T >
boolean canMoveSelection (final int diffLines, final int diffElements)
 
boolean canScroll (final int distance)
 
void dispose ()
 
void execute ()
 
getElement (final int index)
 
Dimension getMaximumSize ()
 
Dimension getMinimumSize ()
 
Dimension getPreferredSize ()
 
TooltipText getTooltip ()
 
void mouseClicked ( @NotNull final MouseEvent e)
 
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 mousePressed ( @NotNull final MouseEvent e)
 
void mouseWheelMoved (final int wheelRotation)
 
void moveSelection (final int diffLines, final int diffElements)
 
void resetScroll ()
 
void scroll (final int distance)
 
void setBounds (final int x, final int y, final int width, final int height)
 
void setChanged ()
 

Protected Member Functions

void activeChanged ()
 
 GUIItemList (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, final int cellWidth, final int cellHeight, @NotNull final ItemView itemView, @Nullable final AbstractLabel currentItem, @NotNull final GUIItemItem templateItem, @NotNull final GuiFactory guiFactory)
 
abstract T newItem (final int index)
 
void selectionChanged (final int selectedIndex)
 
- Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.list.GUIList< T >
void addElement ( @NotNull final T element)
 
Object getSelectedObject ()
 
abstract String getTooltip (final int index)
 
 GUIList ( @NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, final int cellWidth, final int cellHeight, @NotNull final GUIListCellRenderer< T > listCellRenderer, @Nullable final CommandList doubleClickCommandList, @NotNull final GuiFactory guiFactory)
 
int resizeElements (final int newSize)
 
void selectionChanged ()
 
abstract void selectionChanged (final int selectedIndex)
 
void setLayoutOrientation (final int layoutOrientation, final int visibleRowCount)
 
void setSelectedIndex (final int newIndex)
 

Private Member Functions

void button1Clicked (final int modifiers)
 
void button2Clicked (final int modifiers)
 
void button3Clicked (final int modifiers)
 
void rebuildList (@NotNull final Integer @Nullable[] changedSlots)
 
void setChanged (@NotNull final Integer @Nullable[] changedSlots, final int limit)
 
void setChanged (final int index)
 

Private Attributes

final AbstractLabel currentItem
 
final GUIElementChangedListener itemChangedListener
 
final ItemView itemView
 
final LocationsListener locationsListener = changedSlots -> SwingUtilities.invokeLater(() -> rebuildList(changedSlots))
 

Static Private Attributes

static final long serialVersionUID = 1
 

Detailed Description

A GUIList instance that displays GUIItemItem instances.

Parameters
<T>the type of the list elements
Author
Andreas Kirschbaum

Definition at line 46 of file GUIItemList.java.

Constructor & Destructor Documentation

◆ GUIItemList()

com.realtime.crossfire.jxclient.gui.list.GUIItemList< T extends GUIItemItem >.GUIItemList ( @NotNull final TooltipManager  tooltipManager,
@NotNull final GUIElementListener  elementListener,
@NotNull final String  name,
final int  cellWidth,
final int  cellHeight,
@NotNull final ItemView  itemView,
@Nullable final AbstractLabel  currentItem,
@NotNull final GUIItemItem  templateItem,
@NotNull final GuiFactory  guiFactory 
)
protected

Creates a new instance.

Parameters
tooltipManagerthe tooltip manager to update
elementListenerthe element listener to notify
namethe name of this element
cellWidththe width of cells
cellHeightthe height of cells
itemViewthe item view to monitor
currentItemthe label to update with information about the selected item.
templateItemthe template item for painting the list
guiFactorythe global GUI factory instance

Definition at line 94 of file GUIItemList.java.

Member Function Documentation

◆ activeChanged()

void com.realtime.crossfire.jxclient.gui.list.GUIItemList< T extends GUIItemItem >.activeChanged ( )
protected

Definition at line 179 of file GUIItemList.java.

◆ button1Clicked()

void com.realtime.crossfire.jxclient.gui.list.GUIItemList< T extends GUIItemItem >.button1Clicked ( final int  modifiers)
private

Called if the user has clicked the left mouse button.

Parameters
modifiersthe active modifiers

Definition at line 210 of file GUIItemList.java.

Referenced by com.realtime.crossfire.jxclient.gui.list.GUIItemList< GUIItemSpell >.mouseClicked().

Here is the caller graph for this function:

◆ button2Clicked()

void com.realtime.crossfire.jxclient.gui.list.GUIItemList< T extends GUIItemItem >.button2Clicked ( final int  modifiers)
private

Called if the user has clicked the middle mouse button.

Parameters
modifiersthe active modifiers

Definition at line 223 of file GUIItemList.java.

Referenced by com.realtime.crossfire.jxclient.gui.list.GUIItemList< GUIItemSpell >.mouseClicked().

Here is the caller graph for this function:

◆ button3Clicked()

void com.realtime.crossfire.jxclient.gui.list.GUIItemList< T extends GUIItemItem >.button3Clicked ( final int  modifiers)
private

Called if the user has clicked the right mouse button.

Parameters
modifiersthe active modifiers

Definition at line 236 of file GUIItemList.java.

Referenced by com.realtime.crossfire.jxclient.gui.list.GUIItemList< GUIItemSpell >.mouseClicked().

Here is the caller graph for this function:

◆ dispose()

Definition at line 104 of file GUIItemList.java.

◆ getSelectedItem()

◆ mouseClicked()

void com.realtime.crossfire.jxclient.gui.list.GUIItemList< T extends GUIItemItem >.mouseClicked ( @NotNull final MouseEvent  e)

Definition at line 183 of file GUIItemList.java.

◆ newItem()

abstract T com.realtime.crossfire.jxclient.gui.list.GUIItemList< T extends GUIItemItem >.newItem ( final int  index)
abstractprotected

Creates a new GUIElement instance.

Parameters
indexthe item inventory's index
Returns
the new instance

Referenced by com.realtime.crossfire.jxclient.gui.list.GUIItemList< GUIItemSpell >.rebuildList().

Here is the caller graph for this function:

◆ rebuildList()

void com.realtime.crossfire.jxclient.gui.list.GUIItemList< T extends GUIItemItem >.rebuildList ( @NotNull final Integer @Nullable[]  changedSlots)
private

Rebuilds the list cells.

Parameters
changedSlotsthe changed slots;
null
=all slots

Definition at line 113 of file GUIItemList.java.

Referenced by com.realtime.crossfire.jxclient.gui.list.GUIItemList< GUIItemSpell >.GUIItemList().

Here is the caller graph for this function:

◆ selectionChanged()

void com.realtime.crossfire.jxclient.gui.list.GUIItemList< T extends GUIItemItem >.selectionChanged ( final int  selectedIndex)
protected

Definition at line 160 of file GUIItemList.java.

◆ setChanged() [1/2]

void com.realtime.crossfire.jxclient.gui.list.GUIItemList< T extends GUIItemItem >.setChanged ( @NotNull final Integer @Nullable[]  changedSlots,
final int  limit 
)
private

Marks some slots as modified.

Parameters
changedSlotsthe slots to mark as modified;
null
=all
limitthe limit; only slots less than this index are affected

Definition at line 137 of file GUIItemList.java.

◆ setChanged() [2/2]

void com.realtime.crossfire.jxclient.gui.list.GUIItemList< T extends GUIItemItem >.setChanged ( final int  index)
private

Marks one slot as modified.

Parameters
indexthe slot index

Definition at line 155 of file GUIItemList.java.

Member Data Documentation

◆ currentItem

◆ itemChangedListener

Initial value:
= () -> {
}

The GUIElementChangedListener attached to all GUIItemItem instances in the list.

Definition at line 76 of file GUIItemList.java.

Referenced by com.realtime.crossfire.jxclient.gui.list.GUIItemList< GUIItemSpell >.rebuildList().

◆ itemView

◆ locationsListener

final LocationsListener com.realtime.crossfire.jxclient.gui.list.GUIItemList< T extends GUIItemItem >.locationsListener = changedSlots -> SwingUtilities.invokeLater(() -> rebuildList(changedSlots))
private

◆ serialVersionUID

final long com.realtime.crossfire.jxclient.gui.list.GUIItemList< T extends GUIItemItem >.serialVersionUID = 1
staticprivate

The serial version UID.

Definition at line 51 of file GUIItemList.java.


The documentation for this class was generated from the following file:
com.realtime.crossfire.jxclient.gui.list.GUIList< T >::setChanged
void setChanged()
Definition: GUIList.java:529
com.realtime.crossfire.jxclient.gui.list.GUIList< T >::selectionChanged
void selectionChanged()
Definition: GUIList.java:516