From: <aki...@us...> - 2010-06-14 20:34:58
|
Revision: 8400 http://gridarta.svn.sourceforge.net/gridarta/?rev=8400&view=rev Author: akirschbaum Date: 2010-06-14 20:34:51 +0000 (Mon, 14 Jun 2010) Log Message: ----------- Add @Nullable annotations/fix incorrect @NotNull annotations. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/AbstractNewMapDialog.java trunk/src/app/net/sf/gridarta/gui/script/ScriptViewPane.java trunk/src/app/net/sf/gridarta/gui/shortcuts/KeyStrokeDialog.java trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsDialog.java trunk/src/app/net/sf/gridarta/gui/shrinkmapsizedialog/ShrinkMapSizeDialog.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 20:30:18 UTC (rev 8399) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 20:34:51 UTC (rev 8400) @@ -560,7 +560,7 @@ * {@inheritDoc} */ @Override - public void setValue(@NotNull final Object newValue) { + public void setValue(@Nullable final Object newValue) { super.setValue(newValue); if (dialog != null && newValue != UNINITIALIZED_VALUE) { dialog.dispose(); Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 20:30:18 UTC (rev 8399) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 20:34:51 UTC (rev 8400) @@ -604,7 +604,7 @@ * {@inheritDoc} */ @Override - public void setValue(@NotNull final Object newValue) { + public void setValue(@Nullable final Object newValue) { super.setValue(newValue); if (dialog != null && newValue != UNINITIALIZED_VALUE) { dialog.dispose(); Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 20:30:18 UTC (rev 8399) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 20:34:51 UTC (rev 8400) @@ -551,7 +551,7 @@ * {@inheritDoc} */ @Override - public void setValue(@NotNull final Object newValue) { + public void setValue(@Nullable final Object newValue) { super.setValue(newValue); if (dialog != null && newValue != UNINITIALIZED_VALUE) { dialog.dispose(); Modified: trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java 2010-06-14 20:30:18 UTC (rev 8399) +++ trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java 2010-06-14 20:34:51 UTC (rev 8400) @@ -242,7 +242,7 @@ /** {@inheritDoc} */ @Override - public void setValue(final Object newValue) { + public void setValue(@Nullable final Object newValue) { super.setValue(newValue); if (newValue != UNINITIALIZED_VALUE) { errorViewOk(); Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-14 20:30:18 UTC (rev 8399) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-14 20:34:51 UTC (rev 8400) @@ -916,7 +916,7 @@ * {@inheritDoc} */ @Override - public void setValue(@NotNull final Object newValue) { + public void setValue(@Nullable final Object newValue) { super.setValue(newValue); if (newValue != UNINITIALIZED_VALUE) { gameObjectAttributesDialogFactory.hideAttributeDialog(gameObject); Modified: trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java 2010-06-14 20:30:18 UTC (rev 8399) +++ trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java 2010-06-14 20:34:51 UTC (rev 8400) @@ -50,6 +50,7 @@ import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.action.ActionMethod; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * A dialog to ask the user for coordinates to move the cursor to. @@ -258,7 +259,7 @@ * {@inheritDoc} */ @Override - public void setValue(final Object newValue) { + public void setValue(@Nullable final Object newValue) { super.setValue(newValue); if (newValue != UNINITIALIZED_VALUE) { goLocationDialogManager.disposeDialog(mapView); Modified: trunk/src/app/net/sf/gridarta/gui/newmap/AbstractNewMapDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/AbstractNewMapDialog.java 2010-06-14 20:30:18 UTC (rev 8399) +++ trunk/src/app/net/sf/gridarta/gui/newmap/AbstractNewMapDialog.java 2010-06-14 20:34:51 UTC (rev 8400) @@ -218,7 +218,7 @@ * {@inheritDoc} */ @Override - public void setValue(@NotNull final Object newValue) { + public void setValue(@Nullable final Object newValue) { super.setValue(newValue); if (newValue != UNINITIALIZED_VALUE) { dialog.dispose(); Modified: trunk/src/app/net/sf/gridarta/gui/script/ScriptViewPane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/ScriptViewPane.java 2010-06-14 20:30:18 UTC (rev 8399) +++ trunk/src/app/net/sf/gridarta/gui/script/ScriptViewPane.java 2010-06-14 20:34:51 UTC (rev 8400) @@ -61,7 +61,7 @@ * {@inheritDoc} */ @Override - public void setValue(final Object newValue) { + public void setValue(@Nullable final Object newValue) { super.setValue(newValue); if (dialog != null && newValue != UNINITIALIZED_VALUE) { dialog.dispose(); Modified: trunk/src/app/net/sf/gridarta/gui/shortcuts/KeyStrokeDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/shortcuts/KeyStrokeDialog.java 2010-06-14 20:30:18 UTC (rev 8399) +++ trunk/src/app/net/sf/gridarta/gui/shortcuts/KeyStrokeDialog.java 2010-06-14 20:34:51 UTC (rev 8400) @@ -220,7 +220,7 @@ * {@inheritDoc} */ @Override - public void setValue(final Object newValue) { + public void setValue(@Nullable final Object newValue) { super.setValue(newValue); if (newValue != UNINITIALIZED_VALUE) { dialog.dispose(); Modified: trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsDialog.java 2010-06-14 20:30:18 UTC (rev 8399) +++ trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsDialog.java 2010-06-14 20:34:51 UTC (rev 8400) @@ -405,7 +405,7 @@ * {@inheritDoc} */ @Override - public void setValue(final Object newValue) { + public void setValue(@Nullable final Object newValue) { super.setValue(newValue); if (newValue != UNINITIALIZED_VALUE) { dialog.dispose(); Modified: trunk/src/app/net/sf/gridarta/gui/shrinkmapsizedialog/ShrinkMapSizeDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/shrinkmapsizedialog/ShrinkMapSizeDialog.java 2010-06-14 20:30:18 UTC (rev 8399) +++ trunk/src/app/net/sf/gridarta/gui/shrinkmapsizedialog/ShrinkMapSizeDialog.java 2010-06-14 20:34:51 UTC (rev 8400) @@ -237,7 +237,7 @@ * {@inheritDoc} */ @Override - public void setValue(final Object newValue) { + public void setValue(@Nullable final Object newValue) { super.setValue(newValue); if (newValue != UNINITIALIZED_VALUE) { shrinkMapSizeDialogManager.disposeDialog(mapView); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-14 21:18:40
|
Revision: 8404 http://gridarta.svn.sourceforge.net/gridarta/?rev=8404&view=rev Author: akirschbaum Date: 2010-06-14 21:18:31 +0000 (Mon, 14 Jun 2010) Log Message: ----------- Check for missing resource keys. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java trunk/model/src/app/net/sf/gridarta/model/configsource/DefaultConfigSourceFactory.java trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserControl.java trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/TilePanel.java trunk/src/app/net/sf/gridarta/gui/map/tools/DeletionTool.java trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java trunk/src/app/net/sf/gridarta/gui/map/tools/SelectionTool.java trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/AbstractNewMapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapFolderDialog.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/gui/prefs/AppPreferences.java trunk/src/app/net/sf/gridarta/gui/prefs/DevPreferences.java trunk/src/app/net/sf/gridarta/gui/prefs/GUIPreferences.java trunk/src/app/net/sf/gridarta/gui/prefs/MapValidatorPreferences.java trunk/src/app/net/sf/gridarta/gui/prefs/MiscPreferences.java trunk/src/app/net/sf/gridarta/gui/prefs/NetPreferences.java trunk/src/app/net/sf/gridarta/gui/prefs/PreferencesHelper.java trunk/src/app/net/sf/gridarta/gui/prefs/ResPreferences.java trunk/src/app/net/sf/gridarta/gui/prefs/UpdatePreferences.java trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java trunk/src/app/net/sf/gridarta/gui/shortcuts/KeyStrokeDialog.java trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsDialog.java trunk/src/app/net/sf/gridarta/gui/shrinkmapsizedialog/ShrinkMapSizeDialog.java trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java trunk/src/app/net/sf/gridarta/gui/utils/SwingUtils.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabButtonAction.java trunk/src/app/net/sf/gridarta/mainactions/DefaultExiter.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java trunk/src/app/net/sf/gridarta/updater/Updater.java trunk/src/app/net/sf/gridarta/validation/AbstractValidator.java trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditUndoActions.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/actions/Find.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/actions/Replace.java trunk/utils/src/app/net/sf/gridarta/gui/utils/FileFilters.java trunk/utils/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java trunk/utils/src/app/net/sf/gridarta/utils/ProcessRunner.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -56,6 +56,7 @@ import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.normalizer.MapPathNormalizer; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.Size2D; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; @@ -334,11 +335,11 @@ tabs.setBorder(new EmptyBorder(10, 4, 4, 4)); final Component mainPanel = createMainPanel(map); - tabs.add(ACTION_BUILDER.getString("mapMapTabTitle"), mainPanel); + tabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "mapMapTabTitle"), mainPanel); mapTilePane = new IsoMapTilePane<GameObject, MapArchObject, Archetype>(mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer); final Component tilePanel = createTilePathPanel(mapTilePane); - tabs.add(ACTION_BUILDER.getString("mapTilesTabTitle"), tilePanel); + tabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "mapTilesTabTitle"), tilePanel); mapTilePaneEnabled = mapModel.getMapFile() != null; tabs.setEnabledAt(tabs.indexOfComponent(tilePanel), mapTilePaneEnabled); @@ -463,29 +464,29 @@ gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.weightx = 2.0; - mapPanel.add(new JLabel(ACTION_BUILDER.getString("mapName")), labelGbc); + mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapName")), labelGbc); mapName.setColumns(16); mapName.setText(map.getMapName()); mapPanel.add(mapName, gbc); - mapPanel.add(new JLabel(ACTION_BUILDER.getString("mapBackgroundMusic")), labelGbc); + mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapBackgroundMusic")), labelGbc); mapBackgroundMusic.setColumns(16); mapBackgroundMusic.setText(map.getBackgroundMusic()); mapPanel.add(mapBackgroundMusic, gbc); - mapPanel.add(new JLabel(ACTION_BUILDER.getString("mapRegion")), labelGbc); + mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapRegion")), labelGbc); mapRegion.setColumns(16); mapRegion.setText(map.getRegion()); mapPanel.add(mapRegion, gbc); - mapPanel.add(new JLabel(ACTION_BUILDER.getString("mapWidth")), labelGbc); + mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapWidth")), labelGbc); mapWidthField.setColumns(5); mapWidthField.setText(Integer.toString(mapModel.getMapArchObject().getMapSize().getWidth())); gbc.gridwidth = 1; gbc.weightx = 1.0; mapPanel.add(mapWidthField, gbc); - mapPanel.add(new JLabel(ACTION_BUILDER.getString("mapHeight")), labelGbc); + mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapHeight")), labelGbc); mapHeightField.setColumns(5); mapHeightField.setText(Integer.toString(mapModel.getMapArchObject().getMapSize().getHeight())); gbc.gridwidth = GridBagConstraints.REMAINDER; @@ -574,7 +575,7 @@ */ @NotNull private static Border createTitledBorder(@NotNull final String key) { - return BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(ACTION_BUILDER.getString(key)), GUIConstants.DIALOG_BORDER); + return BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(ActionBuilderUtils.getString(ACTION_BUILDER, key)), GUIConstants.DIALOG_BORDER); } /** @@ -588,7 +589,7 @@ @NotNull private static Component createPanelLine(@NotNull final JTextField textField, final int n, final int defaultValue, @NotNull final String labelKey) { final Container lineLayout = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - lineLayout.add(new JLabel(ACTION_BUILDER.getString(labelKey))); + lineLayout.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, labelKey))); textField.setColumns(n); textField.setText(Integer.toString(defaultValue)); lineLayout.add(textField); @@ -608,7 +609,7 @@ final JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); panel.add(checkBox); - checkBox.setText(ACTION_BUILDER.getString(labelKey)); + checkBox.setText(ActionBuilderUtils.getString(ACTION_BUILDER, labelKey)); checkBox.setSelected(state); return panel; } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -48,6 +48,7 @@ import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.normalizer.MapPathNormalizer; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.Size2D; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; @@ -392,26 +393,26 @@ tabs.setBorder(new EmptyBorder(10, 4, 4, 4)); final Component mapPanel = createMapPanel(map); - tabs.add(ACTION_BUILDER.getString("mapMapTabTitle"), mapPanel); + tabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "mapMapTabTitle"), mapPanel); final Component textPanel = createMapTextPanel(map); - tabs.add(ACTION_BUILDER.getString("mapTextTabTitle"), textPanel); + tabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "mapTextTabTitle"), textPanel); final Component lorePanel = createMapLorePanel(map); - tabs.add(ACTION_BUILDER.getString("mapLoreTabTitle"), lorePanel); + tabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "mapLoreTabTitle"), lorePanel); final Component parametersPanel = createParametersPanel(map); - tabs.add(ACTION_BUILDER.getString("mapParametersTabTitle"), parametersPanel); + tabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "mapParametersTabTitle"), parametersPanel); final Component shopPanel = createShopPanel(map); - tabs.add(ACTION_BUILDER.getString("mapShopTabTitle"), shopPanel); + tabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "mapShopTabTitle"), shopPanel); final Component weatherPanel = createWeatherPanel(map); - tabs.add(ACTION_BUILDER.getString("mapWeatherTabTitle"), weatherPanel); + tabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "mapWeatherTabTitle"), weatherPanel); mapTilePane = new FlatMapTilePane<GameObject, MapArchObject, Archetype>(mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer); final Component tilePanel = createTilePathPanel(mapTilePane); - tabs.add(ACTION_BUILDER.getString("mapTilesTabTitle"), tilePanel); + tabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "mapTilesTabTitle"), tilePanel); mapTilePaneEnabled = mapModel.getMapFile() != null; tabs.setEnabledAt(tabs.indexOfComponent(tilePanel), mapTilePaneEnabled); @@ -622,7 +623,7 @@ private void addInputFieldLine(@NotNull final Container panel, @NotNull final JTextField textField, final int n, @NotNull final String defaultText, @NotNull final String labelKey) { textField.setColumns(n); textField.setText(defaultText); - panel.add(new JLabel(ACTION_BUILDER.getString(labelKey)), gbcLabel); + panel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, labelKey)), gbcLabel); panel.add(textField, gbcTextField); } @@ -634,7 +635,7 @@ * @param labelKey the key of the label */ private void addCheckBoxLine(@NotNull final Container panel, @NotNull final AbstractButton checkBox, final boolean state, @NotNull final String labelKey) { - checkBox.setText(ACTION_BUILDER.getString(labelKey)); + checkBox.setText(ActionBuilderUtils.getString(ACTION_BUILDER, labelKey)); checkBox.setSelected(state); panel.add(checkBox, gbcCheckBox); } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -57,6 +57,7 @@ import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.normalizer.MapPathNormalizer; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.Size2D; import net.sf.gridarta.var.daimonin.model.archetype.Archetype; import net.sf.gridarta.var.daimonin.model.gameobject.GameObject; @@ -329,11 +330,11 @@ tabs.setBorder(new EmptyBorder(10, 4, 4, 4)); final Component mainPanel = createMainPanel(map); - tabs.add(ACTION_BUILDER.getString("mapMapTabTitle"), mainPanel); + tabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "mapMapTabTitle"), mainPanel); mapTilePane = new IsoMapTilePane<GameObject, MapArchObject, Archetype>(mapManager, globalSettings, mapModel, mapFileFilter, mapPathNormalizer); final Component tilePanel = createTilePathPanel(mapTilePane); - tabs.add(ACTION_BUILDER.getString("mapTilesTabTitle"), tilePanel); + tabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "mapTilesTabTitle"), tilePanel); mapTilePaneEnabled = mapModel.getMapFile() != null; tabs.setEnabledAt(tabs.indexOfComponent(tilePanel), mapTilePaneEnabled); @@ -456,12 +457,12 @@ gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.weightx = 2.0; - mapPanel.add(new JLabel(ACTION_BUILDER.getString("mapName")), labelGbc); + mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapName")), labelGbc); mapName.setColumns(16); mapName.setText(map.getMapName()); mapPanel.add(mapName, gbc); - mapPanel.add(new JLabel(ACTION_BUILDER.getString("mapBackgroundMusic")), labelGbc); + mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapBackgroundMusic")), labelGbc); mapBackgroundMusic.setColumns(16); mapBackgroundMusic.setText(map.getBackgroundMusic()); final Container mapBackgroundMusicPanel = new JPanel(new BorderLayout()); @@ -469,14 +470,14 @@ mapBackgroundMusicPanel.add(new JFileChooserButton(globalSettings.getMediaDirectory(), mapBackgroundMusic, JFileChooser.FILES_ONLY), BorderLayout.EAST); mapPanel.add(mapBackgroundMusicPanel, gbc); - mapPanel.add(new JLabel(ACTION_BUILDER.getString("mapWidth")), labelGbc); + mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapWidth")), labelGbc); mapWidthField.setColumns(5); mapWidthField.setText(Integer.toString(mapModel.getMapArchObject().getMapSize().getWidth())); gbc.gridwidth = 1; gbc.weightx = 1.0; mapPanel.add(mapWidthField, gbc); - mapPanel.add(new JLabel(ACTION_BUILDER.getString("mapHeight")), labelGbc); + mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapHeight")), labelGbc); mapHeightField.setColumns(5); mapHeightField.setText(Integer.toString(mapModel.getMapArchObject().getMapSize().getHeight())); gbc.gridwidth = GridBagConstraints.REMAINDER; @@ -565,7 +566,7 @@ */ @NotNull private static Border createTitledBorder(@NotNull final String key) { - return BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(ACTION_BUILDER.getString(key)), GUIConstants.DIALOG_BORDER); + return BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(ActionBuilderUtils.getString(ACTION_BUILDER, key)), GUIConstants.DIALOG_BORDER); } /** @@ -579,7 +580,7 @@ @NotNull private static Component createPanelLine(@NotNull final JTextField textField, final int n, final int defaultValue, @NotNull final String labelKey) { final Container lineLayout = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - lineLayout.add(new JLabel(ACTION_BUILDER.getString(labelKey))); + lineLayout.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, labelKey))); textField.setColumns(n); textField.setText(Integer.toString(defaultValue)); lineLayout.add(textField); @@ -598,7 +599,7 @@ final JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS)); panel.add(checkBox); - checkBox.setText(ACTION_BUILDER.getString(labelKey)); + checkBox.setText(ActionBuilderUtils.getString(ACTION_BUILDER, labelKey)); checkBox.setSelected(state); return panel; } Modified: trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -27,6 +27,7 @@ import net.sf.gridarta.model.data.AbstractNamedObjects; import net.sf.gridarta.model.data.IllegalNamedObjectException; import net.sf.gridarta.model.data.NamedObject; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.IOUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; @@ -60,7 +61,7 @@ * @param animTreeFile the collected animation tree file */ public DefaultAnimationObjects(@NotNull final String animTreeFile) { - super(ACTION_BUILDER.getString("nameOfAnimationObject")); + super(ActionBuilderUtils.getString(ACTION_BUILDER, "nameOfAnimationObject")); this.animTreeFile = animTreeFile; } @@ -103,7 +104,7 @@ * @throws IOException in case of I/O problems during collection */ private void collectAnimations(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - progress.setLabel(ACTION_BUILDER.getString("archCollectAnimations"), size()); + progress.setLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "archCollectAnimations"), size()); final BufferedWriter animations = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, "animations")), IOUtils.MAP_ENCODING)); try { int counter = 0; // counter for progress bar @@ -126,7 +127,7 @@ * @throws IOException in case of I/O problems during collection */ private void collectAnimTree(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - progress.setLabel(ACTION_BUILDER.getString("archCollectAnimTree"), size()); + progress.setLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "archCollectAnimTree"), size()); final BufferedWriter animtree = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, animTreeFile)), IOUtils.MAP_ENCODING)); try { int counter = 0; // counter for progress bar Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -37,6 +37,7 @@ import net.sf.gridarta.model.face.FaceObjectProvidersListener; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.EventListenerList2; import net.sf.gridarta.utils.IOUtils; import net.sf.japi.swing.action.ActionBuilder; @@ -278,7 +279,7 @@ * @throws IOException in case of I/O problems during collection */ private void collect(@NotNull final Progress progress, @NotNull final Writer writer) throws IOException { - progress.setLabel(ACTION_BUILDER.getString("archCollectArches"), archetypes.size()); + progress.setLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "archCollectArches"), archetypes.size()); int artifactCount = 0; int count = 0; for (final R arch : archetypes) { Modified: trunk/model/src/app/net/sf/gridarta/model/configsource/DefaultConfigSourceFactory.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/configsource/DefaultConfigSourceFactory.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/model/src/app/net/sf/gridarta/model/configsource/DefaultConfigSourceFactory.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.MissingResourceException; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; @@ -55,11 +56,7 @@ * Creates a new instance. */ public DefaultConfigSourceFactory() { - final String configSourceClassNames = ACTION_BUILDER.getString(CONFIG_SOURCES_KEY); - if (configSourceClassNames == null) { - throw new MissingResourceException("No configuration sources defined", "net.sf.gridarta", CONFIG_SOURCES_KEY); - } - + final String configSourceClassNames = ActionBuilderUtils.getString(ACTION_BUILDER, CONFIG_SOURCES_KEY); for (final String configSourceClassName : configSourceClassNames.split(" ", -1)) { final Class<?> configSourceClass; try { Modified: trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -43,6 +43,7 @@ import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.gridarta.model.errorview.ErrorViewCollector; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.ArrayUtils; import net.sf.gridarta.utils.CommonConstants; import net.sf.gridarta.utils.IOUtils; @@ -124,7 +125,7 @@ * @param archFaceProvider the arch face provider to use for collection */ public DefaultFaceObjects(@NotNull final String pngFile, @NotNull final String faceTreeFile, @NotNull final Pattern faceTreeInputPattern, @NotNull final String faceTreeOutputFormat, @NotNull final ArchFaceProvider archFaceProvider) { - super(ACTION_BUILDER.getString("nameOfFaceObject")); + super(ActionBuilderUtils.getString(ACTION_BUILDER, "nameOfFaceObject")); this.pngFile = pngFile; this.faceTreeFile = faceTreeFile; this.faceTreeInputPattern = faceTreeInputPattern; @@ -162,7 +163,7 @@ final PrintStream binFile = new PrintStream(fos); try { final int numOfFaceObjects = size(); - progress.setLabel(ACTION_BUILDER.getString("archCollectImages"), numOfFaceObjects); + progress.setLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "archCollectImages"), numOfFaceObjects); int i = 0; for (final FaceObject faceObject : this) { final String face = faceObject.getFaceName(); @@ -215,7 +216,7 @@ final BufferedWriter treeFile = new BufferedWriter(osw); try { final int numOfFaceObjects = size(); - progress.setLabel(ACTION_BUILDER.getString("archCollectTree"), numOfFaceObjects); + progress.setLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "archCollectTree"), numOfFaceObjects); int i = 0; for (final NamedObject faceObject : this) { final String path = faceObject.getPath(); @@ -252,7 +253,7 @@ final PrintWriter textFile = new PrintWriter(bw, false); try { final int numOfFaceObjects = size(); - progress.setLabel(ACTION_BUILDER.getString("archCollectBmaps"), numOfFaceObjects); + progress.setLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "archCollectBmaps"), numOfFaceObjects); int i = 0; for (final FaceObject faceObject : this) { final String face = faceObject.getFaceName(); Modified: trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserControl.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserControl.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -26,7 +26,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.MissingResourceException; import net.sf.gridarta.gui.objectchooser.ObjectChooserTab; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserFolder; @@ -35,6 +34,7 @@ import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; @@ -172,11 +172,7 @@ @NotNull @Override public String getTitle() { - final String title = ACTION_BUILDER.getString("objectChooser.archetypesTabTitle"); - if (title == null) { - throw new MissingResourceException("missing preferences key", ArchetypeChooserControl.class.getName(), "objectChooser.archetypesTabTitle"); - } - return title; + return ActionBuilderUtils.getString(ACTION_BUILDER, "objectChooser.archetypesTabTitle"); } } // class ArchetypeChooserControl Modified: trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -37,6 +37,7 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.action.ActionMethod; @@ -125,7 +126,7 @@ descriptionField.getDocument().addDocumentListener(documentListener); updateOkButton(); - dialog = createDialog(parentComponent, ACTION_BUILDER.getString("editBookmark.title")); + dialog = createDialog(parentComponent, ActionBuilderUtils.getString(ACTION_BUILDER, "editBookmark.title")); dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); dialog.getRootPane().setDefaultButton(okButton); dialog.pack(); @@ -153,7 +154,7 @@ mainPanel.setBorder(GUIConstants.DIALOG_BORDER); - mainPanel.add(new JLabel(ACTION_BUILDER.getString("editBookmark.description"))); + mainPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "editBookmark.description"))); mainPanel.add(Box.createVerticalStrut(5)); mainPanel.add(descriptionField); Modified: trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -48,6 +48,7 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.action.ActionMethod; @@ -166,7 +167,7 @@ setMessage(createPanel()); - dialog = createDialog(parentComponent, ACTION_BUILDER.getString("manageBookmarks.title")); + dialog = createDialog(parentComponent, ActionBuilderUtils.getString(ACTION_BUILDER, "manageBookmarks.title")); dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); dialog.setModal(false); dialog.setResizable(true); Modified: trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -35,6 +35,7 @@ import javax.swing.tree.TreePath; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.errorview.ErrorViewCategory; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; @@ -252,7 +253,7 @@ }; assert okButton != null; okButton.setEnabled(false); - dialog = pane.createDialog(parent, ACTION_BUILDER.getString("errorViewTitle")); + dialog = pane.createDialog(parent, ActionBuilderUtils.getString(ACTION_BUILDER, "errorViewTitle")); pane.selectInitialValue(); assert dialog != null; dialog.pack(); Modified: trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -50,6 +50,7 @@ import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.action.ActionMethod; @@ -191,7 +192,7 @@ final GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; - panel.add(new JLabel(ACTION_BUILDER.getString("findArchetypesName")), gbc); + panel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "findArchetypesName")), gbc); gbc.gridx = 1; gbc.gridy = 0; gbc.fill = GridBagConstraints.HORIZONTAL; @@ -208,7 +209,7 @@ final JButton closeButton = new JButton(ACTION_BUILDER.createAction(false, "findArchetypesClose", this)); final JOptionPane optionPane = new JOptionPane(panel, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null, new JButton[] { searchButton, closeButton, }, searchButton); optionPane.setInitialValue(nameField); - dialog = optionPane.createDialog(parent, ACTION_BUILDER.getString("findArchetypesTitle")); + dialog = optionPane.createDialog(parent, ActionBuilderUtils.getString(ACTION_BUILDER, "findArchetypesTitle")); dialog.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); dialog.setModal(false); dialog.setResizable(true); Modified: trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -30,6 +30,7 @@ import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; @@ -57,7 +58,7 @@ /** * The column titles. */ - private static final String[] columnName = { ACTION_BUILDER.getString("findArchetypesColumnName"), ACTION_BUILDER.getString("findArchetypesColumnArch"), ACTION_BUILDER.getString("findArchetypesColumnType"), ACTION_BUILDER.getString("findArchetypesColumnFolder"), }; + private static final String[] columnName = { ActionBuilderUtils.getString(ACTION_BUILDER, "findArchetypesColumnName"), ActionBuilderUtils.getString(ACTION_BUILDER, "findArchetypesColumnArch"), ActionBuilderUtils.getString(ACTION_BUILDER, "findArchetypesColumnType"), ActionBuilderUtils.getString(ACTION_BUILDER, "findArchetypesColumnFolder"), }; /** * The instance for looking up archetype types. Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -132,6 +132,7 @@ import net.sf.gridarta.textedit.textarea.SyntaxDocument; import net.sf.gridarta.textedit.textarea.TextAreaDefaults; import net.sf.gridarta.textedit.textarea.tokenmarker.TokenMarkerFactory; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.Size2D; import net.sf.gridarta.utils.StringUtils; import net.sf.japi.swing.action.ActionBuilder; @@ -904,7 +905,7 @@ */ @NotNull public JDialog createDialog() { - final JDialog dialog = createDialog(parent, ACTION_BUILDER.getString("attribTitle")); + final JDialog dialog = createDialog(parent, ActionBuilderUtils.getString(ACTION_BUILDER, "attribTitle")); dialog.getRootPane().setDefaultButton(okButton); dialog.setResizable(true); dialog.setModal(false); Modified: trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -45,6 +45,7 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.Size2D; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; @@ -130,7 +131,7 @@ TextComponentUtils.setAutoSelectOnFocus(yCoordinateField); TextComponentUtils.setActionNextFocus(xCoordinateField, yCoordinateField); - dialog = createDialog(mapView.getComponent(), ACTION_BUILDER.getString("goLocation.title")); + dialog = createDialog(mapView.getComponent(), ActionBuilderUtils.getString(ACTION_BUILDER, "goLocation.title")); dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); dialog.getRootPane().setDefaultButton(okButton); dialog.setModal(false); @@ -164,12 +165,12 @@ final Point point = mapView.getMapViewBasic().getMapCursor().getLocation(); - coordinatesPanel.add(new JLabel(ACTION_BUILDER.getString("goLocationX")), gbcLabel); + coordinatesPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "goLocationX")), gbcLabel); xCoordinateField.setText(point == null ? "0" : Integer.toString(point.x)); xCoordinateField.setColumns(3); coordinatesPanel.add(xCoordinateField, gbcField); - coordinatesPanel.add(new JLabel(ACTION_BUILDER.getString("goLocationY")), gbcLabel); + coordinatesPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "goLocationY")), gbcLabel); yCoordinateField.setText(point == null ? "0" : Integer.toString(point.y)); yCoordinateField.setColumns(3); coordinatesPanel.add(yCoordinateField, gbcField); Modified: trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -22,6 +22,7 @@ import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gui.utils.HideFileFilterProxy; import net.sf.gridarta.gui.utils.MapFileFilter; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.util.filter.file.EndingFileFilter; @@ -46,16 +47,16 @@ /** * Swing FileFilter for map files. */ - public static final FileFilter mapFileFilter = new HideFileFilterProxy(new MapFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.maps"), ".lua", ".py", ".txt", ".text")); + public static final FileFilter mapFileFilter = new HideFileFilterProxy(new MapFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.maps"), ".lua", ".py", ".txt", ".text")); /** * Swing FileFilter for Python scripts. */ - public static final FileFilter pythonFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.python"), ".py")); + public static final FileFilter pythonFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.python"), ".py")); /** * Swing FileFilter for Lua scripts. */ - public static final FileFilter luaFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.lua"), ".lua")); + public static final FileFilter luaFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.lua"), ".lua")); } // class FileFilters Modified: trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -46,6 +46,7 @@ import net.sf.gridarta.model.map.tiles.MapLink; import net.sf.gridarta.model.map.tiles.TileLink; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.action.ActionMethod; @@ -157,11 +158,7 @@ */ @NotNull private static TileLink newTileLink(@NotNull final String key, @NotNull final MapLink[] mapLinks, @NotNull final Direction revLink) { - final String name = ACTION_BUILDER.getString(key); - if (name == null) { - throw new IllegalArgumentException("resource key '" + key + "' does not exist"); - } - return new TileLink(name, mapLinks, revLink); + return new TileLink(ActionBuilderUtils.getString(ACTION_BUILDER, key), mapLinks, revLink); } /** @@ -207,7 +204,7 @@ @NotNull private static Component buildTilePanels(@NotNull final MapTilePanel[] tilePanels, @NotNull final DirectionLayout.Direction[] directionMapping) { final JComponent panel = new JPanel(new DirectionLayout()); - panel.setBorder(new CompoundBorder(BorderFactory.createTitledBorder(ACTION_BUILDER.getString("mapTiles")), GUIConstants.DIALOG_BORDER)); + panel.setBorder(new CompoundBorder(BorderFactory.createTitledBorder(ActionBuilderUtils.getString(ACTION_BUILDER, "mapTiles")), GUIConstants.DIALOG_BORDER)); for (int index = 0; index < tilePanels.length; index++) { panel.add(tilePanels[index].getTilePanel(), directionMapping[index]); } @@ -222,7 +219,7 @@ @NotNull private Component buildSubPanel() { final JComponent subPanel = new JPanel(new GridBagLayout()); - subPanel.setBorder(new CompoundBorder(BorderFactory.createTitledBorder(ACTION_BUILDER.getString("mapControl")), GUIConstants.DIALOG_BORDER)); + subPanel.setBorder(new CompoundBorder(BorderFactory.createTitledBorder(ActionBuilderUtils.getString(ACTION_BUILDER, "mapControl")), GUIConstants.DIALOG_BORDER)); final GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.NONE; gbc.weightx = 1.0; Modified: trunk/src/app/net/sf/gridarta/gui/map/maptilepane/TilePanel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/maptilepane/TilePanel.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/map/maptilepane/TilePanel.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -35,6 +35,7 @@ import javax.swing.JTextField; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.model.io.PathManager; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.FileChooserUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; @@ -275,7 +276,7 @@ */ private RASwitch() { setMargin(new Insets(0, 0, 0, 0)); - setToolTipText(ACTION_BUILDER.getString("mapTilePathMode.shortdescription")); + setToolTipText(ActionBuilderUtils.getString(ACTION_BUILDER, "mapTilePathMode.shortdescription")); updateText(); addActionListener(this); setPreferredSize(getMinimumSize()); Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/DeletionTool.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/DeletionTool.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/DeletionTool.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -41,6 +41,7 @@ import net.sf.gridarta.model.mapcursor.MapCursor; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.match.GameObjectMatcher; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.action.ActionMethod; @@ -391,9 +392,9 @@ * @return the combo box */ private static JComboBox createDeleteComboBox() { - final String[] options = { ACTION_BUILDER.getString("deletionTool.delete.top"), ACTION_BUILDER.getString("deletionTool.delete.all"), ACTION_BUILDER.getString("deletionTool.delete.bottom"), }; + final String[] options = { ActionBuilderUtils.getString(ACTION_BUILDER, "deletionTool.delete.top"), ActionBuilderUtils.getString(ACTION_BUILDER, "deletionTool.delete.all"), ActionBuilderUtils.getString(ACTION_BUILDER, "deletionTool.delete.bottom"), }; final JComboBox comboBox = new JComboBox(options); - comboBox.setToolTipText(ACTION_BUILDER.getString("deletionTool.delete.shortdescription")); + comboBox.setToolTipText(ActionBuilderUtils.getString(ACTION_BUILDER, "deletionTool.delete.shortdescription")); return comboBox; } @@ -402,9 +403,9 @@ * @return the combo box */ private static JComboBox createScopeComboBox() { - final String[] options = { ACTION_BUILDER.getString("deletionTool.scope.square"), ACTION_BUILDER.getString("deletionTool.scope.aboveFloor"), ACTION_BUILDER.getString("deletionTool.scope.belowFloor"), ACTION_BUILDER.getString("deletionTool.scope.selectedObject"), ACTION_BUILDER.getString("deletionTool.scope.wall"), ACTION_BUILDER.getString("deletionTool.scope.floor"), }; + final String[] options = { ActionBuilderUtils.getString(ACTION_BUILDER, "deletionTool.scope.square"), ActionBuilderUtils.getString(ACTION_BUILDER, "deletionTool.scope.aboveFloor"), ActionBuilderUtils.getString(ACTION_BUILDER, "deletionTool.scope.belowFloor"), ActionBuilderUtils.getString(ACTION_BUILDER, "deletionTool.scope.selectedObject"), ActionBuilderUtils.getString(ACTION_BUILDER, "deletionTool.scope.wall"), ActionBuilderUtils.getString(ACTION_BUILDER, "deletionTool.scope.floor"), }; final JComboBox comboBox = new JComboBox(options); - comboBox.setToolTipText(ACTION_BUILDER.getString("deletionTool.scope.shortdescription")); + comboBox.setToolTipText(ActionBuilderUtils.getString(ACTION_BUILDER, "deletionTool.scope.shortdescription")); return comboBox; } Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -41,6 +41,7 @@ import net.sf.gridarta.model.map.mapmodel.InsertionModeSet; import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.mapcursor.MapCursor; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; @@ -272,9 +273,9 @@ * @return the combo box */ private static JComboBox createModeComboBox() { - final String[] options = { ACTION_BUILDER.getString("insertionTool.mode.auto"), ACTION_BUILDER.getString("insertionTool.mode.topmost"), ACTION_BUILDER.getString("insertionTool.mode.aboveFloor"), ACTION_BUILDER.getString("insertionTool.mode.belowFloor"), ACTION_BUILDER.getString("insertionTool.mode.bottommost"), }; + final String[] options = { ActionBuilderUtils.getString(ACTION_BUILDER, "insertionTool.mode.auto"), ActionBuilderUtils.getString(ACTION_BUILDER, "insertionTool.mode.topmost"), ActionBuilderUtils.getString(ACTION_BUILDER, "insertionTool.mode.aboveFloor"), ActionBuilderUtils.getString(ACTION_BUILDER, "insertionTool.mode.belowFloor"), ActionBuilderUtils.getString(ACTION_BUILDER, "insertionTool.mode.bottommost"), }; final JComboBox comboBox = new JComboBox(options); - comboBox.setToolTipText(ACTION_BUILDER.getString("insertionTool.mode.shortdescription")); + comboBox.setToolTipText(ActionBuilderUtils.getString(ACTION_BUILDER, "insertionTool.mode.shortdescription")); return comboBox; } Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/SelectionTool.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/SelectionTool.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/SelectionTool.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -39,6 +39,7 @@ import net.sf.gridarta.model.map.mapmodel.InsertionMode; import net.sf.gridarta.model.map.mapmodel.InsertionModeSet; import net.sf.gridarta.model.mapcursor.MapCursor; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.action.ActionMethod; @@ -239,9 +240,9 @@ * @return the combo box */ private static JComboBox createModeComboBox() { - final String[] options = { ACTION_BUILDER.getString("selectionTool.mode.auto"), ACTION_BUILDER.getString("selectionTool.mode.topmost"), ACTION_BUILDER.getString("selectionTool.mode.aboveFloor"), ACTION_BUILDER.getString("selectionTool.mode.belowFloor"), ACTION_BUILDER.getString("selectionTool.mode.bottommost"), }; + final String[] options = { ActionBuilderUtils.getString(ACTION_BUILDER, "selectionTool.mode.auto"), ActionBuilderUtils.getString(ACTION_BUILDER, "selectionTool.mode.topmost"), ActionBuilderUtils.getString(ACTION_BUILDER, "selectionTool.mode.aboveFloor"), ActionBuilderUtils.getString(ACTION_BUILDER, "selectionTool.mode.belowFloor"), ActionBuilderUtils.getString(ACTION_BUILDER, "selectionTool.mode.bottommost"), }; final JComboBox comboBox = new JComboBox(options); - comboBox.setToolTipText(ACTION_BUILDER.getString("selectionTool.mode.shortdescription")); + comboBox.setToolTipText(ActionBuilderUtils.getString(ACTION_BUILDER, "selectionTool.mode.shortdescription")); return comboBox; } Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -38,6 +38,7 @@ import net.sf.gridarta.model.map.mapmodel.InsertionModeSet; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.match.GameObjectMatcher; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; @@ -92,11 +93,11 @@ lmbSelector = new ToolSelector<G, A, R>("selection", mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapChooserControl, floorGameObjectMatcher, wallGameObjectMatcher, monsterGameObjectMatcher, insertionModeSet); mmbSelector = new ToolSelector<G, A, R>("deletion", mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapChooserControl, floorGameObjectMatcher, wallGameObjectMatcher, monsterGameObjectMatcher, insertionModeSet); rmbSelector = new ToolSelector<G, A, R>("insertion", mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapChooserControl, floorGameObjectMatcher, wallGameObjectMatcher, monsterGameObjectMatcher, insertionModeSet); - add(new JLabel(ACTION_BUILDER.getString("mouse")), BorderLayout.NORTH); + add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mouse")), BorderLayout.NORTH); final Container mouseTabs = new JTabbedPane(); - mouseTabs.add(ACTION_BUILDER.getString("left"), lmbSelector); - mouseTabs.add(ACTION_BUILDER.getString("middle"), mmbSelector); - mouseTabs.add(ACTION_BUILDER.getString("right"), rmbSelector); + mouseTabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "left"), lmbSelector); + mouseTabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "middle"), mmbSelector); + mouseTabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "right"), rmbSelector); add(mouseTabs); } Modified: trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -28,6 +28,7 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.NumberUtils; import net.sf.gridarta.utils.Size2D; import net.sf.japi.swing.action.ActionBuilder; @@ -154,7 +155,7 @@ protected void addMapWidthField(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel, @NotNull final GridBagConstraints gbcField) { mapWidthField.setText(Integer.toString(widthKey == null ? defaultWidth : preferences.getInt(widthKey, defaultWidth))); mapWidthField.setColumns(3); - panel.add(new JLabel(ACTION_BUILDER.getString("mapWidth")), gbcLabel); + panel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapWidth")), gbcLabel); panel.add(mapWidthField, gbcField); mapWidthField.selectAll(); } @@ -166,7 +167,7 @@ protected void addMapHeightField(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel, @NotNull final GridBagConstraints gbcField) { mapHeightField.setText(Integer.toString(heightKey == null ? defaultHeight : preferences.getInt(heightKey, defaultHeight))); mapHeightField.setColumns(3); - panel.add(new JLabel(ACTION_BUILDER.getString("mapHeight")), gbcLabel); + panel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapHeight")), gbcLabel); panel.add(mapHeightField, gbcField); mapHeightField.selectAll(); } Modified: trunk/src/app/net/sf/gridarta/gui/newmap/AbstractNewMapDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/AbstractNewMapDialog.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/newmap/AbstractNewMapDialog.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -44,6 +44,7 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.action.ActionMethod; @@ -180,7 +181,7 @@ gbcField.insets = new Insets(2, 2, 2, 2); gbcField.gridwidth = GridBagConstraints.REMAINDER; - panel.setBorder(new CompoundBorder(new TitledBorder(new EtchedBorder(), ACTION_BUILDER.getString("newMapParameters")), GUIConstants.DIALOG_BORDER)); + panel.setBorder(new CompoundBorder(new TitledBorder(new EtchedBorder(), ActionBuilderUtils.getString(ACTION_BUILDER, "newMapParameters")), GUIConstants.DIALOG_BORDER)); addMapSizeDefaultCheckbox(panel, gbcField); addMapWidthField(panel, gbcLabel, gbcField); addMapHeightField(panel, gbcLabel, gbcField); Modified: trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -31,6 +31,7 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.model.map.maparchobject.MapArchObjectFactory; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.NumberUtils; import net.sf.gridarta.utils.Size2D; import net.sf.japi.swing.action.ActionBuilder; @@ -126,7 +127,7 @@ this.showMapDifficulty = showMapDifficulty; this.defaultDifficulty = defaultDifficulty; - init1(parentComponent, ACTION_BUILDER.getString("newMap.title")); + init1(parentComponent, ActionBuilderUtils.getString(ACTION_BUILDER, "newMap.title")); init2(); mapNameField.selectAll(); @@ -142,7 +143,7 @@ @Override protected JPanel createMapNamePanel() { final JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - panel.add(new JLabel(ACTION_BUILDER.getString("newMapMapName"))); + panel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "newMapMapName"))); panel.add(mapNameField); return panel; } @@ -157,7 +158,7 @@ } mapDifficultyField.setText(Integer.toString(preferences.getInt(DEFAULT_DIFFICULTY_KEY, defaultDifficulty))); - panel.add(new JLabel(ACTION_BUILDER.getString("mapDifficulty")), gbcLabel); + panel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapDifficulty")), gbcLabel); mapDifficultyField.setColumns(3); panel.add(mapDifficultyField, gbcField); } Modified: trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapDialog.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapDialog.java 2010-06-14 21:18:31 UTC (rev 8404) @@ -33,6 +33,7 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.Size2D; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; @@ -87,7 +88,7 @@ super(false, null, null, defaultWidth, defaultHeight); this.objectChooser = objectChooser; this.pickmapChooserControl = pickmapChooserControl; - init1(parentComponent, ACTION_BUILDER.getString("newPickmap.title")); + init1(parentComponent, ActionBuilderUtils.getString(ACTION_BUILDER, "newPickmap.title")); init2(); addDocumentListener(pickmapNameField); updateOkButton(); @@ -100,7 +101,7 @@ @Override protected JPanel createMapNamePanel() { final JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - panel.add(new JLabel(ACTION_BUILDER.getString("newMapPickmapName"))); + panel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "newMapPickmapName"))); panel.add(pickmapNameField); return panel; } Modified: trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapFolderDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapFolderDialog.java 2010-06-14 20:41:30 UTC (rev 8403) +++ trunk/src/app/net/sf/gridarta/gui/newmap/NewPi... [truncated message content] |
From: <aki...@us...> - 2010-06-14 21:31:25
|
Revision: 8405 http://gridarta.svn.sourceforge.net/gridarta/?rev=8405&view=rev Author: akirschbaum Date: 2010-06-14 21:31:17 +0000 (Mon, 14 Jun 2010) Log Message: ----------- Extract duplicated code into ActionBuilderUtils.newLabel(). Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapDialog.java trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapFolderDialog.java trunk/src/app/net/sf/gridarta/gui/prefs/GUIPreferences.java trunk/src/app/net/sf/gridarta/gui/prefs/MiscPreferences.java trunk/src/app/net/sf/gridarta/gui/prefs/PreferencesHelper.java trunk/src/app/net/sf/gridarta/gui/prefs/ResPreferences.java trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsDialog.java trunk/src/app/net/sf/gridarta/gui/shrinkmapsizedialog/ShrinkMapSizeDialog.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/actions/Replace.java trunk/utils/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java trunk/utils/src/app/net/sf/gridarta/utils/ProcessRunner.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -36,7 +36,6 @@ import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JFrame; -import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; @@ -464,29 +463,29 @@ gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.weightx = 2.0; - mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapName")), labelGbc); + mapPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "mapName"), labelGbc); mapName.setColumns(16); mapName.setText(map.getMapName()); mapPanel.add(mapName, gbc); - mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapBackgroundMusic")), labelGbc); + mapPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "mapBackgroundMusic"), labelGbc); mapBackgroundMusic.setColumns(16); mapBackgroundMusic.setText(map.getBackgroundMusic()); mapPanel.add(mapBackgroundMusic, gbc); - mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapRegion")), labelGbc); + mapPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "mapRegion"), labelGbc); mapRegion.setColumns(16); mapRegion.setText(map.getRegion()); mapPanel.add(mapRegion, gbc); - mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapWidth")), labelGbc); + mapPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "mapWidth"), labelGbc); mapWidthField.setColumns(5); mapWidthField.setText(Integer.toString(mapModel.getMapArchObject().getMapSize().getWidth())); gbc.gridwidth = 1; gbc.weightx = 1.0; mapPanel.add(mapWidthField, gbc); - mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapHeight")), labelGbc); + mapPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "mapHeight"), labelGbc); mapHeightField.setColumns(5); mapHeightField.setText(Integer.toString(mapModel.getMapArchObject().getMapSize().getHeight())); gbc.gridwidth = GridBagConstraints.REMAINDER; @@ -589,7 +588,7 @@ @NotNull private static Component createPanelLine(@NotNull final JTextField textField, final int n, final int defaultValue, @NotNull final String labelKey) { final Container lineLayout = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - lineLayout.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, labelKey))); + lineLayout.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, labelKey)); textField.setColumns(n); textField.setText(Integer.toString(defaultValue)); lineLayout.add(textField); Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -31,7 +31,6 @@ import javax.swing.JCheckBox; import javax.swing.JDialog; import javax.swing.JFrame; -import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTabbedPane; @@ -623,7 +622,7 @@ private void addInputFieldLine(@NotNull final Container panel, @NotNull final JTextField textField, final int n, @NotNull final String defaultText, @NotNull final String labelKey) { textField.setColumns(n); textField.setText(defaultText); - panel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, labelKey)), gbcLabel); + panel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, labelKey), gbcLabel); panel.add(textField, gbcTextField); } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -37,7 +37,6 @@ import javax.swing.JDialog; import javax.swing.JFileChooser; import javax.swing.JFrame; -import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; @@ -457,12 +456,12 @@ gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.weightx = 2.0; - mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapName")), labelGbc); + mapPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "mapName"), labelGbc); mapName.setColumns(16); mapName.setText(map.getMapName()); mapPanel.add(mapName, gbc); - mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapBackgroundMusic")), labelGbc); + mapPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "mapBackgroundMusic"), labelGbc); mapBackgroundMusic.setColumns(16); mapBackgroundMusic.setText(map.getBackgroundMusic()); final Container mapBackgroundMusicPanel = new JPanel(new BorderLayout()); @@ -470,14 +469,14 @@ mapBackgroundMusicPanel.add(new JFileChooserButton(globalSettings.getMediaDirectory(), mapBackgroundMusic, JFileChooser.FILES_ONLY), BorderLayout.EAST); mapPanel.add(mapBackgroundMusicPanel, gbc); - mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapWidth")), labelGbc); + mapPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "mapWidth"), labelGbc); mapWidthField.setColumns(5); mapWidthField.setText(Integer.toString(mapModel.getMapArchObject().getMapSize().getWidth())); gbc.gridwidth = 1; gbc.weightx = 1.0; mapPanel.add(mapWidthField, gbc); - mapPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapHeight")), labelGbc); + mapPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "mapHeight"), labelGbc); mapHeightField.setColumns(5); mapHeightField.setText(Integer.toString(mapModel.getMapArchObject().getMapSize().getHeight())); gbc.gridwidth = GridBagConstraints.REMAINDER; @@ -580,7 +579,7 @@ @NotNull private static Component createPanelLine(@NotNull final JTextField textField, final int n, final int defaultValue, @NotNull final String labelKey) { final Container lineLayout = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - lineLayout.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, labelKey))); + lineLayout.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, labelKey)); textField.setColumns(n); textField.setText(Integer.toString(defaultValue)); lineLayout.add(textField); Modified: trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -24,7 +24,6 @@ import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JDialog; -import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; @@ -154,7 +153,7 @@ mainPanel.setBorder(GUIConstants.DIALOG_BORDER); - mainPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "editBookmark.description"))); + mainPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "editBookmark.description")); mainPanel.add(Box.createVerticalStrut(5)); mainPanel.add(descriptionField); Modified: trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -28,7 +28,6 @@ import javax.swing.Action; import javax.swing.JButton; import javax.swing.JDialog; -import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; @@ -192,7 +191,7 @@ final GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; - panel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "findArchetypesName")), gbc); + panel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "findArchetypesName"), gbc); gbc.gridx = 1; gbc.gridy = 0; gbc.fill = GridBagConstraints.HORIZONTAL; Modified: trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/src/app/net/sf/gridarta/gui/golocationdialog/GoLocationDialog.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -165,12 +165,12 @@ final Point point = mapView.getMapViewBasic().getMapCursor().getLocation(); - coordinatesPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "goLocationX")), gbcLabel); + coordinatesPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "goLocationX"), gbcLabel); xCoordinateField.setText(point == null ? "0" : Integer.toString(point.x)); xCoordinateField.setColumns(3); coordinatesPanel.add(xCoordinateField, gbcField); - coordinatesPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "goLocationY")), gbcLabel); + coordinatesPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "goLocationY"), gbcLabel); yCoordinateField.setText(point == null ? "0" : Integer.toString(point.y)); yCoordinateField.setColumns(3); coordinatesPanel.add(yCoordinateField, gbcField); Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -23,7 +23,6 @@ import java.awt.Container; import java.awt.event.InputEvent; import java.awt.event.MouseEvent; -import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTabbedPane; import net.sf.gridarta.gui.map.event.MouseOpEvent; @@ -93,7 +92,7 @@ lmbSelector = new ToolSelector<G, A, R>("selection", mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapChooserControl, floorGameObjectMatcher, wallGameObjectMatcher, monsterGameObjectMatcher, insertionModeSet); mmbSelector = new ToolSelector<G, A, R>("deletion", mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapChooserControl, floorGameObjectMatcher, wallGameObjectMatcher, monsterGameObjectMatcher, insertionModeSet); rmbSelector = new ToolSelector<G, A, R>("insertion", mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapChooserControl, floorGameObjectMatcher, wallGameObjectMatcher, monsterGameObjectMatcher, insertionModeSet); - add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mouse")), BorderLayout.NORTH); + add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "mouse"), BorderLayout.NORTH); final Container mouseTabs = new JTabbedPane(); mouseTabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "left"), lmbSelector); mouseTabs.add(ActionBuilderUtils.getString(ACTION_BUILDER, "middle"), mmbSelector); Modified: trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/src/app/net/sf/gridarta/gui/newmap/AbstractMapsizeNewMapDialog.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -22,7 +22,6 @@ import java.awt.GridBagConstraints; import javax.swing.AbstractButton; import javax.swing.JCheckBox; -import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import net.sf.gridarta.model.archetype.Archetype; @@ -155,7 +154,7 @@ protected void addMapWidthField(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel, @NotNull final GridBagConstraints gbcField) { mapWidthField.setText(Integer.toString(widthKey == null ? defaultWidth : preferences.getInt(widthKey, defaultWidth))); mapWidthField.setColumns(3); - panel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapWidth")), gbcLabel); + panel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "mapWidth"), gbcLabel); panel.add(mapWidthField, gbcField); mapWidthField.selectAll(); } @@ -167,7 +166,7 @@ protected void addMapHeightField(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel, @NotNull final GridBagConstraints gbcField) { mapHeightField.setText(Integer.toString(heightKey == null ? defaultHeight : preferences.getInt(heightKey, defaultHeight))); mapHeightField.setColumns(3); - panel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapHeight")), gbcLabel); + panel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "mapHeight"), gbcLabel); panel.add(mapHeightField, gbcField); mapHeightField.selectAll(); } Modified: trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/src/app/net/sf/gridarta/gui/newmap/NewMapDialog.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -22,7 +22,6 @@ import java.awt.Component; import java.awt.FlowLayout; import java.awt.GridBagConstraints; -import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.text.JTextComponent; @@ -143,7 +142,7 @@ @Override protected JPanel createMapNamePanel() { final JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - panel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "newMapMapName"))); + panel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "newMapMapName")); panel.add(mapNameField); return panel; } @@ -158,7 +157,7 @@ } mapDifficultyField.setText(Integer.toString(preferences.getInt(DEFAULT_DIFFICULTY_KEY, defaultDifficulty))); - panel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "mapDifficulty")), gbcLabel); + panel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "mapDifficulty"), gbcLabel); mapDifficultyField.setColumns(3); panel.add(mapDifficultyField, gbcField); } Modified: trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapDialog.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapDialog.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -23,7 +23,6 @@ import java.awt.FlowLayout; import java.awt.GridBagConstraints; import java.io.IOException; -import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.text.JTextComponent; @@ -101,7 +100,7 @@ @Override protected JPanel createMapNamePanel() { final JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - panel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "newMapPickmapName"))); + panel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "newMapPickmapName")); panel.add(pickmapNameField); return panel; } Modified: trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapFolderDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapFolderDialog.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/src/app/net/sf/gridarta/gui/newmap/NewPickmapFolderDialog.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -23,7 +23,6 @@ import java.awt.FlowLayout; import java.awt.GridBagConstraints; import java.io.File; -import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.text.JTextComponent; @@ -107,7 +106,7 @@ @Override protected JPanel createMapNamePanel() { final JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - panel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "newMapPickmapFolderName"))); + panel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "newMapPickmapFolderName")); panel.add(folderNameField); return panel; } Modified: trunk/src/app/net/sf/gridarta/gui/prefs/GUIPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/GUIPreferences.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/src/app/net/sf/gridarta/gui/prefs/GUIPreferences.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -31,7 +31,6 @@ import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JComponent; -import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.border.Border; import javax.swing.border.CompoundBorder; @@ -191,7 +190,7 @@ } Arrays.sort(locales, comp); - lineLayout.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "optionsLanguage"))); // create label + lineLayout.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "optionsLanguage")); // create label localeBox = new JComboBox(locales); // set "content" localeBox.setRenderer(new LocaleListCellRenderer()); Modified: trunk/src/app/net/sf/gridarta/gui/prefs/MiscPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/MiscPreferences.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/src/app/net/sf/gridarta/gui/prefs/MiscPreferences.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -25,7 +25,6 @@ import javax.swing.Box; import javax.swing.JCheckBox; import javax.swing.JComponent; -import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.border.Border; @@ -214,7 +213,7 @@ autoCreateExit.setSelected(exitConnectorModel.isAutoCreateExit()); preferencesHelper.addComponent(autoCreateExit); - final JComponent label = new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "optionsExitConnectorExitArchetypeName.text")); + final JComponent label = ActionBuilderUtils.newLabel(ACTION_BUILDER, "optionsExitConnectorExitArchetypeName.text"); label.setToolTipText(ActionBuilderUtils.getString(ACTION_BUILDER, "optionsExitConnectorExitArchetypeName.shortdescription")); preferencesHelper.addComponent(label); exitArchetypeName = new JTextField(exitConnectorModel.getExitArchetypeName()); Modified: trunk/src/app/net/sf/gridarta/gui/prefs/PreferencesHelper.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/PreferencesHelper.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/src/app/net/sf/gridarta/gui/prefs/PreferencesHelper.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -74,7 +74,7 @@ */ @NotNull public JFileField createFileField(@NotNull final String key, @NotNull final String initial, final int fileSelectionMode) { - addComponent(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, key) + ":")); + addComponent(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, key) + ":")); // XXX: use ActionBuilderUtils.newLabel() final JFileField fileField = new JFileField(initial, fileSelectionMode); final String tooltip = ACTION_BUILDER.getString(key + ".shortdescription"); Modified: trunk/src/app/net/sf/gridarta/gui/prefs/ResPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/ResPreferences.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/src/app/net/sf/gridarta/gui/prefs/ResPreferences.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -29,7 +29,6 @@ import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JFileChooser; -import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.border.Border; @@ -281,12 +280,12 @@ final ConfigSource configSource = globalSettings.getConfigSource(); configSourceComboBox.setSelectedItem(configSource); configSourceComboBox.addItemListener(itemListener); - preferencesHelper.addComponent(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "optionsConfigSource.text"))); + preferencesHelper.addComponent(ActionBuilderUtils.newLabel(ACTION_BUILDER, "optionsConfigSource.text")); preferencesHelper.addComponent(configSourceComboBox); archField.setEnabled(configSource.isArchDirectoryInputFieldEnabled()); if (globalSettings.hasImageSet()) { - preferencesHelper.addComponent(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "optionsImageSet"))); + preferencesHelper.addComponent(ActionBuilderUtils.newLabel(ACTION_BUILDER, "optionsImageSet")); preferencesHelper.addComponent(buildImageSetBox()); } Modified: trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -306,7 +306,7 @@ // first line: heading final Container line1 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - final JComponent labelOn = new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "replaceOn")); + final JComponent labelOn = ActionBuilderUtils.newLabel(ACTION_BUILDER, "replaceOn"); labelOn.setToolTipText(ActionBuilderUtils.getString(ACTION_BUILDER, "replaceOn.shortdescription")); line1.add(labelOn); line1.add(Box.createVerticalStrut(3)); @@ -325,7 +325,7 @@ // second line: replace what? final Container line2 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - final JComponent label1 = new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "replaceDelete")); + final JComponent label1 = ActionBuilderUtils.newLabel(ACTION_BUILDER, "replaceDelete"); label1.setToolTipText(ActionBuilderUtils.getString(ACTION_BUILDER, "replaceDelete.shortdescription")); line2.add(label1); line2.add(Box.createVerticalStrut(5)); @@ -343,7 +343,7 @@ // third line: replace by? final Container line3 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - final JComponent label2 = new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "replaceBy")); + final JComponent label2 = ActionBuilderUtils.newLabel(ACTION_BUILDER, "replaceBy"); label2.setToolTipText(ActionBuilderUtils.getString(ACTION_BUILDER, "replaceBy.shortdescription")); line3.add(label2); line3.add(Box.createVerticalStrut(5)); @@ -375,7 +375,7 @@ // fourth line: replace density final Container line4 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - final JComponent label4 = new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "replaceDensity")); + final JComponent label4 = ActionBuilderUtils.newLabel(ACTION_BUILDER, "replaceDensity"); label4.setToolTipText(ActionBuilderUtils.getString(ACTION_BUILDER, "replaceDensity.shortdescription")); line4.add(label4); line4.add(Box.createVerticalStrut(5)); Modified: trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsDialog.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsDialog.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -32,7 +32,6 @@ import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JDialog; -import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; @@ -322,7 +321,7 @@ gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 1.0; gbc.weighty = 0.0; - actionDescriptionPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "shortcuts.actionDescription")), gbc); + actionDescriptionPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "shortcuts.actionDescription"), gbc); gbc.gridy++; gbc.fill = GridBagConstraints.BOTH; gbc.weighty = 1.0; @@ -334,7 +333,7 @@ gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 1.0; gbc.weighty = 0.0; - actionShortcutPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "shortcuts.shortcut")), gbc); + actionShortcutPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "shortcuts.shortcut"), gbc); gbc.gridy++; actionShortcutPanel.add(actionShortcut, gbc); Modified: trunk/src/app/net/sf/gridarta/gui/shrinkmapsizedialog/ShrinkMapSizeDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/shrinkmapsizedialog/ShrinkMapSizeDialog.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/src/app/net/sf/gridarta/gui/shrinkmapsizedialog/ShrinkMapSizeDialog.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -148,7 +148,7 @@ */ @NotNull private JPanel createPanel() { - final JComponent label = new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "shrinkMapSizeDialogLabel")); + final JComponent label = ActionBuilderUtils.newLabel(ACTION_BUILDER, "shrinkMapSizeDialogLabel"); label.setAlignmentX(0.0F); eastCheckBox.setAlignmentX(0.0F); southCheckBox.setAlignmentX(0.0F); Modified: trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/actions/Replace.java =================================================================== --- trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/actions/Replace.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/actions/Replace.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -27,7 +27,6 @@ import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JDialog; -import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; @@ -200,7 +199,7 @@ // find text field final Container findTextPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - findTextPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "scriptEdit.replace.find"))); + findTextPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "scriptEdit.replace.find")); findTextPanel.add(findTextField); final String selectedText = textArea.getSelectedText(); findTextField.setText(selectedText != null ? selectedText : textToFind); @@ -209,7 +208,7 @@ // replacement text field final Container replaceTextPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - replaceTextPanel.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "scriptEdit.replace.replace"))); + replaceTextPanel.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "scriptEdit.replace.replace")); replaceTextPanel.add(replaceTextField); replaceTextField.setText(textToReplace); replacePanel.add(replaceTextPanel); Modified: trunk/utils/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java =================================================================== --- trunk/utils/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/utils/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -20,6 +20,7 @@ package net.sf.gridarta.utils; import java.util.MissingResourceException; +import javax.swing.JLabel; import net.sf.japi.swing.action.ActionBuilder; import org.jetbrains.annotations.NotNull; @@ -92,4 +93,15 @@ return value; } + /** + * Creates a new {@link JLabel} from a resource key. + * @param actionBuilder the action builder to query + * @param key the resource key + * @return the label + */ + @NotNull + public static JLabel newLabel(final ActionBuilder actionBuilder, final String key) { + return new JLabel(getString(actionBuilder, key)); + } + } // class ActionBuilderUtils Modified: trunk/utils/src/app/net/sf/gridarta/utils/ProcessRunner.java =================================================================== --- trunk/utils/src/app/net/sf/gridarta/utils/ProcessRunner.java 2010-06-14 21:18:31 UTC (rev 8404) +++ trunk/utils/src/app/net/sf/gridarta/utils/ProcessRunner.java 2010-06-14 21:31:17 UTC (rev 8405) @@ -32,7 +32,6 @@ import javax.swing.Action; import javax.swing.JDialog; import javax.swing.JFrame; -import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; @@ -169,7 +168,7 @@ toolBar.add(controlStart); toolBar.add(controlStop); toolBar.add(ACTION_BUILDER.createAction(false, "controlClear", this)); - toolBar.add(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "controlCloseOkay"))); + toolBar.add(ActionBuilderUtils.newLabel(ACTION_BUILDER, "controlCloseOkay")); controlStop.setEnabled(false); add(toolBar, BorderLayout.SOUTH); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-22 20:11:41
|
Revision: 8407 http://gridarta.svn.sourceforge.net/gridarta/?rev=8407&view=rev Author: akirschbaum Date: 2010-06-22 20:11:35 +0000 (Tue, 22 Jun 2010) Log Message: ----------- Improve CTRL-ALT-E (toggle game object text editor): do not anymore try to restore the previous state before anything was saved. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-22 19:54:18 UTC (rev 8406) +++ trunk/atrinik/ChangeLog 2010-06-22 20:11:35 UTC (rev 8407) @@ -1,3 +1,9 @@ +2010-06-22 Andreas Kirschbaum + + * Improve CTRL-ALT-E (toggle game object text editor): do not + anymore try to restore the previous state before anything was + saved. + 2010-06-14 Andreas Kirschbaum * Do not crash if a treasurelist definition file cannot be found. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-22 19:54:18 UTC (rev 8406) +++ trunk/crossfire/ChangeLog 2010-06-22 20:11:35 UTC (rev 8407) @@ -1,3 +1,9 @@ +2010-06-22 Andreas Kirschbaum + + * Improve CTRL-ALT-E (toggle game object text editor): do not + anymore try to restore the previous state before anything was + saved. + 2010-06-14 Andreas Kirschbaum * Do not crash if a treasurelist definition file cannot be found. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-22 19:54:18 UTC (rev 8406) +++ trunk/daimonin/ChangeLog 2010-06-22 20:11:35 UTC (rev 8407) @@ -1,3 +1,9 @@ +2010-06-22 Andreas Kirschbaum + + * Improve CTRL-ALT-E (toggle game object text editor): do not + anymore try to restore the previous state before anything was + saved. + 2010-06-14 Andreas Kirschbaum * Do not crash if a treasurelist definition file cannot be found. Modified: trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java 2010-06-22 19:54:18 UTC (rev 8406) +++ trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java 2010-06-22 20:11:35 UTC (rev 8407) @@ -61,9 +61,15 @@ private final GameObjectAttributesTab<G, A, R> textEditorTab; /** + * Whether a previously selected tab has been remembered. Applies to {@link + * #prevTab} and {@link #prevTab2}. + */ + private boolean prevTabSaved = false; + + /** * The previously active {@link Tab} before the last switch to {@link * #gameObjectTab}. Set to <code>null</code> if not yet switched or if no - * other tab was active. + * other tab was active. Ignored unless {@link #prevTabSaved} is set. */ @Nullable private Tab prevTab = null; @@ -72,6 +78,7 @@ * The previously active {@link GameObjectAttributesTab} in {@link * #gameObjectTab} before the last switch to {@link #textEditorTab}. Set to * <code>null</code> if not yet switched or if no other tab was active. + * Ignored unless {@link #prevTabSaved} is set. */ @Nullable private GameObjectAttributesTab<G, A, R> prevTab2 = null; @@ -99,8 +106,19 @@ public void gameObjectTextEditor() { final Tab activeTab = mainView.getActiveTab(gameObjectTab.getLocation()); final GameObjectAttributesTab<G, A, R> activeTab2 = gameObjectAttributesControl.getSelectedTab(); - if (activeTab != null && activeTab == gameObjectTab && activeTab2 == textEditorTab) { - // game object text editor is active ==> restore saved state + final boolean gameObjectTextEditorIsActive = activeTab != null && activeTab == gameObjectTab && activeTab2 == textEditorTab; + if (!gameObjectTextEditorIsActive) { + // save state and activate game object text editor + prevTabSaved = true; + prevTab = activeTab; + prevTab2 = activeTab2; + + gameObjectTab.getButton().setSelected(true); + gameObjectAttributesControl.selectTab(textEditorTab); + textEditorTab.requestFocus(); + } else if (prevTabSaved) { + prevTabSaved = false; + // restore saved state if (prevTab != null) { prevTab.getButton().setSelected(true); prevTab = null; @@ -111,14 +129,6 @@ gameObjectAttributesControl.selectTab(prevTab2); prevTab2 = null; } - } else { - // game object text editor is inactive ==> save state and activate it - prevTab = activeTab; - prevTab2 = activeTab2; - - gameObjectTab.getButton().setSelected(true); - gameObjectAttributesControl.selectTab(textEditorTab); - textEditorTab.requestFocus(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 19:28:55
|
Revision: 8418 http://gridarta.svn.sourceforge.net/gridarta/?rev=8418&view=rev Author: akirschbaum Date: 2010-06-23 19:28:49 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Make --script command line option work in headless mode. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-23 19:22:16 UTC (rev 8417) +++ trunk/atrinik/ChangeLog 2010-06-23 19:28:49 UTC (rev 8418) @@ -1,3 +1,7 @@ +2010-06-23 Andreas Kirschbaum + + * Make --script command line option work in headless mode. + 2010-06-22 Andreas Kirschbaum * Improve CTRL-ALT-E (toggle game object text editor): do not Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-23 19:22:16 UTC (rev 8417) +++ trunk/crossfire/ChangeLog 2010-06-23 19:28:49 UTC (rev 8418) @@ -1,3 +1,7 @@ +2010-06-23 Andreas Kirschbaum + + * Make --script command line option work in headless mode. + 2010-06-22 Andreas Kirschbaum * Improve CTRL-ALT-E (toggle game object text editor): do not Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-23 19:22:16 UTC (rev 8417) +++ trunk/daimonin/ChangeLog 2010-06-23 19:28:49 UTC (rev 8418) @@ -1,3 +1,7 @@ +2010-06-23 Andreas Kirschbaum + + * Make --script command line option work in headless mode. + 2010-06-22 Andreas Kirschbaum * Improve CTRL-ALT-E (toggle game object text editor): do not Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 19:22:16 UTC (rev 8417) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 19:28:49 UTC (rev 8418) @@ -21,6 +21,7 @@ import gnu.getopt.Getopt; import gnu.getopt.LongOpt; +import java.awt.GraphicsEnvironment; import java.io.File; import java.lang.reflect.InvocationTargetException; import java.util.Arrays; @@ -218,7 +219,7 @@ } // Create the application and give it the parameters - final ErrorView errorView = mode.isConsoleMode() ? new ConsoleErrorView() : new DefaultErrorView(null); + final ErrorView errorView = GraphicsEnvironment.isHeadless() || mode.isConsoleMode() ? new ConsoleErrorView() : new DefaultErrorView(null); final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); final ConfigSourceFactory configSourceFactory = new DefaultConfigSourceFactory(); @@ -286,7 +287,7 @@ final ScriptExecutor<G, A, R> scriptExecutor = new ScriptExecutor<G, A, R>(scriptModel, scriptParameters); if (script != null) { - returnCode = runScript(script, editorFactory, mainControl, errorView, args2, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); + returnCode = runScript(script, errorView, args2, scriptExecutor); } else { try { switch (mode) { @@ -333,69 +334,13 @@ /** * Executes a plugin script. - * @param mainControl the main control to use * @param script the name of the script to run - * @param editorFactory the editor factory to use * @param errorView the error view to add errors to * @param args2 the arguments for the script - * @param guiUtils the gui utils to use - * @param configSourceFactory the config source factory to use - * @param rendererFactory the renderer factory to use - * @param filterControl the filter control to use * @param scriptExecutor the script executor to use - * @param scriptParameters the script parameters to use - * @param mapManager the map manager to use - * @param pickmapManager the pickmap manager to use - * @param mapControlFactory the map control factory to use - * @param archetypeSet the archetype set - * @param faceObjects the face objects - * @param globalSettings the global settings - * @param mapViewSettings the map view settings - * @param faceObjectProviders the face object providers - * @param pathManager the path manager - * @param topmostInsertionMode the "topmost" insertion mode - * @param gameObjectFactory the game object factory - * @param systemIcons the system icons for creating icons - * @param archetypeTypeSet the archetype type set - * @param mapArchObjectFactory the map arch object factory to use - * @param mapReaderFactory the map reader factory to use - * @param validators the map validators - * @param gameObjectMatchers the game object matchers - * @param scriptModel the script model - * @param animationObjects the animation objects - * @param archetypeChooserModel the archetype chooser model - * @param scriptedEventEditor the scripted event editor - * @param resources the resources - * @param numberSpells the number spells to use - * @param gameObjectSpells the game object spells to use - * @param attributeRangeChecker the attribute range checker to use - * @param pluginParameterFactory the plugin parameter factory to use * @return return code suitable for passing to {@link System#exit(int)} */ - private int runScript(@NotNull final String script, final EditorFactory<G, A, R> editorFactory, final DefaultMainControl<G, A, R> mainControl, final ErrorView errorView, final List<String> args2, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory) { - final GUIMainControl<G, A, R>[] tmp2 = (GUIMainControl<G, A, R>[]) new GUIMainControl<?, ?, ?>[1]; - final Runnable runnable2 = new Runnable() { - - /** {@inheritDoc} */ - @Override - public void run() { - tmp2[0] = editorFactory.createGUIMainControl(mainControl, errorView, guiUtils, configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, mapManager, pickmapManager, mapControlFactory, archetypeSet, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, scriptModel, animationObjects, archetypeChooserModel, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory); - } - - }; - try { - SwingUtilities.invokeAndWait(runnable2); - } catch (final InterruptedException ex) { - log.fatal(ex.getMessage(), ex); - Thread.currentThread().interrupt(); - return 1; - } catch (final InvocationTargetException ex) { - log.fatal(ex.getMessage(), ex); - return 1; - } - assert tmp2[0] != null; - final GUIMainControl<G, A, R> guiMainControl = tmp2[0]; - + private int runScript(@NotNull final String script, final ErrorView errorView, final List<String> args2, @NotNull final ScriptExecutor<G, A, R> scriptExecutor) { checkForErrors(errorView); waitDialog(errorView); @@ -406,12 +351,8 @@ /** {@inheritDoc} */ @Override public void run() { - try { - final Command command = new ScriptCommand(script2, args2, guiMainControl.getScriptExecutor()); - tmp[0] = command.execute(); - } finally { - guiMainControl.getExiter().doExit(tmp[0]); - } + final Command command = new ScriptCommand(script2, args2, scriptExecutor); + tmp[0] = command.execute(); } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 19:56:02
|
Revision: 8419 http://gridarta.svn.sourceforge.net/gridarta/?rev=8419&view=rev Author: akirschbaum Date: 2010-06-23 19:55:55 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Add --config command-line option for a specific config file rather than the default. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/AtrinikEditor.java trunk/build.xml trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/CrossfireEditor.java trunk/daimonin/ChangeLog trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DaimoninEditor.java trunk/preferences/src/app/net/sf/gridarta/preferences/FilePreferencesFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/atrinik/ChangeLog 2010-06-23 19:55:55 UTC (rev 8419) @@ -1,5 +1,13 @@ 2010-06-23 Andreas Kirschbaum + * Add --config command-line option for a specific config file + rather than the default (~/.gridarta/atrinik.conf, + ~/.gridarta/crossfire.conf, Java preferences). + + May be used to run regression tests or scripts independent of + editor settings, or to use different settings when editing maps + for different server versions. + * Make --script command line option work in headless mode. 2010-06-22 Andreas Kirschbaum Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/AtrinikEditor.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/AtrinikEditor.java 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/AtrinikEditor.java 2010-06-23 19:55:55 UTC (rev 8419) @@ -20,8 +20,6 @@ package net.sf.gridarta.var.atrinik.maincontrol; import net.sf.gridarta.maincontrol.GridartaEditor; -import net.sf.gridarta.preferences.FilePreferencesFactory; -import net.sf.gridarta.utils.ConfigFileUtils; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; @@ -33,11 +31,6 @@ */ public class AtrinikEditor { - static { - System.setProperty("java.util.prefs.PreferencesFactory", "net.sf.gridarta.preferences.FilePreferencesFactory"); - FilePreferencesFactory.initialize("user_net_sf_gridarta", ConfigFileUtils.getHomeFile("atrinik.conf")); - } - /** * Prevent instantiation (UtilityClass). */ @@ -49,7 +42,7 @@ * @param args The command line parameters given to the level editor. */ public static void main(final String... args) { - new GridartaEditor<GameObject, MapArchObject, Archetype>("net.sf.gridarta.var.atrinik.tod").run("net.sf.gridarta.var.atrinik", "AtrinikEditor.jar", new DefaultEditorFactory(), args); + new GridartaEditor<GameObject, MapArchObject, Archetype>("net.sf.gridarta.var.atrinik.tod").run("net.sf.gridarta.var.atrinik", "AtrinikEditor.jar", new DefaultEditorFactory(), "atrinik.conf", args); } } // class AtrinikEditor Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/build.xml 2010-06-23 19:55:55 UTC (rev 8419) @@ -322,7 +322,7 @@ </copy> </target> - <target name="compile-gridarta" description="Compiles the gridarta module." depends="compile-model,compile-textedit,compile-utils"> + <target name="compile-gridarta" description="Compiles the gridarta module." depends="compile-model,compile-preferences,compile-textedit,compile-utils"> <mkdir dir="dest/gridarta/app"/> <javac srcdir="src/app" destdir="dest/gridarta/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> @@ -339,6 +339,7 @@ <fileset dir="lib" includes="jdom.jar"/> <fileset dir="lib" includes="log4j-1.2.13.jar"/> <pathelement location="dest/model/app"/> + <pathelement location="dest/preferences/app"/> <pathelement location="dest/textedit/app"/> <pathelement location="dest/utils/app"/> </classpath> @@ -351,6 +352,7 @@ <fileset dir="lib" includes="junit-4.2.jar"/> <pathelement location="dest/gridarta/app"/> <pathelement location="dest/model/app"/> + <pathelement location="dest/preferences/app"/> <pathelement location="dest/model/test"/> <pathelement location="dest/utils/app"/> </classpath> Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/crossfire/ChangeLog 2010-06-23 19:55:55 UTC (rev 8419) @@ -1,5 +1,13 @@ 2010-06-23 Andreas Kirschbaum + * Add --config command-line option for a specific config file + rather than the default (~/.gridarta/atrinik.conf, + ~/.gridarta/crossfire.conf, Java preferences). + + May be used to run regression tests or scripts independent of + editor settings, or to use different settings when editing maps + for different server versions. + * Make --script command line option work in headless mode. 2010-06-22 Andreas Kirschbaum Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/CrossfireEditor.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/CrossfireEditor.java 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/CrossfireEditor.java 2010-06-23 19:55:55 UTC (rev 8419) @@ -20,8 +20,6 @@ package net.sf.gridarta.var.crossfire.maincontrol; import net.sf.gridarta.maincontrol.GridartaEditor; -import net.sf.gridarta.preferences.FilePreferencesFactory; -import net.sf.gridarta.utils.ConfigFileUtils; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; @@ -33,11 +31,6 @@ */ public class CrossfireEditor { - static { - System.setProperty("java.util.prefs.PreferencesFactory", "net.sf.gridarta.preferences.FilePreferencesFactory"); - FilePreferencesFactory.initialize("user_net_sf_gridarta", ConfigFileUtils.getHomeFile("crossfire.conf")); - } - /** * Prevent instantiation (UtilityClass). */ @@ -49,7 +42,7 @@ * @param args The command line parameters given to the level editor. */ public static void main(final String... args) { - new GridartaEditor<GameObject, MapArchObject, Archetype>("net.sf.gridarta.var.crossfire.tod").run("net.sf.gridarta.var.crossfire", "CrossfireEditor.jar", new DefaultEditorFactory(), args); + new GridartaEditor<GameObject, MapArchObject, Archetype>("net.sf.gridarta.var.crossfire.tod").run("net.sf.gridarta.var.crossfire", "CrossfireEditor.jar", new DefaultEditorFactory(), "crossfire.conf", args); } } // class CrossfireEditor Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/daimonin/ChangeLog 2010-06-23 19:55:55 UTC (rev 8419) @@ -1,5 +1,13 @@ 2010-06-23 Andreas Kirschbaum + * Add --config command-line option for a specific config file + rather than the default (~/.gridarta/atrinik.conf, + ~/.gridarta/crossfire.conf, Java preferences). + + May be used to run regression tests or scripts independent of + editor settings, or to use different settings when editing maps + for different server versions. + * Make --script command line option work in headless mode. 2010-06-22 Andreas Kirschbaum Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DaimoninEditor.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DaimoninEditor.java 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DaimoninEditor.java 2010-06-23 19:55:55 UTC (rev 8419) @@ -42,7 +42,7 @@ * @param args The command line parameters given to the level editor. */ public static void main(final String... args) { - new GridartaEditor<GameObject, MapArchObject, Archetype>("net.sf.gridarta.var.daimonin.tod").run("net.sf.gridarta.var.daimonin", "DaimoninEditor.jar", new DefaultEditorFactory(), args); + new GridartaEditor<GameObject, MapArchObject, Archetype>("net.sf.gridarta.var.daimonin.tod").run("net.sf.gridarta.var.daimonin", "DaimoninEditor.jar", new DefaultEditorFactory(), null, args); } } // class DaimoninEditor Modified: trunk/preferences/src/app/net/sf/gridarta/preferences/FilePreferencesFactory.java =================================================================== --- trunk/preferences/src/app/net/sf/gridarta/preferences/FilePreferencesFactory.java 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/preferences/src/app/net/sf/gridarta/preferences/FilePreferencesFactory.java 2010-06-23 19:55:55 UTC (rev 8419) @@ -50,6 +50,10 @@ * not use a backing file */ public static void initialize(@NotNull final String defaultName, @Nullable final File file) { + if (userRoot != null || systemRoot != null) { + throw new IllegalStateException(); + } + final Storage storage = new Storage(defaultName, file); userRoot = new FilePreferencesRoot(NodeType.USER, storage); systemRoot = new FilePreferencesRoot(NodeType.SYSTEM, storage); Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 19:28:49 UTC (rev 8418) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-23 19:55:55 UTC (rev 8419) @@ -89,10 +89,12 @@ import net.sf.gridarta.model.spells.GameObjectSpell; import net.sf.gridarta.model.spells.NumberSpell; import net.sf.gridarta.model.spells.Spells; +import net.sf.gridarta.preferences.FilePreferencesFactory; import net.sf.gridarta.script.ScriptExecutor; import net.sf.gridarta.script.ScriptModel; import net.sf.gridarta.script.ScriptParameters; import net.sf.gridarta.script.parameter.PluginParameterFactory; +import net.sf.gridarta.utils.ConfigFileUtils; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.SyntaxErrorException; import net.sf.gridarta.utils.SystemIcons; @@ -134,12 +136,6 @@ } catch (final MissingResourceException e) { log.warn("No build number found:", e); } - // Make sure the locale is set before any ActionBuilder is used. - final Preferences preferences = Preferences.userNodeForPackage(MainControl.class); - final String locName = preferences.get(GUIPreferences.PREFERENCES_LANGUAGE, null); - if (locName != null) { - Locale.setDefault(new Locale(locName)); - } } /** @@ -148,14 +144,17 @@ * builder * @param editorJarName the name of the .jar file containing the executable * @param editorFactory the editor factory to use + * @param defaultConfig the default config file or <code>null</code> to use + * Java's preferences * @param args the command line parameters given to the level editor */ - public void run(@NotNull final String actionBuilderPackage, @NotNull final String editorJarName, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final String... args) { + public void run(@NotNull final String actionBuilderPackage, @NotNull final String editorJarName, @NotNull final EditorFactory<G, A, R> editorFactory, @Nullable final String defaultConfig, @NotNull final String... args) { boolean err = false; // whether a fatal error (exit required) occurred. String script = null; - final LongOpt[] longOpts = { new LongOpt("batchpng", LongOpt.NO_ARGUMENT, null, (int) 'b'), new LongOpt("normal", LongOpt.NO_ARGUMENT, null, (int) 'n'), new LongOpt("singlepng", LongOpt.NO_ARGUMENT, null, (int) 's'), new LongOpt("collectarches", LongOpt.NO_ARGUMENT, null, (int) 'c'), new LongOpt("collectArches", LongOpt.NO_ARGUMENT, null, (int) 'c'), new LongOpt("help", LongOpt.NO_ARGUMENT, null, (int) 'h'), new LongOpt("noexit", LongOpt.NO_ARGUMENT, null, 2), new LongOpt("script", LongOpt.REQUIRED_ARGUMENT, null, 1), }; + final LongOpt[] longOpts = { new LongOpt("batchpng", LongOpt.NO_ARGUMENT, null, (int) 'b'), new LongOpt("normal", LongOpt.NO_ARGUMENT, null, (int) 'n'), new LongOpt("singlepng", LongOpt.NO_ARGUMENT, null, (int) 's'), new LongOpt("collectarches", LongOpt.NO_ARGUMENT, null, (int) 'c'), new LongOpt("collectArches", LongOpt.NO_ARGUMENT, null, (int) 'c'), new LongOpt("help", LongOpt.NO_ARGUMENT, null, (int) 'h'), new LongOpt("noexit", LongOpt.NO_ARGUMENT, null, 2), new LongOpt("script", LongOpt.REQUIRED_ARGUMENT, null, 1), new LongOpt("config", LongOpt.REQUIRED_ARGUMENT, null, 3), }; final Getopt g = new Getopt("testprog", args, "bchns", longOpts); Mode mode = Mode.NORMAL; + File config = defaultConfig == null ? null : ConfigFileUtils.getHomeFile(defaultConfig); boolean doExit = true; while (true) { final int ch = g.getopt(); @@ -173,7 +172,7 @@ break; case 'h': - usage(editorJarName); + usage(editorJarName, defaultConfig); return; case 'n': @@ -192,6 +191,14 @@ doExit = false; break; + case 3: // --config + config = new File(g.getOptarg()); + if (!config.exists()) { + System.err.println(config + ": configuration file does not exist"); + err = true; + } + break; + case '?': default: err = true; @@ -202,6 +209,18 @@ if (err) { returnCode = 1; } else { + if (config != null) { + System.setProperty("java.util.prefs.PreferencesFactory", "net.sf.gridarta.preferences.FilePreferencesFactory"); + FilePreferencesFactory.initialize("user_net_sf_gridarta", config); + } + + // Make sure the locale is set before any ActionBuilder is used. + final Preferences preferences = Preferences.userNodeForPackage(MainControl.class); + final String locName = preferences.get(GUIPreferences.PREFERENCES_LANGUAGE, null); + if (locName != null) { + Locale.setDefault(new Locale(locName)); + } + final List<String> args2 = Arrays.asList(args).subList(g.getOptind(), args.length); // print jre version, for easier recognition of jre-specific problems @@ -486,7 +505,7 @@ return 0; } - private static void usage(@NotNull final String editorJarName) { + private static void usage(@NotNull final String editorJarName, @Nullable final String defaultConfig) { System.out.println("usage: java -jar " + editorJarName + " [option...] [map-file...]"); System.out.println(""); System.out.println(" -h, --help print this help"); @@ -494,6 +513,7 @@ System.out.println(" -c, --collectarches collect archetypes"); System.out.println(" -n, --normal start editor with GUI (default)"); System.out.println(" -s, --singlepng create a PNG file from the specified map"); + System.out.println(" --config=config-file use given config file; uses "+(defaultConfig == null ? "Java preferences" : "~/.gridarta/" + defaultConfig)+" is not given"); System.out.println(" --noexit do not call System.exit()"); System.out.println(" --script=name [arg=value...]"); System.out.println(" run a plugin script with the given arguments"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 20:05:16
|
Revision: 8420 http://gridarta.svn.sourceforge.net/gridarta/?rev=8420&view=rev Author: akirschbaum Date: 2010-06-23 20:05:09 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Open map files even if no archetypes have been found. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/atrinik/ChangeLog 2010-06-23 20:05:09 UTC (rev 8420) @@ -1,5 +1,7 @@ 2010-06-23 Andreas Kirschbaum + * Open map files even if no archetypes have been found. + * Add --config command-line option for a specific config file rather than the default (~/.gridarta/atrinik.conf, ~/.gridarta/crossfire.conf, Java preferences). Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/crossfire/ChangeLog 2010-06-23 20:05:09 UTC (rev 8420) @@ -1,5 +1,7 @@ 2010-06-23 Andreas Kirschbaum + * Open map files even if no archetypes have been found. + * Add --config command-line option for a specific config file rather than the default (~/.gridarta/atrinik.conf, ~/.gridarta/crossfire.conf, Java preferences). Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/daimonin/ChangeLog 2010-06-23 20:05:09 UTC (rev 8420) @@ -1,5 +1,7 @@ 2010-06-23 Andreas Kirschbaum + * Open map files even if no archetypes have been found. + * Add --config command-line option for a specific config file rather than the default (~/.gridarta/atrinik.conf, ~/.gridarta/crossfire.conf, Java preferences). Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-23 20:05:09 UTC (rev 8420) @@ -479,7 +479,7 @@ scriptEditControl.setTextAreaDefaults(textAreaDefaults); scriptedEventEditor.setScriptEditControl(scriptEditControl); scriptArchEditor.setScriptEditControl(scriptEditControl); - fileControl = new DefaultFileControl<G, A, R>(globalSettings, archetypeSet, mapImageCache, mapManager, mapViewsManager, mainViewFrame, GuiFileFilters.mapFileFilter, scriptFileFilter, newMapDialogFactory, scriptExtension, scriptEditControl); + fileControl = new DefaultFileControl<G, A, R>(globalSettings, mapImageCache, mapManager, mapViewsManager, mainViewFrame, GuiFileFilters.mapFileFilter, scriptFileFilter, newMapDialogFactory, scriptExtension, scriptEditControl); pickmapChooserControl.setFileControl(fileControl); mapViewsManager.setFileControl(fileControl); final GameObjectMatcher floorMatcher = gameObjectMatchers.getMatcher("system_floor", "floor"); Modified: trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java 2010-06-23 20:05:09 UTC (rev 8420) @@ -30,7 +30,6 @@ import net.sf.gridarta.gui.mapimagecache.MapImageCache; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.model.map.mapcontrol.MapControl; @@ -63,12 +62,6 @@ private final GlobalSettings globalSettings; /** - * The {@link ArchetypeSet}. - */ - @NotNull - private final ArchetypeSet<G, A, R> archetypeSet; - - /** * The {@link MapImageCache}. */ @NotNull @@ -132,7 +125,6 @@ /** * Creates a new instance. * @param globalSettings the global settings instance - * @param archetypeSet the archetype set * @param mapImageCache the map image cache * @param mapManager the map manager * @param mapViewsManager the map views manager @@ -143,9 +135,8 @@ * @param scriptExtension the file extension for script files * @param scriptEditControl the script edit control to forward to */ - public DefaultFileControl(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final Component parent, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final NewMapDialogFactory<G, A, R> newMapDialogFactory, @NotNull final String scriptExtension, @NotNull final ScriptEditControl scriptEditControl) { + public DefaultFileControl(@NotNull final GlobalSettings globalSettings, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final Component parent, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final NewMapDialogFactory<G, A, R> newMapDialogFactory, @NotNull final String scriptExtension, @NotNull final ScriptEditControl scriptEditControl) { this.globalSettings = globalSettings; - this.archetypeSet = archetypeSet; this.mapImageCache = mapImageCache; this.mapManager = mapManager; this.mapViewsManager = mapViewsManager; @@ -216,12 +207,6 @@ return; } - if (archetypeSet.getArchetypeCount() == 0) { - // ArchStack is empty -> abort! - ACTION_BUILDER.showMessageDialog(parent, "openFileWantedNoArches"); - return; - } - globalSettings.setChangedDir(true); // user has chosen an active dir final File dir = tmpFileChooser.getCurrentDirectory(); final File[] files = tmpFileChooser.getSelectedFiles(); Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/src/app/net/sf/gridarta/messages.properties 2010-06-23 20:05:09 UTC (rev 8420) @@ -1517,8 +1517,6 @@ fileDialog.filter.txt=Text Files fileDialog.filter.text=Text Files fileDialog.filter.py=Python Scripts -openFileWantedNoArches.title=Cannot open map -openFileWantedNoArches.message=There are currently no archetypes available!\nYou need to have archetypes loaded before opening a map. ################## Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2010-06-23 20:05:09 UTC (rev 8420) @@ -1305,8 +1305,6 @@ fileDialog.filter.txt=Text-Dateien fileDialog.filter.text=Text-Dateien fileDialog.filter.py=Python-Skripte -openFileWantedNoArches.title=Kann Karte nicht \xF6ffnen -openFileWantedNoArches.message=Es sind keine Archetypen verf\xFCgbar.\nDiese werden ben\xF6tigt, um eine Karte zu \xF6ffnen. ################## Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-06-23 20:05:09 UTC (rev 8420) @@ -1285,8 +1285,6 @@ #fileDialog.filter.arc= #fileDialog.filter.anim= #fileDialog.filter.face= -#openFileWantedNoArches.title= -#openFileWantedNoArches.message= ################## Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-06-23 19:55:55 UTC (rev 8419) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-06-23 20:05:09 UTC (rev 8420) @@ -1296,8 +1296,6 @@ fileDialog.filter.arc=Arketypdefinitioner fileDialog.filter.anim=Animationdefinitioner #fileDialog.filter.face= -openFileWantedNoArches.title=Kan inte \xF6ppna karta -openFileWantedNoArches.message=Det finns inga arketyper (arches) tillg\xE4ngliga!\nDu m\xE5ste ha arketyperna innan du kan \xF6ppna en karta.\nL\xE4s i online-dokumentationen hur du kan skaffa arketypfiler.. ################## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-23 23:43:42
|
Revision: 8430 http://gridarta.svn.sourceforge.net/gridarta/?rev=8430&view=rev Author: akirschbaum Date: 2010-06-23 23:43:35 +0000 (Wed, 23 Jun 2010) Log Message: ----------- Remove mapModel parameter from MapModelListener.mapSizeChanged(). Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -169,7 +169,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore: will trigger an mapGridChanged() callback } Modified: trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -581,7 +581,7 @@ private void fireMapSizeChanged(@NotNull final Size2D newSize) { setModified(); for (final MapModelListener<G, A, R> listener : mapModelListeners.getListeners()) { - listener.mapSizeChanged(this, newSize); + listener.mapSizeChanged(newSize); } } Modified: trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -38,10 +38,9 @@ /** * The size of a map has changed. - * @param mapModel the map model that has changed * @param newSize the new map size */ - void mapSizeChanged(@Deprecated @NotNull MapModel<G, A, R> mapModel, @NotNull Size2D newSize); + void mapSizeChanged(@NotNull Size2D newSize); /** * Squares of a map have changed. The following things are square changes: Modified: trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -82,7 +82,7 @@ * {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { log("mapSizeChanged", null, null); } Modified: trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -335,8 +335,8 @@ * {@inheritDoc} */ @Override - public void mapSizeChanged(@Deprecated @NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { - scheduleMapModel(this.mapModel); + public void mapSizeChanged(@NotNull final Size2D newSize) { + scheduleMapModel(mapModel); } /** Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -698,7 +698,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@Deprecated @NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { if (gameObject.getMapSquare() == null) { setValue(cancelButton); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -183,7 +183,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -240,7 +240,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -143,7 +143,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@Deprecated @NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -95,7 +95,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -113,7 +113,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { getMapGrid().resize(newSize); } Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -214,7 +214,7 @@ * {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore: will trigger an mapGridChanged() callback } Modified: trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -114,7 +114,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@Deprecated @NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -250,7 +250,7 @@ * {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -230,7 +230,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@Deprecated @NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -68,7 +68,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@Deprecated @NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -30,6 +30,8 @@ import java.awt.event.MouseListener; import java.awt.geom.RectangularShape; import java.io.File; +import java.util.HashMap; +import java.util.Map; import java.util.Set; import javax.swing.AbstractButton; import javax.swing.Action; @@ -116,69 +118,76 @@ private final MapSquareSelectionCache<G, A, R> mapSquareSelectionCache; /** - * The map model listener. + * Maps {@link MapControl} instance to the attached {@link MapModelListener} + * instance. */ - private final MapModelListener<G, A, R> mapModelListener = new MapModelListener<G, A, R>() { + @NotNull + private final Map<MapControl<G, A, R>, MapModelListener<G, A, R>> mapModelListeners = new HashMap<MapControl<G, A, R>, MapModelListener<G, A, R>>(); - /** {@inheritDoc} */ - @Override - public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { - if (selectedSquareModel.isSelectedMapModel(mapModel)) { - refresh(); - } - } + /** + * The map manager listener. + */ + private final MapManagerListener<G, A, R> mapManagerListener = new MapManagerListener<G, A, R>() { /** {@inheritDoc} */ @Override - public void mapSquaresChanged(@NotNull final Set<MapSquare<G, A, R>> mapSquares) { - if (selectedSquareModel.isSelectedMapSquares(mapSquares)) { - refresh(); - } + public void currentMapChanged(@Nullable final MapControl<G, A, R> mapControl) { + // ignore } /** {@inheritDoc} */ @Override - public void mapObjectsChanged(@NotNull final Set<G> gameObjects, @NotNull final Set<G> transientGameObjects) { - if (selectedSquareModel.isSelectedGameObjects(gameObjects) || selectedSquareModel.isSelectedGameObjects(transientGameObjects)) { - refresh(); - } - } + public void mapCreated(@NotNull final MapControl<G, A, R> mapControl, final boolean interactive) { - /** {@inheritDoc} */ - @Override - public void errorsChanged(@NotNull final ErrorCollector<G, A, R> errors) { - // ignore - } + final MapModel<G, A, R> mapModel = mapControl.getMapModel(); + final MapModelListener<G, A, R> mapModelListener = new MapModelListener<G, A, R>() { - /** {@inheritDoc} */ - @Override - public void mapFileChanged(@Nullable final File oldMapFile) { - // ignore - } + /** {@inheritDoc} */ + @Override + public void mapSizeChanged(@NotNull final Size2D newSize) { + if (selectedSquareModel.isSelectedMapModel(mapModel)) { + refresh(); + } + } - /** {@inheritDoc} */ - @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { - // ignore - } + /** {@inheritDoc} */ + @Override + public void mapSquaresChanged(@NotNull final Set<MapSquare<G, A, R>> mapSquares) { + if (selectedSquareModel.isSelectedMapSquares(mapSquares)) { + refresh(); + } + } - }; + /** {@inheritDoc} */ + @Override + public void mapObjectsChanged(@NotNull final Set<G> gameObjects, @NotNull final Set<G> transientGameObjects) { + if (selectedSquareModel.isSelectedGameObjects(gameObjects) || selectedSquareModel.isSelectedGameObjects(transientGameObjects)) { + refresh(); + } + } - /** - * The map manager listener. - */ - private final MapManagerListener<G, A, R> mapManagerListener = new MapManagerListener<G, A, R>() { + /** {@inheritDoc} */ + @Override + public void errorsChanged(@NotNull final ErrorCollector<G, A, R> errors) { + // ignore + } - /** {@inheritDoc} */ - @Override - public void currentMapChanged(@Nullable final MapControl<G, A, R> mapControl) { - // ignore - } + /** {@inheritDoc} */ + @Override + public void mapFileChanged(@Nullable final File oldMapFile) { + // ignore + } - /** {@inheritDoc} */ - @Override - public void mapCreated(@NotNull final MapControl<G, A, R> mapControl, final boolean interactive) { - mapControl.getMapModel().addMapModelListener(mapModelListener); + /** {@inheritDoc} */ + @Override + public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + // ignore + } + + }; + + mapModel.addMapModelListener(mapModelListener); + mapModelListeners.put(mapControl, mapModelListener); } /** {@inheritDoc} */ @@ -190,6 +199,8 @@ /** {@inheritDoc} */ @Override public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { + final MapModelListener<G, A, R> mapModelListener = mapModelListeners.remove(mapControl); + assert mapModelListener != null; mapControl.getMapModel().removeMapModelListener(mapModelListener); } Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-06-23 23:27:13 UTC (rev 8429) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-06-23 23:43:35 UTC (rev 8430) @@ -568,7 +568,7 @@ /** {@inheritDoc} */ @Override - public void mapSizeChanged(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D newSize) { + public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 00:19:26
|
Revision: 8431 http://gridarta.svn.sourceforge.net/gridarta/?rev=8431&view=rev Author: akirschbaum Date: 2010-06-24 00:19:16 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Remove mapModel parameter from MapModelListener.modifiedChanged(). Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -259,7 +259,7 @@ * {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -639,7 +639,7 @@ */ private void fireModifiedChanged() { for (final MapModelListener<G, A, R> listener : mapModelListeners.getListeners()) { - listener.modifiedChanged(this); + listener.modifiedChanged(); } } Modified: trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/MapModelListener.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -79,8 +79,7 @@ /** * The modified flag has changed. - * @param mapModel the map model that has changed */ - void modifiedChanged(@NotNull MapModel<G, A, R> mapModel); + void modifiedChanged(); } // interface MapModelListener Modified: trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -127,7 +127,7 @@ * {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel) { + public void modifiedChanged() { // ignore } }; Modified: trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -375,7 +375,7 @@ * {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -734,7 +734,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -213,7 +213,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -285,7 +285,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -173,7 +173,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { updateActions(); } Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -125,7 +125,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { updateTitle(); } Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -143,7 +143,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -254,7 +254,7 @@ * {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -31,7 +31,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.model.map.mapcontrol.MapControl; -import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.mapmodel.MapModelListener; import net.sf.gridarta.model.map.mapmodel.MapSquare; import net.sf.gridarta.model.map.validation.ErrorCollector; @@ -144,7 +143,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { updateName(); } Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -294,7 +294,7 @@ * {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -54,7 +54,6 @@ import net.sf.gridarta.model.map.mapcontrol.DefaultMapControl; import net.sf.gridarta.model.map.mapcontrol.MapControl; import net.sf.gridarta.model.map.mapcontrol.MapControlListener; -import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.mapmodel.MapModelListener; import net.sf.gridarta.model.map.mapmodel.MapSquare; import net.sf.gridarta.model.map.validation.ErrorCollector; @@ -260,7 +259,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { refresh(); } Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserModel.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -23,9 +23,11 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.Set; import net.sf.gridarta.mapfiles.MapFile; import net.sf.gridarta.mapfiles.MapFileNameComparator; @@ -60,57 +62,11 @@ private final Collection<PickmapChooserModelListener<G, A, R>> listeners = new LinkedList<PickmapChooserModelListener<G, A, R>>(); /** - * The map control listener which is attached to all pickmaps to detect - * changes of the "modified" flag. + * Maps {@link MapControl} instance to attached {@link MapModelListener}. */ @NotNull - private final MapModelListener<G, A, R> mapModelListener = new MapModelListener<G, A, R>() { + private final Map<MapControl<G, A, R>, MapModelListener<G, A, R>> mapModelListeners = new HashMap<MapControl<G, A, R>, MapModelListener<G, A, R>>(); - /** {@inheritDoc} */ - @Override - public void mapSizeChanged(@NotNull final Size2D newSize) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void mapSquaresChanged(@NotNull final Set<MapSquare<G, A, R>> mapSquares) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void mapObjectsChanged(@NotNull final Set<G> gameObjects, @NotNull final Set<G> transientGameObjects) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void errorsChanged(@NotNull final ErrorCollector<G, A, R> errors) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void mapFileChanged(@Nullable final File oldMapFile) { - // ignore - } - - /** {@inheritDoc} */ - @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { - int index = 0; - for (final MapFile<G, A, R> mapFile : mapFiles) { - if (mapFile.getPickmap().getMapModel() == mapModel) { - firePickmapModifiedChanged(index, mapFile); - return; - } - index++; - } - } - - }; - /** * Adds a map file. * @param mapFile the map file to add @@ -120,7 +76,7 @@ final int tmp = Collections.binarySearch(mapFiles, mapFile, MapFileNameComparator.INSTANCE); final int index = tmp >= 0 ? tmp : -tmp - 1; mapFiles.add(index, mapFile); - mapFile.getPickmap().getMapModel().addMapModelListener(mapModelListener); + addMapModelListener(mapFile.getPickmap()); return index; } @@ -135,7 +91,7 @@ if (index < 0) { return -1; // might have been a pickmap that could not be loaded } - mapFile.getPickmap().getMapModel().removeMapModelListener(mapModelListener); + removeMapModelListener(mapFile.getPickmap()); mapFiles.remove(index); return index; } @@ -152,8 +108,8 @@ if (index < 0) { return -1; // might have been a pickmap that could not be loaded } - oldPickmap.getMapModel().removeMapModelListener(mapModelListener); - mapFile.getPickmap().getMapModel().addMapModelListener(mapModelListener); + removeMapModelListener(oldPickmap); + addMapModelListener(mapFile.getPickmap()); firePickmapReverted(mapFile); return index; } @@ -214,7 +170,7 @@ */ public void clear() { for (final MapFile<G, A, R> mapFile : mapFiles) { - mapFile.getPickmap().getMapModel().removeMapModelListener(mapModelListener); + removeMapModelListener(mapFile.getPickmap()); } mapFiles.clear(); } @@ -258,4 +214,91 @@ } } + /** + * Tracks a {@link MapControl} instance for changes. The map control + * instance must not be tracked. + * @param mapControl the map control instance + */ + private void addMapModelListener(@NotNull final MapControl<G, A, R> mapControl) { + final MapModel<G, A, R> mapModel = mapControl.getMapModel(); + final MapModelListener<G, A, R> mapModelListener = new PickmapChooserMapModelListener(mapModel); + mapModel.addMapModelListener(mapModelListener); + mapModelListeners.put(mapControl, mapModelListener); + } + + /** + * Stops tracking a {@link MapControl} instance for changes. The map control + * instance must be tracked. + * @param mapControl the map control instance + */ + private void removeMapModelListener(@NotNull final MapControl<G, A, R> mapControl) { + final MapModelListener<G, A, R> mapModelListener = mapModelListeners.remove(mapControl); + assert mapModelListener != null; + mapControl.getMapModel().removeMapModelListener(mapModelListener); + } + + /** + * A {@link MapModelListener} which tracks a pickmap for modifications. + */ + private class PickmapChooserMapModelListener implements MapModelListener<G, A, R> { + + /** + * The tracked {@link MapModel}. + */ + @NotNull + private final MapModel<G, A, R> mapModel; + + /** + * Creates a new instance. + * @param mapModel the tracked map map mpdel + */ + private PickmapChooserMapModelListener(@NotNull final MapModel<G, A, R> mapModel) { + this.mapModel = mapModel; + } + + /** {@inheritDoc} */ + @Override + public void mapSizeChanged(@NotNull final Size2D newSize) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapSquaresChanged(@NotNull final Set<MapSquare<G, A, R>> mapSquares) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapObjectsChanged(@NotNull final Set<G> gameObjects, @NotNull final Set<G> transientGameObjects) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void errorsChanged(@NotNull final ErrorCollector<G, A, R> errors) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void mapFileChanged(@Nullable final File oldMapFile) { + // ignore + } + + /** {@inheritDoc} */ + @Override + public void modifiedChanged() { + int index = 0; + for (final MapFile<G, A, R> mapFile : mapFiles) { + if (mapFile.getPickmap().getMapModel() == mapModel) { + firePickmapModifiedChanged(index, mapFile); + return; + } + index++; + } + } + + } + } // class PickmapChooserModel Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -180,7 +180,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-06-23 23:43:35 UTC (rev 8430) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-06-24 00:19:16 UTC (rev 8431) @@ -598,7 +598,7 @@ /** {@inheritDoc} */ @Override - public void modifiedChanged(@NotNull final MapModel<G, A, R> mapModel) { + public void modifiedChanged() { // ignore } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 02:44:33
|
Revision: 8437 http://gridarta.svn.sourceforge.net/gridarta/?rev=8437&view=rev Author: akirschbaum Date: 2010-06-24 02:44:24 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Remove support for creating GameObject instances from archetype names. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetypeFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetypeFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParserFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/smoothface/SmoothFaces.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetype.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetypeFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParserFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java trunk/model/src/app/net/sf/gridarta/model/anim/AnimationObjects.java trunk/model/src/app/net/sf/gridarta/model/anim/AnimationValidator.java trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeValidator.java trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/model/src/app/net/sf/gridarta/model/collectable/Collectable.java trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java trunk/model/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java trunk/model/src/app/net/sf/gridarta/model/face/FaceObjects.java trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java trunk/model/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java trunk/model/src/app/net/sf/gridarta/model/io/DefaultMapReader.java trunk/model/src/app/net/sf/gridarta/model/io/DefaultMapReaderFactory.java trunk/model/src/app/net/sf/gridarta/model/io/GameObjectParser.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResources.java trunk/model/src/app/net/sf/gridarta/model/resource/CollectedResourcesWriter.java trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetype.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.java trunk/model/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java trunk/model/src/test/net/sf/gridarta/model/gameobject/TestGameObject.java trunk/model/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java trunk/model/src/test/net/sf/gridarta/model/io/TestGameObjectParser.java trunk/model/src/test/net/sf/gridarta/model/io/TestMapReaderFactory.java trunk/model/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java trunk/model/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java trunk/src/app/net/sf/gridarta/gui/utils/FaceComponent.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -238,7 +238,7 @@ */ @NotNull @Override - public GameObjectFactory<GameObject, MapArchObject, Archetype> newGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { + public GameObjectFactory<GameObject, MapArchObject, Archetype> newGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { return new DefaultGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); } @@ -247,8 +247,8 @@ */ @NotNull @Override - public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers) { - return new DefaultGameObjectParserFactory(gameObjectFactory, gameObjectMatchers); + public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + return new DefaultGameObjectParserFactory(gameObjectFactory, gameObjectMatchers, archetypeSet); } /** @@ -265,7 +265,7 @@ */ @NotNull @Override - public ArchetypeFactory<GameObject, MapArchObject, Archetype> newArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { + public ArchetypeFactory<GameObject, MapArchObject, Archetype> newArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { return new DefaultArchetypeFactory(faceObjectProviders, animationObjects); } @@ -274,8 +274,8 @@ */ @NotNull @Override - public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final FaceObjectProviders faceObjectProviders) { - return new ArchetypeSet(archetypeFactory, gameObjectParser, faceObjectProviders); + public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { + return new ArchetypeSet(archetypeFactory, faceObjectProviders); } /** @@ -292,15 +292,15 @@ */ @NotNull @Override - public FaceObjects createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { - return new DefaultFaceObjects(IGUIConstants.PNG_FILE, IGUIConstants.FACETREE_FILE, Pattern.compile("^(.*)"), "%2$s", archFaceProvider); + public FaceObjects<GameObject, MapArchObject, Archetype> createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { + return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(IGUIConstants.PNG_FILE, IGUIConstants.FACETREE_FILE, Pattern.compile("^(.*)"), "%2$s", archFaceProvider); } /** * {@inheritDoc} */ @Override - public void initSmoothFaces(@NotNull final FaceObjects faceObjects) { + public void initSmoothFaces(@NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects) { } /** @@ -397,7 +397,7 @@ * {@inheritDoc} */ @Override - public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects animationObjects, final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { + public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { try { final URL url = IOUtils.getResource(globalSettings.getConfigurationDirectory(), IGUIConstants.ARCHDEF_FILE); multiPositionData.load(errorView, url); @@ -502,7 +502,7 @@ */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(GuiFileFilters.pythonFileFilter, ".py", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "AtrinikEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubDirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new Direction[] { Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH, }, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); } @@ -511,7 +511,7 @@ */ @NotNull @Override - public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { return new DefaultResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, archFaceProvider, faceObjectProviders); } @@ -520,8 +520,8 @@ */ @NotNull @Override - public AnimationObjects newAnimationObjects() { - return new DefaultAnimationObjects(IGUIConstants.ANIMTREE_FILE); + public AnimationObjects<GameObject, MapArchObject, Archetype> newAnimationObjects() { + return new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(IGUIConstants.ANIMTREE_FILE); } } // class DefaultEditorFactory Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -40,27 +40,19 @@ public class ArchetypeSet extends AbstractArchetypeSet<GameObject, MapArchObject, Archetype> { /** - * The game object parser for saving inventories. - */ - @NotNull - private final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser; - - /** * Create the ArchetypeSet. * @param archetypeFactory the archetype factory instance to use - * @param gameObjectParser the game object parser to use * @param faceObjectProviders the face object providers */ - public ArchetypeSet(@NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final FaceObjectProviders faceObjectProviders) { + public ArchetypeSet(@NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { super(archetypeFactory, IGUIConstants.ARCH_FILE, faceObjectProviders); - this.gameObjectParser = gameObjectParser; } /** * {@inheritDoc} */ @Override - protected int collectArch(@NotNull final Archetype arch, @NotNull final Writer out) throws IOException { + protected int collectArch(@NotNull final Archetype arch, @NotNull final Writer out, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { out.append("Object ").append(arch.getArchetypeName()).append('\n'); if (arch.getMultiShapeID() > 0) { Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -44,7 +44,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public DefaultArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { + public DefaultArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { super(archetypeName, faceObjectProviders, animationObjects); } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetypeFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetypeFactory.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetypeFactory.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -42,7 +42,7 @@ * The {@link AnimationObjects} for looking up animations. */ @NotNull - private final AnimationObjects animationObjects; + private final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects; /** * Creates a new instance. @@ -50,7 +50,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public DefaultArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { + public DefaultArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { this.faceObjectProviders = faceObjectProviders; this.animationObjects = animationObjects; } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -45,7 +45,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public UndefinedArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { + public UndefinedArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { super(archetypeName, faceObjectProviders, animationObjects); setEditorFolder(net.sf.gridarta.model.gameobject.GameObject.EDITOR_FOLDER_INTERN); } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -46,7 +46,7 @@ * The {@link AnimationObjects} for looking up animations. */ @NotNull - private final AnimationObjects animationObjects; + private final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects; /** * The {@link ArchetypeTypeSet} for looking up archetype types. @@ -61,7 +61,7 @@ * @param archetypeTypeSet the archetype type set for looking up archetype * types */ - public DefaultGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { + public DefaultGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { this.faceObjectProviders = faceObjectProviders; this.animationObjects = animationObjects; this.archetypeTypeSet = archetypeTypeSet; @@ -79,18 +79,8 @@ /** * {@inheritDoc} */ - @Deprecated @NotNull @Override - public GameObject newGameObject(@NotNull final String archetypeName) { - return new GameObject(archetypeName, faceObjectProviders, animationObjects, archetypeTypeSet); - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override public GameObject createGameObject(@NotNull final Archetype archetype) { return createGameObjectPart(archetype, null); } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -54,21 +54,6 @@ /** * Creates a new instance. - * @param archetypeName the name of the base archetype - * @param faceObjectProviders the face face object providers for looking up - * faces - * @param animationObjects the animation objects for looking up animations - * @param archetypeTypeSet the archetype type set for looking up archetype - * types - */ - @Deprecated - public GameObject(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { - super(archetypeName, faceObjectProviders, animationObjects); - this.archetypeTypeSet = archetypeTypeSet; - } - - /** - * Creates a new instance. * @param archetype the base archetype * @param faceObjectProviders the face object providers for looking up * faces @@ -76,7 +61,7 @@ * @param archetypeTypeSet the archetype type set for looking up archetype * types */ - public GameObject(@NotNull final Archetype archetype, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { + public GameObject(@NotNull final Archetype archetype, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { super(archetype, faceObjectProviders, animationObjects); this.archetypeTypeSet = archetypeTypeSet; } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -21,6 +21,7 @@ import java.util.LinkedHashMap; import java.util.Map; +import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.AbstractGameObjectParser; import net.sf.gridarta.model.match.GameObjectMatchers; @@ -41,9 +42,10 @@ * @param gameObjectFactory the game object factory for creating new game * object instances * @param gameObjectMatchers the game object matchers to use + * @param archetypeSet the archetype set for looking up archetypes */ - public DefaultGameObjectParser(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers) { - super(gameObjectFactory, gameObjectMatchers); + public DefaultGameObjectParser(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + super(gameObjectFactory, gameObjectMatchers, archetypeSet); } /** Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -19,6 +19,7 @@ package net.sf.gridarta.var.atrinik.model.io; +import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.io.GameObjectParserFactory; @@ -47,13 +48,21 @@ private final GameObjectMatchers gameObjectMatchers; /** + * The {@link ArchetypeSet} for looking up archetypes. + */ + @NotNull + private final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet; + + /** * Creates a new instance. * @param gameObjectFactory the game object factory to use * @param gameObjectMatchers the game object matchers to use + * @param archetypeSet the archetype set for looking up archetypes */ - public DefaultGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers) { + public DefaultGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { this.gameObjectFactory = gameObjectFactory; this.gameObjectMatchers = gameObjectMatchers; + this.archetypeSet = archetypeSet; } /** @@ -61,7 +70,7 @@ */ @Override public GameObjectParser<GameObject, MapArchObject, Archetype> newGameObjectParser() { - return new DefaultGameObjectParser(gameObjectFactory, gameObjectMatchers); + return new DefaultGameObjectParser(gameObjectFactory, gameObjectMatchers, archetypeSet); } } // class DefaultGameObjectParserFactory Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -49,6 +49,12 @@ public class DefaultResources extends AbstractResources<GameObject, MapArchObject, Archetype> { /** + * The {@link GameObjectParser} to use. + */ + @NotNull + private final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser; + + /** * The {@link ArchetypeSet} to update. */ @NotNull @@ -64,13 +70,13 @@ * The {@link FaceObjects} instance. */ @NotNull - private final FaceObjects faceObjects; + private final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects; /** * The {@link AnimationObjects} instance. */ @NotNull - private final AnimationObjects animationObjects; + private final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects; /** * The {@link ArchFaceProvider} to use. @@ -96,8 +102,9 @@ * @param faceObjectProviders the face object providers for looking up * faces */ - public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { super(gameObjectParser, archetypeSet, mapViewSettings); + this.gameObjectParser = gameObjectParser; this.archetypeSet = archetypeSet; this.archetypeParser = archetypeParser; this.faceObjects = faceObjects; @@ -129,7 +136,7 @@ */ @Override protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - new CollectedResourcesWriter(archetypeSet, animationObjects, faceObjects).write(progress, collectedDirectory); + new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser, archetypeSet, animationObjects, faceObjects).write(progress, collectedDirectory); } /** Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -118,19 +118,20 @@ @Override protected AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ? extends AbstractArchetypeBuilder<GameObject, MapArchObject, Archetype>> newArchetypeParser() { final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); - final FaceObjects faceObjects = new DefaultFaceObjects("png", "facetree", Pattern.compile(".*"), "facetree.output", archFaceProvider); + final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects = new DefaultFaceObjects<GameObject, MapArchObject, Archetype>("png", "facetree", Pattern.compile(".*"), "facetree.output", archFaceProvider); final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); - final AnimationObjects animationObjects = new DefaultAnimationObjects("animtree"); + final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects = new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>("animtree"); final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); final DefaultGameObjectFactory gameObjectFactory = new DefaultGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); final GameObjectMatchers gameObjectMatchers = new GameObjectMatchers(); - final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, gameObjectMatchers); - archetypeSet = new ArchetypeSet(archetypeFactory, gameObjectParser, faceObjectProviders); + archetypeSet = new ArchetypeSet(archetypeFactory, faceObjectProviders); archetypeSet.setLoadedFromArchive(true); assert archetypeSet != null; + final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, gameObjectMatchers, archetypeSet); + assert archetypeSet != null; final IsoMapSquareInfo isoMapSquareInfo = new IsoMapSquareInfo(1, 1, 1, 1); final MultiPositionData multiPositionData = new MultiPositionData(isoMapSquareInfo); assert archetypeSet != null; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -194,7 +194,7 @@ */ @NotNull @Override - public GameObjectFactory<GameObject, MapArchObject, Archetype> newGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { + public GameObjectFactory<GameObject, MapArchObject, Archetype> newGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { return new DefaultGameObjectFactory(faceObjectProviders, animationObjects); } @@ -203,8 +203,8 @@ */ @NotNull @Override - public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers) { - return new DefaultGameObjectParserFactory(gameObjectFactory, gameObjectMatchers); + public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + return new DefaultGameObjectParserFactory(gameObjectFactory, gameObjectMatchers, archetypeSet); } /** @@ -221,7 +221,7 @@ */ @NotNull @Override - public ArchetypeFactory<GameObject, MapArchObject, Archetype> newArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { + public ArchetypeFactory<GameObject, MapArchObject, Archetype> newArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { return new DefaultArchetypeFactory(faceObjectProviders, animationObjects); } @@ -230,8 +230,8 @@ */ @NotNull @Override - public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final FaceObjectProviders faceObjectProviders) { - return new ArchetypeSet(globalSettings.getImageSet(), archetypeFactory, gameObjectParser, faceObjectProviders); + public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { + return new ArchetypeSet(globalSettings.getImageSet(), archetypeFactory, faceObjectProviders); } /** @@ -248,15 +248,15 @@ */ @NotNull @Override - public FaceObjects createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { - return new DefaultFaceObjects(IGUIConstants.PNG_FILE, IGUIConstants.FACETREE_FILE, Pattern.compile("^.*\t\\.?(.*)"), "\\%1$05d\t./arch%2$s", archFaceProvider); + public FaceObjects<GameObject, MapArchObject, Archetype> createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { + return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(IGUIConstants.PNG_FILE, IGUIConstants.FACETREE_FILE, Pattern.compile("^.*\t\\.?(.*)"), "\\%1$05d\t./arch%2$s", archFaceProvider); } /** * {@inheritDoc} */ @Override - public void initSmoothFaces(@NotNull final FaceObjects faceObjects) { + public void initSmoothFaces(@NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects) { if (smoothFaces != null) { throw new IllegalStateException(); } @@ -292,7 +292,7 @@ * {@inheritDoc} */ @Override - public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects animationObjects, final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { + public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { if (smoothFaces == null) { throw new IllegalStateException(); } @@ -398,7 +398,7 @@ */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(GuiFileFilters.pythonFileFilter, ".py", false, mapManager, pickmapManager, archetypeSet, mapControlFactory, null, "CrossfireEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, null, this, errorView, new DirectoryCacheFiles(ConfigFileUtils.getHomeFile("thumbnails"), ".png"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, 0, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, true, scriptedEventEditor, new Direction[] { Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, }, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); } @@ -407,7 +407,7 @@ */ @NotNull @Override - public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { if (smoothFaces == null) { throw new IllegalStateException(); } @@ -419,8 +419,8 @@ */ @NotNull @Override - public AnimationObjects newAnimationObjects() { - return new DefaultAnimationObjects(IGUIConstants.ANIMTREE_FILE); + public AnimationObjects<GameObject, MapArchObject, Archetype> newAnimationObjects() { + return new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(IGUIConstants.ANIMTREE_FILE); } } // class DefaultEditorFactory Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -91,7 +91,7 @@ * @param gameObjectFactory the factory for creating game objects * @param smoothFaces the smooth faces instance to update */ - public ArchetypeParser(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SmoothFaces smoothFaces) { + public ArchetypeParser(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SmoothFaces smoothFaces) { super(new DefaultArchetypeBuilder(gameObjectFactory), animationObjects, archetypeSet); this.gameObjectParser = gameObjectParser; this.smoothFaces = smoothFaces; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -46,29 +46,21 @@ private final String imageSet; /** - * The game object parser for saving inventories. - */ - @NotNull - private final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser; - - /** * Create the ArchetypeSet. * @param imageSet the image set to use * @param archetypeFactory the archetype factory to use - * @param gameObjectParser the game object parser to use * @param faceObjectProviders the face object providers */ - public ArchetypeSet(@NotNull final String imageSet, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final FaceObjectProviders faceObjectProviders) { + public ArchetypeSet(@NotNull final String imageSet, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { super(archetypeFactory, IGUIConstants.ARCH_FILE, faceObjectProviders); this.imageSet = imageSet.equals("none") ? null : imageSet; - this.gameObjectParser = gameObjectParser; } /** * {@inheritDoc} */ @Override - protected int collectArch(@NotNull final Archetype arch, @NotNull final Writer out) throws IOException { + protected int collectArch(@NotNull final Archetype arch, @NotNull final Writer out, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { out.append("Object ").append(arch.getArchetypeName()).append('\n'); // special: add a string-attribute with the display-category Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -44,7 +44,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public DefaultArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { + public DefaultArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { super(archetypeName, faceObjectProviders, animationObjects); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetypeFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetypeFactory.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetypeFactory.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -42,7 +42,7 @@ * The {@link AnimationObjects} for looking up animations. */ @NotNull - private final AnimationObjects animationObjects; + private final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects; /** * Creates a new instance. @@ -50,7 +50,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public DefaultArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { + public DefaultArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { this.faceObjectProviders = faceObjectProviders; this.animationObjects = animationObjects; } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java 2010-06-24 00:59:32 UTC (rev 8436) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java 2010-06-24 02:44:24 UTC (rev 8437) @@ -45,7 +45,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public UndefinedArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { + ... [truncated message content] |
From: <aki...@us...> - 2010-06-24 03:09:46
|
Revision: 8438 http://gridarta.svn.sourceforge.net/gridarta/?rev=8438&view=rev Author: akirschbaum Date: 2010-06-24 03:09:38 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Remove GameObject,setArchetypeName() and BaseObject.getArchetypeName(). Modified Paths: -------------- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/model/src/app/net/sf/gridarta/model/archetype/Archetype.java trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeValidator.java trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilter.java trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObject.java trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/model/src/app/net/sf/gridarta/model/match/MutableNameGameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/spells/GameObjectSpell.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeNameCellRenderer.java trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java trunk/src/app/net/sf/gridarta/gui/replacedialog/ArchetypeNameMatchCriteria.java trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxCellRenderer.java trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxEditor.java trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxModel.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -98,7 +98,7 @@ final Archetype arch2 = getArchetypeSet().getArchetype("arch2"); Assert.assertEquals(1, arch2.countInvObjects()); final GameObject inv = arch2.iterator().next(); - Assert.assertEquals("arch1", inv.getArchetypeName()); + Assert.assertEquals("arch1", inv.getArchetype().getArchetypeName()); Assert.assertEquals("name1", inv.getAttributeString(BaseObject.NAME)); } Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -72,7 +72,7 @@ final Archetype arch2 = getArchetypeSet().getArchetype("arch2"); Assert.assertEquals(1, arch2.countInvObjects()); final GameObject inv = arch2.iterator().next(); - Assert.assertEquals("arch1", inv.getArchetypeName()); + Assert.assertEquals("arch1", inv.getArchetype().getArchetypeName()); Assert.assertEquals("name1", inv.getAttributeString(BaseObject.NAME)); } Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -203,20 +203,7 @@ */ @Override public void setArchetypeName(@NotNull final String archetypeName) { - final String newArchetypeName = archetypeName.intern(); - // Using == on these Strings is okay, they are both interned. - //noinspection StringEquality - if (this.archetypeName == newArchetypeName) { - return; - } - - beginGameObjectChange(); - try { - this.archetypeName = newArchetypeName; - // XXX: update objName - } finally { - endGameObjectChange(); - } + this.archetypeName = archetypeName; } /** Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/Archetype.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -66,9 +66,16 @@ void addFirst(@NotNull G gameObject); /** - * Set the archetype name. - * @param archetypeName the archetype name + * Returns the name of this archetype. + * @return the name */ + @NotNull + String getArchetypeName(); + + /** + * Sets the name of this archetype. + * @param archetypeName the name + */ void setArchetypeName(@NotNull String archetypeName); /** Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeValidator.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeValidator.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeValidator.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -21,7 +21,6 @@ import net.sf.gridarta.model.anim.AnimationObject; import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.gridarta.model.face.FaceObject; @@ -70,7 +69,7 @@ * @param archetypeSet the archetype set instance to validate */ public void validate(@NotNull final ArchetypeSet<?, ?, ?> archetypeSet) { - for (final BaseObject<?, ?, ?, ?> archetype : archetypeSet.getArchetypes()) { + for (final Archetype<?, ?, ?> archetype : archetypeSet.getArchetypes()) { validateArchetype(archetype); } } @@ -79,7 +78,7 @@ * Validates an {@link Archetype} instance. * @param archetype the archetype instance to validate */ - private void validateArchetype(@NotNull final BaseObject<?, ?, ?, ?> archetype) { + private void validateArchetype(@NotNull final Archetype<?, ?, ?> archetype) { final String animName = archetype.getAnimName(); if (animName != null && !animName.equals("NONE")) { final AnimationObject animation = animationObjects.get(animName); Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -694,7 +694,7 @@ * @param objName the name of this object. */ private void setObjName(@NotNull final String objName) { - final String objName2 = objName.length() == 0 ? getArchetypeName() : objName; + final String objName2 = objName.length() == 0 ? getArchetype().getArchetypeName() : objName; final String newObjName = objName2.intern(); // Using == on these Strings is okay, they are both interned. //noinspection StringEquality @@ -716,22 +716,19 @@ @NotNull @Override public String getBestName() { - if (getArchetype() != null) { - final String archObjName = getArchetype().getObjName(); + final Archetype<G, A, R> archetype = getArchetype(); + if (archetype != null) { + final String archObjName = archetype.getObjName(); if (objName.length() > 0) { return objName; } else if (archObjName.length() > 0) { return archObjName; - } else if (getArchetypeName().length() > 0) { - return getArchetypeName(); } else { - return getArchetype().getArchetypeName(); + return archetype.getArchetypeName(); } } else { if (objName.length() > 0) { return objName; - } else if (getArchetypeName().length() > 0) { - return getArchetypeName(); } else { throw new IllegalStateException(); } @@ -788,13 +785,10 @@ */ @Override public boolean isDefaultGameObject() { - final BaseObject<G, A, R, ?> archetype = getArchetype(); + final R archetype = getArchetype(); if (archetype == null) { return false; } - if (!getArchetypeName().equals(archetype.getArchetypeName())) { - return false; - } if (!objName.equals(archetype.getObjName())) { return false; } @@ -828,7 +822,7 @@ // ignore "faceObjSource" // ignore "normalFace" // ignore "container" - && abstractBaseObject.getArchetype() == getArchetype() && abstractBaseObject.getArchetypeName().equals(getArchetypeName()) && abstractBaseObject.objName.equals(objName) && abstractBaseObject.gameObjectText.equals(gameObjectText) && (abstractBaseObject.msgText == null ? msgText == null : msgText != null && msgText.toString().equals(abstractBaseObject.msgText.toString())) + && abstractBaseObject.getArchetype() == getArchetype() && abstractBaseObject.getArchetype().getArchetypeName().equals(getArchetype().getArchetypeName()) && abstractBaseObject.objName.equals(objName) && abstractBaseObject.gameObjectText.equals(gameObjectText) && (abstractBaseObject.msgText == null ? msgText == null : msgText != null && msgText.toString().equals(abstractBaseObject.msgText.toString())) // ignore "mapX" // ignore "mapY" // ignore "attributeCache" Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -227,13 +227,6 @@ R getArchetype(); /** - * Returns the name of the archetype. - * @return the name - */ - @NotNull - String getArchetypeName(); - - /** * Returns the edit type. * @return edit type */ Modified: trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilter.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilter.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilter.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -85,7 +85,7 @@ public boolean match(@NotNull final NamedFilterConfig config, @NotNull final GameObject<?, ?, ?> gameObject) { try { if (log.isDebugEnabled()) { - log.debug("match called on " + gameObject.getArchetypeName()); + log.debug("match called on " + gameObject.getArchetype().getArchetypeName()); } for (final String name : subFilters.keySet()) { if (log.isDebugEnabled()) { Modified: trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -38,13 +38,6 @@ public abstract class AbstractGameObject<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractBaseObject<G, A, R, G> implements GameObject<G, A, R> { /** - * The name of the {@link Archetype} associated with this game object. - * @serial - */ - @NotNull - private String archetypeName; - - /** * The {@link Archetype} of this game object. Set to <code>null</code> if * not yet known. * @serial @@ -71,7 +64,6 @@ */ protected AbstractGameObject(@NotNull final R archetype, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<G, A, R> animationObjects) { super(faceObjectProviders, animationObjects); - archetypeName = archetype.getArchetypeName(); this.archetype = archetype; updateArchetype(); } @@ -348,44 +340,13 @@ } this.archetype = archetype; - setArchetypeName(archetype.getArchetypeName()); updateArchetype(); } /** * {@inheritDoc} */ - @NotNull @Override - public String getArchetypeName() { - return archetypeName; - } - - /** - * {@inheritDoc} - */ - @Override - public void setArchetypeName(@NotNull final String archetypeName) { - final String newArchetypeName = archetypeName.intern(); - // Using == on these Strings is okay, they are both interned. - //noinspection StringEquality - if (this.archetypeName == newArchetypeName) { - return; - } - - beginGameObjectChange(); - try { - this.archetypeName = newArchetypeName; - // XXX: update objName - } finally { - endGameObjectChange(); - } - } - - /** - * {@inheritDoc} - */ - @Override public boolean hasUndefinedArchetype() { return archetype != null && archetype.isUndefinedArchetype(); } Modified: trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObject.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObject.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -269,12 +269,6 @@ void setArchetype(@NotNull R archetype); /** - * Set the archetype name. - * @param archetypeName the archetype name - */ - void setArchetypeName(@NotNull String archetypeName); - - /** * Return whether this instance references an undefined archetype. * @return <code>true</code> if this instance references an undefined * archetype Modified: trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -224,7 +224,7 @@ final Map<String, String> fields = getModifiedFields(gameObject); appendable.append("arch "); - appendable.append(gameObject.getArchetypeName()); + appendable.append(gameObject.getArchetype().getArchetypeName()); appendable.append("\n"); for (final Map.Entry<String, String> entry : fields.entrySet()) { appendable.append(entry.getKey()); Modified: trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -677,7 +677,7 @@ if (!allowDouble) { final String temp = part.getArchetypeName(); for (final BaseObject<G, A, R, ?> node : mapGrid.getMapSquare(point.x, point.y)) { - if (node.getArchetypeName().equals(temp)) { + if (node.getArchetype().getArchetypeName().equals(temp)) { return false; } } Modified: trunk/model/src/app/net/sf/gridarta/model/match/MutableNameGameObjectMatcher.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/match/MutableNameGameObjectMatcher.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/match/MutableNameGameObjectMatcher.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -55,7 +55,7 @@ */ @Override public boolean isMatching(@NotNull final GameObject<?, ?, ?> arch) { - return name.matches(arch.getArchetypeName()); + return name.matches(arch.getArchetype().getArchetypeName()); } /** Modified: trunk/model/src/app/net/sf/gridarta/model/spells/GameObjectSpell.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/spells/GameObjectSpell.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/model/src/app/net/sf/gridarta/model/spells/GameObjectSpell.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -80,7 +80,7 @@ */ private static String getName(final BaseObject<?, ?, ?, ?> archetype) { final String archObjName = archetype.getObjName(); - final String archetypeName = archetype.getArchetypeName(); + final String archetypeName = archetype.getArchetype().getArchetypeName(); return (archObjName.length() > 0 ? archObjName : archetypeName) + " [" + archetypeName + "]"; } Modified: trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeNameCellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeNameCellRenderer.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeNameCellRenderer.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -22,7 +22,6 @@ import java.awt.Component; import javax.swing.JList; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; @@ -61,7 +60,7 @@ public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - final BaseObject<?, ?, ?, ?> archetype = (BaseObject<?, ?, ?, ?>) value; + final Archetype<?, ?, ?> archetype = (Archetype<?, ?, ?>) value; setText(archetype.getArchetypeName()); setIcon(faceObjectProviders.getFace(archetype)); return this; Modified: trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -27,7 +27,6 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetypetype.ArchetypeType; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; -import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.utils.ActionBuilderUtils; @@ -88,8 +87,8 @@ /** {@inheritDoc} */ @Override public int compare(final Integer o1, final Integer o2) { - final BaseObject<G, A, R, ?> archetype1 = archetypes.get(o1); - final BaseObject<G, A, R, ?> archetype2 = archetypes.get(o2); + final Archetype<G, A, R> archetype1 = archetypes.get(o1); + final Archetype<G, A, R> archetype2 = archetypes.get(o2); final int cmpBestName = archetype1.getBestName().compareToIgnoreCase(archetype2.getBestName()); if (cmpBestName != 0) { Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -281,7 +281,7 @@ setArchNameField(objName, Color.blue); } else { final String archObjName = gameObject.getArchetype().getObjName(); - setArchNameField(archObjName.length() > 0 ? archObjName : gameObject.getArchetypeName(), Color.black); + setArchNameField(archObjName.length() > 0 ? archObjName : gameObject.getArchetype().getArchetypeName(), Color.black); } } @@ -302,7 +302,7 @@ final ArchetypeType archetypeType = archetypeTypeSet.getArchetypeType(gameObject); typeText.append(archetypeType.getTypeName()); typeText.append(" (").append(archetypeType.getTypeNo()).append(')'); - typeText.append(" [").append(gameObject.getArchetypeName()).append(']'); + typeText.append(" [").append(gameObject.getArchetype().getArchetypeName()).append(']'); if (gameObject.isMulti()) { typeText.append(" [").append(gameObject.getSizeX()).append('x').append(gameObject.getSizeY()).append(']'); } else { @@ -331,7 +331,7 @@ } final BaseObject<G, A, R, ?> cont = gameObject.getContainerGameObject(); if (cont != null) { - specialText.append(" (env: ").append(cont.getArchetypeName()).append(')'); + specialText.append(" (env: ").append(cont.getArchetype().getArchetypeName()).append(')'); } archMapPos.setText(specialText.toString()); } Modified: trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -129,7 +129,7 @@ gameObjectNameLabel.setForeground(Color.BLACK); gameObjectNameLabel.setText(objName); - gameObjectArchetypeNameLabel.setText(headObject.getArchetypeName()); + gameObjectArchetypeNameLabel.setText(headObject.getArchetype().getArchetypeName()); final ArchetypeType archetypeType = archetypeTypeSet.getArchetypeType(headObject); gameObjectTypeLabel.setText(archetypeType.getTypeName() + " (" + archetypeType.getTypeNo() + ')'); Modified: trunk/src/app/net/sf/gridarta/gui/replacedialog/ArchetypeNameMatchCriteria.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/replacedialog/ArchetypeNameMatchCriteria.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/replacedialog/ArchetypeNameMatchCriteria.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -51,7 +51,7 @@ */ @Override public boolean matches(@NotNull final G gameObject) { - return archetypeName.matcher(gameObject.getArchetypeName()).matches(); + return archetypeName.matcher(gameObject.getArchetype().getArchetypeName()).matches(); } } // class ArchetypeNameMatchCriteria Modified: trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxCellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxCellRenderer.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxCellRenderer.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -76,7 +76,7 @@ setIcon(null); return this; } - setText(arch.getArchetypeName()); + setText(arch.getArchetype().getArchetypeName()); setIcon(faceObjectProviders.getFace(arch)); Modified: trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxEditor.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxEditor.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -120,7 +120,7 @@ public void actionPerformed(final ActionEvent e) { final BaseObject<G, A, R, ?> gameObject = objectChooser.getSelection(); if (gameObject != null) { - final Archetype<G, A, R> ao = archComboBoxModel.getNearestMatch(gameObject.getArchetypeName()); + final Archetype<G, A, R> ao = archComboBoxModel.getNearestMatch(gameObject.getArchetype().getArchetypeName()); archComboBox.setSelectedItem(ao); setItem(ao); } @@ -133,7 +133,7 @@ public void actionPerformed(final ActionEvent e) { final BaseObject<G, A, R, ?> gameObject = gameObjectAttributesModel.getSelectedGameObject(); if (gameObject != null) { - final Archetype<G, A, R> ao = archComboBoxModel.getNearestMatch(gameObject.getArchetypeName()); + final Archetype<G, A, R> ao = archComboBoxModel.getNearestMatch(gameObject.getArchetype().getArchetypeName()); archComboBox.setSelectedItem(ao); setItem(ao); } @@ -253,9 +253,9 @@ } } else { if (!locked) { - editor.setText(arch.getArchetypeName()); + editor.setText(arch.getArchetype().getArchetypeName()); } - icon.setText(arch.getArchetypeName()); + icon.setText(arch.getArchetype().getArchetypeName()); } } Modified: trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxModel.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxModel.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -26,7 +26,6 @@ import javax.swing.ComboBoxModel; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.ArchetypeSet; -import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; @@ -115,13 +114,13 @@ public int compare(final Object o1, final Object o2) { final String s1; if (o1 instanceof Archetype) { - s1 = ((BaseObject<?, ?, ?, ?>) o1).getArchetypeName(); + s1 = ((Archetype<?, ?, ?>) o1).getArchetypeName(); } else { s1 = o1.toString(); } final String s2; if (o2 instanceof Archetype) { - s2 = ((BaseObject<?, ?, ?, ?>) o2).getArchetypeName(); + s2 = ((Archetype<?, ?, ?>) o2).getArchetypeName(); } else { s2 = o2.toString(); } Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java 2010-06-24 02:44:24 UTC (rev 8437) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java 2010-06-24 03:09:38 UTC (rev 8438) @@ -96,7 +96,7 @@ if (defaultName.length() > 0) { setText(defaultName); // default name } else { - setText(arch.getArchetypeName()); // arch name + setText(arch.getArchetype().getArchetypeName()); // arch name } } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 03:27:37
|
Revision: 8440 http://gridarta.svn.sourceforge.net/gridarta/?rev=8440&view=rev Author: akirschbaum Date: 2010-06-24 03:27:31 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Fix unchecked warnings. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java trunk/model/src/app/net/sf/gridarta/model/resource/CollectedResourcesWriter.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2010-06-24 03:17:54 UTC (rev 8439) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2010-06-24 03:27:31 UTC (rev 8440) @@ -136,7 +136,11 @@ */ @Override protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser, archetypeSet, animationObjects, faceObjects).write(progress, collectedDirectory); + final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); + collectedResourcesWriter.addCollectable(archetypeSet); + collectedResourcesWriter.addCollectable(animationObjects); + collectedResourcesWriter.addCollectable(faceObjects); + collectedResourcesWriter.write(progress, collectedDirectory); } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2010-06-24 03:17:54 UTC (rev 8439) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2010-06-24 03:27:31 UTC (rev 8440) @@ -141,7 +141,12 @@ */ @Override protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser, archetypeSet, animationObjects, faceObjects, smoothFaces).write(progress, collectedDirectory); + final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); + collectedResourcesWriter.addCollectable(archetypeSet); + collectedResourcesWriter.addCollectable(animationObjects); + collectedResourcesWriter.addCollectable(faceObjects); + collectedResourcesWriter.addCollectable(smoothFaces); + collectedResourcesWriter.write(progress, collectedDirectory); } } // class DefaultResources Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2010-06-24 03:17:54 UTC (rev 8439) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2010-06-24 03:27:31 UTC (rev 8440) @@ -136,7 +136,11 @@ */ @Override protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser, archetypeSet, animationObjects, faceObjects).write(progress, collectedDirectory); + final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); + collectedResourcesWriter.addCollectable(archetypeSet); + collectedResourcesWriter.addCollectable(animationObjects); + collectedResourcesWriter.addCollectable(faceObjects); + collectedResourcesWriter.write(progress, collectedDirectory); } /** Modified: trunk/model/src/app/net/sf/gridarta/model/resource/CollectedResourcesWriter.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/resource/CollectedResourcesWriter.java 2010-06-24 03:17:54 UTC (rev 8439) +++ trunk/model/src/app/net/sf/gridarta/model/resource/CollectedResourcesWriter.java 2010-06-24 03:27:31 UTC (rev 8440) @@ -22,7 +22,6 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.collectable.Collectable; @@ -54,14 +53,20 @@ * Creates a new instance. * @param gameObjectParser the game object parser for writing inventory game * objects - * @param collectables the collectable resources */ - public CollectedResourcesWriter(@NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final Collectable<G, A, R>... collectables) { + public CollectedResourcesWriter(@NotNull final GameObjectParser<G, A, R> gameObjectParser) { this.gameObjectParser = gameObjectParser; - this.collectables.addAll(Arrays.asList(collectables)); } /** + * Adds a {@link Collectable} resource. + * @param collectable the collectable resource + */ + public void addCollectable(@NotNull final Collectable<G, A, R> collectable) { + collectables.add(collectable); + } + + /** * Writes the resources into a collection. * @param progress the progress to use * @param collectedDirectory the collected directory to write to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 16:57:02
|
Revision: 8443 http://gridarta.svn.sourceforge.net/gridarta/?rev=8443&view=rev Author: akirschbaum Date: 2010-06-24 16:56:56 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Include all map validators when running plugin scripts from command-line. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-24 16:55:09 UTC (rev 8442) +++ trunk/atrinik/ChangeLog 2010-06-24 16:56:56 UTC (rev 8443) @@ -1,3 +1,8 @@ +2010-06-24 Andreas Kirschbaum + + * Include all map validators when running plugin scripts from + command-line. + 2010-06-23 Andreas Kirschbaum * Open map files even if no archetypes have been found. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-24 16:55:09 UTC (rev 8442) +++ trunk/crossfire/ChangeLog 2010-06-24 16:56:56 UTC (rev 8443) @@ -1,3 +1,8 @@ +2010-06-24 Andreas Kirschbaum + + * Include all map validators when running plugin scripts from + command-line. + 2010-06-23 Andreas Kirschbaum * Open map files even if no archetypes have been found. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-24 16:55:09 UTC (rev 8442) +++ trunk/daimonin/ChangeLog 2010-06-24 16:56:56 UTC (rev 8443) @@ -1,3 +1,8 @@ +2010-06-24 Andreas Kirschbaum + + * Include all map validators when running plugin scripts from + command-line. + 2010-06-23 Andreas Kirschbaum * Open map files even if no archetypes have been found. Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-06-24 16:55:09 UTC (rev 8442) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-06-24 16:56:56 UTC (rev 8443) @@ -31,6 +31,7 @@ import javax.swing.ImageIcon; import javax.swing.filechooser.FileFilter; import javax.xml.parsers.ParserConfigurationException; +import net.sf.gridarta.gui.archetypetype.ArchetypeTypeChecks; import net.sf.gridarta.gui.filter.FilterControl; import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.gui.map.renderer.RendererFactory; @@ -298,6 +299,7 @@ final ScriptModelParser<G, A, R> scriptModelParser = new ScriptModelParser<G, A, R>(pluginParameterFactory); new ScriptModelLoader<G, A, R>(scriptModelParser).loadScripts(errorView, scriptsFile, scriptModel); new AutojoinListsParser<G, A, R>(errorView, archetypeSet, autojoinLists).loadList(globalSettings.getConfigurationDirectory()); + ArchetypeTypeChecks.addChecks(archetypeTypeSet, attributeRangeChecker); } /** Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-24 16:55:09 UTC (rev 8442) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-24 16:56:56 UTC (rev 8443) @@ -488,7 +488,6 @@ final ExitMatcher<G, A, R> exitMatcher = new ExitMatcher<G, A, R>(exitGameObjectMatcher); final MapPathNormalizer mapPathNormalizer = new MapPathNormalizer(globalSettings); final MapPropertiesDialogFactory<G, A, R> mapPropertiesDialogFactory = editorFactory.newMapPropertiesDialogFactory(globalSettings, mapManager, mapPathNormalizer); - ArchetypeTypeChecks.addChecks(archetypeTypeSet, attributeRangeChecker); final DelayedMapModelListenerManager<G, A, R> delayedMapModelListenerManager = new DelayedMapModelListenerManager<G, A, R>(mapManager, exiter); final Control<?, G, A, R> lockedItemsControl = new LockedItemsControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, lockedItemsTypeNumbers); final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel = new GameObjectAttributesModel<G, A, R>(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-24 17:22:30
|
Revision: 8450 http://gridarta.svn.sourceforge.net/gridarta/?rev=8450&view=rev Author: akirschbaum Date: 2010-06-24 17:22:24 +0000 (Thu, 24 Jun 2010) Log Message: ----------- Set cursor to end of text in CTRL-ALT-E (toggle game object text editor). Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java trunk/src/app/net/sf/gridarta/gui/gameobjecttexteditor/GameObjectTextEditor.java trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-24 17:19:29 UTC (rev 8449) +++ trunk/atrinik/ChangeLog 2010-06-24 17:22:24 UTC (rev 8450) @@ -1,5 +1,8 @@ 2010-06-24 Andreas Kirschbaum + * Set cursor to end of text in CTRL-ALT-E (toggle game object text + editor). + * Include all map validators when running plugin scripts from command-line. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-24 17:19:29 UTC (rev 8449) +++ trunk/crossfire/ChangeLog 2010-06-24 17:22:24 UTC (rev 8450) @@ -1,5 +1,8 @@ 2010-06-24 Andreas Kirschbaum + * Set cursor to end of text in CTRL-ALT-E (toggle game object text + editor). + * Include all map validators when running plugin scripts from command-line. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-24 17:19:29 UTC (rev 8449) +++ trunk/daimonin/ChangeLog 2010-06-24 17:22:24 UTC (rev 8450) @@ -1,5 +1,8 @@ 2010-06-24 Andreas Kirschbaum + * Set cursor to end of text in CTRL-ALT-E (toggle game object text + editor). + * Include all map validators when running plugin scripts from command-line. Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java 2010-06-24 17:19:29 UTC (rev 8449) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/TextEditorTab.java 2010-06-24 17:22:24 UTC (rev 8450) @@ -92,7 +92,7 @@ */ @Override public void activate() { - gameObjectTextEditor.getTextPane().requestFocusInWindow(); + gameObjectTextEditor.activate(); } /** Modified: trunk/src/app/net/sf/gridarta/gui/gameobjecttexteditor/GameObjectTextEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjecttexteditor/GameObjectTextEditor.java 2010-06-24 17:19:29 UTC (rev 8449) +++ trunk/src/app/net/sf/gridarta/gui/gameobjecttexteditor/GameObjectTextEditor.java 2010-06-24 17:22:24 UTC (rev 8450) @@ -153,8 +153,20 @@ * Returns the text input pane. * @return the text input pane */ + @NotNull public Component getTextPane() { return archEdit; } + /** + * Activates this component. + */ + public void activate() { + archEdit.requestFocusInWindow(); + final Document document = archEdit.getDocument(); + if (document != null) { + archEdit.setCaretPosition(document.getLength()); + } + } + } // class GameObjectTextEditor Modified: trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java 2010-06-24 17:19:29 UTC (rev 8449) +++ trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java 2010-06-24 17:22:24 UTC (rev 8450) @@ -21,6 +21,7 @@ import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesControl; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesTab; +import net.sf.gridarta.gui.gameobjectattributespanel.TextEditorTab; import net.sf.gridarta.gui.utils.tabbedpanel.Tab; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; @@ -58,7 +59,7 @@ * editor. */ @NotNull - private final GameObjectAttributesTab<G, A, R> textEditorTab; + private final TextEditorTab<G, A, R> textEditorTab; /** * Whether a previously selected tab has been remembered. Applies to {@link @@ -92,7 +93,7 @@ * @param textEditorTab the game object attributes tab that displays the * game object text editor */ - public MainViewActions(@NotNull final MainView mainView, @NotNull final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl, @NotNull final Tab gameObjectTab, @NotNull final GameObjectAttributesTab<G, A, R> textEditorTab) { + public MainViewActions(@NotNull final MainView mainView, @NotNull final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl, @NotNull final Tab gameObjectTab, @NotNull final TextEditorTab<G, A, R> textEditorTab) { this.mainView = mainView; this.gameObjectAttributesControl = gameObjectAttributesControl; this.gameObjectTab = gameObjectTab; @@ -127,6 +128,7 @@ } if (prevTab2 != null) { gameObjectAttributesControl.selectTab(prevTab2); + prevTab2.activate(); prevTab2 = null; } } Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-24 17:19:29 UTC (rev 8449) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-24 17:22:24 UTC (rev 8450) @@ -37,7 +37,6 @@ import net.sf.gridarta.delayedmapmodel.DelayedMapModelListenerManager; import net.sf.gridarta.exitconnector.ExitConnectorActions; import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; -import net.sf.gridarta.gui.archetypetype.ArchetypeTypeChecks; import net.sf.gridarta.gui.autovalidator.AutoValidator; import net.sf.gridarta.gui.bookmarks.BookmarkActions; import net.sf.gridarta.gui.connectionview.ConnectionControl; @@ -55,7 +54,6 @@ import net.sf.gridarta.gui.gameobjectattributespanel.FaceTab; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesControl; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesModel; -import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesTab; import net.sf.gridarta.gui.gameobjectattributespanel.MsgTextTab; import net.sf.gridarta.gui.gameobjectattributespanel.TextEditorTab; import net.sf.gridarta.gui.io.GuiFileFilters; @@ -498,7 +496,7 @@ final ToolPalette<G, A, R> toolPalette = new ToolPalette<G, A, R>(mapViewSettings, selectedSquareView, selectedSquareModel, objectChooser, pickmapChooserControl, floorMatcher, wallMatcher, monsterMatcher, insertionModeSet); updaterManager = new UpdaterManager(exiter, mapManager, mainViewFrame, gridartaJarFilename); - final GameObjectAttributesTab<G, A, R> textEditorTab = new TextEditorTab<G, A, R>(gameObjectAttributesModel, archetypeTypeSet); + final TextEditorTab<G, A, R> textEditorTab = new TextEditorTab<G, A, R>(gameObjectAttributesModel, archetypeTypeSet); final GameObjectTab<G, A, R> gameObjectTab = new GameObjectTab<G, A, R>("gameObject", gameObjectAttributesControl, Location.BOTTOM, 0, true); //noinspection ResultOfObjectAllocationIgnored This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-25 18:05:33
|
Revision: 8456 http://gridarta.svn.sourceforge.net/gridarta/?rev=8456&view=rev Author: akirschbaum Date: 2010-06-25 18:05:24 +0000 (Fri, 25 Jun 2010) Log Message: ----------- Implement #3018432 (Display archetype titles): Include "title" attribute when showing game object or archetype names. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-25 05:46:21 UTC (rev 8455) +++ trunk/atrinik/ChangeLog 2010-06-25 18:05:24 UTC (rev 8456) @@ -1,3 +1,8 @@ +2010-06-25 Andreas Kirschbaum + + * Implement #3018432 (Display archetype titles): Include "title" + attribute when showing game object or archetype names. + 2010-06-24 Andreas Kirschbaum * Set cursor to end of text in CTRL-ALT-E (toggle game object text Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-25 05:46:21 UTC (rev 8455) +++ trunk/crossfire/ChangeLog 2010-06-25 18:05:24 UTC (rev 8456) @@ -1,3 +1,8 @@ +2010-06-25 Andreas Kirschbaum + + * Implement #3018432 (Display archetype titles): Include "title" + attribute when showing game object or archetype names. + 2010-06-24 Andreas Kirschbaum * Set cursor to end of text in CTRL-ALT-E (toggle game object text Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-25 05:46:21 UTC (rev 8455) +++ trunk/daimonin/ChangeLog 2010-06-25 18:05:24 UTC (rev 8456) @@ -1,3 +1,8 @@ +2010-06-25 Andreas Kirschbaum + + * Implement #3018432 (Display archetype titles): Include "title" + attribute when showing game object or archetype names. + 2010-06-24 Andreas Kirschbaum * Set cursor to end of text in CTRL-ALT-E (toggle game object text Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-25 05:46:21 UTC (rev 8455) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-25 18:05:24 UTC (rev 8456) @@ -716,17 +716,21 @@ @NotNull @Override public String getBestName() { + final String baseName; if (objName.length() > 0) { - return objName; + baseName = objName; + } else { + final Archetype<G, A, R> archetype = getArchetype(); + final String archObjName = archetype.getObjName(); + if (archObjName.length() > 0) { + baseName = archObjName; + } else { + baseName = archetype.getArchetypeName(); + } } - final Archetype<G, A, R> archetype = getArchetype(); - final String archObjName = archetype.getObjName(); - if (archObjName.length() > 0) { - return archObjName; - } - - return archetype.getArchetypeName(); + final String title = getAttributeString(TITLE); + return title.isEmpty() ? baseName : baseName + " " +title; } /** Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-06-25 05:46:21 UTC (rev 8455) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-06-25 18:05:24 UTC (rev 8456) @@ -63,6 +63,12 @@ String TYPE = "type"; /** + * The attribute name of the object's title. + */ + @NotNull + String TITLE = "title"; + + /** * Returns the type number of this Archetype. * @return The type number of this Archetype. */ Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java 2010-06-25 05:46:21 UTC (rev 8455) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java 2010-06-25 18:05:24 UTC (rev 8456) @@ -83,22 +83,8 @@ // window gets changed by user and java is still blitting here if (arch != null) { arch = arch.getHead(); - setIcon(faceObjectProviders.getFace(arch)); - - // In the map-square-window the object names are displayed - // next to the icons - final String archObjName = arch.getObjName(); - if (archObjName.length() > 0) { - setText(archObjName); // special name - } else { - final String defaultName = arch.getArchetype().getObjName(); - if (defaultName.length() > 0) { - setText(defaultName); // default name - } else { - setText(arch.getArchetype().getArchetypeName()); // arch name - } - } + setText(arch.getBestName()); } else { setIcon(unknownSquareIcon); setText("?"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-25 19:34:37
|
Revision: 8457 http://gridarta.svn.sourceforge.net/gridarta/?rev=8457&view=rev Author: akirschbaum Date: 2010-06-25 19:34:30 +0000 (Fri, 25 Jun 2010) Log Message: ----------- Add support needed for #3018414. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java trunk/resource/system/dtd/types.dtd trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java Added Paths: ----------- trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2010-06-25 18:05:24 UTC (rev 8456) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2010-06-25 19:34:30 UTC (rev 8457) @@ -52,6 +52,12 @@ private final int typeNo; /** + * Additional description text. + */ + @NotNull + private final String display; + + /** * The description. */ @Nullable @@ -88,15 +94,17 @@ * Creates a new instance. * @param typeName the type name (artificial) * @param typeNo the type number + * @param display additional description text * @param description the description * @param use the usage notes * @param sectionNum the number of attribute sections * @param archetypeAttributes the list of archetype attributes * @param typeAttributes the list of additional attributes */ - public ArchetypeType(@NotNull final String typeName, final int typeNo, @Nullable final String description, @Nullable final String use, final int sectionNum, @NotNull final ArchetypeAttributes archetypeAttributes, @NotNull final ArchetypeAttributesDefinition typeAttributes) { + public ArchetypeType(@NotNull final String typeName, final int typeNo, @NotNull final String display, @Nullable final String description, @Nullable final String use, final int sectionNum, @NotNull final ArchetypeAttributes archetypeAttributes, @NotNull final ArchetypeAttributesDefinition typeAttributes) { this.typeName = typeName; this.typeNo = typeNo; + this.display = display; this.description = description; this.use = use; this.sectionNum = sectionNum; @@ -240,4 +248,58 @@ } } + /** + * Returns a description of this type. + * @param baseObject the base object to describe + * @return the description + */ + @NotNull + public String getDisplayName(@NotNull final BaseObject<?, ?, ?, ?> baseObject) { + final StringBuilder sb = new StringBuilder(); + sb.append(typeName); + sb.append(" ("); + sb.append(typeNo); + sb.append(')'); + + if (display.length() > 0) { + sb.append(" ["); + int start = 0; + while (start < display.length()) { + final int end = display.indexOf("${", start); + if (end == -1) { + break; + } + + final int end2 = display.indexOf('}', end + 2); + if (end2 == -1) { + // ignore syntax error + break; + } + + sb.append(display.substring(start, end)); + final String spec = display.substring(end + 2, end2); + final int question = spec.indexOf('?'); + final String value; + if (question == -1) { + value = baseObject.getAttributeString(spec); + } else { + final int colon = spec.indexOf(':', question + 1); + final String attributeValue = baseObject.getAttributeString(spec.substring(0, question)); + final boolean attributeExists = attributeValue.length() != 0 && !attributeValue.equals("0"); + if (attributeExists) { + value = spec.substring(question + 1, colon == -1 ? spec.length(): colon); + } else { + value = colon == -1 ? "" : spec.substring(colon + 1); + } + } + sb.append(value); + start = end2 + 1; + } + sb.append(display.substring(start)); + sb.append(']'); + } + + return sb.toString(); + } + } // class ArchetypeType Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java 2010-06-25 18:05:24 UTC (rev 8456) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java 2010-06-25 19:34:30 UTC (rev 8457) @@ -148,6 +148,7 @@ public ArchetypeType loadAttributeList(@NotNull final Element typeElement, @NotNull final ErrorViewCollector errorViewCollector, @Nullable final ArchetypeType archetypeType, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final IgnorelistsDefinition ignorelistsDefinition, final boolean isDefaultType) { final String typeName = parseTypeName(typeElement, isDefaultType); final int typeNo = parseTypeNo(typeElement, isDefaultType, typeName, errorViewCollector); + final String display = typeElement.getAttribute(ArchetypeTypeSetParser.XML_TYPE_DISPLAY); final Collection<String> ignoreTable = new HashSet<String>(); final ArchetypeAttributesDefinition typeAttributes = isDefaultType ? new ArchetypeAttributesDefinition() : parseTypeAttributes(typeElement, typeName, errorViewCollector, ignoreTable, ignorelistsDefinition); @@ -180,7 +181,7 @@ } attributes.setSectionNames(sectionNames); - return new ArchetypeType(typeName, typeNo, parseDescription(typeElement), parseUse(typeElement), sectionNames.getSectionNames(), attributes, typeAttributes); + return new ArchetypeType(typeName, typeNo, display, parseDescription(typeElement), parseUse(typeElement), sectionNames.getSectionNames(), attributes, typeAttributes); } /** Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2010-06-25 18:05:24 UTC (rev 8456) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2010-06-25 19:34:30 UTC (rev 8457) @@ -219,6 +219,15 @@ } /** + * Returns a description of this type. + * @param baseObject the base object to describe + * @return the description + */ + @NotNull + public String getDisplayName(@NotNull final BaseObject<?, ?, ?, ?> baseObject) { + return getArchetypeType(baseObject).getDisplayName(baseObject); + } + /** * Returns an {@link ArchetypeType} by type name. * @param typeName the type name to look up * @return the archetype type instance or <code>null</code> if the type name @@ -267,7 +276,7 @@ public void defineFallbackArchetypeType() { fallbackArchetypeType = archetypeTypeNames.get("Misc"); if (fallbackArchetypeType == null) { - fallbackArchetypeType = new ArchetypeType("", 0, null, null, 2, new ArchetypeAttributes(), new ArchetypeAttributesDefinition()); + fallbackArchetypeType = new ArchetypeType("", 0, "", null, null, 2, new ArchetypeAttributes(), new ArchetypeAttributesDefinition()); } } Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2010-06-25 18:05:24 UTC (rev 8456) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2010-06-25 19:34:30 UTC (rev 8457) @@ -176,6 +176,13 @@ public static final String XML_TYPE_NUMBER = "number"; /** + * The name of the "display" attribute within {@link #XML_ELEMENT_TYPE} + * elements. + */ + @NotNull + public static final String XML_TYPE_DISPLAY = "display"; + + /** * The name of the "ignorelists" element. */ @NotNull Added: trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java (rev 0) +++ trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java 2010-06-25 19:34:30 UTC (rev 8457) @@ -0,0 +1,153 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.archetypetype; + +import java.util.regex.Pattern; +import net.sf.gridarta.model.anim.AnimationObjects; +import net.sf.gridarta.model.anim.DefaultAnimationObjects; +import net.sf.gridarta.model.archetype.TestArchetype; +import net.sf.gridarta.model.baseobject.BaseObject; +import net.sf.gridarta.model.face.ArchFaceProvider; +import net.sf.gridarta.model.face.DefaultFaceObjects; +import net.sf.gridarta.model.face.FaceObjectProviders; +import net.sf.gridarta.model.face.FaceObjects; +import net.sf.gridarta.model.gameobject.TestGameObject; +import net.sf.gridarta.model.map.maparchobject.TestMapArchObject; +import net.sf.gridarta.utils.GUIUtils; +import net.sf.gridarta.utils.SystemIcons; +import org.junit.Assert; +import org.junit.Test; + +/** + * Regression tests for {@link ArchetypeType}. + * @author Andreas Kirschbaum + */ +public class ArchetypeTypeTest { + + /** + * Checks that empty expansions work correctly. + */ + @Test + public void testAttributes1() { + final GUIUtils guiUtils = new GUIUtils(); + final SystemIcons systemIcons = new SystemIcons(guiUtils); + final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); + final FaceObjects<TestGameObject, TestMapArchObject, TestArchetype> faceObjects = new DefaultFaceObjects<TestGameObject, TestMapArchObject, TestArchetype>("png", "facetree", Pattern.compile(".*"), "", archFaceProvider); + final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); + final AnimationObjects<TestGameObject, TestMapArchObject, TestArchetype> animationObjects = new DefaultAnimationObjects<TestGameObject, TestMapArchObject, TestArchetype>("animtree"); + final ArchetypeAttributes archetypeAttributes = new ArchetypeAttributes(); + final ArchetypeAttributesDefinition typeAttributes = new ArchetypeAttributesDefinition(); + final BaseObject<?, ?, ?, ?> archetype = new TestArchetype("base", faceObjectProviders, animationObjects); + + final ArchetypeType archetypeType1 = new ArchetypeType("name1", 1, "", "description", "use", 1, archetypeAttributes, typeAttributes); + Assert.assertEquals("name1 (1)", archetypeType1.getDisplayName(archetype)); + } + + /** + * Checks that ${xxx} expansions work correctly. + */ + @Test + public void testAttributes2() { + final GUIUtils guiUtils = new GUIUtils(); + final SystemIcons systemIcons = new SystemIcons(guiUtils); + final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); + final FaceObjects<TestGameObject, TestMapArchObject, TestArchetype> faceObjects = new DefaultFaceObjects<TestGameObject, TestMapArchObject, TestArchetype>("png", "facetree", Pattern.compile(".*"), "", archFaceProvider); + final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); + final AnimationObjects<TestGameObject, TestMapArchObject, TestArchetype> animationObjects = new DefaultAnimationObjects<TestGameObject, TestMapArchObject, TestArchetype>("animtree"); + final ArchetypeAttributes archetypeAttributes = new ArchetypeAttributes(); + final ArchetypeAttributesDefinition typeAttributes = new ArchetypeAttributesDefinition(); + final BaseObject<?, ?, ?, ?> archetype = new TestArchetype("base", faceObjectProviders, animationObjects); + + final ArchetypeType archetypeType2 = new ArchetypeType("name2", 1, "a=${a}${a}", "description", "use", 1, archetypeAttributes, typeAttributes); + Assert.assertEquals("name2 (1) [a=]", archetypeType2.getDisplayName(archetype)); + + archetype.setObjectText("a xyz\n"); + Assert.assertEquals("name2 (1) [a=xyzxyz]", archetypeType2.getDisplayName(archetype)); + + archetype.setObjectText("a ${a}\n"); + Assert.assertEquals("name2 (1) [a=${a}${a}]", archetypeType2.getDisplayName(archetype)); + + // syntax errors are not fatal + final ArchetypeType archetypeType3 = new ArchetypeType("name", 1, "${}", "description", "use", 1, archetypeAttributes, typeAttributes); + Assert.assertEquals("name (1) []", archetypeType3.getDisplayName(archetype)); + + final ArchetypeType archetypeType4 = new ArchetypeType("name", 1, "${a", "description", "use", 1, archetypeAttributes, typeAttributes); + Assert.assertEquals("name (1) [${a]", archetypeType4.getDisplayName(archetype)); + } + + /** + * Checks that ${xxx?true:false} expansions work correctly. + */ + @Test + public void testAttributes3() { + final GUIUtils guiUtils = new GUIUtils(); + final SystemIcons systemIcons = new SystemIcons(guiUtils); + final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); + final FaceObjects<TestGameObject, TestMapArchObject, TestArchetype> faceObjects = new DefaultFaceObjects<TestGameObject, TestMapArchObject, TestArchetype>("png", "facetree", Pattern.compile(".*"), "", archFaceProvider); + final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); + final AnimationObjects<TestGameObject, TestMapArchObject, TestArchetype> animationObjects = new DefaultAnimationObjects<TestGameObject, TestMapArchObject, TestArchetype>("animtree"); + final ArchetypeAttributes archetypeAttributes = new ArchetypeAttributes(); + final ArchetypeAttributesDefinition typeAttributes = new ArchetypeAttributesDefinition(); + final BaseObject<?, ?, ?, ?> archetype = new TestArchetype("base", faceObjectProviders, animationObjects); + + final ArchetypeType archetypeType2 = new ArchetypeType("name2", 1, "a=${a?True:False}", "description", "use", 1, archetypeAttributes, typeAttributes); + Assert.assertEquals("name2 (1) [a=False]", archetypeType2.getDisplayName(archetype)); + + archetype.setObjectText("a xyz\n"); + Assert.assertEquals("name2 (1) [a=True]", archetypeType2.getDisplayName(archetype)); + + archetype.setObjectText("a 0\n"); + Assert.assertEquals("name2 (1) [a=False]", archetypeType2.getDisplayName(archetype)); + + // empty replacements are allowed + final ArchetypeType archetypeType3 = new ArchetypeType("name", 1, "${a?:}", "description", "use", 1, archetypeAttributes, typeAttributes); + archetype.setObjectText("a 0\n"); + Assert.assertEquals("name (1) []", archetypeType3.getDisplayName(archetype)); + archetype.setObjectText("a 1\n"); + Assert.assertEquals("name (1) []", archetypeType3.getDisplayName(archetype)); + + // replacements with multiple colons + final ArchetypeType archetypeType4 = new ArchetypeType("name", 1, "${a?b:c:d}", "description", "use", 1, archetypeAttributes, typeAttributes); + archetype.setObjectText("a 0\n"); + Assert.assertEquals("name (1) [c:d]", archetypeType4.getDisplayName(archetype)); + archetype.setObjectText("a 1\n"); + Assert.assertEquals("name (1) [b]", archetypeType4.getDisplayName(archetype)); + + // syntax errors are not fatal + final ArchetypeType archetypeType5 = new ArchetypeType("name", 1, "${?", "description", "use", 1, archetypeAttributes, typeAttributes); + archetype.setObjectText("a 0\n"); + Assert.assertEquals("name (1) [${?]", archetypeType5.getDisplayName(archetype)); + archetype.setObjectText("a 1\n"); + Assert.assertEquals("name (1) [${?]", archetypeType5.getDisplayName(archetype)); + + final ArchetypeType archetypeType6 = new ArchetypeType("name", 1, "${a?", "description", "use", 1, archetypeAttributes, typeAttributes); + archetype.setObjectText("a 0\n"); + Assert.assertEquals("name (1) [${a?]", archetypeType6.getDisplayName(archetype)); + archetype.setObjectText("a 1\n"); + Assert.assertEquals("name (1) [${a?]", archetypeType6.getDisplayName(archetype)); + + final ArchetypeType archetypeType7 = new ArchetypeType("name", 1, "${a?:", "description", "use", 1, archetypeAttributes, typeAttributes); + archetype.setObjectText("a 0\n"); + Assert.assertEquals("name (1) [${a?:]", archetypeType7.getDisplayName(archetype)); + archetype.setObjectText("a 1\n"); + Assert.assertEquals("name (1) [${a?:]", archetypeType7.getDisplayName(archetype)); + } + +} // class ArchetypeTypeTest Property changes on: trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/resource/system/dtd/types.dtd =================================================================== --- trunk/resource/system/dtd/types.dtd 2010-06-25 18:05:24 UTC (rev 8456) +++ trunk/resource/system/dtd/types.dtd 2010-06-25 19:34:30 UTC (rev 8457) @@ -93,12 +93,17 @@ is implicitly imported at the end. --> <!-- available: the type is ignored when set to "no"; can be used to temporarily disable type definitions. --> +<!-- display: a string to include in the description of this type; ${attr} + references are replaced with attribute values; ${attr?true:false} + references are replaced by "true" if the attribute exists and is not zero, + or else by "false". --> <!ELEMENT type (import_type*,required?,ignore?,description?,use?,(section | attribute)*)> <!ATTLIST type xml:base CDATA #IMPLIED name CDATA #REQUIRED number CDATA #REQUIRED available (yes|no) 'yes' + display CDATA #IMPLIED > <!ELEMENT description (#PCDATA)> Modified: trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java 2010-06-25 18:05:24 UTC (rev 8456) +++ trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java 2010-06-25 19:34:30 UTC (rev 8457) @@ -25,7 +25,6 @@ import java.util.List; import javax.swing.table.AbstractTableModel; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetypetype.ArchetypeType; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; @@ -170,8 +169,7 @@ return archetype.getArchetypeName(); case 2: - final ArchetypeType archetypeType = archetypeTypeSet.getArchetypeType(archetype); - return archetypeType.getTypeName() + " (" + archetypeType.getTypeNo() + ')'; + return archetypeTypeSet.getDisplayName(archetype); case 3: return archetype.getEditorFolder(); Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2010-06-25 18:05:24 UTC (rev 8456) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2010-06-25 19:34:30 UTC (rev 8457) @@ -33,7 +33,6 @@ import javax.swing.text.JTextComponent; import net.sf.gridarta.gui.utils.Severity; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetypetype.ArchetypeType; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.gameobject.FaceSource; @@ -299,9 +298,7 @@ archTypeText.setText("Type:"); } else { final StringBuilder typeText = new StringBuilder("Type: "); - final ArchetypeType archetypeType = archetypeTypeSet.getArchetypeType(gameObject); - typeText.append(archetypeType.getTypeName()); - typeText.append(" (").append(archetypeType.getTypeNo()).append(')'); + typeText.append(archetypeTypeSet.getDisplayName(gameObject)); typeText.append(" [").append(gameObject.getArchetype().getArchetypeName()).append(']'); if (gameObject.isMulti()) { typeText.append(" [").append(gameObject.getSizeX()).append('x').append(gameObject.getSizeY()).append(']'); Modified: trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java 2010-06-25 18:05:24 UTC (rev 8456) +++ trunk/src/app/net/sf/gridarta/gui/objectchoicedisplay/ObjectChoiceDisplay.java 2010-06-25 19:34:30 UTC (rev 8457) @@ -24,7 +24,6 @@ import java.awt.GridBagLayout; import javax.swing.JLabel; import javax.swing.JPanel; -import net.sf.gridarta.model.archetypetype.ArchetypeType; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.baseobject.BaseObject; import org.jetbrains.annotations.NotNull; @@ -131,8 +130,7 @@ gameObjectArchetypeNameLabel.setText(headObject.getArchetype().getArchetypeName()); - final ArchetypeType archetypeType = archetypeTypeSet.getArchetypeType(headObject); - gameObjectTypeLabel.setText(archetypeType.getTypeName() + " (" + archetypeType.getTypeNo() + ')'); + gameObjectTypeLabel.setText(archetypeTypeSet.getDisplayName(headObject)); if (headObject.isMulti()) { gameObjectExtentsLabel.setText("<html><span style=\"color:green;\"> multi</span> (" + headObject.getMultiRefCount() + " parts) (" + headObject.getSizeX() + ',' + headObject.getSizeY() + ")</html>"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-25 21:16:54
|
Revision: 8460 http://gridarta.svn.sourceforge.net/gridarta/?rev=8460&view=rev Author: akirschbaum Date: 2010-06-25 21:16:48 +0000 (Fri, 25 Jun 2010) Log Message: ----------- Fix typos. Modified Paths: -------------- trunk/crossfire/resource/resource/conf/types.xml trunk/gridarta.ipr Modified: trunk/crossfire/resource/resource/conf/types.xml =================================================================== --- trunk/crossfire/resource/resource/conf/types.xml 2010-06-25 21:05:08 UTC (rev 8459) +++ trunk/crossfire/resource/resource/conf/types.xml 2010-06-25 21:16:48 UTC (rev 8460) @@ -353,7 +353,7 @@ <ignorelists> - <!-- This ignorelist is for all system objects which are non pickable + <!-- This ignore list is for all system objects which are non pickable and invisible. They don't interact with players at all. --> <ignore_list name="system_object"> <attribute arch="value"/> @@ -370,7 +370,7 @@ <attribute arch="invisible"/> </ignore_list> - <!-- This ignorelist is for non-pickable objects. They can be seen by + <!-- This ignore list is for non-pickable objects. They can be seen by the player, but don't have values like material or weight. --> <ignore_list name="non_pickable"> <attribute arch="value"/> @@ -384,7 +384,7 @@ <attribute arch="identified"/> </ignore_list> - <!-- This ignorelist is for event objects. --> + <!-- This ignore list is for event objects. --> <ignore_list name="event_object"> <attribute arch="name"/> <attribute arch="face"/> @@ -553,7 +553,7 @@ the name of an object. Yet, titles are not recognized by altars. Remember to put a note somewhere, telling the player what he is expected to drop on the altar. (Often this is put in the altar's - name: E.g. "drop 100 platinums") + name: E.g. "drop 100 platinum coins") </attribute> <attribute arch="food" editor="drop amount" type="int" min="1" max="32767"> The drop amount specifies the amount of items (specified in <match @@ -610,7 +610,7 @@ the name of an object. Yet, titles are not recognized by altars. Remember to put a note somewhere, telling the player what he is expected to drop on the altar. (Often this is put in the altar's - name: E.g. "drop 100 platinums") + name: E.g. "drop 100 platinum coins") </attribute> <attribute arch="food" editor="drop amount" type="int" min="1" max="32767"> The drop amount specifies the amount of items (specified in <match @@ -673,7 +673,7 @@ <attribute arch="wc" editor="weapon class" type="int" min="-128" max="127"> The <weapon class> value adds to the overall weapon class of the wielder's melee attacks. Weapon class improves the chance of - hitting the opponent. Weapon class is the "counterpiece" of <armor + hitting the opponent. Weapon class is the "counter piece" of <armor class>. It should usually be set only for weapon-like items. Lower values are better. </attribute> @@ -1270,7 +1270,7 @@ "arrows" and "keys". Unfortunately it is not easy to create new container classes, - because items need a matching counterpiece-attribute to the <container + because items need a matching counter piece attribute to the <container class> before they can be put inside a container. This attribute ("race") is set only for the existing container classes. </attribute> @@ -1345,7 +1345,7 @@ VERY IMPORTANT: Be careful with the exchange-ratio! When you drop items on a converter, the stuff you get must be of equal or lesser value than before! (Except if you are using "rare" items like - dragonscales for payment). The code will not check if your ratio is + dragon scales for payment). The code will not check if your ratio is sane, so the player could gain infinite wealth by using your converter. ]]> </use> <attribute arch="no_pick" value="1" type="fixed"/> @@ -1686,7 +1686,7 @@ </attribute> <attribute arch="ac" editor="armor class" type="int"> Doors of high <armor class> are less likely to get hit. <armor - class> can be considered the "counterpiece" to <weapon class>. + class> can be considered the "counter piece" to <weapon class>. </attribute> <attribute arch="other_arch" editor="drop arch" type="string"> This string defines the object that will be created when the door @@ -1823,7 +1823,7 @@ If set, this message will be displayed to the player when he applies the exit. This is quite useful to throw in some "role-play feeling": "As you enter the dark cave you hear the sound of rustling - dragonscales...". Well, my English is poor, but you get the point. + dragon scales...". Well, my English is poor, but you get the point. =) </attribute> <attribute arch="unique" editor="unique destination" type="bool"> @@ -1865,9 +1865,9 @@ in that special piece of weapon or armor, so don't let the dragon-fellows miss out on the reward completely. ]]> </use> - <attribute arch="food" editor="foodpoints" type="int" min="0" max="32767"> - The player's stomach will get filled with this amount of foodpoints. - The player's health will increase by <foodpoints>/50 hp. + <attribute arch="food" editor="food points" type="int" min="0" max="32767"> + The player's stomach will get filled with this amount of food points. + The player's health will increase by <food points>/50 hp. </attribute> <attribute arch="level" editor="flesh level" type="int" min="-32768" max="32767" check_min="1" check_max="115"> The <flesh level> is not visible to the players and it affects @@ -2137,9 +2137,9 @@ By eating/drinking food-objects, the player can fill his stomach and gain a little health. ]]> </description> - <attribute arch="food" editor="foodpoints" type="int" min="0" max="32767"> - The player's stomach will get filled with this amount of foodpoints. - The player's health will increase by <foodpoints>/50 hp. + <attribute arch="food" editor="food points" type="int" min="0" max="32767"> + The player's stomach will get filled with this amount of food points. + The player's health will increase by <food points>/50 hp. </attribute> <attribute arch="startequip" editor="godgiven item" type="bool"> A godgiven item vanishes as soon as the player drops it to the @@ -2502,7 +2502,7 @@ <description><![CDATA[ Inorganic materials are generally used as ingredients for alchemical recipes. By themselves, they have no special - functionalities. ]]> + functionality. ]]> </description> <attribute arch="is_dust" editor="is dust" type="bool"></attribute> <section name="resistance"> @@ -2836,7 +2836,7 @@ <attribute arch="ac" editor="armor class" type="int"> A magic wall of high <armor class> is less likely to get hit from an opponent. <armor class> can be considered the - "counterpiece" to <weapon class>. + "counter piece" to <weapon class>. </attribute> </section> <section name="resistance"> @@ -3032,7 +3032,7 @@ make sure that the <experience> is set to a reasonable value. Compare with existing arches to get a feeling what reasonable means. Keep in mind that spellcasting monsters are a lot harder to kill - than non-spellcasters! + than non spell casters! </attribute> <attribute arch="speed" editor="speed" type="float"> The <speed> determines how fast a monster will both move and @@ -3112,7 +3112,7 @@ <attribute arch="wc" editor="weapon class" type="int" min="-128" max="127"> Monsters of high <weapon class> are more likely to really hit their opponent. <weapon class> can be considered the - "counterpiece" to <armor class>. + "counter piece" to <armor class>. </attribute> <attribute arch="hp" editor="health points" type="int" min="0" max="32767"> The <health points> of a monster define how long it takes @@ -3130,7 +3130,7 @@ <attribute arch="ac" editor="armor class" type="int"> Monsters of low <armor class> are less likely to get hit from their opponent. <armor class> can be considered the - "counterpiece" to <weapon class>. Values typically range + "counter piece" to <weapon class>. Values typically range between +20 (very bad) to -20 (quite good). </attribute> <attribute arch="Con" editor="healing rate" type="int" min="0" max="127"> @@ -3296,7 +3296,7 @@ Being <asleep>, a monster won't move unless a player enters the <sensing range> of the monster. Usually the sensing range is larger than the players line of sight. Due to - that, in most cases the player won't ever notice weither a + that, in most cases the player won't ever notice whether a monster was asleep or not. </attribute> <attribute arch="will_apply" editor="misc. actions" type="bitmask_will_apply"> @@ -4466,7 +4466,7 @@ <attribute arch="invisible" value="1" type="fixed"/> <attribute arch="no_drop" value="1" type="fixed"/> <attribute arch="skill" editor="skill name" type="string"> - The <skill name> is used for matchings. When a usable object + The <skill name> is used for matching. When a usable object has an identical <skill name>, players (or monsters) will need this skill to apply/use the object. </attribute> @@ -4886,7 +4886,7 @@ <type number="2" name="Transport"> <description><![CDATA[ A transport is an object that helps the player move. It should not be confused - an EXIT, which instaneously transport a player from one map to another. + an EXIT, which instantaneously transport a player from one map to another. <br><br> Instead, a transport may let the player move faster, give him move types they don't have, etc. A simple example of this would a horse. It doesn't @@ -5025,7 +5025,7 @@ <description><![CDATA[ Trapdoors are very similar to pits. The difference is that they can not be closed. Instead, the weight of the object on the - trapdoor determines weither it slams the trapdoor open and falls through + trapdoor determines whether it slams the trapdoor open and falls through or not.<br> Once a trapdoor has been opened (by a creature or items of sufficient weight,) it remains open, acting like an opened pit. ]]> @@ -5186,7 +5186,7 @@ <attribute arch="move_block" editor="blocked movement" type="bitmask_movement"> If set, the object cannot be passed by players nor monsters. </attribute> - <attribute arch="can_roll" editor="moveable" type="bool"> + <attribute arch="can_roll" editor="movable" type="bool"> If set, the object is able to "roll", so it can be pushed around. This setting is used for boulders and barrels. </attribute> @@ -5209,7 +5209,7 @@ charging, but usually that isn't worth the cost. ]]> </description> <use><![CDATA[ - Wands are quite seldomly used. The reason probably is that they're + Wands are quite rarely used. The reason probably is that they're generally not cost-efficient. Handing out high-level wands with powerful special spells isn't a good idea either, because of the recharge ability. @@ -5301,7 +5301,7 @@ </attribute> <attribute arch="ac" editor="armor class" type="int"> Weak walls of high <armor class> are less likely to get hit. - <armor class> can be considered the "counterpiece" to <weapon + <armor class> can be considered the "counter piece" to <weapon class>. </attribute> <section name="resistance"> Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2010-06-25 21:05:08 UTC (rev 8459) +++ trunk/gridarta.ipr 2010-06-25 21:16:48 UTC (rev 8460) @@ -1125,6 +1125,7 @@ <dictionary name="ank"> <words> <w>accel</w> + <w>adamantite</w> <w>agentlib</w> <w>angelion</w> <w>animname</w> @@ -1141,6 +1142,7 @@ <w>autojoin</w> <w>autojoining</w> <w>backbuffer</w> + <w>balrogs</w> <w>baseobject</w> <w>batchpng</w> <w>beanshell</w> @@ -1172,12 +1174,14 @@ <w>cvsroot</w> <w>daimonin</w> <w>daimonin's</w> + <w>damnations</w> <w>debian</w> <w>dedit</w> <w>derivates</w> <w>dest</w> <w>djava</w> <w>doctype</w> + <w>dragonmen</w> <w>encodings</w> <w>endlore</w> <w>endmsg</w> @@ -1191,6 +1195,7 @@ <w>filenames</w> <w>filter<?, ?></w> <w>finalizer</w> + <w>fireborns</w> <w>fixme</w> <w>focusability</w> <w>formatter</w> @@ -1202,12 +1207,14 @@ <w>getenv</w> <w>glibc</w> <w>gnomovision</w> + <w>godgiven</w> <w>goto</w> <w>gridarta</w> <w>gridarta's</w> <w>gridder</w> <w>gridzilla</w> <w>guildmaster</w> + <w>hitpoints</w> <w>hotkey</w> <w>hprof</w> <w>https</w> @@ -1239,6 +1246,7 @@ <w>mapcontrol</w> <w>matchers</w> <w>megaxslt</w> + <w>mergeable</w> <w>metalforge</w> <w>microsystems</w> <w>missorted</w> @@ -1246,13 +1254,16 @@ <w>monospaced</w> <w>mpart</w> <w>multi</w> + <w>natively</w> <w>nesw</w> <w>nmtoken</w> <w>nodeps</w> <w>nogui</w> <w>nokleberg</w> + <w>nuernberg</w> <w>ohloh</w> <w>online</w> + <w>orcs</w> <w>outfile</w> <w>oversized</w> <w>overstrike</w> @@ -1277,10 +1288,12 @@ <w>resize</w> <w>resized</w> <w>resizes</w> + <w>respawn</w> <w>rethrown</w> <w>revertable</w> <w>revivable</w> <w>riedquat</w> + <w>roleplay</w> <w>rsync</w> <w>scansize</w> <w>screenshot</w> @@ -1301,13 +1314,19 @@ <w>solaris</w> <w>sourceforge</w> <w>spawnpoint</w> + <w>spellbook's</w> + <w>spellcraft</w> + <w>spellpath</w> + <w>spellpaths</w> <w>startup</w> + <w>staves</w> <w>stdtxt</w> <w>stoneglow</w> <w>strncmp</w> <w>sublicense</w> <w>sweeped</w> <w>switchcheck</w> + <w>teleported</w> <w>teleporter</w> <w>teleporters</w> <w>textfield</w> @@ -1330,6 +1349,7 @@ <w>tönnies</w> <w>unapplied</w> <w>unconstructable</w> + <w>uncursed</w> <w>undoable</w> <w>unexperienced</w> <w>unislash</w> @@ -1337,6 +1357,7 @@ <w>unregistering</w> <w>unsets</w> <w>unsynchronized</w> + <w>unwielded</w> <w>validator's</w> <w>validator...</w> <w>variable's</w> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-25 21:30:07
|
Revision: 8462 http://gridarta.svn.sourceforge.net/gridarta/?rev=8462&view=rev Author: akirschbaum Date: 2010-06-25 21:29:58 +0000 (Fri, 25 Jun 2010) Log Message: ----------- Remove raw types. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java trunk/model/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeParser.java trunk/model/src/test/net/sf/gridarta/model/resource/TestFilesResourcesReader.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java trunk/src/app/net/sf/gridarta/gui/utils/AnimationComponent.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -78,7 +78,7 @@ * @param multiPositionData the multi position data to query for multi-part * objects */ - public ArchetypeParser(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final MultiPositionData multiPositionData) { + public ArchetypeParser(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final MultiPositionData multiPositionData) { super(new DefaultArchetypeBuilder(gameObjectFactory), animationObjects, archetypeSet); this.gameObjectParser = gameObjectParser; this.multiPositionData = multiPositionData; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -80,7 +80,7 @@ * The {@link FaceObjects} instance. */ @NotNull - private final FaceObjects faceObjects; + private final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects; /** * Creates a new instance. @@ -90,7 +90,7 @@ * @param faceObjects the face objects instance * @param animationObjects the animation objects instance */ - public CollectedResourcesReader(@NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects) { + public CollectedResourcesReader(@NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { super(collectedDirectory, null, animationObjects, faceObjects); this.collectedDirectory = collectedDirectory; this.archetypeSet = archetypeSet; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -62,7 +62,7 @@ * @param animationObjects the animation objects instance * @param archFaceProvider the arch face provider to use */ - public FilesResourcesReader(@NotNull final File archDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider) { + public FilesResourcesReader(@NotNull final File archDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider) { super(archDirectory, archetypeSet, archetypeParser, archFaceProvider, collectedDirectory, null, animationObjects, faceObjects); this.archDirectory = archDirectory; this.archFaceProvider = archFaceProvider; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -88,7 +88,7 @@ * The face objects to update. */ @NotNull - private final FaceObjects faceObjects; + private final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects; /** * The smooth faces to update. @@ -106,7 +106,7 @@ * @param animationObjects the animation objects instance * @param smoothFaces the smooth faces to update */ - public CollectedResourcesReader(@NotNull final File configurationDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final SmoothFaces smoothFaces) { + public CollectedResourcesReader(@NotNull final File configurationDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final SmoothFaces smoothFaces) { super(collectedDirectory, archetypeSet.getImageSet(), animationObjects, faceObjects); this.configurationDirectory = configurationDirectory; this.collectedDirectory = collectedDirectory; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -47,7 +47,7 @@ * @param animationObjects the animation objects instance * @param archFaceProvider the arch face provider to use */ - public FilesResourcesReader(@NotNull final File archDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider) { + public FilesResourcesReader(@NotNull final File archDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider) { super(archDirectory, archetypeSet, archetypeParser, archFaceProvider, collectedDirectory, archetypeSet.getImageSet(), animationObjects, faceObjects); } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -69,7 +69,7 @@ * @param multiPositionData the multi position data to query for multi-part * objects */ - public ArchetypeParser(@NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final MultiPositionData multiPositionData) { + public ArchetypeParser(@NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final MultiPositionData multiPositionData) { super(new DefaultArchetypeBuilder(gameObjectFactory), animationObjects, archetypeSet); this.multiPositionData = multiPositionData; } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -80,7 +80,7 @@ * The {@link FaceObjects} instance. */ @NotNull - private final FaceObjects faceObjects; + private final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects; /** * Creates a new instance. @@ -90,7 +90,7 @@ * @param faceObjects the face objects instance * @param animationObjects the animation objects instance */ - public CollectedResourcesReader(@NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects) { + public CollectedResourcesReader(@NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { super(collectedDirectory, null, animationObjects, faceObjects); this.collectedDirectory = collectedDirectory; this.archetypeSet = archetypeSet; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -62,7 +62,7 @@ * @param animationObjects the animation objects instance * @param archFaceProvider the arch face provider to use */ - public FilesResourcesReader(@NotNull final File archDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider) { + public FilesResourcesReader(@NotNull final File archDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider) { super(archDirectory, archetypeSet, archetypeParser, archFaceProvider, collectedDirectory, null, animationObjects, faceObjects); this.archDirectory = archDirectory; this.archFaceProvider = archFaceProvider; Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -55,7 +55,7 @@ /** * The animation objects instance. */ - private final AnimationObjects animationObjects; + private final AnimationObjects<G, A, R> animationObjects; /** * The {@link ArchetypeSet} to use. @@ -69,7 +69,7 @@ * @param animationObjects the animation objects instance to use * @param archetypeSet the archetype set */ - protected AbstractArchetypeParser(@NotNull final B archetypeBuilder, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeSet<G, A, R> archetypeSet) { + protected AbstractArchetypeParser(@NotNull final B archetypeBuilder, @NotNull final AnimationObjects<G, A, R> animationObjects, @NotNull final ArchetypeSet<G, A, R> archetypeSet) { this.archetypeBuilder = archetypeBuilder; this.animationObjects = animationObjects; this.archetypeSet = archetypeSet; Modified: trunk/model/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/model/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -65,7 +65,7 @@ * @throws AnimationParseException in case parsing the animation reveals * errors */ - public static void loadAnimations(@NotNull final AnimationObjects animationObjects, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String path, @NotNull final File animFile, @NotNull final String startKey, final boolean ignoreOtherText) throws IOException, AnimationParseException { + public static void loadAnimations(@NotNull final AnimationObjects<?, ?, ?> animationObjects, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String path, @NotNull final File animFile, @NotNull final String startKey, final boolean ignoreOtherText) throws IOException, AnimationParseException { final FileInputStream fileInputStream = new FileInputStream(animFile); try { final Reader inputStreamReader = new InputStreamReader(fileInputStream, IOUtils.MAP_ENCODING); @@ -100,7 +100,7 @@ * errors * @throws IOException in case of I/O errors */ - public static void loadAnimations(@NotNull final AnimationObjects animationObjects, @NotNull final ErrorViewCollector errorViewCollector, final Reader reader, @NotNull final String startKey, final boolean ignoreOtherText, @Nullable final String path, @Nullable final Map<String, String> animations) throws AnimationParseException, IOException { + public static void loadAnimations(@NotNull final AnimationObjects<?, ?, ?> animationObjects, @NotNull final ErrorViewCollector errorViewCollector, final Reader reader, @NotNull final String startKey, final boolean ignoreOtherText, @Nullable final String path, @Nullable final Map<String, String> animations) throws AnimationParseException, IOException { if (path == null && animations == null) { throw new IllegalArgumentException(); } @@ -151,7 +151,7 @@ * errors * @throws IOException in case of I/O errors */ - private static int processAnimation(@NotNull final String animName, final int startLineNumber, @NotNull final BufferedReader in, @NotNull final String startKey, @NotNull final AnimationObjects animationObjects, @NotNull final ErrorViewCollector errorViewCollector, @Nullable final String path, @Nullable final Map<String, String> animations) throws AnimationParseException, IOException { + private static int processAnimation(@NotNull final String animName, final int startLineNumber, @NotNull final BufferedReader in, @NotNull final String startKey, @NotNull final AnimationObjects<?, ?, ?> animationObjects, @NotNull final ErrorViewCollector errorViewCollector, @Nullable final String path, @Nullable final Map<String, String> animations) throws AnimationParseException, IOException { int lineNumber = startLineNumber; final StringBuilder animText = new StringBuilder(); while (true) { @@ -187,7 +187,7 @@ * @param animName the name of this animation * @param animText the contents of the anim..mina block without comments */ - private static void processAnimationLine(@NotNull final AnimationObjects animationObjects, @NotNull final ErrorViewCollector errorViewCollector, @Nullable final String path, @Nullable final Map<String, String> animations, @NotNull final String animName, @NotNull final String animText) { + private static void processAnimationLine(@NotNull final AnimationObjects<?, ?, ?> animationObjects, @NotNull final ErrorViewCollector errorViewCollector, @Nullable final String path, @Nullable final Map<String, String> animations, @NotNull final String animName, @NotNull final String animText) { if (path == null && animations == null) { throw new IllegalArgumentException(); } Modified: trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -84,7 +84,7 @@ * The {@link AnimationObjects} to use. */ @NotNull - private final AnimationObjects animationObjects; + private final AnimationObjects<G, A, R> animationObjects; /** * The {@link ArchFaceProvider} to use. @@ -103,7 +103,7 @@ * @param animationObjects the animation objects instance * @param faceObjects the face objects instance */ - protected AbstractFilesResourcesReader(@NotNull final File archDirectory, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final AbstractArchetypeParser<G, A, R, ?> archetypeParser, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final File collectedDirectory, @Nullable final String imageSet, @NotNull final AnimationObjects animationObjects, @NotNull final FaceObjects faceObjects) { + protected AbstractFilesResourcesReader(@NotNull final File archDirectory, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final AbstractArchetypeParser<G, A, R, ?> archetypeParser, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final File collectedDirectory, @Nullable final String imageSet, @NotNull final AnimationObjects<G, A, R> animationObjects, @NotNull final FaceObjects<G, A, R> faceObjects) { super(collectedDirectory, imageSet, animationObjects, faceObjects); this.archDirectory = archDirectory; this.archetypeSet = archetypeSet; Modified: trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -88,13 +88,13 @@ * The animation objects instance. */ @NotNull - private final AnimationObjects animationObjects; + private final AnimationObjects<G, A, R> animationObjects; /** * The face objects instance. */ @NotNull - private final FaceObjects faceObjects; + private final FaceObjects<G, A, R> faceObjects; /** * Creates a new instance. @@ -103,7 +103,7 @@ * @param animationObjects the animation objects instance * @param faceObjects the face objects instance */ - protected AbstractResourcesReader(@NotNull final File collectedDirectory, @Nullable final String imageSet, @NotNull final AnimationObjects animationObjects, @NotNull final FaceObjects faceObjects) { + protected AbstractResourcesReader(@NotNull final File collectedDirectory, @Nullable final String imageSet, @NotNull final AnimationObjects<G, A, R> animationObjects, @NotNull final FaceObjects<G, A, R> faceObjects) { this.collectedDirectory = collectedDirectory; this.imageSet = imageSet; this.animationObjects = animationObjects; Modified: trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeParser.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeParser.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeParser.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -41,7 +41,7 @@ * @param animationObjects the animation objects instance to use * @param archetypeSet the archetype set */ - public TestArchetypeParser(@NotNull final TestArchetypeBuilder archetypeBuilder, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet) { + public TestArchetypeParser(@NotNull final TestArchetypeBuilder archetypeBuilder, @NotNull final AnimationObjects<TestGameObject, TestMapArchObject, TestArchetype> animationObjects, @NotNull final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet) { super(archetypeBuilder, animationObjects, archetypeSet); } Modified: trunk/model/src/test/net/sf/gridarta/model/resource/TestFilesResourcesReader.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/resource/TestFilesResourcesReader.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/model/src/test/net/sf/gridarta/model/resource/TestFilesResourcesReader.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -48,7 +48,7 @@ * @param animationObjects the animation objects instance * @param faceObjects the face objects instance */ - public TestFilesResourcesReader(@NotNull final File archDirectory, @NotNull final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet, @NotNull final AbstractArchetypeParser<TestGameObject, TestMapArchObject, TestArchetype, ?> archetypeParser, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final File collectedDirectory, @Nullable final String imageSet, @NotNull final AnimationObjects animationObjects, @NotNull final FaceObjects faceObjects) { + public TestFilesResourcesReader(@NotNull final File archDirectory, @NotNull final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet, @NotNull final AbstractArchetypeParser<TestGameObject, TestMapArchObject, TestArchetype, ?> archetypeParser, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final File collectedDirectory, @Nullable final String imageSet, @NotNull final AnimationObjects<TestGameObject, TestMapArchObject, TestArchetype> animationObjects, @NotNull final FaceObjects<TestGameObject, TestMapArchObject, TestArchetype> faceObjects) { super(archDirectory, archetypeSet, archetypeParser, archFaceProvider, collectedDirectory, imageSet, animationObjects, faceObjects); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -215,7 +215,7 @@ * @serial */ @NotNull - private final AnimationObjects animationObjects; + private final AnimationObjects<G, A, R> animationObjects; /** * The {@link GlobalSettings} instance. @@ -240,7 +240,7 @@ * @serial */ @NotNull - private final FaceObjects faceObjects; + private final FaceObjects<G, A, R> faceObjects; /** * The game object spells to use. @@ -824,7 +824,7 @@ * @param textAreaDefaults the text area defaults for text fields * @param mapManager the map manager instance */ - public GameObjectAttributesDialog(@NotNull final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory, final ArchetypeTypeSet archetypeTypeSet, @NotNull final G gameObject, @NotNull final JFrame parent, @NotNull final CFTreasureListTree<G, A, R> treasureListTree, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final GlobalSettings globalSettings, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final FaceObjects faceObjects, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, final int undefinedSpellIndex, @NotNull final TreasureTree treasureTree, @NotNull final ImageIcon noFaceSquareIcon, @NotNull final ImageIcon unknownSquareIcon, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final TextAreaDefaults textAreaDefaults, @NotNull final MapManager<G, A, R> mapManager) { + public GameObjectAttributesDialog(@NotNull final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory, final ArchetypeTypeSet archetypeTypeSet, @NotNull final G gameObject, @NotNull final JFrame parent, @NotNull final CFTreasureListTree<G, A, R> treasureListTree, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<G, A, R> animationObjects, @NotNull final GlobalSettings globalSettings, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final FaceObjects<G, A, R> faceObjects, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, final int undefinedSpellIndex, @NotNull final TreasureTree treasureTree, @NotNull final ImageIcon noFaceSquareIcon, @NotNull final ImageIcon unknownSquareIcon, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final TextAreaDefaults textAreaDefaults, @NotNull final MapManager<G, A, R> mapManager) { this.gameObjectAttributesDialogFactory = gameObjectAttributesDialogFactory; this.archetypeTypeSet = archetypeTypeSet; this.gameObject = gameObject; @@ -962,7 +962,7 @@ * @return Face for the supplied GameObject. */ @NotNull - private ImageIcon getFace(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { + private ImageIcon getFace(@NotNull final BaseObject<G, A, R, ?> gameObject) { return faceObjectProviders.getFace(gameObject); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -87,7 +87,7 @@ * The {@link AnimationObjects} instance for choosing animation names. */ @NotNull - private final AnimationObjects animationObjects; + private final AnimationObjects<G, A, R> animationObjects; /** * The {@link GlobalSettings} instance. @@ -111,7 +111,7 @@ * The {@link FaceObjects} instance for choosing face names. */ @NotNull - private final FaceObjects faceObjects; + private final FaceObjects<G, A, R> faceObjects; /** * The game object spells to use. @@ -188,7 +188,7 @@ * @param gameObjectMatchers the game object matchers to use * @param mapManager the map manager instance */ - public GameObjectAttributesDialogFactory(@NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final JFrame parent, @NotNull final CFTreasureListTree<G, A, R> treasureListTree, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final GlobalSettings globalSettings, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final FaceObjects faceObjects, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, final int undefinedSpellIndex, @NotNull final TreasureTree treasureTree, @NotNull final ImageIcon noFaceSquareIcon, @NotNull final ImageIcon unknownSquareIcon, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final MapManager<G, A, R> mapManager) { + public GameObjectAttributesDialogFactory(@NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final JFrame parent, @NotNull final CFTreasureListTree<G, A, R> treasureListTree, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<G, A, R> animationObjects, @NotNull final GlobalSettings globalSettings, @NotNull final FileFilter mapFileFilter, @NotNull final FileFilter scriptFileFilter, @NotNull final FaceObjects<G, A, R> faceObjects, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, final int undefinedSpellIndex, @NotNull final TreasureTree treasureTree, @NotNull final ImageIcon noFaceSquareIcon, @NotNull final ImageIcon unknownSquareIcon, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final MapManager<G, A, R> mapManager) { this.archetypeTypeSet = archetypeTypeSet; this.parent = parent; this.treasureListTree = treasureListTree; Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -163,7 +163,7 @@ * @param noFaceSquareIcon the image icon for no animations * @param unknownSquareIcon the image icon for undefined animations */ - public FaceTab(@NotNull final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ImageIcon noFaceSquareIcon, @NotNull final ImageIcon unknownSquareIcon) { + public FaceTab(@NotNull final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel, @NotNull final FaceObjects<G, A, R> faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<G, A, R> animationObjects, @NotNull final ImageIcon noFaceSquareIcon, @NotNull final ImageIcon unknownSquareIcon) { super(gameObjectAttributesModel); this.faceObjects = faceObjects; this.animationObjects = animationObjects; Modified: trunk/src/app/net/sf/gridarta/gui/utils/AnimationComponent.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/AnimationComponent.java 2010-06-25 21:17:43 UTC (rev 8461) +++ trunk/src/app/net/sf/gridarta/gui/utils/AnimationComponent.java 2010-06-25 21:29:58 UTC (rev 8462) @@ -66,7 +66,7 @@ * @param noFaceSquareIcon the image icon for no animations * @param unknownSquareIcon the image icon for undefined animations */ - public AnimationComponent(@NotNull final String animationName, @NotNull final AnimationObjects animationObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final ImageIcon noFaceSquareIcon, @NotNull final ImageIcon unknownSquareIcon) { + public AnimationComponent(@NotNull final String animationName, @NotNull final AnimationObjects<?, ?, ?> animationObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final ImageIcon noFaceSquareIcon, @NotNull final ImageIcon unknownSquareIcon) { super(new GridBagLayout()); textField.setText(animationName); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-25 21:34:52
|
Revision: 8463 http://gridarta.svn.sourceforge.net/gridarta/?rev=8463&view=rev Author: akirschbaum Date: 2010-06-25 21:34:46 +0000 (Fri, 25 Jun 2010) Log Message: ----------- Explicitly initialize fields. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeBitmask.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/map/tools/DeletionTool.java trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/HTMLTokenMarker.java Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2010-06-25 21:29:58 UTC (rev 8462) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2010-06-25 21:34:46 UTC (rev 8463) @@ -119,7 +119,7 @@ private final Iterator<G> delegate = contents.iterator(); /** Current element (last element returned by {@link #next()}). */ - private G current; + private G current = null; /** {@inheritDoc} */ @Override Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeBitmask.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeBitmask.java 2010-06-25 21:29:58 UTC (rev 8462) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeBitmask.java 2010-06-25 21:34:46 UTC (rev 8463) @@ -54,7 +54,7 @@ /** * Active bitmask value. */ - private int value; + private int value = 0; /** * Reference to the bitmask data. Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-25 21:29:58 UTC (rev 8462) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-25 21:34:46 UTC (rev 8463) @@ -1537,7 +1537,7 @@ * The latest deselected item. */ @Nullable - private String deselected; + private String deselected = null; /** * While <code>true</code>, this listener ignores all events. Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/DeletionTool.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/DeletionTool.java 2010-06-25 21:29:58 UTC (rev 8462) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/DeletionTool.java 2010-06-25 21:34:46 UTC (rev 8463) @@ -161,17 +161,17 @@ /** * Whether "ignore walls" is enabled. */ - private boolean deletionToolExceptionsIgnoreWalls; + private boolean deletionToolExceptionsIgnoreWalls = false; /** * Whether "ignore floors" is enabled. */ - private boolean deletionToolExceptionsIgnoreFloors; + private boolean deletionToolExceptionsIgnoreFloors = false; /** * Whether "ignore monsters" is enabled. */ - private boolean deletionToolExceptionsIgnoreMonsters; + private boolean deletionToolExceptionsIgnoreMonsters = false; /** * The {@link JComboBox} for selecting the objects to delete. Modified: trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java 2010-06-25 21:29:58 UTC (rev 8462) +++ trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java 2010-06-25 21:34:46 UTC (rev 8463) @@ -120,7 +120,7 @@ // popup frame for new scripts: @Nullable - private JDialog newScriptFrame; + private JDialog newScriptFrame = null; @NotNull private JLabel headingLabel; Modified: trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java 2010-06-25 21:29:58 UTC (rev 8462) +++ trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java 2010-06-25 21:34:46 UTC (rev 8463) @@ -144,55 +144,55 @@ * NorthWest Component. * @serial include */ - private Component cNW; + private Component cNW = null; /** * North Component. * @serial include */ - private Component cN; + private Component cN = null; /** * NorthEast Component. * @serial include */ - private Component cNE; + private Component cNE = null; /** * East Component. * @serial include */ - private Component cE; + private Component cE = null; /** * SouthEast Component. * @serial include */ - private Component cSE; + private Component cSE = null; /** * South Component. * @serial include */ - private Component cS; + private Component cS = null; /** * SouthWest Component. * @serial include */ - private Component cSW; + private Component cSW = null; /** * West Component. * @serial include */ - private Component cW; + private Component cW = null; /** * Center Component. * @serial include */ - private Component cC; + private Component cC = null; /** * Creates a DirectionLayout with zero gaps. Modified: trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java =================================================================== --- trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java 2010-06-25 21:29:58 UTC (rev 8462) +++ trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java 2010-06-25 21:34:46 UTC (rev 8463) @@ -40,11 +40,11 @@ private static final Category log = Logger.getLogger(InputHandler.class); @Nullable - protected ActionListener grabAction; + protected ActionListener grabAction = null; - private boolean repeat; + private boolean repeat = false; - protected int repeatCount; + protected int repeatCount = 0; /** * Adds the default key bindings to this input handler. This should not be Modified: trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/HTMLTokenMarker.java =================================================================== --- trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/HTMLTokenMarker.java 2010-06-25 21:29:58 UTC (rev 8462) +++ trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/HTMLTokenMarker.java 2010-06-25 21:34:46 UTC (rev 8463) @@ -26,9 +26,9 @@ private final boolean js; - private int lastOffset; + private int lastOffset = 0; - private int lastKeyword; + private int lastKeyword = 0; public HTMLTokenMarker() { this(true); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-25 21:38:53
|
Revision: 8464 http://gridarta.svn.sourceforge.net/gridarta/?rev=8464&view=rev Author: akirschbaum Date: 2010-06-25 21:38:46 +0000 (Fri, 25 Jun 2010) Log Message: ----------- Add nullable annotations. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2010-06-25 21:34:46 UTC (rev 8463) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2010-06-25 21:38:46 UTC (rev 8464) @@ -116,9 +116,11 @@ return new Iterator<G>() { /** The basic iterator. */ + @NotNull private final Iterator<G> delegate = contents.iterator(); /** Current element (last element returned by {@link #next()}). */ + @Nullable private G current = null; /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java 2010-06-25 21:34:46 UTC (rev 8463) +++ trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java 2010-06-25 21:38:46 UTC (rev 8464) @@ -26,6 +26,7 @@ import java.awt.LayoutManager2; import java.io.Serializable; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * This class implements a layout that is similar to {@link @@ -50,6 +51,7 @@ * static itself, so referencing this from an enum constructor would be * illegal if this were declared inside the enum. */ + @NotNull private static final Direction[] daimoninToDirectionMap = new Direction[8]; //private static Map<Integer,Direction> daimoninToDirectionMap = new HashMap<Integer,Direction>(); @@ -144,54 +146,63 @@ * NorthWest Component. * @serial include */ + @Nullable private Component cNW = null; /** * North Component. * @serial include */ + @Nullable private Component cN = null; /** * NorthEast Component. * @serial include */ + @Nullable private Component cNE = null; /** * East Component. * @serial include */ + @Nullable private Component cE = null; /** * SouthEast Component. * @serial include */ + @Nullable private Component cSE = null; /** * South Component. * @serial include */ + @Nullable private Component cS = null; /** * SouthWest Component. * @serial include */ + @Nullable private Component cSW = null; /** * West Component. * @serial include */ + @Nullable private Component cW = null; /** * Center Component. * @serial include */ + @Nullable private Component cC = null; /** @@ -248,7 +259,7 @@ */ @SuppressWarnings({ "ChainOfInstanceofChecks" }) @Override - public void addLayoutComponent(final Component comp, final Object constraints) { + public void addLayoutComponent(@NotNull final Component comp, @Nullable final Object constraints) { if (constraints == null) { cC = comp; return; @@ -301,7 +312,7 @@ * {@inheritDoc} */ @Override - public void addLayoutComponent(final String name, final Component comp) { + public void addLayoutComponent(@NotNull final String name, @NotNull final Component comp) { throw new IllegalArgumentException("DirectionLayout does not support String constraints."); } @@ -310,7 +321,7 @@ */ @Override @SuppressWarnings({ "ObjectEquality", "AssignmentToNull" }) - public void removeLayoutComponent(final Component comp) { + public void removeLayoutComponent(@NotNull final Component comp) { synchronized (comp.getTreeLock()) { if (cC == comp) { cC = null; @@ -337,8 +348,9 @@ /** * {@inheritDoc} */ + @NotNull @Override - public Dimension minimumLayoutSize(final Container parent) { + public Dimension minimumLayoutSize(@NotNull final Container parent) { synchronized (parent.getTreeLock()) { final Dimension dim = new Dimension(0, 0); // return dimension final Dimension empty = new Dimension(0, 0); // fallback if null component @@ -363,6 +375,7 @@ /** * {@inheritDoc} */ + @NotNull @Override public Dimension preferredLayoutSize(final Container parent) { synchronized (parent.getTreeLock()) { @@ -389,8 +402,9 @@ /** * {@inheritDoc} */ + @NotNull @Override - public Dimension maximumLayoutSize(final Container target) { + public Dimension maximumLayoutSize(@NotNull final Container target) { return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE); } @@ -398,7 +412,7 @@ * {@inheritDoc} */ @Override - public float getLayoutAlignmentX(final Container target) { + public float getLayoutAlignmentX(@NotNull final Container target) { return 0.5f; } @@ -406,7 +420,7 @@ * {@inheritDoc} */ @Override - public float getLayoutAlignmentY(final Container target) { + public float getLayoutAlignmentY(@NotNull final Container target) { return 0.5f; } @@ -414,7 +428,7 @@ * {@inheritDoc} */ @Override - public void invalidateLayout(final Container target) { + public void invalidateLayout(@NotNull final Container target) { /* Do Nothing, like BorderLayout. */ } @@ -422,7 +436,7 @@ * {@inheritDoc} */ @Override - public void layoutContainer(final Container parent) { + public void layoutContainer(@NotNull final Container parent) { synchronized (parent.getTreeLock()) { final Dimension size = parent.getSize(); final Insets padding = parent.getInsets(); @@ -494,6 +508,7 @@ /** * {@inheritDoc} */ + @NotNull @Override public String toString() { return getClass().getName() + "[hGap=" + hGap + ",vGap=" + vGap + ']'; @@ -507,7 +522,7 @@ * @return maximum of numbers, which is {@link Integer#MIN_VALUE} in case no * number was supplied. */ - private static int max(final int... numbers) { + private static int max(@NotNull final int... numbers) { int ret = Integer.MIN_VALUE; for (final int number : numbers) { if (number > ret) { @@ -522,6 +537,7 @@ * @param daimoninDirection direction from Daimonin * @return Direction enum for <var>daimoninDirection</var> */ + @NotNull private static Direction getDirectionFromDaimonin(final int daimoninDirection) { return daimoninToDirectionMap[daimoninDirection]; //return daimoninToDirectionMap.get(daimoninDirection); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-26 06:15:55
|
Revision: 8472 http://gridarta.svn.sourceforge.net/gridarta/?rev=8472&view=rev Author: akirschbaum Date: 2010-06-26 06:15:48 +0000 (Sat, 26 Jun 2010) Log Message: ----------- Replace boolean flag with control flow. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/MapArchObjectParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/MapArchObjectParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/MapArchObjectParser.java trunk/model/src/app/net/sf/gridarta/model/io/AbstractMapArchObjectParser.java trunk/model/src/test/net/sf/gridarta/model/io/TestMapArchObjectParser.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/MapArchObjectParser.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/MapArchObjectParser.java 2010-06-26 06:09:21 UTC (rev 8471) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/MapArchObjectParser.java 2010-06-26 06:15:48 UTC (rev 8472) @@ -19,6 +19,7 @@ package net.sf.gridarta.var.atrinik.model.io; +import java.io.BufferedReader; import java.io.IOException; import java.util.Formatter; import net.sf.gridarta.model.direction.Direction; @@ -129,7 +130,7 @@ * {@inheritDoc} */ @Override - protected boolean parseLine(@NotNull final String line, @NotNull final MapArchObject mapArchObject) { + protected boolean parseLine(@NotNull final String line, @NotNull final MapArchObject mapArchObject, @NotNull final BufferedReader reader) { if (line.startsWith("no_save ")) { mapArchObject.setNoSave(NumberUtils.parseInt(line.substring(8)) != 0); return true; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/MapArchObjectParser.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/MapArchObjectParser.java 2010-06-26 06:09:21 UTC (rev 8471) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/MapArchObjectParser.java 2010-06-26 06:15:48 UTC (rev 8472) @@ -36,16 +36,10 @@ public class MapArchObjectParser extends AbstractMapArchObjectParser<MapArchObject> { /** - * Set to <code>true</code> while parsing a map lore section. - */ - private boolean loreflag = false; - - /** * {@inheritDoc} */ @Override public void load(@NotNull final BufferedReader reader, @NotNull final MapArchObject mapArchObject) throws IOException { - loreflag = false; super.load(reader, mapArchObject); } @@ -152,20 +146,7 @@ * {@inheritDoc} */ @Override - protected boolean parseLine(@NotNull final String line, @NotNull final MapArchObject mapArchObject) { - if (loreflag) { - // reading lore text: - if (line.equals("endmaplore")) { - loreflag = false; - } else { - if (mapArchObject.getLore().length() > 0) { - mapArchObject.addLore("\n"); - } - mapArchObject.addLore(line); - } - return true; - } - + protected boolean parseLine(@NotNull final String line, @NotNull final MapArchObject mapArchObject, @NotNull final BufferedReader reader) throws IOException { if (line.startsWith("region ")) { mapArchObject.setRegion(line.substring(7)); return true; @@ -242,7 +223,22 @@ } if (line.equals("maplore")) { - loreflag = true; + while (true) { + final String loreLine = reader.readLine(); + if (loreLine == null) { + throw new IOException("unexpected end of file in maplore..endmaplore field"); + } + + if (loreLine.equals("endmaplore")) { + break; + } + + if (mapArchObject.getLore().length() > 0) { + mapArchObject.addLore("\n"); + } + mapArchObject.addLore(loreLine); + } + return true; } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/MapArchObjectParser.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/MapArchObjectParser.java 2010-06-26 06:09:21 UTC (rev 8471) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/MapArchObjectParser.java 2010-06-26 06:15:48 UTC (rev 8472) @@ -19,6 +19,7 @@ package net.sf.gridarta.var.daimonin.model.io; +import java.io.BufferedReader; import java.io.IOException; import java.util.Formatter; import net.sf.gridarta.model.direction.Direction; @@ -126,7 +127,7 @@ * {@inheritDoc} */ @Override - protected boolean parseLine(@NotNull final String line, @NotNull final MapArchObject mapArchObject) { + protected boolean parseLine(@NotNull final String line, @NotNull final MapArchObject mapArchObject, @NotNull final BufferedReader reader) { if (line.startsWith("no_save ")) { mapArchObject.setNoSave(NumberUtils.parseInt(line.substring(8)) != 0); return true; Modified: trunk/model/src/app/net/sf/gridarta/model/io/AbstractMapArchObjectParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/io/AbstractMapArchObjectParser.java 2010-06-26 06:09:21 UTC (rev 8471) +++ trunk/model/src/app/net/sf/gridarta/model/io/AbstractMapArchObjectParser.java 2010-06-26 06:15:48 UTC (rev 8472) @@ -31,8 +31,8 @@ /** * Abstract base class for classes implementing {@link MapArchObjectParser}s. * This class contains the common code for reading map arch objects. Subclasses - * can extend the parser ({@link #parseLine(String, MapArchObject)}. No support - * for writing is present. + * can extend the parser ({@link #parseLine(String, MapArchObject, + * BufferedReader)}. No support for writing is present. * @author Andreas Kirschbaum */ public abstract class AbstractMapArchObjectParser<A extends MapArchObject<A>> implements MapArchObjectParser<A> { @@ -63,7 +63,7 @@ final String trimmedLine = StringUtils.removeTrailingWhitespace(line); - if (parseLine(trimmedLine, mapArchObject)) { + if (parseLine(trimmedLine, mapArchObject, reader)) { // ignore } else if (trimmedLine.equals("msg")) { while (true) { @@ -136,8 +136,10 @@ * Parse a line for this editor type. * @param line The line to parse. * @param mapArchObject The map arch object to update. + * @param reader the reader for reading additional lines * @return Whether the line has been consumed. + * @throws IOException if an I/O error occurs */ - protected abstract boolean parseLine(@NotNull final String line, @NotNull final A mapArchObject); + protected abstract boolean parseLine(@NotNull final String line, @NotNull final A mapArchObject, @NotNull final BufferedReader reader) throws IOException; } // class AbstractMapArchObjectParser Modified: trunk/model/src/test/net/sf/gridarta/model/io/TestMapArchObjectParser.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/io/TestMapArchObjectParser.java 2010-06-26 06:09:21 UTC (rev 8471) +++ trunk/model/src/test/net/sf/gridarta/model/io/TestMapArchObjectParser.java 2010-06-26 06:15:48 UTC (rev 8472) @@ -19,6 +19,7 @@ package net.sf.gridarta.model.io; +import java.io.BufferedReader; import java.io.IOException; import java.util.Formatter; import net.sf.gridarta.model.direction.Direction; @@ -35,7 +36,7 @@ * {@inheritDoc} */ @Override - protected boolean parseLine(@NotNull final String line, @NotNull final TestMapArchObject mapArchObject) { + protected boolean parseLine(@NotNull final String line, @NotNull final TestMapArchObject mapArchObject, @NotNull final BufferedReader reader) { return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-26 06:32:01
|
Revision: 8474 http://gridarta.svn.sourceforge.net/gridarta/?rev=8474&view=rev Author: akirschbaum Date: 2010-06-26 06:31:53 +0000 (Sat, 26 Jun 2010) Log Message: ----------- Suppress warnings. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxModel.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderPanel.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java trunk/utils/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java Modified: trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java 2010-06-26 06:17:32 UTC (rev 8473) +++ trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java 2010-06-26 06:31:53 UTC (rev 8474) @@ -793,6 +793,7 @@ * @param newMapView the new map view * @param direction the direction to scroll * @return the new view position + * @noinspection TypeMayBeWeakened */ @NotNull private Point calculateNewViewPosition(@NotNull final JScrollPane oldMapView, @NotNull final JScrollPane newMapView, @NotNull final Direction direction) { Modified: trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxModel.java 2010-06-26 06:17:32 UTC (rev 8473) +++ trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxModel.java 2010-06-26 06:31:53 UTC (rev 8474) @@ -107,6 +107,9 @@ // "abc" -> "abcd" } + /** + * @noinspection TypeMayBeWeakened + */ @NotNull public Archetype<G, A, R> getNearestMatch(@NotNull final String name) { int pos = Arrays.binarySearch(archList, name, new Comparator<Object>() { Modified: trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderPanel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderPanel.java 2010-06-26 06:17:32 UTC (rev 8473) +++ trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderPanel.java 2010-06-26 06:31:53 UTC (rev 8474) @@ -78,6 +78,7 @@ * @param component the component * @param size the size of the component; width or height, depending on * <code>location</code> + * @noinspection TypeMayBeWeakened */ public void setComponent(@NotNull final Location location, @NotNull final Component component, final int size) { splitPanes[location.ordinal()].setOptionalComponent(component, size); @@ -86,6 +87,7 @@ /** * Unsets the optional {@link Component} for a location. * @param location the location + * @noinspection TypeMayBeWeakened */ public void unsetComponent(@NotNull final Location location) { splitPanes[location.ordinal()].setOptionalComponent(null, 0); Modified: trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java 2010-06-26 06:17:32 UTC (rev 8473) +++ trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java 2010-06-26 06:31:53 UTC (rev 8474) @@ -160,6 +160,7 @@ * view. * @param location the location * @return the tab or <code>null</code> if no active tab exists + * @noinspection TypeMayBeWeakened */ @Nullable public Tab getActiveTab(@NotNull final Location location) { Modified: trunk/utils/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java =================================================================== --- trunk/utils/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java 2010-06-26 06:17:32 UTC (rev 8473) +++ trunk/utils/src/app/net/sf/gridarta/utils/ActionBuilderUtils.java 2010-06-26 06:31:53 UTC (rev 8474) @@ -98,6 +98,7 @@ * @param actionBuilder the action builder to query * @param key the resource key * @return the label + * @noinspection TypeMayBeWeakened */ @NotNull public static JLabel newLabel(@NotNull final ActionBuilder actionBuilder, @NotNull final String key) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-26 07:05:39
|
Revision: 8481 http://gridarta.svn.sourceforge.net/gridarta/?rev=8481&view=rev Author: akirschbaum Date: 2010-06-26 07:05:33 +0000 (Sat, 26 Jun 2010) Log Message: ----------- Suppress warnings. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/configsource/DefaultConfigSourceFactory.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java Modified: trunk/model/src/app/net/sf/gridarta/model/configsource/DefaultConfigSourceFactory.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/configsource/DefaultConfigSourceFactory.java 2010-06-26 07:03:26 UTC (rev 8480) +++ trunk/model/src/app/net/sf/gridarta/model/configsource/DefaultConfigSourceFactory.java 2010-06-26 07:05:33 UTC (rev 8481) @@ -62,6 +62,7 @@ try { configSourceClass = Class.forName(configSourceClassName); } catch (final ClassNotFoundException ex) { + //noinspection ThrowInsideCatchBlockWhichIgnoresCaughtException throw new MissingResourceException("Class does not exist: " + configSourceClassName + ": " + ex.getMessage(), "net.sf.gridarta", CONFIG_SOURCES_KEY); } @@ -69,6 +70,7 @@ try { configSourceClass2 = configSourceClass.asSubclass(ConfigSource.class); } catch (final ClassCastException ex) { + //noinspection ThrowInsideCatchBlockWhichIgnoresCaughtException throw new MissingResourceException("Class does not implement ConfigSource: " + configSourceClassName + ": " + ex.getMessage(), "net.sf.gridarta", CONFIG_SOURCES_KEY); } @@ -76,8 +78,10 @@ try { configSource = configSourceClass2.newInstance(); } catch (final InstantiationException ex) { + //noinspection ThrowInsideCatchBlockWhichIgnoresCaughtException throw new MissingResourceException("Class cannot be instantiated: " + configSourceClassName + ": " + ex.getMessage(), "net.sf.gridarta", CONFIG_SOURCES_KEY); } catch (final IllegalAccessException ex) { + //noinspection ThrowInsideCatchBlockWhichIgnoresCaughtException throw new MissingResourceException("Class cannot be instantiated: " + configSourceClassName + ": " + ex.getMessage(), "net.sf.gridarta", CONFIG_SOURCES_KEY); } Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-06-26 07:03:26 UTC (rev 8480) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-06-26 07:05:33 UTC (rev 8481) @@ -179,6 +179,7 @@ xmlHelper = new XmlHelper(); } catch (final ParserConfigurationException ex) { log.fatal("Cannot create XML parser: " + ex.getMessage()); + //noinspection ThrowInsideCatchBlockWhichIgnoresCaughtException throw new MissingResourceException("Cannot create XML parser: " + ex.getMessage(), null, null); } try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-26 07:26:18
|
Revision: 8487 http://gridarta.svn.sourceforge.net/gridarta/?rev=8487&view=rev Author: akirschbaum Date: 2010-06-26 07:26:12 +0000 (Sat, 26 Jun 2010) Log Message: ----------- Rename variable names. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetype/AttributeListUtils.java trunk/model/src/app/net/sf/gridarta/model/spells/Spells.java trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditUndoActions.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/DefaultInputHandler.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/AttributeListUtils.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/AttributeListUtils.java 2010-06-26 07:21:20 UTC (rev 8486) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/AttributeListUtils.java 2010-06-26 07:26:12 UTC (rev 8487) @@ -103,7 +103,7 @@ if (line.length() > 0 && (test == null || c == '\n')) { result.append(line).append('\n'); } - } catch (final StringIndexOutOfBoundsException e) { + } catch (final StringIndexOutOfBoundsException ignored) { // ignore } } Modified: trunk/model/src/app/net/sf/gridarta/model/spells/Spells.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/spells/Spells.java 2010-06-26 07:21:20 UTC (rev 8486) +++ trunk/model/src/app/net/sf/gridarta/model/spells/Spells.java 2010-06-26 07:26:12 UTC (rev 8487) @@ -92,7 +92,7 @@ public S getSpell(final int index) { try { return spells.get(index); - } catch (final IndexOutOfBoundsException ex) { + } catch (final IndexOutOfBoundsException ignored) { return spells.get(0); } } Modified: trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java =================================================================== --- trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java 2010-06-26 07:21:20 UTC (rev 8486) +++ trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java 2010-06-26 07:26:12 UTC (rev 8487) @@ -287,13 +287,13 @@ final File file; try { file = mapPathNormalizer.normalizeMapPath(mapModel, path); - } catch (final InvalidPathException ex) { + } catch (final InvalidPathException ignored) { return null; - } catch (final IOErrorException ex) { + } catch (final IOErrorException ignored) { return null; - } catch (final RelativePathOnUnsavedMapException ex) { + } catch (final RelativePathOnUnsavedMapException ignored) { return null; - } catch (final SameMapException ex) { + } catch (final SameMapException ignored) { return null; } return mapManager.openMapFile(file, false); Modified: trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditUndoActions.java =================================================================== --- trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditUndoActions.java 2010-06-26 07:21:20 UTC (rev 8486) +++ trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditUndoActions.java 2010-06-26 07:26:12 UTC (rev 8487) @@ -123,7 +123,7 @@ undoManager.undo(); refresh(); } - } catch (final CannotUndoException ex) { + } catch (final CannotUndoException ignored) { // ignore } } Modified: trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/DefaultInputHandler.java =================================================================== --- trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/DefaultInputHandler.java 2010-06-26 07:21:20 UTC (rev 8486) +++ trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/DefaultInputHandler.java 2010-06-26 07:26:12 UTC (rev 8487) @@ -260,10 +260,10 @@ try { ch = KeyEvent.class.getField("VK_" + key).getInt(null); - } catch (final IllegalAccessException e) { + } catch (final IllegalAccessException ignored) { log.error("Invalid key stroke: " + keyStroke); return null; - } catch (final NoSuchFieldException e) { + } catch (final NoSuchFieldException ignored) { log.error("Invalid key stroke: " + keyStroke); return null; } Modified: trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java =================================================================== --- trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2010-06-26 07:21:20 UTC (rev 8486) +++ trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2010-06-26 07:26:12 UTC (rev 8487) @@ -259,13 +259,13 @@ // System.err.println("freeTabKeyFromFocusTraversal() succeeded!"); } } - } catch (final ClassNotFoundException e) { + } catch (final ClassNotFoundException ignored) { // ignore - } catch (final IllegalAccessException e) { + } catch (final IllegalAccessException ignored) { // ignore - } catch (final InvocationTargetException e) { + } catch (final InvocationTargetException ignored) { // ignore - } catch (final NoSuchFieldException e) { + } catch (final NoSuchFieldException ignored) { // ignore } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-27 18:14:59
|
Revision: 8522 http://gridarta.svn.sourceforge.net/gridarta/?rev=8522&view=rev Author: akirschbaum Date: 2010-06-27 18:14:53 +0000 (Sun, 27 Jun 2010) Log Message: ----------- Include details in error messages of "Tile path invalid" map validator. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/map/validation/errors/TilePathsError.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/validation/checks/TilePathsChecker.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-27 17:20:01 UTC (rev 8521) +++ trunk/atrinik/ChangeLog 2010-06-27 18:14:53 UTC (rev 8522) @@ -1,3 +1,8 @@ +2010-06-27 Andreas Kirschbaum + + * Include details in error messages of "Tile path invalid" map + validator. + 2010-06-25 Andreas Kirschbaum * Implement #3018432 (Display archetype titles): Include "title" Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-27 17:20:01 UTC (rev 8521) +++ trunk/crossfire/ChangeLog 2010-06-27 18:14:53 UTC (rev 8522) @@ -1,3 +1,8 @@ +2010-06-27 Andreas Kirschbaum + + * Include details in error messages of "Tile path invalid" map + validator. + 2010-06-25 Andreas Kirschbaum * Implement #3018414 (Improved archetype list). Now monster Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-27 17:20:01 UTC (rev 8521) +++ trunk/daimonin/ChangeLog 2010-06-27 18:14:53 UTC (rev 8522) @@ -1,3 +1,8 @@ +2010-06-27 Andreas Kirschbaum + + * Include details in error messages of "Tile path invalid" map + validator. + 2010-06-25 Andreas Kirschbaum * Implement #3018432 (Display archetype titles): Include "title" Modified: trunk/model/src/app/net/sf/gridarta/model/map/validation/errors/TilePathsError.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/map/validation/errors/TilePathsError.java 2010-06-27 17:20:01 UTC (rev 8521) +++ trunk/model/src/app/net/sf/gridarta/model/map/validation/errors/TilePathsError.java 2010-06-27 18:14:53 UTC (rev 8522) @@ -20,6 +20,7 @@ package net.sf.gridarta.model.map.validation.errors; import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.direction.Direction; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.model.map.mapmodel.MapModel; @@ -37,6 +38,12 @@ private static final long serialVersionUID = 1L; /** + * The direction on which the error occurred. + */ + @NotNull + private final Direction direction; + + /** * The tile path that was wrong. */ @NotNull @@ -45,20 +52,30 @@ /** * Create a MapValidationError. * @param mapModel the map on which the error occurred + * @param direction the direction on which the error occurred * @param tilePath tile path which was wrong */ - public TilePathsError(@NotNull final MapModel<G, A, R> mapModel, @NotNull final String tilePath) { + public TilePathsError(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Direction direction, @NotNull final String tilePath) { super(mapModel); + this.direction = direction; this.tilePath = tilePath; } /** - * Returns the tile path that was wrong. - * @return the tile path that was wrong. + * {@inheritDoc} */ - @NotNull - public String getTilePath() { - return tilePath; + @Override + public String getParameter(final int id) { + switch (id) { + case 0: + return direction.toString(); + + case 1: + return tilePath; + + default: + return super.getParameter(id); + } } } // class TilePathsError Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2010-06-27 17:20:01 UTC (rev 8521) +++ trunk/src/app/net/sf/gridarta/messages.properties 2010-06-27 18:14:53 UTC (rev 8522) @@ -1369,7 +1369,7 @@ Validator.TilePaths.default=true Validator.TilePaths.title=Tile path invalid -Validator.TilePaths.msg=<html><h3>{0}</h3><p>This map has invalid tile paths.<br>Go to the map properties dialog and change the map tile paths. +Validator.TilePaths.msg=<html><h3>{0}</h3><p>The tile path ''{5}'' in direction ''{4}'' is invalid.<br>Go to the map properties dialog and change the map tile paths. Validator.UndefinedAnim.title=Undefined animation Validator.UndefinedAnim.msg=<html><h3>{0}</h3><p>The animation "{4}" does not exist.</p><p>Sie could:</p><ul><li>Change the animation attribute</li></ul> Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2010-06-27 17:20:01 UTC (rev 8521) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2010-06-27 18:14:53 UTC (rev 8522) @@ -1166,7 +1166,7 @@ Validator.SysObjectNotOnLayerZero.msg=<html><h3>{0}</h3><p>Dieses Objekt ist ein System-Objekt.<br>System-Objekte sollten immer in Ebene Null liegen,<br>aber dieses Objekt ist in einer anderen Ebene.</p><p>Sie k\xF6nnen:</p><ul><li>Dieses Problem ignorieren</li><li>Die Ebene des System-Objekt auf Null setzen</li></ul> Validator.TilePaths.title=\xDCng\xFCltiger Kartenverbindungspfad -Validator.TilePaths.msg=<html><h3>{0}</h3><p>Diese Karte besitzt einen ung\xFCltigen Kartenverbindungspfad.<br>\xC4ndern Sie den Kartenverbindungspfad in den Karteneigenschaften. +Validator.TilePaths.msg=<html><h3>{0}</h3><p>Diese Karte besitzt einen ung\xFCltigen Kartenverbindungspfad ''{5}'' in Richtung ''{4}''.<br>\xC4ndern Sie den Kartenverbindungspfad in den Karteneigenschaften. Validator.UndefinedAnim.title=Ung\xFCltige Animation Validator.UndefinedAnim.msg=<html><h3>{0}</h3><p>Die Animation "{4}" existiert nicht.</p><p>Sie k\xF6nnen:</p><ul><li>Das Attribut "animation" \xE4ndern</li></ul> Modified: trunk/src/app/net/sf/gridarta/validation/checks/TilePathsChecker.java =================================================================== --- trunk/src/app/net/sf/gridarta/validation/checks/TilePathsChecker.java 2010-06-27 17:20:01 UTC (rev 8521) +++ trunk/src/app/net/sf/gridarta/validation/checks/TilePathsChecker.java 2010-06-27 18:14:53 UTC (rev 8522) @@ -84,7 +84,7 @@ newFile = mapDir == null ? null : new File(mapDir, path); } if (newFile != null && (!newFile.exists() || newFile.isDirectory())) { - errorCollector.collect(new TilePathsError<G, A, R>(mapModel, path)); + errorCollector.collect(new TilePathsError<G, A, R>(mapModel, directions[direction], path)); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |