 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.combobox;
34 import java.awt.Component;
35 import java.util.ArrayList;
36 import java.util.List;
37 import javax.swing.JLabel;
38 import javax.swing.JList;
39 import org.jetbrains.annotations.NotNull;
40 import org.jetbrains.annotations.Nullable;
78 public void classListChanged() {
83 public void classInfoChanged(@NotNull
final String className) {
88 public void raceListChanged() {
93 public void raceInfoChanged(@NotNull
final String raceName) {
98 public void startingMapListChanged() {
103 public void startingMapInfoChanged(@NotNull
final String startingMapName) {
116 public void changed() {
133 super(tooltipManager, elementListener, name,
label, guiFactory);
159 tmp.sort((o1, o2) -> {
162 return info1 ==
null || info2 ==
null ? 0 : info1.
getName().compareTo(info2.
getName());
170 protected Component
getListCellRendererComponent(@NotNull
final JList<? extends String> list, @Nullable
final String value,
final int index,
final boolean selected,
final boolean cellHasFocus) {
187 return classInfo ==
null ?
"" : classInfo.
getMsg();
final Model model
The Model to track for available classes.
One possible class or race for character creation.
final NewCharacterInformationListener newCharacterInformationListener
The NewCharacterInformationListener attached to model.
void updateModel()
Updates the combo box model to reflect the current class list of model.
String getName()
Returns the human-readable race name.
final NewCharModelListener newCharModelListener
The listener attached to newCharModel.
String getDescription(@Nullable final String item)
void addListener(@NotNull final NewCharModelListener listener)
Adds a listener to notify of changes.
GUIClassesComboBox(@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final Model model, @NotNull final NewCharModel newCharModel, @Nullable final GUILabelLog label, @NotNull final GuiFactory guiFactory)
Creates a new instance.
final GUILabelLog label
The GUILog to update or.
final NewCharModel newCharModel
The NewCharModel that is shown.
Interface for listeners interested in NewCharModel related changes.
String getMsg()
Returns the long description.
void setClass(@NotNull final String class_)
Sets the selected class.
void updateSelectedItem()
Called whenever the selected item has changed.
NewCharacterInformation getNewCharacterInformation()
Returns the NewCharacterInformation for creating new characters.
String getClass_()
Returns the selected class.
A GUIElement that displays a combo box.
Component getListCellRendererComponent(@NotNull final JList<? extends String > list, @Nullable final String value, final int index, final boolean selected, final boolean cellHasFocus)
General information for creating new characters.
A GUIComboBox that shows available classes for character creation.
void removeListener(@NotNull final NewCharModelListener listener)
Removes a listener to be notified of changes.
Factory for creating Gui instances.
static final long serialVersionUID
The serial version UID.
final JLabel renderer
The JLabel that displays the list values.
void setSelectedItem( @NotNull final T item)
Updates the selected item.
void updateSelectedItem(@Nullable final String item)
A gui element implementing a static text field which may contain media tags.
Combines all model classes that are updated.
Listener for GUIElement related events.