Crossfire JXClient, Trunk  R20561
GUIInventoryList.java
Go to the documentation of this file.
1 /*
2  * This file is part of JXClient, the Fullscreen Java Crossfire Client.
3  *
4  * JXClient is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * JXClient is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with JXClient; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * Copyright (C) 2005-2008 Yann Chachkoff.
19  * Copyright (C) 2006-2011 Andreas Kirschbaum.
20  */
21 
22 package com.realtime.crossfire.jxclient.gui.list;
23 
34 import org.jetbrains.annotations.NotNull;
35 import org.jetbrains.annotations.Nullable;
36 
41 public class GUIInventoryList extends GUIItemList<GUIItemInventory> {
42 
46  private static final long serialVersionUID = 1L;
47 
51  @NotNull
53 
57  @NotNull
59 
63  @NotNull
64  private final String name;
65 
69  @NotNull
70  private final ItemView itemView;
71 
75  @NotNull
76  private final CommandQueue commandQueue;
77 
81  @NotNull
82  private final ItemPainter itemPainter;
83 
87  @NotNull
89 
93  @NotNull
94  private final FacesManager facesManager;
95 
99  @NotNull
100  private final FloorView floorView;
101 
118  public GUIInventoryList(@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 CommandQueue commandQueue, @NotNull final ItemPainter itemPainter, @NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final FacesManager facesManager, @NotNull final FloorView floorView) {
119  super(tooltipManager, elementListener, name, cellWidth, cellHeight, itemView, currentItem, new GUIItemInventory(tooltipManager, elementListener, commandQueue, name+"_template", itemPainter, -1, crossfireServerConnection, facesManager, floorView, itemView, cellHeight));
120  this.tooltipManager = tooltipManager;
121  this.elementListener = elementListener;
122  this.name = name;
123  this.itemView = itemView;
124  this.commandQueue = commandQueue;
125  this.itemPainter = itemPainter;
126  this.crossfireServerConnection = crossfireServerConnection;
127  this.facesManager = facesManager;
128  this.floorView = floorView;
129  }
130 
134  @Override
135  @NotNull
136  protected GUIItemInventory newItem(final int index) {
137  return new GUIItemInventory(tooltipManager, elementListener, commandQueue, name+index, itemPainter, index, crossfireServerConnection, facesManager, floorView, itemView, 0);
138  }
139 
140 }
Abstract base class for all label classes.
A GUIItem for displaying inventory objects.
Manages image information ("faces") needed to display the map view, items, and spell icons...
final ItemPainter itemPainter
The item painter for painting the icon.
final FacesManager facesManager
The faces manager instance to use.
final String name
The base name for created elements.
A GUIList instance that displays GUIItemItem instances.
final TooltipManager tooltipManager
The tooltip manager to update.
static final long serialVersionUID
The serial version UID.
final GUIElementListener elementListener
The GUIElementListener to notify.
final CrossfireServerConnection crossfireServerConnection
The connection instance.
final CommandQueue commandQueue
The command queue for sending commands.
GUIInventoryList(@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 CommandQueue commandQueue, @NotNull final ItemPainter itemPainter, @NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final FacesManager facesManager, @NotNull final FloorView floorView)
Creates a new instance.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
Maintains the pending (ncom) commands sent to the server.
Provides a view to all items comprising the current floor view.
Definition: FloorView.java:35
final AbstractLabel currentItem
The label to update with information about the selected item.
Maintains a mapping of face numbers to face data.