use of games.strategy.engine.data.properties.IEditableProperty in project triplea by triplea-game.
the class GameDataExporter method propertyList.
@SuppressWarnings("unchecked")
private void propertyList(final GameData data) {
// TODO: Unchecked Reflection
xmlfile.append(" <propertyList>\n");
final GameProperties gameProperties = data.getProperties();
try {
// TODO: unchecked reflection below.. this is bad stuff.. find ways to remove
final Field conPropField = GameProperties.class.getDeclaredField(GameProperties.CONSTANT_PROPERTIES_FIELD_NAME);
conPropField.setAccessible(true);
final Field edPropField = GameProperties.class.getDeclaredField(GameProperties.EDITABLE_PROPERTIES_FIELD_NAME);
edPropField.setAccessible(true);
printConstantProperties((Map<String, Object>) conPropField.get(gameProperties));
printEditableProperties((Map<String, IEditableProperty>) edPropField.get(gameProperties));
} catch (final NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) {
ClientLogger.logError("An Error occured whilst trying trying to setup the Property List", e);
}
xmlfile.append(" </propertyList>\n");
}
use of games.strategy.engine.data.properties.IEditableProperty in project triplea by triplea-game.
the class MapOptionsPanel method build.
static JPanel build(final GameData gameData, final StagingScreen screen) {
final GameProperties properties = gameData.getProperties();
final List<IEditableProperty> props = properties.getEditableProperties();
final JPanelBuilder panelBuilder = JPanelBuilder.builder().gridBagLayout(2).add(new JLabel("<html><h2>Map Options</h2></html>")).add(new JPanel());
props.stream().filter(prop -> !prop.getName().contains("bid")).forEach(prop -> {
panelBuilder.add(JLabelBuilder.builder().textWithMaxLength(prop.getName(), 25).tooltip(prop.getName()).build());
panelBuilder.add(screen != StagingScreen.NETWORK_CLIENT ? prop.getEditorComponent() : prop.getEditorComponentDisabled());
});
return panelBuilder.build();
}
Aggregations