 |
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();
One possible class or race for character creation.
void updateModel()
Updates the combo box model to reflect the current race list of model.
String getName()
Returns the human-readable race name.
GUIRacesComboBox(@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 NewCharacterInformationListener newCharacterInformationListener
The NewCharacterInformationListener attached to model.
void addListener(@NotNull final NewCharModelListener listener)
Adds a listener to notify of changes.
final JLabel renderer
The JLabel that displays the list values.
final GUILabelLog label
The GUILog to update or.
Interface for listeners interested in NewCharModel related changes.
String getMsg()
Returns the long description.
void updateSelectedItem()
Called whenever the selected item has changed.
final Model model
The Model to track for available races.
NewCharacterInformation getNewCharacterInformation()
Returns the NewCharacterInformation for creating new characters.
A GUIElement that displays a combo box.
void setRace(@NotNull final String race)
Sets the selected race.
General information for creating new characters.
void removeListener(@NotNull final NewCharModelListener listener)
Removes a listener to be notified of changes.
Factory for creating Gui instances.
void updateSelectedItem(@Nullable final String item)
final NewCharModelListener newCharModelListener
The listener attached to newCharModel.
String getRace()
Returns the selected race.
void setSelectedItem( @NotNull final T item)
Updates the selected item.
final NewCharModel newCharModel
The NewCharModel that is shown.
String getDescription(@Nullable final String item)
A gui element implementing a static text field which may contain media tags.
static final long serialVersionUID
The serial version UID.
Component getListCellRendererComponent(@NotNull final JList<? extends String > list, @Nullable final String value, final int index, final boolean selected, final boolean cellHasFocus)
Combines all model classes that are updated.
Listener for GUIElement related events.
A GUIComboBox that shows available races for character creation.