Crossfire JXClient, Trunk
R20561
|
Maintains the character list for an account. More...
Public Member Functions | |
void | add (@NotNull final CharacterInformation characterInformation) |
Adds an entry. More... | |
void | addCharacterInformationListener (final int index, @NotNull final CharacterInformationListener listener) |
Adds a character entry listener for one entry. More... | |
void | addCharacterListener (@NotNull final CharacterListener listener) |
Adds a character listener. More... | |
void | begin () |
Starts an update transaction. More... | |
void | commit () |
Finishes an update transaction. More... | |
boolean | displaysFace (final int faceNum) |
Returns whether any character has the given face. More... | |
int | getCharacterIndex (@NotNull final String characterName) |
Returns the index of an entry by character name. More... | |
CharacterInformation | getEntry (final int index) |
Returns a character entry by index. More... | |
void | removeCharacterInformationListener (final int index, @NotNull final CharacterInformationListener listener) |
Removes a character entry listener for one entry. More... | |
void | removeCharacterListener (@NotNull final CharacterListener listener) |
Removes a character listener. More... | |
int | size () |
Returns the number of character entries. More... | |
Private Member Functions | |
EventListenerList2< CharacterInformationListener > | getCharacterInformationListeners (final int index) |
Returns the character entry listeners for one entry index. More... | |
Private Attributes | |
final Map< Integer, EventListenerList2< CharacterInformationListener > > | characterInformationListeners = new HashMap<>() |
All registered character entry listeners. More... | |
final EventListenerList2< CharacterListener > | characterListeners = new EventListenerList2<>() |
All registered character listeners. More... | |
final List< CharacterInformation > | characters = new ArrayList<>() |
The current entries. More... | |
final Collection< CharacterInformation > | charactersPending = new ArrayList<>() |
The pending entries. More... | |
final Object | sync = new Object() |
Object used for synchronization. More... | |
Maintains the character list for an account.
Only meaningful if the server supports the new "loginmethod".
Definition at line 38 of file CharacterModel.java.
void com.realtime.crossfire.jxclient.account.CharacterModel.add | ( | @NotNull final CharacterInformation | characterInformation | ) |
Adds an entry.
characterInformation | the entry to add |
Definition at line 122 of file CharacterModel.java.
References com.realtime.crossfire.jxclient.account.CharacterModel.sync.
void com.realtime.crossfire.jxclient.account.CharacterModel.addCharacterInformationListener | ( | final int | index, |
@NotNull final CharacterInformationListener | listener | ||
) |
Adds a character entry listener for one entry.
index | the entry index to monitor |
listener | the listener to add |
Definition at line 182 of file CharacterModel.java.
References com.realtime.crossfire.jxclient.account.CharacterModel.getCharacterInformationListeners().
Referenced by com.realtime.crossfire.jxclient.gui.list.GUICharacterList.rebuildList(), and com.realtime.crossfire.jxclient.gui.list.GUICharacter.setIndex().
void com.realtime.crossfire.jxclient.account.CharacterModel.addCharacterListener | ( | @NotNull final CharacterListener | listener | ) |
Adds a character listener.
listener | the listener to add |
Definition at line 165 of file CharacterModel.java.
References com.realtime.crossfire.jxclient.util.EventListenerList2< T extends EventListener >.add().
void com.realtime.crossfire.jxclient.account.CharacterModel.begin | ( | ) |
Starts an update transaction.
Definition at line 131 of file CharacterModel.java.
void com.realtime.crossfire.jxclient.account.CharacterModel.commit | ( | ) |
Finishes an update transaction.
Definition at line 138 of file CharacterModel.java.
References com.realtime.crossfire.jxclient.account.CharacterModel.getCharacterInformationListeners(), and com.realtime.crossfire.jxclient.account.CharacterModel.sync.
boolean com.realtime.crossfire.jxclient.account.CharacterModel.displaysFace | ( | final int | faceNum | ) |
Returns whether any character has the given face.
faceNum | the face |
Definition at line 219 of file CharacterModel.java.
int com.realtime.crossfire.jxclient.account.CharacterModel.getCharacterIndex | ( | @NotNull final String | characterName | ) |
Returns the index of an entry by character name.
characterName | the character name |
Definition at line 93 of file CharacterModel.java.
References com.realtime.crossfire.jxclient.account.CharacterModel.sync.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUICharacterList.setCharacter().
|
private |
Returns the character entry listeners for one entry index.
index | the entry index |
Definition at line 201 of file CharacterModel.java.
References com.realtime.crossfire.jxclient.account.CharacterModel.characterInformationListeners.
Referenced by com.realtime.crossfire.jxclient.account.CharacterModel.addCharacterInformationListener(), com.realtime.crossfire.jxclient.account.CharacterModel.commit(), and com.realtime.crossfire.jxclient.account.CharacterModel.removeCharacterInformationListener().
CharacterInformation com.realtime.crossfire.jxclient.account.CharacterModel.getEntry | ( | final int | index | ) |
Returns a character entry by index.
index | the index |
Definition at line 78 of file CharacterModel.java.
References com.realtime.crossfire.jxclient.account.CharacterModel.sync.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUICharacterList.getCurrentCharacter(), com.realtime.crossfire.jxclient.gui.list.GUICharacter.getMinimumSizeInt(), com.realtime.crossfire.jxclient.gui.list.GUICharacter.paintComponent(), and com.realtime.crossfire.jxclient.gui.list.GUICharacter.updateTooltip().
void com.realtime.crossfire.jxclient.account.CharacterModel.removeCharacterInformationListener | ( | final int | index, |
@NotNull final CharacterInformationListener | listener | ||
) |
Removes a character entry listener for one entry.
index | the entry index to monitor |
listener | the listener to remove |
Definition at line 191 of file CharacterModel.java.
References com.realtime.crossfire.jxclient.account.CharacterModel.getCharacterInformationListeners().
Referenced by com.realtime.crossfire.jxclient.gui.list.GUICharacterList.rebuildList(), and com.realtime.crossfire.jxclient.gui.list.GUICharacter.setIndex().
void com.realtime.crossfire.jxclient.account.CharacterModel.removeCharacterListener | ( | @NotNull final CharacterListener | listener | ) |
Removes a character listener.
listener | the listener to remove |
Definition at line 173 of file CharacterModel.java.
References com.realtime.crossfire.jxclient.util.EventListenerList2< T extends EventListener >.remove().
int com.realtime.crossfire.jxclient.account.CharacterModel.size | ( | ) |
Returns the number of character entries.
Definition at line 112 of file CharacterModel.java.
References com.realtime.crossfire.jxclient.account.CharacterModel.sync.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUICharacterList.rebuildList().
|
private |
All registered character entry listeners.
Maps entry index to list of listeners.
Definition at line 70 of file CharacterModel.java.
Referenced by com.realtime.crossfire.jxclient.account.CharacterModel.getCharacterInformationListeners().
|
private |
All registered character listeners.
Definition at line 63 of file CharacterModel.java.
|
private |
The current entries.
Definition at line 44 of file CharacterModel.java.
|
private |
The pending entries.
Only valid between begin() and commit().
Definition at line 51 of file CharacterModel.java.
|
private |
Object used for synchronization.
Definition at line 57 of file CharacterModel.java.
Referenced by com.realtime.crossfire.jxclient.account.CharacterModel.add(), com.realtime.crossfire.jxclient.account.CharacterModel.commit(), com.realtime.crossfire.jxclient.account.CharacterModel.getCharacterIndex(), com.realtime.crossfire.jxclient.account.CharacterModel.getEntry(), and com.realtime.crossfire.jxclient.account.CharacterModel.size().