new UserPreferencesManager().persist(up);
return ip;
}
private String getName() {
UserPreferences up = new UserPreferencesManager().load();
PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.name), LanguageFactory.getInstance().getString(MessageId.whatsYourName), up.getName(), false, 0, 255, -1);
Point location = new Point(0,0);
Dimension size = new Dimension(900,720);
Dimension dialogSize = dialog.getSize();
dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));
dialog.prompt();
String name = dialog.getValue();
up.setName(name);
new UserPreferencesManager().persist(up);
return name;
}