MCPcopy Create free account
hub / github.com/PCGen/pcgen / createNewCharacter

Method createNewCharacter

code/src/java/pcgen/gui2/PCGenFrame.java:981–998  ·  view source on GitHub ↗

creates a new character and sets its file if possible then sets the character as the currently selected character @param file the File for this character

(File file)

Source from the content-addressed store, hash-verified

979 * @param file the File for this character
980 */
981 public void createNewCharacter(File file)
982 {
983 GuiAssertions.assertIsSwingThread();
984 DataSetFacade data = getLoadedDataSetRef().get();
985 CharacterFacade character = CharacterManager.createNewCharacter(this, data);
986 //This is called before the we set it as the selected character so
987 //the InfoTabbedPane can catch any character specific properties when
988 //it is first displayed
989 if (file != null)
990 {
991 character.setFile(file);
992 }
993 //Because CharacterManager adds the new character to the character
994 //list before it returns, it is not necessary to update the character
995 //tabs since they will catch that event before the call to
996 //setCharacter is called
997 setCharacter(character);
998 }
999
1000 /**
1001 * Loads a character from a file. Any sources that are required for

Callers 4

revertCharacterMethod · 0.95
actionPerformedMethod · 0.45
onNewMethod · 0.45

Calls 6

assertIsSwingThreadMethod · 0.95
getLoadedDataSetRefMethod · 0.95
createNewCharacterMethod · 0.95
setFileMethod · 0.95
setCharacterMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected