Crossfire JXClient, Trunk
Public Member Functions | Private Member Functions | Private Attributes | List of all members
com.realtime.crossfire.jxclient.account.CharacterModel Class Reference
Collaboration diagram for com.realtime.crossfire.jxclient.account.CharacterModel:
Collaboration graph

Public Member Functions

void add (@NotNull final CharacterInformation characterInformation)
 
void addCharacterInformationListener (final int index, @NotNull final CharacterInformationListener listener)
 
void addCharacterListener (@NotNull final CharacterListener listener)
 
void begin ()
 
void commit ()
 
boolean displaysFace (final int faceNum)
 
int getCharacterIndex (@NotNull final String characterName)
 
CharacterInformation getEntry (final int index)
 
void removeCharacterInformationListener (final int index, @NotNull final CharacterInformationListener listener)
 
void removeCharacterListener (@NotNull final CharacterListener listener)
 
int size ()
 

Private Member Functions

EventListenerList2< CharacterInformationListenergetCharacterInformationListeners (final int index)
 

Private Attributes

final Map< Integer, EventListenerList2< CharacterInformationListener > > characterInformationListeners = new HashMap<>()
 
final EventListenerList2< CharacterListenercharacterListeners = new EventListenerList2<>()
 
final List< CharacterInformationcharacters = new ArrayList<>()
 
final Collection< CharacterInformationcharactersPending = new ArrayList<>()
 
final Object sync = new Object()
 

Detailed Description

Maintains the character list for an account. Only meaningful if the server supports the new "loginmethod".

Author
Nicolas Weeger

Definition at line 40 of file CharacterModel.java.

Member Function Documentation

◆ add()

void com.realtime.crossfire.jxclient.account.CharacterModel.add ( @NotNull final CharacterInformation  characterInformation)

Adds an entry.

Parameters
characterInformationthe entry to add

Definition at line 124 of file CharacterModel.java.

References com.realtime.crossfire.jxclient.account.CharacterModel.charactersPending, and com.realtime.crossfire.jxclient.account.CharacterModel.sync.

◆ addCharacterInformationListener()

void com.realtime.crossfire.jxclient.account.CharacterModel.addCharacterInformationListener ( final int  index,
@NotNull final CharacterInformationListener  listener 
)

Adds a character entry listener for one entry.

Parameters
indexthe entry index to monitor
listenerthe listener to add

Definition at line 184 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addCharacterListener()

void com.realtime.crossfire.jxclient.account.CharacterModel.addCharacterListener ( @NotNull final CharacterListener  listener)

Adds a character listener.

Parameters
listenerthe listener to add

Definition at line 167 of file CharacterModel.java.

References com.realtime.crossfire.jxclient.account.CharacterModel.characterListeners.

◆ begin()

void com.realtime.crossfire.jxclient.account.CharacterModel.begin ( )

Starts an update transaction.

Definition at line 133 of file CharacterModel.java.

References com.realtime.crossfire.jxclient.account.CharacterModel.charactersPending.

◆ commit()

void com.realtime.crossfire.jxclient.account.CharacterModel.commit ( )

◆ displaysFace()

boolean com.realtime.crossfire.jxclient.account.CharacterModel.displaysFace ( final int  faceNum)

Returns whether any character has the given face.

Parameters
faceNumthe face
Returns
whether the face was found

Definition at line 221 of file CharacterModel.java.

References com.realtime.crossfire.jxclient.account.CharacterModel.characters.

Referenced by com.realtime.crossfire.jxclient.gui.list.GUICharacterList.GUICharacterList().

Here is the caller graph for this function:

◆ getCharacterIndex()

int com.realtime.crossfire.jxclient.account.CharacterModel.getCharacterIndex ( @NotNull final String  characterName)

Returns the index of an entry by character name.

Parameters
characterNamethe character name
Returns
the index, or
-1
if not found

Definition at line 95 of file CharacterModel.java.

References com.realtime.crossfire.jxclient.account.CharacterModel.characters, and com.realtime.crossfire.jxclient.account.CharacterModel.sync.

Referenced by com.realtime.crossfire.jxclient.gui.list.GUICharacterList.setCharacter().

Here is the caller graph for this function:

◆ getCharacterInformationListeners()

EventListenerList2<CharacterInformationListener> com.realtime.crossfire.jxclient.account.CharacterModel.getCharacterInformationListeners ( final int  index)
private

◆ getEntry()

CharacterInformation com.realtime.crossfire.jxclient.account.CharacterModel.getEntry ( final int  index)

◆ removeCharacterInformationListener()

void com.realtime.crossfire.jxclient.account.CharacterModel.removeCharacterInformationListener ( final int  index,
@NotNull final CharacterInformationListener  listener 
)

Removes a character entry listener for one entry.

Parameters
indexthe entry index to monitor
listenerthe listener to remove

Definition at line 193 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeCharacterListener()

void com.realtime.crossfire.jxclient.account.CharacterModel.removeCharacterListener ( @NotNull final CharacterListener  listener)

Removes a character listener.

Parameters
listenerthe listener to remove

Definition at line 175 of file CharacterModel.java.

References com.realtime.crossfire.jxclient.account.CharacterModel.characterListeners.

◆ size()

int com.realtime.crossfire.jxclient.account.CharacterModel.size ( )

Returns the number of character entries.

Returns
the number of character entries

Definition at line 114 of file CharacterModel.java.

References com.realtime.crossfire.jxclient.account.CharacterModel.characters, and com.realtime.crossfire.jxclient.account.CharacterModel.sync.

Referenced by com.realtime.crossfire.jxclient.gui.list.GUICharacterList.rebuildList().

Here is the caller graph for this function:

Member Data Documentation

◆ characterInformationListeners

final Map<Integer, EventListenerList2<CharacterInformationListener> > com.realtime.crossfire.jxclient.account.CharacterModel.characterInformationListeners = new HashMap<>()
private

All registered character entry listeners. Maps entry index to list of listeners.

Definition at line 72 of file CharacterModel.java.

Referenced by com.realtime.crossfire.jxclient.account.CharacterModel.getCharacterInformationListeners().

◆ characterListeners

final EventListenerList2<CharacterListener> com.realtime.crossfire.jxclient.account.CharacterModel.characterListeners = new EventListenerList2<>()
private

◆ characters

final List<CharacterInformation> com.realtime.crossfire.jxclient.account.CharacterModel.characters = new ArrayList<>()
private

◆ charactersPending

final Collection<CharacterInformation> com.realtime.crossfire.jxclient.account.CharacterModel.charactersPending = new ArrayList<>()
private

◆ sync

final Object com.realtime.crossfire.jxclient.account.CharacterModel.sync = new Object()
private

The documentation for this class was generated from the following file: