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

Public Member Functions

void addListener (@NotNull final NewCharModelListener listener)
 
String getClass_ ()
 
int getClassStatAdjustment (@NotNull final NewcharStat stat)
 
String getErrorText ()
 
NewCharacterInformation getNewCharacterInformation ()
 
Choice getOption ()
 
int getOptionIndex ()
 
String getRace ()
 
int getRaceStatAdjustment (@NotNull final NewcharStat stat)
 
String getStartingMap ()
 
int getTotal (@NotNull final NewcharStat stat)
 
int getUnusedPoints ()
 
int getValue (@NotNull final NewcharStat stat)
 
boolean hasNonServerFailureErrorText ()
 
 NewCharModel (@NotNull final NewCharacterInformation newCharacterInformation)
 
void removeListener (@NotNull final NewCharModelListener listener)
 
void setClass (@NotNull final String class_)
 
void setErrorText (final int priority, @Nullable final String text)
 
void setOptionIndex (final int optionIndex)
 
void setRace (@NotNull final String race)
 
void setStartingMap (@NotNull final String startingMap)
 
void setValue (@NotNull final NewcharStat stat, final int value)
 

Static Public Attributes

static final int PRIORITY_CHARACTER_NAME = 9
 
static final int PRIORITY_INVALID_STAT_CHA = 7
 
static final int PRIORITY_INVALID_STAT_CON = 3
 
static final int PRIORITY_INVALID_STAT_DEX = 2
 
static final int PRIORITY_INVALID_STAT_INT = 4
 
static final int PRIORITY_INVALID_STAT_POW = 6
 
static final int PRIORITY_INVALID_STAT_STR = 1
 
static final int PRIORITY_INVALID_STAT_WIS = 5
 
static final int PRIORITY_SERVER_FAILURE = Integer.MAX_VALUE
 
static final int PRIORITY_UNUSED_POINTS = 8
 

Private Member Functions

void notifyListeners ()
 
void updateOption ()
 

Private Attributes

String class_ = UNKNOWN
 
final Map< Integer, String > errorTexts = new TreeMap<>()
 
final EventListenerList2< NewCharModelListenerlisteners = new EventListenerList2<>()
 
final NewCharacterInformation newCharacterInformation
 
Choice option
 
int optionIndex
 
String race = UNKNOWN
 
String startingMap = UNKNOWN
 
final Map< NewcharStat, Integer > values = new EnumMap<>(NewcharStat.class)
 

Static Private Attributes

static final String UNKNOWN = "unknown"
 

Detailed Description

General information for creating new characters.

Author
Andreas Kirschbaum

Definition at line 43 of file NewCharModel.java.

Constructor & Destructor Documentation

◆ NewCharModel()

com.realtime.crossfire.jxclient.gui.label.NewCharModel.NewCharModel ( @NotNull final NewCharacterInformation  newCharacterInformation)

Member Function Documentation

◆ addListener()

void com.realtime.crossfire.jxclient.gui.label.NewCharModel.addListener ( @NotNull final NewCharModelListener  listener)

◆ getClass_()

String com.realtime.crossfire.jxclient.gui.label.NewCharModel.getClass_ ( )

◆ getClassStatAdjustment()

int com.realtime.crossfire.jxclient.gui.label.NewCharModel.getClassStatAdjustment ( @NotNull final NewcharStat  stat)

◆ getErrorText()

String com.realtime.crossfire.jxclient.gui.label.NewCharModel.getErrorText ( )

Returns the error text to show.

Returns
the error text or an empty string to show none

Definition at line 396 of file NewCharModel.java.

References com.realtime.crossfire.jxclient.gui.label.NewCharModel.errorTexts.

Referenced by com.realtime.crossfire.jxclient.gui.label.GUINewcharLabel.updateContents().

Here is the caller graph for this function:

◆ getNewCharacterInformation()

NewCharacterInformation com.realtime.crossfire.jxclient.gui.label.NewCharModel.getNewCharacterInformation ( )

◆ getOption()

Choice com.realtime.crossfire.jxclient.gui.label.NewCharModel.getOption ( )

◆ getOptionIndex()

int com.realtime.crossfire.jxclient.gui.label.NewCharModel.getOptionIndex ( )

Return the selected character option.

Returns
the option or
-1
if no option is available

Definition at line 446 of file NewCharModel.java.

References com.realtime.crossfire.jxclient.gui.label.NewCharModel.optionIndex.

Referenced by com.realtime.crossfire.jxclient.gui.commands.AccountCreateCharacterCommand.execute(), and com.realtime.crossfire.jxclient.gui.combobox.GUICharOptionsComboBox.GUICharOptionsComboBox().

Here is the caller graph for this function:

◆ getRace()

String com.realtime.crossfire.jxclient.gui.label.NewCharModel.getRace ( )

◆ getRaceStatAdjustment()

int com.realtime.crossfire.jxclient.gui.label.NewCharModel.getRaceStatAdjustment ( @NotNull final NewcharStat  stat)

◆ getStartingMap()

String com.realtime.crossfire.jxclient.gui.label.NewCharModel.getStartingMap ( )

◆ getTotal()

int com.realtime.crossfire.jxclient.gui.label.NewCharModel.getTotal ( @NotNull final NewcharStat  stat)

Returns the total points (sum of base, race, and class) for a stat.

Parameters
statthe stat
Returns
the points

Definition at line 331 of file NewCharModel.java.

References com.realtime.crossfire.jxclient.gui.label.NewCharModel.getClassStatAdjustment(), com.realtime.crossfire.jxclient.gui.label.NewCharModel.getRaceStatAdjustment(), and com.realtime.crossfire.jxclient.gui.label.NewCharModel.getValue().

Referenced by com.realtime.crossfire.jxclient.gui.label.GUINewcharLabel.updateContents().

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

◆ getUnusedPoints()

int com.realtime.crossfire.jxclient.gui.label.NewCharModel.getUnusedPoints ( )

◆ getValue()

int com.realtime.crossfire.jxclient.gui.label.NewCharModel.getValue ( @NotNull final NewcharStat  stat)

Returns the base points for a stat.

Parameters
statthe stat
Returns
the points

Definition at line 353 of file NewCharModel.java.

References com.realtime.crossfire.jxclient.gui.label.NewCharModel.values.

Referenced by com.realtime.crossfire.jxclient.gui.commands.AccountCreateCharacterCommand.execute(), and com.realtime.crossfire.jxclient.gui.label.NewCharModel.getTotal().

Here is the caller graph for this function:

◆ hasNonServerFailureErrorText()

boolean com.realtime.crossfire.jxclient.gui.label.NewCharModel.hasNonServerFailureErrorText ( )

Returns the error text to show.

Returns
the error text or an empty string to show none

Definition at line 405 of file NewCharModel.java.

References com.realtime.crossfire.jxclient.gui.label.NewCharModel.errorTexts, and com.realtime.crossfire.jxclient.gui.label.NewCharModel.PRIORITY_SERVER_FAILURE.

Referenced by com.realtime.crossfire.jxclient.gui.button.AbstractButton.updateEnabled().

Here is the caller graph for this function:

◆ notifyListeners()

void com.realtime.crossfire.jxclient.gui.label.NewCharModel.notifyListeners ( )
private

◆ removeListener()

void com.realtime.crossfire.jxclient.gui.label.NewCharModel.removeListener ( @NotNull final NewCharModelListener  listener)

◆ setClass()

void com.realtime.crossfire.jxclient.gui.label.NewCharModel.setClass ( @NotNull final String  class_)

◆ setErrorText()

void com.realtime.crossfire.jxclient.gui.label.NewCharModel.setErrorText ( final int  priority,
@Nullable final String  text 
)

Sets an error text.

Parameters
prioritythe priority for deciding which error text to show
textthe error text or
null
to remove the error

Definition at line 383 of file NewCharModel.java.

References com.realtime.crossfire.jxclient.gui.label.NewCharModel.errorTexts, and com.realtime.crossfire.jxclient.gui.label.NewCharModel.notifyListeners().

Referenced by com.realtime.crossfire.jxclient.gui.label.GUINewcharLabel.GUINewcharLabel(), com.realtime.crossfire.jxclient.gui.label.GUINewcharLabel.notifyOpen(), com.realtime.crossfire.jxclient.gui.label.GUINewcharLabel.updateContents(), and com.realtime.crossfire.jxclient.gui.textinput.GUIText.updateErrorText().

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

◆ setOptionIndex()

void com.realtime.crossfire.jxclient.gui.label.NewCharModel.setOptionIndex ( final int  optionIndex)

Sets the selected character option.

Parameters
optionIndexthe option; invalid values are handled

Definition at line 454 of file NewCharModel.java.

References com.realtime.crossfire.jxclient.character.Choice.getChoices(), com.realtime.crossfire.jxclient.gui.label.NewCharModel.notifyListeners(), com.realtime.crossfire.jxclient.gui.label.NewCharModel.option, and com.realtime.crossfire.jxclient.gui.label.NewCharModel.optionIndex.

Referenced by com.realtime.crossfire.jxclient.gui.combobox.GUICharOptionsComboBox.updateSelectedItem().

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

◆ setRace()

void com.realtime.crossfire.jxclient.gui.label.NewCharModel.setRace ( @NotNull final String  race)

◆ setStartingMap()

void com.realtime.crossfire.jxclient.gui.label.NewCharModel.setStartingMap ( @NotNull final String  startingMap)

◆ setValue()

void com.realtime.crossfire.jxclient.gui.label.NewCharModel.setValue ( @NotNull final NewcharStat  stat,
final int  value 
)

Sets the base points for a stat.

Parameters
statthe stat
valuethe points

Definition at line 340 of file NewCharModel.java.

References com.realtime.crossfire.jxclient.gui.label.NewCharModel.notifyListeners(), and com.realtime.crossfire.jxclient.gui.label.NewCharModel.values.

Referenced by com.realtime.crossfire.jxclient.gui.misc.GUISpinner.updateSelectedItem().

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

◆ updateOption()

void com.realtime.crossfire.jxclient.gui.label.NewCharModel.updateOption ( )
private

Member Data Documentation

◆ class_

String com.realtime.crossfire.jxclient.gui.label.NewCharModel.class_ = UNKNOWN
private

◆ errorTexts

final Map<Integer, String> com.realtime.crossfire.jxclient.gui.label.NewCharModel.errorTexts = new TreeMap<>()
private

◆ listeners

final EventListenerList2<NewCharModelListener> com.realtime.crossfire.jxclient.gui.label.NewCharModel.listeners = new EventListenerList2<>()
private

◆ newCharacterInformation

final NewCharacterInformation com.realtime.crossfire.jxclient.gui.label.NewCharModel.newCharacterInformation
private

◆ option

Choice com.realtime.crossfire.jxclient.gui.label.NewCharModel.option
private

◆ optionIndex

int com.realtime.crossfire.jxclient.gui.label.NewCharModel.optionIndex
private

◆ PRIORITY_CHARACTER_NAME

final int com.realtime.crossfire.jxclient.gui.label.NewCharModel.PRIORITY_CHARACTER_NAME = 9
static

◆ PRIORITY_INVALID_STAT_CHA

final int com.realtime.crossfire.jxclient.gui.label.NewCharModel.PRIORITY_INVALID_STAT_CHA = 7
static

A priority value for setErrorText(int, String).

Definition at line 84 of file NewCharModel.java.

◆ PRIORITY_INVALID_STAT_CON

final int com.realtime.crossfire.jxclient.gui.label.NewCharModel.PRIORITY_INVALID_STAT_CON = 3
static

A priority value for setErrorText(int, String).

Definition at line 64 of file NewCharModel.java.

◆ PRIORITY_INVALID_STAT_DEX

final int com.realtime.crossfire.jxclient.gui.label.NewCharModel.PRIORITY_INVALID_STAT_DEX = 2
static

A priority value for setErrorText(int, String).

Definition at line 59 of file NewCharModel.java.

◆ PRIORITY_INVALID_STAT_INT

final int com.realtime.crossfire.jxclient.gui.label.NewCharModel.PRIORITY_INVALID_STAT_INT = 4
static

A priority value for setErrorText(int, String).

Definition at line 69 of file NewCharModel.java.

◆ PRIORITY_INVALID_STAT_POW

final int com.realtime.crossfire.jxclient.gui.label.NewCharModel.PRIORITY_INVALID_STAT_POW = 6
static

A priority value for setErrorText(int, String).

Definition at line 79 of file NewCharModel.java.

◆ PRIORITY_INVALID_STAT_STR

final int com.realtime.crossfire.jxclient.gui.label.NewCharModel.PRIORITY_INVALID_STAT_STR = 1
static

A priority value for setErrorText(int, String).

Definition at line 54 of file NewCharModel.java.

◆ PRIORITY_INVALID_STAT_WIS

final int com.realtime.crossfire.jxclient.gui.label.NewCharModel.PRIORITY_INVALID_STAT_WIS = 5
static

A priority value for setErrorText(int, String).

Definition at line 74 of file NewCharModel.java.

◆ PRIORITY_SERVER_FAILURE

final int com.realtime.crossfire.jxclient.gui.label.NewCharModel.PRIORITY_SERVER_FAILURE = Integer.MAX_VALUE
static

◆ PRIORITY_UNUSED_POINTS

final int com.realtime.crossfire.jxclient.gui.label.NewCharModel.PRIORITY_UNUSED_POINTS = 8
static

◆ race

String com.realtime.crossfire.jxclient.gui.label.NewCharModel.race = UNKNOWN
private

◆ startingMap

String com.realtime.crossfire.jxclient.gui.label.NewCharModel.startingMap = UNKNOWN
private

◆ UNKNOWN

final String com.realtime.crossfire.jxclient.gui.label.NewCharModel.UNKNOWN = "unknown"
staticprivate

◆ values

final Map<NewcharStat, Integer> com.realtime.crossfire.jxclient.gui.label.NewCharModel.values = new EnumMap<>(NewcharStat.class)
private

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