 |
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;
79 public void classListChanged() {
84 public void classInfoChanged(@NotNull
final String className) {
89 public void raceListChanged() {
94 public void raceInfoChanged(@NotNull
final String raceName) {
99 public void startingMapListChanged() {
104 public void startingMapInfoChanged(@NotNull
final String startingMapName) {
118 public void changed() {
135 super(tooltipManager, elementListener, name,
label, guiFactory);
161 tmp.sort((o1, o2) -> {
164 return info1 ==
null || info2 ==
null ? 0 : info1.
getName().compareTo(info2.
getName());
172 protected Component
getListCellRendererComponent(@NotNull
final JList<? extends String> list, @Nullable
final String value,
final int index,
final boolean selected,
final boolean cellHasFocus) {
174 renderer.setText(startingMapInfo ==
null ? value : startingMapInfo.
getName());
String getDescription()
Returns the description.
void updateModel()
Updates the combo box model to reflect the current starting map list of model.
final JLabel renderer
The JLabel that displays the list values.
void addListener(@NotNull final NewCharModelListener listener)
Adds a listener to notify of changes.
final GUILabelLog label
The GUILog to update or.
final Model model
The Model to track for available races.
static final long serialVersionUID
The serial version UID.
Interface for listeners interested in NewCharModel related changes.
Component getListCellRendererComponent(@NotNull final JList<? extends String > list, @Nullable final String value, final int index, final boolean selected, final boolean cellHasFocus)
A GUIComboBox that shows available starting maps for character creation.
void updateSelectedItem()
Called whenever the selected item has changed.
NewCharacterInformation getNewCharacterInformation()
Returns the NewCharacterInformation for creating new characters.
A GUIElement that displays a combo box.
GUIStartingMapsComboBox(@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 NewCharModel newCharModel
The NewCharModel that is shown.
String getName()
Returns the proper name.
General information for creating new characters.
final NewCharModelListener newCharModelListener
The listener attached to newCharModel.
void removeListener(@NotNull final NewCharModelListener listener)
Removes a listener to be notified of changes.
Factory for creating Gui instances.
String getDescription(@Nullable final String item)
void updateSelectedItem(@Nullable final String item)
void setSelectedItem( @NotNull final T item)
Updates the selected item.
One possible starting map for character creation.
final NewCharacterInformationListener newCharacterInformationListener
The NewCharacterInformationListener attached to model.
void setStartingMap(@NotNull final String startingMap)
Sets the selected starting map.
String getStartingMap()
Returns the selected starting map.
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.