Crossfire JXClient, Trunk  R20561
GUIKnowledgeList.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 
33 import org.jetbrains.annotations.NotNull;
34 import org.jetbrains.annotations.Nullable;
35 
39 public class GUIKnowledgeList extends GUIItemList<GUIItemKnowledge> {
40 
44  private static final long serialVersionUID = 1L;
45 
49  @NotNull
51 
55  @NotNull
57 
61  @NotNull
62  private final String name;
63 
67  @NotNull
68  private final ItemView itemView;
69 
73  @NotNull
74  private final ItemPainter itemPainter;
75 
79  @NotNull
80  private final FacesManager facesManager;
81 
85  @NotNull
87 
91  @NotNull
92  private final CommandQueue commandQueue;
93 
109  public GUIKnowledgeList(@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 ItemPainter itemPainter, @NotNull final FacesManager facesManager, @NotNull final KnowledgeManager knowledgeManager, @NotNull final CommandQueue commandQueue) {
110  super(tooltipManager, elementListener, name, cellWidth, cellHeight, itemView, currentItem, new GUIItemKnowledge(tooltipManager, elementListener, name+"_template", itemPainter, -1, facesManager, knowledgeManager, itemView, commandQueue, cellHeight));
111  this.tooltipManager = tooltipManager;
112  this.elementListener = elementListener;
113  this.name = name;
114  this.itemView = itemView;
115  this.itemPainter = itemPainter;
116  this.facesManager = facesManager;
117  this.knowledgeManager = knowledgeManager;
118  this.commandQueue = commandQueue;
119  }
120 
124  @NotNull
125  @Override
126  protected GUIItemKnowledge newItem(final int index) {
127  return new GUIItemKnowledge(tooltipManager, elementListener, name+index, itemPainter, index, facesManager, knowledgeManager, itemView, commandQueue, 0);
128  }
129 
130 }
Abstract base class for all label classes.
final TooltipManager tooltipManager
The TooltipManager to update.
Manages image information ("faces") needed to display the map view, items, and spell icons...
final String name
The base name for created elements.
final GUIElementListener elementListener
The GUIElementListener to notify.
static final long serialVersionUID
The serial version UID.
final CommandQueue commandQueue
The CommandQueue for sending commands.
A GUIList instance that displays GUIItemItem instances.
final KnowledgeManager knowledgeManager
The KnowledgeManager instance to watch.
final ItemPainter itemPainter
The ItemPainter for painting the icon.
Maintains the pending (ncom) commands sent to the server.
GUIKnowledgeList(@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 ItemPainter itemPainter, @NotNull final FacesManager facesManager, @NotNull final KnowledgeManager knowledgeManager, @NotNull final CommandQueue commandQueue)
Creates a new instance.
final FacesManager facesManager
The FacesManager to use.
final AbstractLabel currentItem
The label to update with information about the selected item.
Maintains a mapping of face numbers to face data.