From: <aki...@us...> - 2010-06-03 23:08:42
|
Revision: 8089 http://gridarta.svn.sourceforge.net/gridarta/?rev=8089&view=rev Author: akirschbaum Date: 2010-06-03 23:08:35 +0000 (Thu, 03 Jun 2010) Log Message: ----------- Fix 'mpart_id' rather 'mpart_nr' in error message. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-06-03 23:00:42 UTC (rev 8088) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-06-03 23:08:35 UTC (rev 8089) @@ -143,4 +143,4 @@ ####################### # Various Log Messages -logDefArchWithInvalidMpartNr=Arch part {0} has mpart_nr {2}, but head part {1} has mpart_nr {3} +logDefArchWithInvalidMpartId=Arch part {0} has mpart_id {2}, but head part {1} has mpart_id {3} 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-03 23:00:42 UTC (rev 8088) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java 2010-06-03 23:08:35 UTC (rev 8089) @@ -134,7 +134,7 @@ // set or check mpart_id archetype.setMultiShapeID(multiShapeID); if (firstArch != null && multiShapeID != firstArch.getMultiShapeID()) { - errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, ACTION_BUILDER.format("logDefArchWithInvalidMpartNr", archetype.getArchetypeName(), firstArch.getArchetypeName(), Integer.toString(multiShapeID), Integer.toString(firstArch.getMultiShapeID()))); + errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, ACTION_BUILDER.format("logDefArchWithInvalidMpartId", archetype.getArchetypeName(), firstArch.getArchetypeName(), Integer.toString(multiShapeID), Integer.toString(firstArch.getMultiShapeID()))); } } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-06-03 23:00:42 UTC (rev 8088) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-06-03 23:08:35 UTC (rev 8089) @@ -141,4 +141,4 @@ ####################### # Various Log Messages -logDefArchWithInvalidMpartNr=Arch part {0} has mpart_nr {2}, but head part {1} has mpart_nr {3} +logDefArchWithInvalidMpartId=Arch part {0} has mpart_id {2}, but head part {1} has mpart_id {3} 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-03 23:00:42 UTC (rev 8088) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java 2010-06-03 23:08:35 UTC (rev 8089) @@ -133,7 +133,7 @@ // set or check mpart_id archetype.setMultiShapeID(multiShapeID); if (firstArch != null && multiShapeID != firstArch.getMultiShapeID()) { - errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, ACTION_BUILDER.format("logDefArchWithInvalidMpartNr", archetype.getArchetypeName(), firstArch.getArchetypeName(), Integer.toString(multiShapeID), Integer.toString(firstArch.getMultiShapeID()))); + errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, ACTION_BUILDER.format("logDefArchWithInvalidMpartId", archetype.getArchetypeName(), firstArch.getArchetypeName(), Integer.toString(multiShapeID), Integer.toString(firstArch.getMultiShapeID()))); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-04 19:07:55
|
Revision: 8090 http://gridarta.svn.sourceforge.net/gridarta/?rev=8090&view=rev Author: akirschbaum Date: 2010-06-04 19:07:47 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Implement #1714800 (Predefined locations / bookmarks) as Bookmarks menu. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties trunk/daimonin/ChangeLog trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties trunk/src/app/net/sf/gridarta/action.properties trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/mapmenu/RecentMapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/utils/MenuUtils.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.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 Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/bookmarks/ trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.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/mapmenu/AbstractMapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/mapmenu/BookmarksMapMenuPreferences.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/atrinik/ChangeLog 2010-06-04 19:07:47 UTC (rev 8090) @@ -1,3 +1,13 @@ +2010-06-04 Andreas Kirschbaum + + * Implement #1714800 (Predefined locations / bookmarks) as + Bookmarks menu. + + Add Bookmark adds a new bookmark for the current map. + + Manage Bookmarks opens a dialog for managing existing bookmarks: + change bookmark title, reorder bookmarks, remove bookmark. + 2010-06-03 Andreas Kirschbaum * Make "Move Env" to always insert into the selected map square. Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties 2010-06-04 19:07:47 UTC (rev 8090) @@ -24,7 +24,7 @@ ######## # Menus -main.menubar=file edit map archetypes pickmaps resources tools analyze view plugins window help +main.menubar=file edit map archetypes pickmaps resources tools analyze view bookmarks plugins window help file.menu=newMap openFile recent closeMap - saveMap saveMapAs closeAllMaps revertMap createImage - options shortcuts - exit edit.menu=undo redo - clear cut copy paste pasteTiled - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects - gameObjectTextEditor Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/crossfire/ChangeLog 2010-06-04 19:07:47 UTC (rev 8090) @@ -1,5 +1,13 @@ 2010-06-04 Andreas Kirschbaum + * Implement #1714800 (Predefined locations / bookmarks) as + Bookmarks menu. + + Add Bookmark adds a new bookmark for the current map. + + Manage Bookmarks opens a dialog for managing existing bookmarks: + change bookmark title, reorder bookmarks, remove bookmark. + * Properly retain "elevation" game object attributes when editing maps. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties 2010-06-04 19:07:47 UTC (rev 8090) @@ -24,7 +24,7 @@ ######## # Menus -main.menubar=file edit map archetypes pickmaps resources tools analyze view plugins window help +main.menubar=file edit map archetypes pickmaps resources tools analyze view bookmarks plugins window help file.menu=newMap openFile recent closeMap - saveMap saveMapAs closeAllMaps revertMap createImage - options shortcuts - exit edit.menu=undo redo - clear cut copy paste pasteTiled - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap tileShow - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects - gameObjectTextEditor Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/daimonin/ChangeLog 2010-06-04 19:07:47 UTC (rev 8090) @@ -1,3 +1,13 @@ +2010-06-04 Andreas Kirschbaum + + * Implement #1714800 (Predefined locations / bookmarks) as + Bookmarks menu. + + Add Bookmark adds a new bookmark for the current map. + + Manage Bookmarks opens a dialog for managing existing bookmarks: + change bookmark title, reorder bookmarks, remove bookmark. + 2010-06-03 Andreas Kirschbaum * Make "Move Env" to always insert into the selected map square. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties 2010-06-04 19:07:47 UTC (rev 8090) @@ -24,7 +24,7 @@ ######## # Menus -main.menubar=file edit map archetypes pickmaps resources tools analyze view plugins window help +main.menubar=file edit map archetypes pickmaps resources tools analyze view bookmarks plugins window help file.menu=newMap openFile recent closeMap - saveMap saveMapAs closeAllMaps revertMap createImage - options shortcuts - exit edit.menu=undo redo - clear cut copy paste pasteTiled - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects - gameObjectTextEditor Modified: trunk/src/app/net/sf/gridarta/action.properties =================================================================== --- trunk/src/app/net/sf/gridarta/action.properties 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/src/app/net/sf/gridarta/action.properties 2010-06-04 19:07:47 UTC (rev 8090) @@ -124,6 +124,9 @@ scriptEditFile.menu=scriptEditNewScript scriptEditOpen - scriptEditSave scriptEditSaveAs - scriptEditClose scriptEditCloseAll scriptEditEdit.menu=scriptEditUndo scriptEditRedo - scriptEditCut scriptEditCopy scriptEditPaste - scriptEditFind scriptEditReplace scriptEditFindAgain +# Entries after the last separator are replaced with bookmarks. +bookmarks.menu=addBookmark manageBookmarks - + showHelp.icon=general/Help16 tipOfTheDay.icon=general/TipOfTheDay16 Added: trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java 2010-06-04 19:07:47 UTC (rev 8090) @@ -0,0 +1,196 @@ +/* + * 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.gui.bookmarks; + +import java.awt.Component; +import javax.swing.Action; +import net.sf.gridarta.gui.map.mapview.MapView; +import net.sf.gridarta.gui.map.mapview.MapViewManager; +import net.sf.gridarta.gui.map.mapview.MapViewManagerListener; +import net.sf.gridarta.gui.mapimagecache.MapImageCache; +import net.sf.gridarta.gui.mapmenu.BookmarksMapMenuPreferences; +import net.sf.gridarta.gui.mapmenu.MapMenuManager; +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.model.map.mapcontrol.MapControl; +import net.sf.gridarta.model.map.mapmodel.MapModel; +import net.sf.gridarta.utils.ActionUtils; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.swing.action.ActionMethod; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Implements actions for managing bookmarks. + * @author Andreas Kirschbaum + */ +public class BookmarkActions<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { + + /** + * The {@link ActionBuilder} instance. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The {@link MapMenuManager} defining the bookmarks menu entries. + */ + @NotNull + private final MapMenuManager<G, A, R> bookmarksMapMenuManager; + + /** + * The {@link BookmarksMapMenuPreferences} defining the bookmarks menu + * entries. + */ + @NotNull + private final BookmarksMapMenuPreferences<G, A, R> bookmarksMapMenuPreferences; + + /** + * The {@link MapImageCache} for creating map previews. + */ + @NotNull + private final MapImageCache<G, A, R> mapImageCache; + + /** + * The {@link MapViewManager} instance. + */ + @NotNull + private final MapViewManager<G, A, R> mapViewManager; + + /** + * The parent component for dialogs. + */ + @NotNull + private final Component parentComponent; + + /** + * The {@link Action} for "add bookmark". + */ + @NotNull + private final Action addBookmarkAction; + + /** + * The {@link ManageBookmarksDialog} instance. Set to <code>null</code> if not + * yet created. + */ + @Nullable + private ManageBookmarksDialog<G, A, R> manageBookmarksDialog = null; + + /** + * Creates a new instance. + * @param bookmarksMapMenuManager the map menu manager defining the + * bookmarks menu entries + * @param bookmarksMapMenuPreferences the bookmarks map menu preferences + * definition the bookmarks menu entries + * @param mapViewManager the map view manager instance + * @param parentComponent the parent component for dialogs + * @param mapImageCache the map image cache for creating map previews + */ + public BookmarkActions(@NotNull final MapMenuManager<G, A, R> bookmarksMapMenuManager, @NotNull final BookmarksMapMenuPreferences<G, A, R> bookmarksMapMenuPreferences, @NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final Component parentComponent, @NotNull final MapImageCache<G, A, R> mapImageCache) { + this.bookmarksMapMenuManager = bookmarksMapMenuManager; + this.bookmarksMapMenuPreferences = bookmarksMapMenuPreferences; + this.mapViewManager = mapViewManager; + this.parentComponent = parentComponent; + this.mapImageCache = mapImageCache; + addBookmarkAction = ActionUtils.newAction(ACTION_BUILDER, "Bookmarks", this, "addBookmark"); + ActionUtils.newAction(ACTION_BUILDER, "Bookmarks", this, "manageBookmarks"); + + final MapViewManagerListener<G, A, R> mapViewManagerListener = new MapViewManagerListener<G, A, R>() { + + @Override + public void activeMapViewChanged(@Nullable final MapView<G, A, R> mapView) { + updateActions(); + } + + @Override + public void mapViewCreated(@NotNull final MapView<G, A, R> mapView) { + // ignore + } + + @Override + public void mapViewClosing(@NotNull final MapView<G, A, R> mapView) { + // ignore + } + + }; + mapViewManager.addMapViewManagerListener(mapViewManagerListener); + + updateActions(); + } + + /** + * Action method for "addBookmark". Creates a new bookmark for the currently + * opened map. + */ + @ActionMethod + public void addBookmark() { + doAddBookmark(true); + } + + /** + * Action method for "manage bookmarks". Opens the dialog for editing + * existing bookmarks. + */ + @ActionMethod + public void manageBookmarks() { + if (manageBookmarksDialog == null) { + manageBookmarksDialog = new ManageBookmarksDialog<G, A, R>(parentComponent, bookmarksMapMenuPreferences, mapImageCache); + } + manageBookmarksDialog.showDialog(parentComponent); + } + + /** + * Updates the enabled state of all actions. + */ + private void updateActions() { + addBookmarkAction.setEnabled(doAddBookmark(false)); + } + + /** + * Preforms the action "add bookmark". + * @param performAction whether the action should be performed + * @return whether the action has or can be performed + */ + private boolean doAddBookmark(final boolean performAction) { + final MapView<G, A, R> mapView = mapViewManager.getActiveMapView(); + if (mapView == null) { + return false; + } + + final MapControl<G, A, R> mapControl = mapView.getMapControl(); + final MapModel<G, A, R> mapModel = mapControl.getMapModel(); + if (mapModel.getMapFile() == null) { + return false; + } + + if (performAction) { + final A mapArchObject = mapModel.getMapArchObject(); + final EditBookmarkDialog<G, A, R> editBookmarkDialog = new EditBookmarkDialog<G, A, R>(mapView, mapArchObject.getMapName()); + if (editBookmarkDialog.showDialog(mapView)) { + bookmarksMapMenuManager.addRecent(mapModel, editBookmarkDialog.getDescription()); + } + } + + return true; + } + +} // class BookmarkActions Property changes on: trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java 2010-06-04 19:07:47 UTC (rev 8090) @@ -0,0 +1,196 @@ +/* + * 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.gui.bookmarks; + +import java.awt.Component; +import javax.swing.Box; +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; +import javax.swing.WindowConstants; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.JTextComponent; +import net.sf.gridarta.gui.utils.GUIConstants; +import net.sf.gridarta.gui.utils.TextComponentUtils; +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.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.swing.action.ActionMethod; +import org.jetbrains.annotations.NotNull; + +/** + * A dialog that displays one bookmark and allows to edit the values. + * @author Andreas Kirschbaum + */ +public class EditBookmarkDialog<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends JOptionPane { + + /** + * The serial Version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The {@link ActionBuilder}. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The dialog. + */ + @NotNull + private final JDialog dialog; + + /** + * The text input field for the description. + */ + @NotNull + private final JTextComponent descriptionField = new JTextField(); + + /** + * The {@link JButton} for ok. + */ + @NotNull + private final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "editBookmarkOkay", this)); + + /** + * The {@link JButton} for cancel. + */ + @NotNull + private final JButton cancelButton = new JButton(ACTION_BUILDER.createAction(false, "editBookmarkCancel", this)); + + /** + * Creates a new instance. + * @param parentComponent the parent component for the dialog + * @param defaultDescription the default value for the description field + */ + public EditBookmarkDialog(@NotNull final Component parentComponent, @NotNull final String defaultDescription) { + okButton.setDefaultCapable(true); + setOptions(new Object[] { okButton, cancelButton }); + + setMessage(createPanel()); + + TextComponentUtils.setAutoSelectOnFocus(descriptionField); + descriptionField.setText(defaultDescription); + + final DocumentListener documentListener = new DocumentListener() { + + /** {@inheritDoc} */ + @Override + public void insertUpdate(@NotNull final DocumentEvent e) { + updateOkButton(); + } + + /** {@inheritDoc} */ + @Override + public void removeUpdate(@NotNull final DocumentEvent e) { + updateOkButton(); + } + + /** {@inheritDoc} */ + @Override + public void changedUpdate(@NotNull final DocumentEvent e) { + updateOkButton(); + } + + }; + descriptionField.getDocument().addDocumentListener(documentListener); + updateOkButton(); + + dialog = createDialog(parentComponent, ACTION_BUILDER.getString("editBookmark.title")); + dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + dialog.getRootPane().setDefaultButton(okButton); + dialog.pack(); + } + + /** + * Opens the dialog. Returns when the dialog has been dismissed. + * @param parentComponent the parent component for the dialog + * @return whether "ok" was selected + */ + public boolean showDialog(@NotNull final Component parentComponent) { + dialog.setLocationRelativeTo(parentComponent); + dialog.setVisible(true); + return getValue() == okButton; + } + + /** + * Creates the GUI. + * @return the panel containing the GUI + */ + @NotNull + private JPanel createPanel() { + final JPanel mainPanel = new JPanel(); + mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); + + mainPanel.setBorder(GUIConstants.DIALOG_BORDER); + + mainPanel.add(new JLabel(ACTION_BUILDER.getString("editBookmark.description"))); + mainPanel.add(Box.createVerticalStrut(5)); + + mainPanel.add(descriptionField); + mainPanel.add(Box.createVerticalStrut(5)); + + return mainPanel; + } + + /** + * Action method for okay. + */ + @ActionMethod + public void editBookmarkOkay() { + if (!getDescription().isEmpty()) { + setValue(okButton); + } + } + + /** + * Action method for cancel. + */ + @ActionMethod + public void editBookmarkCancel() { + setValue(cancelButton); + } + + /** + * Returns the description. + * @return the description + */ + @NotNull + public String getDescription() { + return descriptionField.getText().trim(); + } + + /** + * Sets the enabled state of {@link #okButton} depending on the contents of + * {@link #descriptionField}. + */ + private void updateOkButton() { + okButton.setEnabled(!getDescription().isEmpty()); + } + +} // class EditBookmarkDialog Property changes on: trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java 2010-06-04 19:07:47 UTC (rev 8090) @@ -0,0 +1,401 @@ +/* + * 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.gui.bookmarks; + +import java.awt.Component; +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.io.File; +import javax.swing.Action; +import javax.swing.DefaultListCellRenderer; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JViewport; +import javax.swing.ListSelectionModel; +import javax.swing.ScrollPaneConstants; +import javax.swing.SwingConstants; +import javax.swing.WindowConstants; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import net.sf.gridarta.gui.mapimagecache.MapImageCache; +import net.sf.gridarta.gui.mapmenu.BookmarksMapMenuPreferences; +import net.sf.gridarta.gui.mapmenu.MapMenuEntry; +import net.sf.gridarta.gui.utils.GUIConstants; +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.japi.swing.action.ActionBuilder; +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 that displays existing bookmarks and allows to edit or remove them. + * @author Andreas Kirschbaum + */ +public class ManageBookmarksDialog<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends JOptionPane { + + /** + * The serial Version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The {@link ActionBuilder}. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The {@link BookmarksMapMenuPreferences} to affect. + */ + @NotNull + private final BookmarksMapMenuPreferences<G, A, R> bookmarksMapMenuPreferences; + + /** + * The {@link MapImageCache} for creating map previews. + */ + @NotNull + private final MapImageCache<G, A, R> mapImageCache; + + /** + * The {@link JList} of all bookmarks. + */ + @NotNull + private final JList bookmarksList; + + /** + * The map preview image. + */ + @NotNull + private final JLabel preview = new JLabel(); + + /** + * The dialog. + */ + @NotNull + private final JDialog dialog; + + /** + * The {@link Action} for "edit bookmark". + */ + @NotNull + private final Action editAction = ACTION_BUILDER.createAction(false, "manageBookmarksEdit", this); + + /** + * The {@link Action} for "move up bookmark". + */ + @NotNull + private final Action moveUpAction = ACTION_BUILDER.createAction(false, "manageBookmarksMoveUp", this); + + /** + * The {@link Action} for "move down bookmark". + */ + @NotNull + private final Action moveDownAction = ACTION_BUILDER.createAction(false, "manageBookmarksMoveDown", this); + + /** + * The {@link Action} for "remove bookmark". + */ + @NotNull + private final Action removeAction = ACTION_BUILDER.createAction(false, "manageBookmarksRemove", this); + + /** + * The {@link JButton} for cancel. + */ + @NotNull + private final JButton closeButton = new JButton(ACTION_BUILDER.createAction(false, "manageBookmarksClose", this)); + + /** + * The currently selected entry. + */ + @Nullable + private MapMenuEntry<G, A, R> selectedMapMenuEntry = null; + + /** + * Creates a new instance. + * @param parentComponent the parent component for the dialog + * @param bookmarksMapMenuPreferences the bookmarks map menu preferences to + * affect + * @param mapImageCache the map image cache for creating map previews + */ + public ManageBookmarksDialog(@NotNull final Component parentComponent, @NotNull final BookmarksMapMenuPreferences<G, A, R> bookmarksMapMenuPreferences, @NotNull final MapImageCache<G, A, R> mapImageCache) { + this.bookmarksMapMenuPreferences = bookmarksMapMenuPreferences; + this.mapImageCache = mapImageCache; + bookmarksList = new JList(bookmarksMapMenuPreferences); + final JButton editButton = new JButton(editAction); + final JButton moveUpButton = new JButton(moveUpAction); + final JButton moveDownButton = new JButton(moveDownAction); + final JButton removeButton = new JButton(removeAction); + setOptions(new Object[] { editButton, moveUpButton, moveDownButton, removeButton, closeButton }); + + setMessage(createPanel()); + + dialog = createDialog(parentComponent, ACTION_BUILDER.getString("manageBookmarks.title")); + dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + dialog.setModal(false); + dialog.setResizable(true); + dialog.pack(); + + updateActions(); + } + + /** + * Opens the dialog. Returns after the dialog has been dismissed. + * @param parentComponent the parent component for the dialog + */ + public void showDialog(@NotNull final Component parentComponent) { + setInitialValue(bookmarksList); + bookmarksList.setSelectedIndex(0); + dialog.setLocationRelativeTo(parentComponent); + dialog.setMinimumSize(new Dimension(600, 300)); + dialog.setPreferredSize(new Dimension(800, 600)); + dialog.setVisible(true); + dialog.toFront(); + } + + /** + * Creates the GUI. + * @return the panel containing the GUI + */ + @NotNull + private JPanel createPanel() { + preview.setHorizontalAlignment(SwingConstants.CENTER); + preview.setPreferredSize(new Dimension(200, 200)); + + final JPanel mainPanel = new JPanel(new GridBagLayout()); + + mainPanel.setBorder(GUIConstants.DIALOG_BORDER); + + final JScrollPane bookmarksScrollPane = new JScrollPane(); + bookmarksScrollPane.setViewportView(bookmarksList); + bookmarksScrollPane.setBackground(bookmarksList.getBackground()); + bookmarksScrollPane.getViewport().add(bookmarksList); + bookmarksScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + bookmarksScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); + bookmarksScrollPane.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); + + final GridBagConstraints gbc = new GridBagConstraints(); + gbc.fill = GridBagConstraints.BOTH; + gbc.weightx = 1.0; + gbc.weighty = 1.0; + gbc.gridx = 0; + gbc.gridy = 0; + mainPanel.add(bookmarksScrollPane, gbc); + + gbc.weightx = 0.0; + gbc.gridx = 1; + mainPanel.add(preview, gbc); + + bookmarksList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + + bookmarksList.setCellRenderer(new DefaultListCellRenderer() { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + @Override + 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 MapMenuEntry<?, ?, ?> mapMenuEntry = (MapMenuEntry<?, ?, ?>) value; + setText(mapMenuEntry.getTitle()); + final File mapFile = mapMenuEntry.getMapFile(); + setToolTipText(mapFile.getPath()); + return this; + } + + }); + + final ListSelectionListener listSelectionListener = new ListSelectionListener() { + + @Override + public void valueChanged(final ListSelectionEvent e) { + updateSelectedBookmark(); + } + + }; + bookmarksList.addListSelectionListener(listSelectionListener); + + return mainPanel; + } + + /** + * Updates {@link #selectedMapMenuEntry} from {@link #bookmarksList}. + */ + private void updateSelectedBookmark() { + //JList does not use type parameters + @SuppressWarnings({ "unchecked" }) + final MapMenuEntry<G, A, R> mapMenuEntry = (MapMenuEntry<G, A, R>) bookmarksList.getSelectedValue(); + selectedMapMenuEntry = mapMenuEntry; + updateActions(); + } + + /** + * Action method for "edit bookmark". + */ + @ActionMethod + public void manageBookmarksEdit() { + doEditBookmark(true); + } + + /** + * Action method for "move up bookmark". + */ + @ActionMethod + public void manageBookmarksMoveUp() { + doMoveUpBookmark(true); + } + + /** + * Action method for "move down bookmark". + */ + @ActionMethod + public void manageBookmarksMoveDown() { + doMoveDownBookmark(true); + } + + /** + * Action method for "remove bookmark". + */ + @ActionMethod + public void manageBookmarksRemove() { + doRemoveBookmark(true); + } + + /** + * Action method for "close bookmarks dialog". + */ + @ActionMethod + public void manageBookmarksClose() { + setValue(closeButton); + } + + /** + * Edits the selected bookmark. + * @param performAction whether the action should be performed + * @return whether the action can or was performed + */ + private boolean doEditBookmark(final boolean performAction) { + final MapMenuEntry<G, A, R> mapMenuEntry = selectedMapMenuEntry; + if (mapMenuEntry == null) { + return false; + } + + if (performAction) { + final EditBookmarkDialog<G, A, R> editBookmarkDialog = new EditBookmarkDialog<G, A, R>(this, mapMenuEntry.getTitle()); + if (editBookmarkDialog.showDialog(this)) { + bookmarksMapMenuPreferences.setTitle(mapMenuEntry, editBookmarkDialog.getDescription()); + } + } + + return true; + } + + /** + * Moves up the selected bookmark. + * @param performAction whether the action should be performed + * @return whether the action can or was performed + */ + private boolean doMoveUpBookmark(final boolean performAction) { + final MapMenuEntry<G, A, R> mapMenuEntry = selectedMapMenuEntry; + if (mapMenuEntry == null) { + return false; + } + + if (!bookmarksMapMenuPreferences.doMoveUp(mapMenuEntry, performAction)) { + return false; + } + + if (performAction) { + bookmarksList.setSelectedIndex(bookmarksList.getSelectedIndex() - 1); + } + + return true; + } + + /** + * Moves down the selected bookmark. + * @param performAction whether the action should be performed + * @return whether the action can or was performed + */ + private boolean doMoveDownBookmark(final boolean performAction) { + final MapMenuEntry<G, A, R> mapMenuEntry = selectedMapMenuEntry; + if (mapMenuEntry == null) { + return false; + } + + if (!bookmarksMapMenuPreferences.doMoveDown(mapMenuEntry, performAction)) { + return false; + } + + if (performAction) { + bookmarksList.setSelectedIndex(bookmarksList.getSelectedIndex() + 1); + } + + return true; + } + + /** + * Removes the selected bookmark. + * @param performAction whether the action should be performed + * @return whether the action can or was performed + */ + private boolean doRemoveBookmark(final boolean performAction) { + final MapMenuEntry<G, A, R> mapMenuEntry = selectedMapMenuEntry; + if (mapMenuEntry == null) { + return false; + } + + if (performAction) { + final int index = bookmarksList.getSelectedIndex(); + bookmarksMapMenuPreferences.removeMapMenuEntry(mapMenuEntry); + if (index < bookmarksList.getModel().getSize()) { + bookmarksList.setSelectedIndex(index); + } else if (index > 0) { + bookmarksList.setSelectedIndex(index - 1); + } + } + + return true; + } + + /** + * Updates the actions' states to reflect the current selection. + */ + private void updateActions() { + editAction.setEnabled(doEditBookmark(false)); + moveUpAction.setEnabled(doMoveUpBookmark(false)); + moveDownAction.setEnabled(doMoveDownBookmark(false)); + removeAction.setEnabled(doRemoveBookmark(false)); + final MapMenuEntry<?, ?, ?> mapMenuEntry = selectedMapMenuEntry; + preview.setIcon(mapMenuEntry == null ? null : new ImageIcon(mapImageCache.getOrCreatePreview(mapMenuEntry.getMapFile()))); + } + +} // class ManageBookmarksDialog Property changes on: trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java 2010-06-04 19:07:47 UTC (rev 8090) @@ -0,0 +1,114 @@ +/* + * 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.gui.mapmenu; + +import java.io.File; +import java.io.IOException; +import javax.swing.AbstractListModel; +import net.sf.gridarta.gui.map.mapview.MapViewsManager; +import net.sf.gridarta.gui.mapimagecache.MapImageCache; +import net.sf.gridarta.mapmanager.FileControl; +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.model.settings.GlobalSettings; +import org.jetbrains.annotations.NotNull; + +/** + * Abstract base class for {@link MapMenuPreferences} implementations. + * @author Andreas Kirschbaum + */ +public abstract class AbstractMapMenuPreferences<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractListModel implements MapMenuPreferences<G, A, R> { + + /** + * The {@link MapViewsManager} instance. + */ + @NotNull + private final MapViewsManager<G, A, R> mapViewsManager; + + /** + * The global settings instance. + */ + @NotNull + private final GlobalSettings globalSettings; + + /** + * The {@link MapImageCache} to use. + */ + @NotNull + private final MapImageCache<G, A, R> mapImageCache; + + /** + * The {@link FileControl}. + */ + @NotNull + private final FileControl<G, A, R> fileControl; + + /** + * Creates a new instance. + * @param mapViewsManager the map views manager instance + * @param globalSettings the global settings instance + * @param mapImageCache the map image cache instance + * @param fileControl the file control + */ + protected AbstractMapMenuPreferences(@NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final FileControl<G, A, R> fileControl) { + this.mapViewsManager = mapViewsManager; + this.globalSettings = globalSettings; + this.mapImageCache = mapImageCache; + this.fileControl = fileControl; + } + + /** + * Creates a new {@link MapMenuEntry}. + * @param title the entry's title + * @param mapFile the entry's map file + * @return the new instance + */ + @NotNull + protected MapMenuEntry<G, A, R> newMapMenuEntry(@NotNull final String title, @NotNull final File mapFile) { + return new MapMenuEntry<G, A, R>(title, mapFile, mapViewsManager, mapImageCache, fileControl, getShortDescription(title, getShortMapFile(globalSettings.getMapsDirectory(), mapFile))); + } + + /** + * Returns the base name of a map file. + * @param mapsDirectory the maps directory + * @param mapFile the map file + * @return the base name + */ + @NotNull + private static String getShortMapFile(@NotNull final File mapsDirectory, @NotNull final File mapFile) { + String canonicalMapFile; + String canonicalMapsDirectory; + try { + canonicalMapFile = mapFile.getCanonicalPath(); + canonicalMapsDirectory = mapsDirectory.getCanonicalPath(); + } catch (final IOException ignored) { + canonicalMapFile = mapFile.getAbsolutePath(); + canonicalMapsDirectory = mapsDirectory.getAbsolutePath(); + } + + if (canonicalMapFile.startsWith(canonicalMapsDirectory)) { + return canonicalMapFile.substring(canonicalMapsDirectory.length()).replace('\\', '/'); + } else { + return canonicalMapFile.replace('\\', '/'); + } + } + +} // class AbstractMapMenuPreferences Property changes on: trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gui/mapmenu/BookmarksMapMenuPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/BookmarksMapMenuPreferences.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/BookmarksMapMenuPreferences.java 2010-06-04 19:07:47 UTC (rev 8090) @@ -0,0 +1,295 @@ +/* + * 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.gui.mapmenu; + +import java.io.File; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.prefs.Preferences; +import net.sf.gridarta.MainControl; +import net.sf.gridarta.gui.map.mapview.MapViewsManager; +import net.sf.gridarta.gui.mapimagecache.MapImageCache; +import net.sf.gridarta.mapmanager.FileControl; +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.model.settings.GlobalSettings; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import org.jetbrains.annotations.NotNull; + +/** + * A {@link MapMenuPreferences} for bookmark menu entries. + * @author Andreas Kirschbaum + */ +public class BookmarksMapMenuPreferences<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractMapMenuPreferences<G, A, R> { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The {@link Preferences}. + */ + @NotNull + private static final Preferences preferences = Preferences.userNodeForPackage(MainControl.class); + + /** + * The {@link ActionBuilder}. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * List with mapMenuEntries. + */ + @NotNull + private final List<MapMenuEntry<G, A, R>> mapMenuEntries = new LinkedList<MapMenuEntry<G, A, R>>(); + + /** + * Creates a new instance. + * @param mapViewsManager the map views manager instance + * @param globalSettings the global settings instance + * @param mapImageCache the map image cache instance + * @param fileControl the file control + */ + public BookmarksMapMenuPreferences(@NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final FileControl<G, A, R> fileControl) { + super(mapViewsManager, globalSettings, mapImageCache, fileControl); + } + + /** + * {@inheritDoc} + */ + @Override + public void init() { + final int numRecents = preferences.getInt("bookmarkNum", 0); + for (int i = 0; i < numRecents; i++) { + final String title = getTitle(i); + final File mapFile = getMapFile(i); + addMapMenuEntry(title, mapFile, false); + } + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public String getTitle(final int index) { + return preferences.get("bookmarkTitle[" + Integer.toString(index) + ']', null); + } + + /** + * Sets an entry's title. + * @param mapMenuEntry the entry + * @param title the title + */ + public void setTitle(@NotNull final MapMenuEntry<G, A, R> mapMenuEntry, @NotNull final String title) { + final int index = indexOf(mapMenuEntry); + if (index == -1) { + throw new IllegalArgumentException(); + } + preferences.put("bookmarkTitle[" + Integer.toString(index) + ']', title); + mapMenuEntry.setTitle(title); + fireContentsChanged(this, index, index); + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public File getMapFile(final int index) { + return new File(preferences.get("bookmarkFilename[" + Integer.toString(index) + ']', null)); + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public String getShortDescription(@NotNull final String title, @NotNull final String mapFile) { + return ACTION_BUILDER.format("bookmarkItem.shortdescriptionformat", title, mapFile); + } + + /** + * {@inheritDoc} + */ + @Override + public void addMapMenuEntry(@NotNull final String title, @NotNull final File mapFile, final boolean doSave) { + final MapMenuEntry<G, A, R> mapMenuEntry = newMapMenuEntry(title, mapFile); + final int index = mapMenuEntries.size(); + mapMenuEntries.add(mapMenuEntry); + fireIntervalAdded(this, index, index); + if (doSave) { + save(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void removeMapMenuEntry(@NotNull final MapMenuEntry<G, A, R> mapMenuEntry) { + final int index = indexOf(mapMenuEntry); + mapMenuEntries.remove(index); + save(); + fireIntervalRemoved(this, index, index); + } + + /** + * Saves all entries to preferences. + */ + private void save() { + int i = 0; + for (final MapMenuEntry<G, A, R> mapMenuEntry : mapMenuEntries) { + preferences.put("bookmarkTitle[" + Integer.toString(i) + ']', mapMenuEntry.getTitle()); + preferences.put("bookmarkFilename[" + Integer.toString(i) + ']', mapMenuEntry.getMapFile().getPath()); + i++; + } + preferences.putInt("bookmarkNum", i); + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public Iterator<MapMenuEntry<G, A, R>> iterator() { + return new Iterator<MapMenuEntry<G, A, R>>() { + + /** + * The {@link Iterator} to forward to. + */ + @NotNull + private final Iterator<MapMenuEntry<G, A, R>> it = mapMenuEntries.iterator(); + + /** + * The index of the current entry. + */ + private int index = -1; + + @Override + public boolean hasNext() { + return it.hasNext(); + } + + @Override + public MapMenuEntry<G, A, R> next() { + return it.next(); + } + + @Override + public void remove() { + it.remove(); + fireIntervalRemoved(BookmarksMapMenuPreferences.this, index, index); + index--; + save(); + } + + }; + } + + /** + * {@inheritDoc} + */ + @Override + public int getSize() { + return mapMenuEntries.size(); + } + + /** + * {@inheritDoc} + */ + @Override + public Object getElementAt(final int index) { + return mapMenuEntries.get(index); + } + + /** + * Moves an entry upwards. + * @param mapMenuEntry the entry + * @param performAction whether to perform the move or just check + * @return whether the action was or can be performed + */ + public boolean doMoveUp(@NotNull final MapMenuEntry<G, A, R> mapMenuEntry, final boolean performAction) { + final int index = indexOf(mapMenuEntry); + if (index == -1) { + throw new IllegalArgumentException(); + } + + if (index <= 0) { + return false; + } + + if (performAction) { + mapMenuEntries.remove(index); + mapMenuEntries.add(index - 1, mapMenuEntry); + save(); + fireContentsChanged(this, index - 1, index); + } + + return true; + } + + /** + * Moves an entry downwards. + * @param mapMenuEntry the entry + * @param performAction whether to perform the move or just check + * @return whether the action was or can be performed + */ + public boolean doMoveDown(@NotNull final MapMenuEntry<G, A, R> mapMenuEntry, final boolean performAction) { + final int index = indexOf(mapMenuEntry); + if (index == -1) { + throw new IllegalArgumentException(); + } + + if (index >= mapMenuEntries.size() - 1) { + return false; + } + + if (performAction) { + mapMenuEntries.remove(index); + mapMenuEntries.add(index + 1, mapMenuEntry); + save(); + fireContentsChanged(this, index, index + 1); + } + + return true; + } + + /** + * Returns the index of a {@link MapMenuEntry} within {@link + * #mapMenuEntries}. + * @param mapMenuEntry the map menu entry + * @return the index + */ + private int indexOf(@NotNull final MapMenuEntry<G, A, R> mapMenuEntry) { + for (int i = 0; i < mapMenuEntries.size(); i++) { + if (mapMenuEntries.get(i) == mapMenuEntry) { + return i; + } + } + return -1; + } + +} // class BookmarksMapMenuPreferences Property changes on: trunk/src/app/net/sf/gridarta/gui/mapmenu/BookmarksMapMenuPreferences.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java 2010-06-04 19:07:47 UTC (rev 8090) @@ -49,7 +49,7 @@ * Title = map name. */ @NotNull - private final String title; + private String title; /** * The {@link MapViewsManager} instance. @@ -85,7 +85,6 @@ * @param shortDescription the short description for tooltips */ public MapMenuEntry(@NotNull final String title, @NotNull final File mapFile, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final FileControl<G, A, R> fileControl, @NotNull final String shortDescription) { - super(title); this.mapFile = mapFile; this.title = title; this.mapViewsManager = mapViewsManager; @@ -119,6 +118,15 @@ } /** + * Sets the title of this entry. + * @param title the title + */ + public void setTitle(@NotNull final String title) { + this.title = title; + putValue(NAME, title); + } + + /** * Get the icon of this file. * @return icon of this file */ Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java 2010-06-04 19:07:47 UTC (rev 8090) @@ -20,17 +20,15 @@ package net.sf.gridarta.gui.mapmenu; import java.io.File; -import java.io.IOException; import java.util.IdentityHashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; import javax.swing.Action; import javax.swing.JMenu; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; -import net.sf.gridarta.gui.mapimagecache.MapImageCache; +import javax.swing.event.ListDataEvent; +import javax.swing.event.ListDataListener; import net.sf.gridarta.gui.utils.MenuUtils; -import net.sf.gridarta.mapmanager.FileControl; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; @@ -43,7 +41,6 @@ import net.sf.gridarta.model.map.mapmodel.MapModelListener; import net.sf.gridarta.model.map.mapmodel.MapSquare; import net.sf.gridarta.model.map.validation.ErrorCollector; -import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.utils.Size2D; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -55,12 +52,6 @@ public class MapMenuManager<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { /** - * The {@link MapViewsManager} instance. - */ - @NotNull - private final MapViewsManager<G, A, R> mapViewsManager; - - /** * The menu to update. * @serial */ @@ -68,24 +59,6 @@ private JMenu recentMenu = null; /** - * The global settings instance. - */ - @NotNull - private final GlobalSettings globalSettings; - - /** - * The {@link MapImageCache} to use. - */ - @NotNull - private final MapImageCache<G, A, R> mapImageCache; - - /** - * The {@link FileControl}. - */ - @NotNull - private final FileControl<G, A, R> fileControl; - - /** * The {@link MapMenuPreferences} to use. */ @NotNull @@ -101,19 +74,31 @@ /** * Create a new instance. * @param mapManager the map manager instance - * @param mapViewsManager the map views manager instance - * @param globalSettings the global settings instance - * @param mapImageCache the map image cache instance - * @param fileControl the file control * @param mapMenuPreferences the recent preferences to use */ - public MapMenuManager(@NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final FileControl<G, A, R> fileControl, @NotNull final MapMenuPreferences<G, A, R> mapMenuPreferences) { - this.mapViewsManager = mapViewsManager; - this.globalSettings = globalSettings; - this.mapImageCache = mapImageCache; - this.fileControl = fileControl; + public MapMenuManager(@NotNull final MapManager<G, A, R> mapManager, @NotNull final MapMenuPreferences<G, A, R> mapMenuPreferences) { this.mapMenuPreferences = mapMenuPreferences; + final ListDataListener listDataListener = new ListDataListener() { + + @Override + public void intervalAdded(@NotNull final ListDataEvent e) { + updateRecent(); + } + + @Override + public void intervalRemoved(@NotNull final ListDataEvent e) { + updateRecent(); + } + + @Override + public void contentsChanged(@NotNull final ListDataEvent e) { + updateRecent(); + } + + }; + mapMenuPreferences.addListDataListener(listDataListener); + final MapManagerListener<G, A, R> mapManagerListener = new MapManagerListener<G, A, R>() { /** {@inheritDoc} */ @@ -175,8 +160,7 @@ return; } - final MapMenuEntry<G, A, R> mapMenuEntry = newMapMenuEntry(title, mapFile); - mapMenuPreferences.addMapMenuEntryEntry(mapMenuEntry, true); + mapMenuPreferences.addMapMenuEntry(title, mapFile, true); updateRecent(); } @@ -222,53 +206,11 @@ * Initializes the recent state. */ public void initRecent() { - final int numRecents = mapMenuPreferences.getNum(); - for (int i = numRecents - 1; i >= 0; i--) { - final String title = mapMenuPreferences.getTitle(i); - final File mapFile = mapMenuPreferences.getMapFile(i); - final MapMenuEntry<G, A, R> mapMenuEntry = newMapMenuEntry(title, mapFile); - mapMenuPreferences.addMapMenuEntryEntry(mapMenuEntry, false); - } + mapMenuPreferences.init(); updateRecent(); } /** - * Creates a new {@link MapMenuEntry}. - * @param title the entry's title - * @param mapFile the entry's map file - * @return the new instance - */ - @NotNull - private MapMenuEntry<G, A, R> newMapMenuEntry(@NotNull final String title, @NotNull final File mapFile) { - return new MapMenuEntry<G, A, R>(title, mapFile, mapViewsManager, mapImageCache, fileControl, mapMenuPreferences.getShortDescription(title, getShortMapFile(globalSettings.getMapsDirectory(), mapFile))); - } - - /** - * Returns the base name of a map file. - * @param mapsDirectory the maps directory - * @param mapFile the map file - * @return the base name - */ - @NotNull - private static String getShortMapFile(@NotNull final File mapsDirectory, @NotNull final File mapFile) { - String canonicalMapFile; - String canonicalMapsDirectory; - try { - canonicalMapFile = mapFile.getCanonicalPath(); - canonicalMapsDirectory = mapsDirectory.getCanonicalPath(); - } catch (final IOException ignored) { - canonicalMapFile = mapFile.getAbsolutePath(); - canonicalMapsDirectory = mapsDirectory.getAbsolutePath(); - } - - if (canonicalMapFile.startsWith(canonicalMapsDirectory)) { - return canonicalMapFile.substring(canonicalMapsDirectory.length()).replace('\\', '/'); - } else { - return canonicalMapFile.replace('\\', '/'); - } - } - - ... [truncated message content] |
From: <aki...@us...> - 2010-06-04 23:52:43
|
Revision: 8094 http://gridarta.svn.sourceforge.net/gridarta/?rev=8094&view=rev Author: akirschbaum Date: 2010-06-04 23:52:32 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Fix Javadoc issues. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java trunk/build.xml 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/FlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/MapArchObjectParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/smoothface/DuplicateSmoothFaceException.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java trunk/gridarta.ipr trunk/src/app/net/sf/gridarta/actions/CannotLoadMapFileException.java trunk/src/app/net/sf/gridarta/actions/MapSizeMismatchException.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserView.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypePanel.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/findarchetypes/TableModel.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/treasurelist/CFTreasureListTree.java trunk/src/app/net/sf/gridarta/gui/treasurelist/TreasureCellRenderer.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateButtonModel.java trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java trunk/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserPanel.java trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/src/app/net/sf/gridarta/model/face/IllegalFaceException.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapSquareGrid.java trunk/src/app/net/sf/gridarta/model/map/normalizer/IOErrorException.java trunk/src/app/net/sf/gridarta/model/map/normalizer/InvalidPathException.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/AttributeRangeError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/BlockedMobOrSpawnPointError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/ValidationError.java trunk/src/app/net/sf/gridarta/model/scripts/UndefinedEventArchetypeTypeException.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureListTreasureObj.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureObj.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Replace.java trunk/src/app/net/sf/gridarta/validation/checks/NonAbsoluteExitPathError.java trunk/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java Added Paths: ----------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/package.html trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package.html trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package.html trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package.html trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package.html trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/package.html trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/scripts/package.html trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/package.html trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/package.html trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/package.html trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/map/renderer/package.html trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/scripts/package.html trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/package.html trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/package.html trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/package.html trunk/src/app/net/sf/gridarta/gui/archetypechooser/package.html trunk/src/app/net/sf/gridarta/gui/connectionview/package.html trunk/src/app/net/sf/gridarta/gui/filter/package.html trunk/src/app/net/sf/gridarta/gui/help/package.html trunk/src/app/net/sf/gridarta/gui/map/package.html trunk/src/app/net/sf/gridarta/gui/map/tools/package.html trunk/src/app/net/sf/gridarta/gui/package.html trunk/src/app/net/sf/gridarta/gui/pickmapchooser/package.html trunk/src/app/net/sf/gridarta/gui/prefs/package.html trunk/src/app/net/sf/gridarta/gui/selectedsquare/package.html trunk/src/app/net/sf/gridarta/gui/undo/package.html trunk/src/app/net/sf/gridarta/gui/utils/tristate/package.html trunk/src/app/net/sf/gridarta/model/anim/package.html trunk/src/app/net/sf/gridarta/model/data/package.html trunk/src/app/net/sf/gridarta/model/face/package.html trunk/src/app/net/sf/gridarta/model/gameobject/package.html trunk/src/app/net/sf/gridarta/model/io/package.html trunk/src/app/net/sf/gridarta/model/map/validation/package.html trunk/src/app/net/sf/gridarta/model/match/package.html trunk/src/app/net/sf/gridarta/model/scripts/package.html trunk/src/app/net/sf/gridarta/model/undo/package.html trunk/src/app/net/sf/gridarta/package.html trunk/src/app/net/sf/gridarta/textedit/scripteditor/package.html trunk/src/app/net/sf/gridarta/textedit/textarea/package.html trunk/src/app/net/sf/gridarta/validation/checks/package.html trunk/src/app/overview.html Removed Paths: ------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/package-info.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package-info.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/overview.html trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package-info.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package-info.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package-info.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/package-info.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/scripts/package-info.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/package-info.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/package-info.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/package-info.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/map/package-info.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/scripts/package-info.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/overview.html trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/package-info.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/package-info.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/package-info.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/package-info.java trunk/src/app/net/sf/gridarta/gui/connectionview/package-info.java trunk/src/app/net/sf/gridarta/gui/filter/package-info.java trunk/src/app/net/sf/gridarta/gui/help/package-info.java trunk/src/app/net/sf/gridarta/gui/map/package-info.java trunk/src/app/net/sf/gridarta/gui/map/tools/package-info.java trunk/src/app/net/sf/gridarta/gui/package-info.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/package-info.java trunk/src/app/net/sf/gridarta/gui/prefs/package-info.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/package-info.java trunk/src/app/net/sf/gridarta/gui/undo/package-info.java trunk/src/app/net/sf/gridarta/gui/utils/tristate/package-info.java trunk/src/app/net/sf/gridarta/model/anim/package-info.java trunk/src/app/net/sf/gridarta/model/data/package-info.java trunk/src/app/net/sf/gridarta/model/face/package-info.java trunk/src/app/net/sf/gridarta/model/gameobject/package-info.java trunk/src/app/net/sf/gridarta/model/io/package-info.java trunk/src/app/net/sf/gridarta/model/map/package-info.java trunk/src/app/net/sf/gridarta/model/map/validation/package-info.java trunk/src/app/net/sf/gridarta/model/match/package-info.java trunk/src/app/net/sf/gridarta/model/scripts/package-info.java trunk/src/app/net/sf/gridarta/model/undo/package-info.java trunk/src/app/net/sf/gridarta/package-info.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/package-info.java trunk/src/app/net/sf/gridarta/textedit/textarea/package-info.java trunk/src/app/net/sf/gridarta/validation/checks/package-info.java trunk/src/test/net/sf/gridarta/gui/map/package-info.java trunk/src/test/net/sf/gridarta/model/io/package-info.java trunk/src/test/net/sf/gridarta/model/map/validation/package-info.java trunk/src/test/net/sf/gridarta/package-info.java Deleted: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/package-info.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/package-info.java 2010-06-04 20:00:44 UTC (rev 8093) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/package-info.java 2010-06-04 23:52:32 UTC (rev 8094) @@ -1,25 +0,0 @@ -/* - * 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. - */ - -/** - * Renders maps. - * @note Management of maps is in a different package: {@link net.sf.gridarta.model.map}. - */ - -package net.sf.gridarta.var.atrinik.gui.map; Added: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/package.html =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/package.html (rev 0) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/package.html 2010-06-04 23:52:32 UTC (rev 8094) @@ -0,0 +1,28 @@ +<!-- + ~ 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. + --> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<body> +<p>Renders maps.</p> + +<p>Note: management of maps is in a different package: {@link + net.sf.gridarta.model.map.mapcontrol}.</p> +</body> +</html> Property changes on: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/package.html ___________________________________________________________________ Added: svn:mime-type + text/html Added: svn:eol-style + LF 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-04 20:00:44 UTC (rev 8093) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-04 23:52:32 UTC (rev 8094) @@ -62,6 +62,7 @@ import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.swing.action.ActionMethod; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -88,118 +89,229 @@ /** * The parent frame for help windows. + * @serial */ @NotNull private final JFrame helpParent; + /** + * The {@link MapModel} this dialog shows. + * @serial + */ @NotNull private final MapModel<GameObject, MapArchObject, Archetype> mapModel; + /** + * The {@link Window} that represents this dialog. + * @serial + */ @Nullable private Window dialog = null; - // input components, see MapArchObject for expl. of purpose - + /** + * The message text. + * @serial + */ @NotNull - private final JTextArea mapDescription = new JTextArea(4, 4); // the msg text/arch text + private final JTextArea mapDescription = new JTextArea(4, 4); + /** + * The map's name. + * @serial + */ @NotNull - private final JTextField mapName = new JTextField(); // name of arch + private final JTextField mapName = new JTextField(); + /** + * The map's region. + * @serial + */ @NotNull - private final JTextField mapRegion = new JTextField(); // map's region + private final JTextField mapRegion = new JTextField(); + /** + * The name of the sound file. + * @serial + */ @NotNull - private final JTextField mapBackgroundMusic = new JTextField(); // name of soundfile + private final JTextField mapBackgroundMusic = new JTextField(); + /** + * The width in squares. + * @serial + */ @NotNull - private final JFormattedTextField mapWidthField = new JFormattedTextField(); // len x + private final JFormattedTextField mapWidthField = new JFormattedTextField(); + /** + * The height in squares. + * @serial + */ @NotNull - private final JFormattedTextField mapHeightField = new JFormattedTextField(); // len y + private final JFormattedTextField mapHeightField = new JFormattedTextField(); + /** + * The outdoor attribute. + * @serial + */ @NotNull - private final AbstractButton checkboxOutdoor = new JCheckBox(); // map outdoor + private final AbstractButton checkboxOutdoor = new JCheckBox(); + /** + * The enter x attribute. + * @serial + */ @NotNull - private final JFormattedTextField fieldEnterX = new JFormattedTextField(); // enter x + private final JFormattedTextField fieldEnterX = new JFormattedTextField(); + /** + * The enter y attribute. + * @serial + */ @NotNull - private final JFormattedTextField fieldEnterY = new JFormattedTextField(); // enter y + private final JFormattedTextField fieldEnterY = new JFormattedTextField(); + /** + * The swap time attribute. + * @serial + */ @NotNull - private final JFormattedTextField fieldSwapTime = new JFormattedTextField(); // swap time + private final JFormattedTextField fieldSwapTime = new JFormattedTextField(); + /** + * The reset timeout attribute. + * @serial + */ @NotNull - private final JFormattedTextField fieldResetTimeout = new JFormattedTextField(); // reset timeout + private final JFormattedTextField fieldResetTimeout = new JFormattedTextField(); + /** + * The map difficulty attribute. + * @serial + */ @NotNull - private final JFormattedTextField fieldDifficulty = new JFormattedTextField(); // map difficulty + private final JFormattedTextField fieldDifficulty = new JFormattedTextField(); + /** + * The map darkness attribute. + * @serial + */ @NotNull - private final JFormattedTextField fieldDarkness = new JFormattedTextField(); // darkness + private final JFormattedTextField fieldDarkness = new JFormattedTextField(); + /** + * The fixed reset attribute. + * @serial + */ @NotNull - private final AbstractButton checkboxFixedReset = new JCheckBox(); // fixed reset + private final AbstractButton checkboxFixedReset = new JCheckBox(); + /** + * The checkbox for the no save attribute. + * @serial + */ @NotNull private final AbstractButton checkboxNoSave = new JCheckBox(); + /** + * The checkbox for the no magic attribute. + * @serial + */ @NotNull private final AbstractButton checkboxNoMagic = new JCheckBox(); + /** + * The checkbox for the no priest attribute. + * @serial + */ @NotNull private final AbstractButton checkboxNoPriest = new JCheckBox(); + /** + * The checkbox for the no summon attribute. + * @serial + */ @NotNull private final AbstractButton checkboxNoSummon = new JCheckBox(); + /** + * The checkbox for the no harm attribute. + * @serial + */ @NotNull private final AbstractButton checkboxNoHarm = new JCheckBox(); + /** + * The checkbox for the no fixed login attribute. + * @serial + */ @NotNull private final AbstractButton checkboxNoFixedLogin = new JCheckBox(); + /** + * The checkbox for the unique attribute. + * @serial + */ @NotNull private final AbstractButton checkboxUnique = new JCheckBox(); + /** + * The checkbox for the fixed reset time attribute. + * @serial + */ @NotNull private final AbstractButton checkboxFixedResetTime = new JCheckBox(); + /** + * The checkbox for the player no save attribute. + * @serial + */ @NotNull private final AbstractButton checkboxPlayerNoSave = new JCheckBox(); + /** + * The checkbox for the pvp attribute. + * @serial + */ @NotNull private final AbstractButton checkboxPvp = new JCheckBox(); + /** + * The checkbox for the plugins attribute. + * @serial + */ @NotNull private final AbstractButton checkboxPlugins = new JCheckBox(); /** - * JButton for ok. + * The button for ok. + * @serial */ @NotNull private final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "mapOkay", this)); /** - * JButton for cancel. + * The button for cancel. + * @serial */ @NotNull private final JButton cancelButton = new JButton(ACTION_BUILDER.createAction(false, "mapCancel", this)); /** - * The MapTilePane. + * The {@link AbstractMapTilePane}. + * @serial */ @NotNull private final AbstractMapTilePane<GameObject, MapArchObject, Archetype> mapTilePane; /** * Whether the map tile pane was enabled. + * @serial */ private final boolean mapTilePaneEnabled; /** - * Creates a map-options dialog. + * Creates a new instance. * @param helpParent the parent frame for help windows * @param mapManager the map manager to use * @param globalSettings the global settings instance @@ -238,9 +350,9 @@ } /** - * Create the mainPanel. - * @param map MapArchObject to create main panel for. - * @return Newly created main panel. + * Creates the main panel. + * @param map the map arch object to create the panel for + * @return the main panel */ @NotNull private Component createMainPanel(@NotNull final MapArchObject map) { @@ -273,9 +385,9 @@ } /** - * Create the mapDataPanel. - * @param map MapArchObject to create panel for. - * @return Newly created mapDataPanel. + * Creates the map data panel. + * @param map the map arch object to create the panel for + * @return the map data panel */ @NotNull private Component createMapDataPanel(@NotNull final net.sf.gridarta.model.map.maparchobject.MapArchObject<MapArchObject> map) { @@ -289,9 +401,9 @@ } /** - * Create the optionsPanel. - * @param map MapArchObject to create panel for. - * @return Newly created optionsPanel. + * Creates the options panel. + * @param map the map arch object to create the panel for + * @return the options panel */ @NotNull private Component createOptionsPanel(@NotNull final MapArchObject map) { @@ -322,9 +434,9 @@ } /** - * Create the mapPanel. - * @param map MapArchObject to create panel for. - * @return Newly created mapPanel. + * Creates the map panel. + * @param map the map arch object to create the panel for + * @return the map panel */ @NotNull private Component createMapPanel(@NotNull final MapArchObject map) { @@ -386,9 +498,9 @@ } /** - * Create the tile path panel. - * @param mapTilePane The <code>MapTilePane<code> contents. - * @return Newly created tile path panel. + * Creates the tile path panel. + * @param mapTilePane the map tile pane contents + * @return the tile path panel */ @NotNull private static Component createTilePathPanel(@NotNull final Component mapTilePane) { @@ -400,6 +512,7 @@ /** * Action method for help. */ + @ActionMethod public void mapHelp() { new Help(helpParent, "tut_mapattr.html").setVisible(true); } @@ -407,6 +520,7 @@ /** * Action method for okay. */ + @ActionMethod public void mapOkay() { if (modifyMapProperties()) { setValue(okButton); @@ -416,6 +530,7 @@ /** * Action method for restore. */ + @ActionMethod public void mapRestore() { restoreMapProperties(); } @@ -423,6 +538,7 @@ /** * Action method for cancel. */ + @ActionMethod public void mapCancel() { setValue(cancelButton); } @@ -449,12 +565,12 @@ } /** - * Create an "attribute"-line (format: <label> <textfield>). - * @param textField formatted textfield - * @param n lenght of textfield - * @param defaultValue initial value in formatted textfield - * @param labelKey (attribute-)label key - * @return created panel + * Creates an "attribute"-line (format: <label> <textfield>). + * @param textField formatted text field + * @param n the length of the text field + * @param defaultValue the initial value in formatted text field + * @param labelKey the (attribute-)label key + * @return the created panel */ @NotNull private static Component createPanelLine(@NotNull final JFormattedTextField textField, final int n, final int defaultValue, @NotNull final String labelKey) { @@ -467,11 +583,12 @@ } /** - * Create a checkbox-line, similar to createPanelLine. - * @param checkBox checkbox - * @param state initial state - * @param labelKey (attribute-)label key - * @return created Checkbox + * Creates a checkbox-line, similar to {@link + * #createPanelLine(JFormattedTextField, int, int, String)}. + * @param checkBox the checkbox + * @param state the initial state + * @param labelKey the (attribute-)label key + * @return the panel */ @NotNull private static Component createPanelCBox(@NotNull final AbstractButton checkBox, final boolean state, @NotNull final String labelKey) { @@ -598,7 +715,7 @@ } /** - * Reset all map properties to the saved values in the map arch object. + * Resets all map properties to the saved values in the map arch object. */ private void restoreMapProperties() { final MapArchObject map = mapModel.getMapArchObject(); Deleted: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package-info.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package-info.java 2010-06-04 20:00:44 UTC (rev 8093) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package-info.java 2010-06-04 23:52:32 UTC (rev 8094) @@ -1,24 +0,0 @@ -/* - * 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. - */ - -/** - * Script related Atrinik specific classes. - */ - -package net.sf.gridarta.var.atrinik.gui.scripts; Added: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package.html =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package.html (rev 0) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package.html 2010-06-04 23:52:32 UTC (rev 8094) @@ -0,0 +1,25 @@ +<!-- + ~ 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. + --> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<body> +Graphical User Interface to choose archetypes. +</body> +</html> Property changes on: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package.html ___________________________________________________________________ Added: svn:mime-type + text/html Added: svn:eol-style + LF Deleted: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/overview.html =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/overview.html 2010-06-04 20:00:44 UTC (rev 8093) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/overview.html 2010-06-04 23:52:32 UTC (rev 8094) @@ -1,145 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?><!-- - ~ 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. - --> - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" - "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> -<head> - <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/> - <title></title> -</head> -<body> -<p> - You are reading the Atrinik Java Map Editor (short Atrinik Editor) API - Documentation. The Atrinik Editor is a Java program to create and modify - maps for the MMORPG <a href="http://www.atrinik.org/">Atrinik MMORPG</a>. -</p> - -<h3>UI Classes</h3> - -<p> - The most important UI class is {@link - net.sf.gridarta.var.atrinik.CMainView}. It is the main window, creates the - main layout and holds all actions. Most actions are delegated to {@link - net.sf.gridarta.var.atrinik.CMainControl} upon performation.</p> - -<p> - Map visualization is done by {@link - net.sf.gridarta.var.atrinik.CMapViewBasic}, which renders the map, and - {@link net.sf.gridarta.var.atrinik.CMapViewIFrame}, which is a - JInternalFrame wrapping CMapViewBasic.</p> - -<h3>Data Model</h3> - -<p> - Each archetype is an instance of {@link - net.sf.gridarta.var.atrinik.arch.ArchObject}.</p> - -<h3>Atrinik Editor Terminology Glossary</h3> -<dl> - <dt id="Animation">Animation</dt> - <dd> - An Animation is a list of faces that defines the appearance of an - Archetype in cases the appearance can change. The number of Facings in - an Animation defines how many different sub-animations the animation - contains. Such a sub-animation is for instance used to show the - Archetype from different perspectives, depending on the direction - (facing) of the Archetype. The number of Frames in an Animation defines - the number of different faces used to display the Archetypes' appearance - for a Facing. The Animations are not played by the Editor, - <p/> - It is possible to have an animation which holds different facings but - only 1 frame per facing. Such animations are used to create "turnable" - objects, that can face in different directions. - <p/> - It is possible to have an animation without a specified number of - facings. Such an object is animated but does not change its appearance - depending on the perspective. - <p/> - There are 2 ways for defining an animation. An animation can be - anonymously defined inside a default arch; such animations inherit the - name from the defining arch. Or an animation can be defined in a - separate file in the <code>arch/</code> folder. - <p/> - Animations are NamedObjects, override Faces, they are implemented by - {@link net.sf.gridarta.var.atrinik.arch.anim.AnimationObject} and {@link - net.sf.gridarta.var.atrinik.arch.anim.AnimationObjects}. - </dd> - <dt id="Archetype">Archetype</dt> - <dd> - An Archetype represents a single object including its description. There - are two kinds of Archetypes, a real Archetype and the default - Archetypes. Depending on the start mode of the editor, the default - Archetypes are all loaded either from a file named - <code>arch/archetypes</code> or by scanning the whole <code>arch/</code> - directory tree for <code>.arc</code>-files. Real Archetypes are objects - in maps and each of them refers to a Default Archetype it is derived - from. Each Real Archetype only stores the information that differs from - its Default Archetype. - <p/> - Additionally, an Archetype can be a so called Artifact. Artifacts are - always read from a file named <code>arch/artifacts</code>. Currently, - Artifacts are under migration. After the migration is finished, - Artifacts are special "appliable" Archetypes. You'd select an ArchObject - and apply an Artifact on it, which would copy all Artifact attributes - over the ArchObject attributes. - <p/> - The class that implements Archetypes is {@link - net.sf.gridarta.var.atrinik.arch.ArchObject}. The class that parses text - for modifying ArchObjects is {@link - net.sf.gridarta.var.atrinik.arch.ArchObjectParser}. The class that holds - all Default Archetypes, including those for Default Artifacts, is {@link - net.sf.gridarta.var.atrinik.arch.ArchObjectStack}. - <p/> - </dd> - <dt id="Artifact">Artifact</dt> - <dd> - See <a href="#Archetype">Archetype</a> - - <p/> - </dd> - <dt id="Face">Face</dt> - <dd> - The Face is the appearance of an Archetype. A Face is defined by a - String that uniquely defines the appearance and is used to reference a - corresponding graphic image, usually a PNG file. The {@link - net.sf.gridarta.var.atrinik.arch.ArchObjectStack} contains a collection - of all available faces. - <p/> - Animations override Faces. - </dd> - <dt id="Map">Map</dt> - <dd> - A Map is a 2-dimensional Matrix of Map Squares. X and Y define a grid - representing a world surface. At those grid positions, Map Squares with - Arch Objects can be found and make up the world, its surface, obstacles, - items etc.. - <p/> - The Map itself is defined by a Map Arch. The class storing the Map is - {@link net.sf.gridarta.var.atrinik.map.MapModel}. - </dd> - <dt id="MapSquare">(Map )Square</dt> - <dd> - A Map Square is a Map matrix element. A Map Square holds zero or more - Arch Objects that describe the world in the map at the Map Square's x - and y position. - </dd> -</dl> -</body> -</html> Deleted: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package-info.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package-info.java 2010-06-04 20:00:44 UTC (rev 8093) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package-info.java 2010-06-04 23:52:32 UTC (rev 8094) @@ -1,24 +0,0 @@ -/* - * 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. - */ - -/** - * Handles the Atrinik variants of {@link net.sf.gridarta.model.gameobject.GameObject GameObjects} and {@link net.sf.gridarta.model.archetype.Archetype Archetypes}. - */ - -package net.sf.gridarta.var.atrinik.model.gameobject; Added: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package.html =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package.html (rev 0) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package.html 2010-06-04 23:52:32 UTC (rev 8094) @@ -0,0 +1,27 @@ +<!-- + ~ 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. + --> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<body> +Handles the Atrinik variants of {@link +net.sf.gridarta.model.gameobject.GameObject GameObjects} and {@link +net.sf.gridarta.model.archetype.Archetype Archetypes}. +</body> +</html> Property changes on: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package.html ___________________________________________________________________ Added: svn:mime-type + text/html Added: svn:eol-style + LF Deleted: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package-info.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package-info.java 2010-06-04 20:00:44 UTC (rev 8093) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package-info.java 2010-06-04 23:52:32 UTC (rev 8094) @@ -1,24 +0,0 @@ -/* - * 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. - */ - -/** - * Reading and Writing of Atrinik maps. - */ - -package net.sf.gridarta.var.atrinik.model.io; Added: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package.html =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package.html (rev 0) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package.html 2010-06-04 23:52:32 UTC (rev 8094) @@ -0,0 +1,25 @@ +<!-- + ~ 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. + --> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<body> +Script related Atrinik specific classes. +</body> +</html> Property changes on: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package.html ___________________________________________________________________ Added: svn:mime-type + text/html Added: svn:eol-style + LF Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java 2010-06-04 20:00:44 UTC (rev 8093) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java 2010-06-04 23:52:32 UTC (rev 8094) @@ -45,82 +45,98 @@ /** * No save map. + * @serial */ private boolean noSave = false; /** * No magic spells. + * @serial */ private boolean noMagic = false; /** * No prayers. + * @serial */ private boolean noPriest = false; /** * No harmful spells allowed. + * @serial */ private boolean noHarm = false; /** * No summoning allowed. + * @serial */ private boolean noSummon = false; /** * Check map reset status after re-login. + * @serial */ private boolean fixedLogin = false; /** * Unique map. + * @serial */ private boolean unique = false; /** * Fixed reset time. + * @serial */ private boolean fixedResetTime = false; /** * Players cannot save on this map. + * @serial */ private boolean playerNoSave = false; /** * Player vs Player combat allowed. + * @serial */ private boolean pvp = false; /** * Global map events for this map allowed. + * @serial */ private boolean plugins = false; /** * The tileset id. 0 means no available tileset id + * @serial */ private int tilesetId = 0; /** * The tileset x coordinate. + * @serial */ private int tilesetX = 0; /** * The tileset y coordinate. + * @serial */ private int tilesetY = 0; /** * The name of the background music. Set to empty string if unset. + * @serial */ @NotNull private String backgroundMusic = ""; /** * The region the map is in. + * @serial */ @NotNull private String region = ""; @@ -149,10 +165,18 @@ setRegion(mapArchObject.region); } + /** + * Returns the no save attribute. + * @return the no save attribute + */ public boolean isNoSave() { return noSave; } + /** + * Sets the no save attribute. + * @param noSave the no save attribute + */ public void setNoSave(final boolean noSave) { if (this.noSave == noSave) { return; @@ -162,10 +186,18 @@ setModified(); } + /** + * Returns the no magic attribute. + * @return the no magic attribute + */ public boolean isNoMagic() { return noMagic; } + /** + * Sets the no magic attribute. + * @param noMagic the no magic attribute + */ public void setNoMagic(final boolean noMagic) { if (this.noMagic == noMagic) { return; @@ -175,10 +207,18 @@ setModified(); } + /** + * Returns the no priest attribute. + * @return the no priest attribute + */ public boolean isNoPriest() { return noPriest; } + /** + * Sets the no priest attribute. + * @param noPriest the no priest attribute + */ public void setNoPriest(final boolean noPriest) { if (this.noPriest == noPriest) { return; @@ -188,10 +228,18 @@ setModified(); } + /** + * Returns the no summon attribute. + * @return the no summon attribute + */ public boolean isNoSummon() { return noSummon; } + /** + * Sets the no summon attribute. + * @param noSummon the no summon attribute + */ public void setNoSummon(final boolean noSummon) { if (this.noSummon == noSummon) { return; @@ -201,10 +249,18 @@ setModified(); } + /** + * Returns the no harm attribute. + * @return the no harm attribute + */ public boolean isNoHarm() { return noHarm; } + /** + * Sets the no harm attribute. + * @param noHarm the no harm attribute + */ public void setNoHarm(final boolean noHarm) { if (this.noHarm == noHarm) { return; @@ -214,10 +270,18 @@ setModified(); } + /** + * Returns the fixed login attribute. + * @return the fixed login attribute + */ public boolean isFixedLogin() { return fixedLogin; } + /** + * Sets the fixed login attribute. + * @param fixedLogin the fixed login attribute + */ public void setFixedLogin(final boolean fixedLogin) { if (this.fixedLogin == fixedLogin) { return; @@ -227,10 +291,18 @@ setModified(); } + /** + * Returns the unique attribute. + * @return the unique attribute + */ public boolean isUnique() { return unique; } + /** + * Sets the unique save attribute. + * @param unique the unique attribute + */ public void setUnique(final boolean unique) { if (this.unique == unique) { return; @@ -240,10 +312,18 @@ setModified(); } + /** + * Returns the fixed reset time attribute. + * @return the fixed reset time attribute + */ public boolean isFixedResetTime() { return fixedResetTime; } + /** + * Sets the fixed reset time attribute. + * @param fixedResetTime the fixed reset time attribute + */ public void setFixedResetTime(final boolean fixedResetTime) { if (this.fixedResetTime == fixedResetTime) { return; @@ -253,10 +333,18 @@ setModified(); } + /** + * Returns the player no save attribute. + * @return the player no save attribute + */ public boolean isPlayerNoSave() { return playerNoSave; } + /** + * Sets the player no save attribute. + * @param playerNoSave the player no save attribute + */ public void setPlayerNoSave(final boolean playerNoSave) { if (this.playerNoSave == playerNoSave) { return; @@ -266,10 +354,18 @@ setModified(); } + /** + * Returns the pvp attribute. + * @return the pvp attribute + */ public boolean isPvp() { return pvp; } + /** + * Sets the pvp attribute. + * @param pvp the pvp attribute + */ public void setPvp(final boolean pvp) { if (this.pvp == pvp) { return; @@ -279,10 +375,18 @@ setModified(); } + /** + * Returns the plugins attribute. + * @return the plugins attribute + */ public boolean isPlugins() { return plugins; } + /** + * Sets the plugins attribute. + * @param plugins the plugins attribute + */ public void setPlugins(final boolean plugins) { if (this.plugins == plugins) { return; @@ -292,10 +396,18 @@ setModified(); } + /** + * Returns the tileset id attribute. + * @return the tileset id attribute + */ public int getTilesetId() { return tilesetId; } + /** + * Sets the tileset id attribute. + * @param tilesetId the tileset id attribute + */ public void setTilesetId(final int tilesetId) { if (this.tilesetId == tilesetId) { return; @@ -305,10 +417,18 @@ setModified(); } + /** + * Returns the tileset x attribute. + * @return the tileset x attribute + */ public int getTilesetX() { return tilesetX; } + /** + * Sets the tileset x attribute. + * @param tilesetX the tileset x attribute + */ public void setTilesetX(final int tilesetX) { if (this.tilesetX == tilesetX) { return; @@ -318,10 +438,18 @@ setModified(); } + /** + * Returns the tileset y attribute. + * @return the tileset y attribute + */ public int getTilesetY() { return tilesetY; } + /** + * Sets the tileset y attribute. + * @param tilesetY the tileset y attribute + */ public void setTilesetY(final int tilesetY) { if (this.tilesetY == tilesetY) { return; @@ -353,11 +481,19 @@ setModified(); } + /** + * Returns the region attribute. + * @return the region attribute + */ @NotNull public String getRegion() { return region; } + /** + * Sets the region attribute. + * @param region the region attribute + */ public void setRegion(@NotNull final String region) { final String trimmedRegion = region.trim(); if (this.region.equals(trimmedRegion)) { Deleted: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package-info.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package-info.java 2010-06-04 20:00:44 UTC (rev 8093) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package-info.java 2010-06-04 23:52:32 UTC (rev 8094) @@ -1,25 +0,0 @@ -/* - * 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. - */ - -/** - * Main package of Gridarta4Atrinik, contains all classes specific to the Atrinik version of the Gridarta map editor. - * @serial exclude - */ - -package net.sf.gridarta.var.atrinik; Added: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package.html =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package.html (rev 0) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package.html 2010-06-04 23:52:32 UTC (rev 8094) @@ -0,0 +1,26 @@ +<!-- + ~ 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. + --> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<body> +<p>Main package of Gridarta4Atrinik, contains all classes specific to the + Atrinik version of the Gridarta map editor.</p> +</body> +</html> Property changes on: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package.html ___________________________________________________________________ Added: svn:mime-type + text/html Added: svn:eol-style + LF Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2010-06-04 20:00:44 UTC (rev 8093) +++ trunk/build.xml 2010-06-04 23:52:32 UTC (rev 8094) @@ -157,8 +157,8 @@ <target name="apiDoc" description="Creates public javadoc documentation."> <mkdir dir="dest/doc/api/${project.version}"/> - <copy todir="dest/doc/api/${project.version}" file="src/doc/api/public/copyright.html"/> - <copy todir="dest/doc/api/${project.version}" file="src/doc/api/public/.htaccess"/> + <!-- <copy todir="dest/doc/api/${project.version}" file="src/doc/api/public/copyright.html"/> --> + <!-- <copy todir="dest/doc/api/${project.version}" file="src/doc/api/public/.htaccess"/> --> <javadoc destdir="dest/doc/api/${project.version}" access="protected" author="yes" version="yes" locale="en_US" use="yes" splitindex="yes" windowtitle="Gridarta API documentation" doctitle="Gridarta<br />Yet another Java API<br />API Documentation" header="Gridarta ${project.version}<br />Yet another Java API<br />API Documentation" footer="Gridarta<br />Yet another Java API<br />API Documentation" bottom="<div style="text-align:center;">© 2005-2006 The Gridarta Developers. All rights reserved. See <a href="{@docRoot}/copyright.html">copyright</a></div>" serialwarn="yes" charset="${build.source.encoding}" docencoding="${build.source.encoding}" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" overview="src/app/overview.html" link="${user.javadoc.link}"> <classpath> <fileset dir="lib" includes="annotations.jar"/> @@ -182,19 +182,26 @@ <sourcepath> <pathelement path="${user.javadoc.javasrc}"/> <pathelement path="src/app"/> + <pathelement path="atrinik/src/app"/> + <pathelement path="crossfire/src/app"/> + <pathelement path="daimonin/src/app"/> </sourcepath> - <packageset dir="src/app" defaultexcludes="yes"> - <include name="**"/> - </packageset> - <tag enabled="true" name="retval" description="Return Values:" scope="methods"/> - <tag enabled="true" name="pre" description="Preconditions:" scope="methods,constructors"/> - <tag enabled="true" name="post" description="Postconditions:" scope="methods"/> - <tag enabled="true" name="note" description="Notes:"/> - <tag enabled="true" name="warning" description="Warnings:"/> - <tag enabled="true" name="todo" description="Todo:"/> - <tag enabled="true" name="fixme" description="Fixme:"/> - <tag enabled="true" name="xxx" description="XXX:"/> - <tag enabled="false" name="used" description="Manually marked as used."/> + <packageset dir="src/app" defaultexcludes="yes"/> + <packageset dir="atrinik/src/app" defaultexcludes="yes"/> + <packageset dir="crossfire/src/app" defaultexcludes="yes"/> + <packageset dir="daimonin/src/app" defaultexcludes="yes"/> + <tag name="todo" description="Todo:"/> + <tag name="used" description="Manually marked as used." enabled="false"/> + <tag name="fixme" description="Fixme:"/> + <tag name="xxx" description="XXX:"/> + <tag name="note" description="Note:"/> + <tag name="warning" description="Warning:"/> + <tag name="retval" description="Return Value:"/> + <tag name="val" description="Value:"/> + <tag name="default" description="Default Value:"/> + <tag name="invariant" description="Invariant:"/> + <tag name="pre" description="Precondition:"/> + <tag name="noinspection" description="No Inspection:"/> </javadoc> </target> @@ -386,18 +393,32 @@ <target name="javadoc" description="Creates the JavaDoc documentation for the complete editor source."> <exec executable="svnversion" outputproperty="build.number"/> <mkdir dir="dest/doc/dev/api"/> - <javadoc destdir="dest/doc/dev/api" locale="en_US" version="yes" author="yes" use="yes" splitindex="yes" windowtitle="Gridarta Editor — API Documentation" doctitle="Gridarta Editor ${build.number}<br />API Documentation" header="Gridarta Editor ${build.number}<br />API Documentation" footer="Gridarta Editor ${build.number}<br />API Documentation" serialwarn="no" charset="utf-8" docencoding="utf-8" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" private="yes" link="${user.javadoc.link}"> + <javadoc destdir="dest/doc/dev/api" locale="en_US" version="yes" author="yes" use="yes" splitindex="yes" windowtitle="Gridarta Editor — API Documentation" doctitle="Gridarta Editor ${build.number}<br />API Documentation" header="Gridarta Editor ${build.number}<br />API Documentation" footer="Gridarta Editor ${build.number}<br />API Documentation" serialwarn="no" charset="utf-8" docencoding="utf-8" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" private="yes" overview="src/app/overview.html" link="${user.javadoc.link}"> <classpath> <fileset dir="atrinik/lib" includes="*.jar" excludes="*.jar-LICENSE"/> <fileset dir="daimonin/lib" includes="*.jar" excludes="*.jar-LICENSE"/> <fileset dir="crossfire/lib" includes="*.jar" excludes="*.jar-LICENSE"/> <fileset dir="lib" includes="*.jar" excludes="*.jar-LICENSE"/> </classpath> - <packageset dir="src/app"/> - <packageset dir="src" includes="test/**"/> - <packageset dir="atrinik/src/app"/> - <packageset dir="crossfire/src/app"/> - <packageset dir="daimonin/src/app"/> + <sourcepath> + <pathelement path="${user.javadoc.javasrc}"/> + <pathelement path="src/app"/> + <pathelement path="src/test"/> + <pathelement path="atrinik/src/app"/> + <pathelement path="atrinik/src/test"/> + <pathelement path="crossfire/src/app"/> + <pathelement path="crossfire/src/test"/> + <pathelement path="daimonin/src/app"/> + <pathelement path="daimonin/src/test"/> + </sourcepath> + <packageset dir="src/app" defaultexcludes="yes"/> + <p... [truncated message content] |
From: <aki...@us...> - 2010-06-04 23:57:18
|
Revision: 8095 http://gridarta.svn.sourceforge.net/gridarta/?rev=8095&view=rev Author: akirschbaum Date: 2010-06-04 23:57:12 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Add @NotNull annotations. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureObj.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-06-04 23:52:32 UTC (rev 8094) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-06-04 23:57:12 UTC (rev 8095) @@ -60,6 +60,7 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(FlatMapRenderer.class); /** Modified: trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java 2010-06-04 23:52:32 UTC (rev 8094) +++ trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java 2010-06-04 23:57:12 UTC (rev 8095) @@ -46,6 +46,7 @@ * The permanently shown {@link Component}. * @serial */ + @NotNull private final Component component; /** Modified: trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java 2010-06-04 23:52:32 UTC (rev 8094) +++ trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java 2010-06-04 23:57:12 UTC (rev 8095) @@ -205,6 +205,7 @@ * Returns the model as a {@link TristateButtonModel}. * @return the model */ + @NotNull public TristateButtonModel getTristateModel() { return (TristateButtonModel) getModel(); } Modified: trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureObj.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureObj.java 2010-06-04 23:52:32 UTC (rev 8094) +++ trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureObj.java 2010-06-04 23:57:12 UTC (rev 8095) @@ -40,6 +40,7 @@ * The name of this treasure object. * @serial */ + @NotNull private final String name; /** @@ -96,6 +97,7 @@ /** * {@inheritDoc} */ + @NotNull @Override public String toString() { final StringBuilder sb = new StringBuilder(); @@ -217,6 +219,7 @@ * Returns the name of this treasure object. * @return the name of this treasure object */ + @NotNull public String getName() { return name; } Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java 2010-06-04 23:52:32 UTC (rev 8094) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java 2010-06-04 23:57:12 UTC (rev 8095) @@ -41,6 +41,7 @@ import org.apache.log4j.Category; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * This class implements a popup window which shows all python methods in the @@ -56,11 +57,13 @@ /** * Python menu definitions. */ + @NotNull private static final String PYTHONMENU_FILE = "cfpython_menu.def"; /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(CFPythonPopup.class); /** @@ -72,12 +75,14 @@ * List of menu entries (all CFPython commands). * @serial */ + @Nullable private static String[] menuEntries = null; /** * The popup menu. * @serial */ + @NotNull private final JPopupMenu menu; /** @@ -213,19 +218,21 @@ */ private class MenuActionListener implements ActionListener { + @NotNull private final ScriptEditControl control; + @NotNull private final CFPythonPopup popup; private boolean ignore = false; // while true, all ActionEvents get ignored - MenuActionListener(final CFPythonPopup popup, final ScriptEditControl control) { + MenuActionListener(@NotNull final CFPythonPopup popup, @NotNull final ScriptEditControl control) { this.popup = popup; this.control = control; } @Override - public void actionPerformed(final ActionEvent e) { + public void actionPerformed(@NotNull final ActionEvent e) { if (!ignore) { // get method name to insert String method = popup.getSelectedItem().toString(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:34:59
|
Revision: 8106 http://gridarta.svn.sourceforge.net/gridarta/?rev=8106&view=rev Author: akirschbaum Date: 2010-06-05 00:34:52 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Fix Javadoc issues. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java trunk/gridarta.ipr trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 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-05 00:30:37 UTC (rev 8105) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2010-06-05 00:34:52 UTC (rev 8106) @@ -30,12 +30,12 @@ /** * The <code>GameObject</code> class handles the Atrinik GameObjects. Usually, - * an GameObject that is really used is derived from a (replacable) default + * an GameObject that is really used is derived from a (replaceable) default * arch. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo this class is not always the best place for multipart object handling, + * @todo this class is not always the best place for multi-part object handling, * see also {@link net.sf.gridarta.model.baseobject.GameObjectContainer} for * issues about this */ Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java 2010-06-05 00:30:37 UTC (rev 8105) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java 2010-06-05 00:34:52 UTC (rev 8106) @@ -31,12 +31,12 @@ /** * The <code>GameObject</code> class handles the Crossfire GameObjects. Usually, - * an GameObject that is really used is derived from a (replacable) default + * an GameObject that is really used is derived from a (replaceable) default * arch. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo this class is not always the best place for multipart object handling, + * @todo this class is not always the best place for multi-part object handling, * see also {@link net.sf.gridarta.model.baseobject.GameObjectContainer} for * issues about this */ Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2010-06-05 00:30:37 UTC (rev 8105) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2010-06-05 00:34:52 UTC (rev 8106) @@ -30,12 +30,12 @@ /** * The <code>GameObject</code> class handles the Daimonin GameObjects. Usually, - * an GameObject that is really used is derived from a (replacable) default + * an GameObject that is really used is derived from a (replaceable) default * arch. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo this class is not always the best place for multipart object handling, + * @todo this class is not always the best place for multi-part object handling, * see also {@link net.sf.gridarta.model.baseobject.GameObjectContainer} for * issues about this */ Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2010-06-05 00:30:37 UTC (rev 8105) +++ trunk/gridarta.ipr 2010-06-05 00:34:52 UTC (rev 8106) @@ -1133,6 +1133,7 @@ <w>autojoin</w> <w>autojoining</w> <w>backbuffer</w> + <w>baseobject</w> <w>beanshell</w> <w>bitmask</w> <w>bitmasks</w> Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-06-05 00:30:37 UTC (rev 8105) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-06-05 00:34:52 UTC (rev 8106) @@ -67,11 +67,15 @@ private boolean isLowestPart = true; /** - * The shape ID of this object. + * The multi shape id. * @serial */ private int multiShapeID = 0; + /** + * The multi part id. + * @serial + */ private int multiPartNr = 0; /** Modified: trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-06-05 00:30:37 UTC (rev 8105) +++ trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-06-05 00:34:52 UTC (rev 8106) @@ -33,7 +33,7 @@ * other Archetype related methods from {@link GameObject} to {@link Archetype} * and see what breaks. Then all method signatures are copied to this interface. * Once that is done we technically know what an Archetype is and can create a - * class for it. Once the Archetype classes are finnished, GameObject will no + * class for it. Once the Archetype classes are finished, GameObject will no * longer implement Archetype and we've separated Archetype from GameObject. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ @@ -126,12 +126,28 @@ */ void setLowestPart(boolean isLowestPart); + /** + * Returns the multi shape id. + * @return the multi shape id + */ int getMultiShapeID(); + /** + * Sets the multi shape id. + * @param multiShapeID the multi shape id + */ void setMultiShapeID(int multiShapeID); + /** + * Returns the multi part id. + * @return the multi part id + */ int getMultiPartNr(); + /** + * Sets the multi part id. + * @param multiPartNr the multi part id + */ void setMultiPartNr(int multiPartNr); /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:35:54
|
Revision: 8107 http://gridarta.svn.sourceforge.net/gridarta/?rev=8107&view=rev Author: akirschbaum Date: 2010-06-05 00:35:47 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Fix compiler warnings. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java 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-05 00:34:52 UTC (rev 8106) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java 2010-06-05 00:35:47 UTC (rev 8107) @@ -35,7 +35,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Creates a new instance. 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-05 00:34:52 UTC (rev 8106) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java 2010-06-05 00:35:47 UTC (rev 8107) @@ -36,7 +36,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Create a new undefined archetype with the given archetype name. 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-05 00:34:52 UTC (rev 8106) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java 2010-06-05 00:35:47 UTC (rev 8107) @@ -36,7 +36,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Create a new undefined archetype with the given archetype name. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:41:52
|
Revision: 8109 http://gridarta.svn.sourceforge.net/gridarta/?rev=8109&view=rev Author: akirschbaum Date: 2010-06-05 00:41:45 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Remove redundant code. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.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/UndefinedArchetype.java 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-05 00:36:13 UTC (rev 8108) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java 2010-06-05 00:41:45 UTC (rev 8109) @@ -60,14 +60,6 @@ /** * {@inheritDoc} */ - @Override - public boolean isLowestPart() { - return true; - } - - /** - * {@inheritDoc} - */ @NotNull @Override protected Archetype getThis() { 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-05 00:36:13 UTC (rev 8108) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java 2010-06-05 00:41:45 UTC (rev 8109) @@ -70,14 +70,6 @@ /** * {@inheritDoc} */ - @Override - public boolean isLowestPart() { - return true; - } - - /** - * {@inheritDoc} - */ @NotNull @Override protected Archetype getThis() { Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetype.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetype.java 2010-06-05 00:36:13 UTC (rev 8108) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetype.java 2010-06-05 00:41:45 UTC (rev 8109) @@ -60,14 +60,6 @@ /** * {@inheritDoc} */ - @Override - public boolean isLowestPart() { - return true; - } - - /** - * {@inheritDoc} - */ @NotNull @Override protected Archetype getThis() { Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java 2010-06-05 00:36:13 UTC (rev 8108) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java 2010-06-05 00:41:45 UTC (rev 8109) @@ -70,14 +70,6 @@ /** * {@inheritDoc} */ - @Override - public boolean isLowestPart() { - return true; - } - - /** - * {@inheritDoc} - */ @NotNull @Override protected Archetype getThis() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:43:36
|
Revision: 8110 http://gridarta.svn.sourceforge.net/gridarta/?rev=8110&view=rev Author: akirschbaum Date: 2010-06-05 00:43:30 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Add transient modifiers. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 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-05 00:41:45 UTC (rev 8109) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2010-06-05 00:43:30 UTC (rev 8110) @@ -50,7 +50,7 @@ * The {@link ArchetypeTypeSet} for looking up archetype types. */ @NotNull - private final ArchetypeTypeSet archetypeTypeSet; + private final transient ArchetypeTypeSet archetypeTypeSet; /** * Creates a new instance. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2010-06-05 00:41:45 UTC (rev 8109) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2010-06-05 00:43:30 UTC (rev 8110) @@ -50,7 +50,7 @@ * The {@link ArchetypeTypeSet} for looking up archetype types. */ @NotNull - private final ArchetypeTypeSet archetypeTypeSet; + private final transient ArchetypeTypeSet archetypeTypeSet; /** * Creates a new instance. Modified: trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-05 00:41:45 UTC (rev 8109) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-05 00:43:30 UTC (rev 8110) @@ -88,7 +88,7 @@ * The {@link FaceObjectProviders} for looking up faces. */ @NotNull - private final FaceObjectProviders faceObjectProviders; + private final transient FaceObjectProviders faceObjectProviders; /** * The name of this object. Modified: trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-06-05 00:41:45 UTC (rev 8109) +++ trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-06-05 00:43:30 UTC (rev 8110) @@ -39,7 +39,7 @@ * The {@link FaceObjectProviders} for looking up faces. */ @NotNull - private final FaceObjectProviders faceObjectProviders; + private final transient FaceObjectProviders faceObjectProviders; /** * The transparent face. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:59:33
|
Revision: 8114 http://gridarta.svn.sourceforge.net/gridarta/?rev=8114&view=rev Author: akirschbaum Date: 2010-06-05 00:59:27 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Fix warning. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 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-05 00:56:24 UTC (rev 8113) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2010-06-05 00:59:27 UTC (rev 8114) @@ -108,6 +108,13 @@ /** * {@inheritDoc} */ + @Override + public void propagateElevation(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { + } + + /** + * {@inheritDoc} + */ @NotNull @Override public GameObject clone() { Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2010-06-05 00:56:24 UTC (rev 8113) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2010-06-05 00:59:27 UTC (rev 8114) @@ -108,6 +108,13 @@ /** * {@inheritDoc} */ + @Override + public void propagateElevation(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { + } + + /** + * {@inheritDoc} + */ @NotNull @Override public GameObject clone() { Modified: trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-06-05 00:56:24 UTC (rev 8113) +++ trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-06-05 00:59:27 UTC (rev 8114) @@ -22,7 +22,6 @@ import javax.swing.ImageIcon; import net.sf.gridarta.model.anim.AnimationObjects; 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.map.maparchobject.MapArchObject; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; @@ -91,13 +90,6 @@ * {@inheritDoc} */ @Override - public void propagateElevation(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { - } - - /** - * {@inheritDoc} - */ - @Override public boolean usesDirection() { return getAttributeInt("is_turnable") != 0 || getAttributeInt("is_animated") != 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 01:21:06
|
Revision: 8129 http://gridarta.svn.sourceforge.net/gridarta/?rev=8129&view=rev Author: akirschbaum Date: 2010-06-05 01:21:00 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Exclude output directories from project. Modified Paths: -------------- trunk/atrinik.iml trunk/daimonin.iml trunk/gridarta.iml Modified: trunk/atrinik.iml =================================================================== --- trunk/atrinik.iml 2010-06-05 01:16:02 UTC (rev 8128) +++ trunk/atrinik.iml 2010-06-05 01:21:00 UTC (rev 8129) @@ -6,6 +6,7 @@ <sourceFolder url="file://$MODULE_DIR$/atrinik/resource" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/atrinik/src/app" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/atrinik/src/test" isTestSource="true" /> + <excludeFolder url="file://$MODULE_DIR$/atrinik/class" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> Modified: trunk/daimonin.iml =================================================================== --- trunk/daimonin.iml 2010-06-05 01:16:02 UTC (rev 8128) +++ trunk/daimonin.iml 2010-06-05 01:21:00 UTC (rev 8129) @@ -6,6 +6,7 @@ <sourceFolder url="file://$MODULE_DIR$/daimonin/resource" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/daimonin/src/app" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/daimonin/src/test" isTestSource="true" /> + <excludeFolder url="file://$MODULE_DIR$/daimonin/class" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> Modified: trunk/gridarta.iml =================================================================== --- trunk/gridarta.iml 2010-06-05 01:16:02 UTC (rev 8128) +++ trunk/gridarta.iml 2010-06-05 01:21:00 UTC (rev 8129) @@ -5,6 +5,7 @@ <sourceFolder url="file://$MODULE_DIR$/resource" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/app" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" /> + <excludeFolder url="file://$MODULE_DIR$/atrinik" /> <excludeFolder url="file://$MODULE_DIR$/classes" /> <excludeFolder url="file://$MODULE_DIR$/crossfire" /> <excludeFolder url="file://$MODULE_DIR$/daimonin" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 10:43:28
|
Revision: 8130 http://gridarta.svn.sourceforge.net/gridarta/?rev=8130&view=rev Author: akirschbaum Date: 2010-06-05 10:43:15 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Fix typos. Modified Paths: -------------- trunk/README trunk/atrinik/debug/ReadMe.txt trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObjectTest.java trunk/crossfire/Developer_README.txt trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/IGUIConstants.java 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/SimpleFlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/CrossfireEditor.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/Archetype.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/MapArchObjectParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/AbstractResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java trunk/daimonin/INSTALL.txt trunk/daimonin/debug/ReadMe.txt trunk/daimonin/devlib/JAPI.xml trunk/daimonin/devlib/README.txt trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java trunk/gridarta.ipr trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypePanel.java trunk/src/app/net/sf/gridarta/gui/autovalidator/AutoValidator.java trunk/src/app/net/sf/gridarta/gui/connectionview/View.java trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java trunk/src/app/net/sf/gridarta/gui/data/NamedObjectsUtils.java trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java trunk/src/app/net/sf/gridarta/gui/filter/FilterState.java trunk/src/app/net/sf/gridarta/gui/findarchetypes/FindArchetypesDialog.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/ConfirmErrorsAL.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/MaskChangeAL.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesModelListener.java trunk/src/app/net/sf/gridarta/gui/help/Help.java trunk/src/app/net/sf/gridarta/gui/help/HtmlPane.java trunk/src/app/net/sf/gridarta/gui/io/FileFilters.java trunk/src/app/net/sf/gridarta/gui/mainwindow/GameObjectTab.java trunk/src/app/net/sf/gridarta/gui/mainwindow/WarningsTab.java trunk/src/app/net/sf/gridarta/gui/map/cursor/MapCursor.java trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpAdapter.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewFactory.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractSimpleIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/GridMapSquarePainter.java trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/MapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/ToolTipAppender.java trunk/src/app/net/sf/gridarta/gui/map/tools/DeletionTool.java trunk/src/app/net/sf/gridarta/gui/map/tools/ToolSelector.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java trunk/src/app/net/sf/gridarta/gui/mapimagecache/ImageType.java trunk/src/app/net/sf/gridarta/gui/misc/MainView.java trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.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/objectchooser/ObjectChooser.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/gui/replacedialog/MatchCriteria.java trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java trunk/src/app/net/sf/gridarta/gui/script/ScriptController.java trunk/src/app/net/sf/gridarta/gui/script/ScriptEditor.java trunk/src/app/net/sf/gridarta/gui/script/ScriptManager.java trunk/src/app/net/sf/gridarta/gui/script/StackLayout.java trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBox.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/script/parameter/DoubleParameterView.java trunk/src/app/net/sf/gridarta/gui/script/parameter/IntegerParameterView.java trunk/src/app/net/sf/gridarta/gui/script/parameter/StringParameterView.java trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java trunk/src/app/net/sf/gridarta/gui/scripts/ScriptedEventEditor.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/MapSquareSelection.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/ModelUpdater.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareControl.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareModel.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.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/shrinkmapsizedialog/ShrinkMapSizeDialogManager.java trunk/src/app/net/sf/gridarta/gui/spells/SpellsUtils.java trunk/src/app/net/sf/gridarta/gui/treasurelist/TreasureCellRenderer.java trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java trunk/src/app/net/sf/gridarta/gui/utils/FaceTreeChooseAction.java trunk/src/app/net/sf/gridarta/gui/utils/GList.java trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java trunk/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java trunk/src/app/net/sf/gridarta/gui/utils/MapFileFilter.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/Tab.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.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/maincontrol/GridartaEditor.java trunk/src/app/net/sf/gridarta/mapfiles/Loader.java trunk/src/app/net/sf/gridarta/mapfiles/MapFile.java trunk/src/app/net/sf/gridarta/mapfiles/MapFolder.java trunk/src/app/net/sf/gridarta/mapfiles/MapFolderNotEmptyException.java trunk/src/app/net/sf/gridarta/mapfiles/MapFolderTree.java trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java trunk/src/app/net/sf/gridarta/model/anim/AnimationObject.java trunk/src/app/net/sf/gridarta/model/anim/AnimationParseException.java trunk/src/app/net/sf/gridarta/model/anim/DefaultAnimationObject.java trunk/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java trunk/src/app/net/sf/gridarta/model/archetype/AttributeListUtils.java trunk/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserFolder.java trunk/src/app/net/sf/gridarta/model/artifact/ArtifactParser.java trunk/src/app/net/sf/gridarta/model/autojoin/AutojoinList.java trunk/src/app/net/sf/gridarta/model/autojoin/AutojoinLists.java trunk/src/app/net/sf/gridarta/model/autojoin/AutojoinListsParser.java trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java trunk/src/app/net/sf/gridarta/model/data/AbstractNamedObject.java trunk/src/app/net/sf/gridarta/model/data/NamedObject.java trunk/src/app/net/sf/gridarta/model/data/NamedTreeNode.java trunk/src/app/net/sf/gridarta/model/exitconnector/ExitConnectorModel.java trunk/src/app/net/sf/gridarta/model/face/CollectedFaceProvider.java trunk/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java trunk/src/app/net/sf/gridarta/model/face/DoubleImageFilter.java trunk/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java trunk/src/app/net/sf/gridarta/model/face/FaceProvider.java trunk/src/app/net/sf/gridarta/model/face/FilterFaceProvider.java trunk/src/app/net/sf/gridarta/model/filter/FilterParser.java trunk/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java trunk/src/app/net/sf/gridarta/model/floodfill/FillUtils.java trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/model/gameobject/IsoMapSquareInfo.java trunk/src/app/net/sf/gridarta/model/gameobject/MultiArchData.java trunk/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java trunk/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java trunk/src/app/net/sf/gridarta/model/io/CacheFiles.java trunk/src/app/net/sf/gridarta/model/map/grid/MapGrid.java trunk/src/app/net/sf/gridarta/model/map/maparchobject/AbstractMapArchObject.java trunk/src/app/net/sf/gridarta/model/map/maparchobject/MapArchObject.java trunk/src/app/net/sf/gridarta/model/map/mapcontrol/DefaultMapControl.java trunk/src/app/net/sf/gridarta/model/map/mapcontrol/MapControl.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/src/app/net/sf/gridarta/model/map/normalizer/MapPathNormalizer.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/CorrectableError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/EmptySpawnPointError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/ValidationError.java trunk/src/app/net/sf/gridarta/model/mapviewsettings/MapViewSettings.java trunk/src/app/net/sf/gridarta/model/mapviewsettings/MapViewSettingsListener.java trunk/src/app/net/sf/gridarta/model/match/GameObjectMatcher.java trunk/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java trunk/src/app/net/sf/gridarta/model/match/NamedGameObjectMatcher.java trunk/src/app/net/sf/gridarta/model/match/SetEnabledAction.java trunk/src/app/net/sf/gridarta/model/scripts/ScriptUtils.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureListsParser.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureObj.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureTree.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureTreeNode.java trunk/src/app/net/sf/gridarta/resource/AbstractResourcesReader.java trunk/src/app/net/sf/gridarta/script/Script.java trunk/src/app/net/sf/gridarta/script/ScriptModelParser.java trunk/src/app/net/sf/gridarta/script/ScriptRunMode.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/EditWindowListener.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditUndoActions.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java trunk/src/app/net/sf/gridarta/textedit/textarea/DefaultInputHandler.java trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java trunk/src/app/net/sf/gridarta/textedit/textarea/ScrollLayout.java trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxDocument.java trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxUtilities.java trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java trunk/src/app/net/sf/gridarta/textedit/textarea/TextUtilities.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Copy.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Cut.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Find.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/FunctionMenu.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/InputActions.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Paste.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Save.java trunk/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/KeywordMap.java trunk/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/Parameter.java trunk/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/PythonTokenMarker.java trunk/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/TokenMarker.java trunk/src/app/net/sf/gridarta/updater/Updater.java trunk/src/app/net/sf/gridarta/updater/UpdaterManager.java trunk/src/app/net/sf/gridarta/utils/CommonConstants.java trunk/src/app/net/sf/gridarta/utils/FileChooserUtils.java trunk/src/app/net/sf/gridarta/utils/GUIUtils.java trunk/src/app/net/sf/gridarta/utils/IOUtils.java trunk/src/app/net/sf/gridarta/utils/ProcessRunner.java trunk/src/app/net/sf/gridarta/utils/StringUtils.java trunk/src/app/net/sf/gridarta/utils/SystemIcons.java trunk/src/app/net/sf/gridarta/validation/AbstractValidator.java trunk/src/app/net/sf/gridarta/validation/checks/AttributeRangeChecker.java trunk/src/app/net/sf/gridarta/validation/checks/BlockedMatrix.java trunk/src/app/net/sf/gridarta/validation/checks/BlockedSpawnPointChecker.java trunk/src/app/net/sf/gridarta/validation/checks/BlockedSquareChecker.java trunk/src/app/net/sf/gridarta/validation/checks/Entry.java trunk/src/app/net/sf/gridarta/validation/checks/ExitChecker.java trunk/src/test/net/sf/gridarta/gui/map/cursor/MapCursorTest.java trunk/src/test/net/sf/gridarta/gui/utils/GSplitPaneTestApplication.java trunk/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java trunk/src/test/net/sf/gridarta/model/archetype/AttributeListUtilsTest.java trunk/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java trunk/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java trunk/src/test/net/sf/gridarta/model/io/PathManagerTest.java trunk/src/test/net/sf/gridarta/model/map/maparchobject/TestMapArchObject.java trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java trunk/src/test/net/sf/gridarta/utils/StringUtilsTest.java trunk/src/test/net/sf/gridarta/utils/WrappingStringBuilderTest.java Added Paths: ----------- 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/ResPreferences.java trunk/src/app/net/sf/gridarta/gui/prefs/UpdatePreferences.java trunk/src/app/net/sf/gridarta/gui/utils/AsynchronousProgress.java trunk/src/app/net/sf/gridarta/model/floodfill/FloodFill.java trunk/src/app/net/sf/gridarta/model/io/SubDirectoryCacheFiles.java trunk/src/app/net/sf/gridarta/model/match/AttributeGameObjectMatcher.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/ToggleRectangle.java Removed Paths: ------------- trunk/src/app/net/sf/gridarta/gui/prefs/AppPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/GUIPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/MapValidatorPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/MiscPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/NetPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/ResPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/UpdatePrefs.java trunk/src/app/net/sf/gridarta/gui/utils/AsynchonousProgress.java trunk/src/app/net/sf/gridarta/model/floodfill/Floodfill.java trunk/src/app/net/sf/gridarta/model/io/SubdirectoryCacheFiles.java trunk/src/app/net/sf/gridarta/model/match/AttribGameObjectMatcher.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/ToggleRect.java Modified: trunk/README =================================================================== --- trunk/README 2010-06-05 01:21:00 UTC (rev 8129) +++ trunk/README 2010-06-05 10:43:15 UTC (rev 8130) @@ -38,7 +38,7 @@ ------------------- Java 6.0 or later Previous versions of Java will not work. Gridarta uses Generics, - autoboxing, static imports, foreach loops, assertions, covariant return + auto-boxing, static imports, foreach loops, assertions, covariant return types and varargs quite a lot. Ant 1.6.5 or later Modified: trunk/atrinik/debug/ReadMe.txt =================================================================== --- trunk/atrinik/debug/ReadMe.txt 2010-06-05 01:21:00 UTC (rev 8129) +++ trunk/atrinik/debug/ReadMe.txt 2010-06-05 10:43:15 UTC (rev 8130) @@ -1,18 +1,18 @@ -Daimonin Editor Debuging: +Daimonin Editor Debugging: ------------------------- -The linux and win32 debugin programs were created to help users, +The linux and win32 debugging programs were created to help users, like your self, to identify any bugs in the editor, that are reported -by the debugers. If a problem does exist you can forward the error +by the debuggers. If a problem does exist you can forward the error message that appears in your debugging console. Intro: ------ -In no way do you have to use either of the debugers... they are simply -to help the developement team in finding bugs.... If you are not running -the debugers and come across what you think might be a bug. Restart the -editor with a debuger (Win32Debug) or (linuxDebug) and try to recreate the +In no way do you have to use either of the debuggers... they are simply +to help the development team in finding bugs.... If you are not running +the debuggers and come across what you think might be a bug. Restart the +editor with a debugger (Win32Debug) or (linuxDebug) and try to recreate the problem. Note: In order to be able to debug, you must have built the editor with @@ -24,7 +24,7 @@ Win32 users: ------------ -Just double click the "Win32Debug.bat" file this will run the +Just double click the "Win32Debug.bat" file this will run the Daimonin Editor from the Command Prompt, thus allowing you to see any system messages that may appear. @@ -33,13 +33,13 @@ ------------ Change to the editor directory (daimonin/editor) Run the "debug/LinuxDebug.sh" -You will also get to see all the debuging info as well be able to use a Java +You will also get to see all the debugging info as well be able to use a Java debugger to attach, set breakpoints, step through etc.. "I found a bug!!" ----------------- -If you find some sort of bug/error please copy the whole error message and +If you find some sort of bug/error please copy the whole error message and either past it in the bug forum @ http://www.daimonin.com or paste the message into an email and send it to both dai...@no... or cha...@ho.... Also include your: @@ -49,4 +49,4 @@ use the Subject Name "Editor Bug") Good luck! -Thank you for your time, The Daimonin Devs. +Thank you for your time, The Daimonin Developers. 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-05 01:21:00 UTC (rev 8129) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -35,15 +35,15 @@ import net.sf.gridarta.gui.map.renderer.RendererFactory; import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; +import net.sf.gridarta.gui.prefs.AppPreferences; import net.sf.gridarta.gui.prefs.AppPreferencesModel; -import net.sf.gridarta.gui.prefs.AppPrefs; -import net.sf.gridarta.gui.prefs.DevPrefs; -import net.sf.gridarta.gui.prefs.GUIPrefs; -import net.sf.gridarta.gui.prefs.MapValidatorPrefs; -import net.sf.gridarta.gui.prefs.MiscPrefs; -import net.sf.gridarta.gui.prefs.NetPrefs; -import net.sf.gridarta.gui.prefs.ResPrefs; -import net.sf.gridarta.gui.prefs.UpdatePrefs; +import net.sf.gridarta.gui.prefs.DevPreferences; +import net.sf.gridarta.gui.prefs.GUIPreferences; +import net.sf.gridarta.gui.prefs.MapValidatorPreferences; +import net.sf.gridarta.gui.prefs.MiscPreferences; +import net.sf.gridarta.gui.prefs.NetPreferences; +import net.sf.gridarta.gui.prefs.ResPreferences; +import net.sf.gridarta.gui.prefs.UpdatePreferences; import net.sf.gridarta.gui.scripts.ScriptArchDataUtils; import net.sf.gridarta.gui.scripts.ScriptedEventEditor; import net.sf.gridarta.maincontrol.DefaultMainControl; @@ -75,7 +75,7 @@ import net.sf.gridarta.model.io.GameObjectParserFactory; import net.sf.gridarta.model.io.MapWriter; import net.sf.gridarta.model.io.PathManager; -import net.sf.gridarta.model.io.SubdirectoryCacheFiles; +import net.sf.gridarta.model.io.SubDirectoryCacheFiles; import net.sf.gridarta.model.map.maparchobject.MapArchObjectFactory; import net.sf.gridarta.model.map.mapcontrol.MapControlFactory; import net.sf.gridarta.model.map.mapmodel.InsertionMode; @@ -217,7 +217,7 @@ */ @Override public int getDoubleFaceOffset() { - return isoMapSquareInfo.getYlen() - 1; + return isoMapSquareInfo.getYLen() - 1; } /** @@ -463,7 +463,7 @@ @NotNull @Override public MapViewFactory<GameObject, MapArchObject, Archetype> newMapViewFactory(@NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final PathManager pathManager) { - return new DefaultMapViewFactory<GameObject, MapArchObject, Archetype>(rendererFactory, isoMapSquareInfo.getXlen(), isoMapSquareInfo.getYlen(), pathManager); + return new DefaultMapViewFactory<GameObject, MapArchObject, Archetype>(rendererFactory, isoMapSquareInfo.getXLen(), isoMapSquareInfo.getYLen(), pathManager); } /** @@ -529,7 +529,7 @@ @NotNull @Override public PreferencesGroup createPreferencesGroup(@NotNull final GlobalSettings globalSettings, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final AppPreferencesModel appPreferencesModel, @NotNull final ExitConnectorModel exitConnectorModel, @NotNull final ConfigSourceFactory configSourceFactory) { - return new PreferencesGroup("Gridarta for Atrinik", new ResPrefs(globalSettings, configSourceFactory), new AppPrefs(appPreferencesModel), new NetPrefs(), new GUIPrefs(globalSettings), new MiscPrefs(exitConnectorModel, globalSettings), new DevPrefs(), new UpdatePrefs(), new MapValidatorPrefs(validators, PREFERENCES_VALIDATOR_AUTO_DEFAULT)); + return new PreferencesGroup("Gridarta for Atrinik", new ResPreferences(globalSettings, configSourceFactory), new AppPreferences(appPreferencesModel), new NetPreferences(), new GUIPreferences(globalSettings), new MiscPreferences(exitConnectorModel, globalSettings), new DevPreferences(), new UpdatePreferences(), new MapValidatorPreferences(validators, PREFERENCES_VALIDATOR_AUTO_DEFAULT)); } /** @@ -538,7 +538,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) { - return mainControl.createGUIMainControl(FileFilters.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 int[] { CommonConstants.NORTH_EAST, CommonConstants.SOUTH_EAST, CommonConstants.SOUTH_WEST, CommonConstants.NORTH_WEST, CommonConstants.EAST, CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, }, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); + return mainControl.createGUIMainControl(FileFilters.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 int[] { CommonConstants.NORTH_EAST, CommonConstants.SOUTH_EAST, CommonConstants.SOUTH_WEST, CommonConstants.NORTH_WEST, CommonConstants.EAST, CommonConstants.SOUTH, CommonConstants.WEST, CommonConstants.NORTH, }, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); } /** 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-05 01:21:00 UTC (rev 8129) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -144,7 +144,7 @@ @Override protected void finishParseArchetype(@NotNull final Archetype archetype) { if (archetype.isMulti()) { - calcLowestMulti(archetype); + calculateLowestMulti(archetype); } } @@ -162,7 +162,7 @@ * order to get the overlapping correct. <p/> * @param arch last tail part of this multi */ - private void calcLowestMulti(final net.sf.gridarta.model.archetype.Archetype<GameObject, MapArchObject, Archetype> arch) { + private void calculateLowestMulti(final net.sf.gridarta.model.archetype.Archetype<GameObject, MapArchObject, Archetype> arch) { final Archetype head = arch.getHead(); int minYOffset = multiPositionData.getYOffset(head.getMultiShapeID(), head.getMultiPartNr()); 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-05 01:21:00 UTC (rev 8129) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -70,7 +70,7 @@ out.append("end\n"); - // process the multipart tails: + // process the multi-part tails: int result = 1; for (Archetype tail = arch.getMultiNext(); tail != null; tail = tail.getMultiNext()) { result++; 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-05 01:21:00 UTC (rev 8129) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -214,7 +214,7 @@ final String animPath = pair.getFirst(); final File animFile = pair.getSecond(); try { - AnimationObjectsReader.loadAnims(animationObjects, errorViewCollector, animPath, animFile, "anim ", false); + AnimationObjectsReader.loadAnimations(animationObjects, errorViewCollector, animPath, animFile, "anim ", false); } catch (final IOException ex) { errorViewCollector.addWarning(ErrorViewCategory.ANIM_FILE_INVALID, ex.getMessage() + ", " + animFile); } catch (final AnimationParseException ex) { 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-05 01:21:00 UTC (rev 8129) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -66,7 +66,7 @@ */ @Test public void testMpartIdOk() throws IOException, UndefinedArchetypeException { - check("Object head\nmpart_id 1\nend\nMore\nObject tail\nmpart_id 1\nend\n", false, false, 2); + check("Object head\n" + "mpart_id 1\n" + "end\nMore\nObject tail\n" + "mpart_id 1\n" + "end\n", false, false, 2); Assert.assertEquals(1, getArchetypeSet().getArchetype("head").getMultiShapeID()); Assert.assertEquals(1, getArchetypeSet().getArchetype("tail").getMultiShapeID()); } @@ -78,7 +78,7 @@ */ @Test public void testMpartIdInconsistent() throws IOException, UndefinedArchetypeException { - check("Object head\nmpart_id 1\nend\nMore\nObject tail\nmpart_id 2\nend\n", false, true, 2); + check("Object head\n" + "mpart_id 1\n" + "end\nMore\nObject tail\n" + "mpart_id 2\n" + "end\n", false, true, 2); Assert.assertEquals(1, getArchetypeSet().getArchetype("head").getMultiShapeID()); Assert.assertEquals(2, getArchetypeSet().getArchetype("tail").getMultiShapeID()); } Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObjectTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObjectTest.java 2010-06-05 01:21:00 UTC (rev 8129) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObjectTest.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -44,10 +44,10 @@ @Test public void testParseMapArchNoAttributes() throws IOException { final MapArchObject mao = new MapArchObject(); - final AbstractMapArchObjectParser<MapArchObject> maop = new MapArchObjectParser(); + final AbstractMapArchObjectParser<MapArchObject> mapArchObjectParser = new MapArchObjectParser(); final BufferedReader in = openTestDataReader("noAttributes.testdata"); try { - maop.load(in, mao); + mapArchObjectParser.load(in, mao); } finally { in.close(); } Modified: trunk/crossfire/Developer_README.txt =================================================================== --- trunk/crossfire/Developer_README.txt 2010-06-05 01:21:00 UTC (rev 8129) +++ trunk/crossfire/Developer_README.txt 2010-06-05 10:43:15 UTC (rev 8130) @@ -6,7 +6,7 @@ 1. The basic setup of the editor was done by Michael Toennies, derived from a basic editor-application called "Gridder" by - Pasi Ker\x84nen. Then, I (Andreas Vogl) have added the countless features + Pasi Ker�nen. Then, I (Andreas Vogl) have added the countless features necessary to turn this application into a real useful CF map-editor. We have both spent a lot of time on the editor (take a glimpse at the CHANGES.txt file), so please communicate with us, best through the @@ -26,9 +26,9 @@ spotted. Before you start to do this however, please double-check that your editor is really configured to "insert spaces". - Linefeeds may be checked in either in windows or in unix/linux style. + Line feeds may be checked in either in windows or in unix/linux style. All reasonable text- and java editors can deal with both linefeed formats. - Converting linefeeds is allowed, but in this case please make sure that only + Converting line feeds is allowed, but in this case please make sure that only linefeed characters are changed and nothing else is affected. 2. Due to the platform-independent nature of Java, the editor has the @@ -53,8 +53,8 @@ 3. Unfortunately, the editor has relatively high performance requirements. I've spent a lot of extra-work to keep everything as fast and - memory-efficient as possible. So, when you add new datafields or - calculations in the archobject area, please make sure they are as + memory-efficient as possible. So, when you add new data fields or + calculations in the archetype area, please make sure they are as efficient as possible and worth both the time and space they consume. Now don't be afraid too much. No development would be possible @@ -86,7 +86,7 @@ For the record: "Model"-classes should contain data of an object. "View"-classes should only manage the graphical layout and appearance of an object. "Controller"-classes should manage - events and dataflow, concering that object. In a perfect world, + events and data flow, concerning that object. In a perfect world, these three things would be totally separated and you could replace any of these parts without changing the others. I have yet never seen it realized perfectly, so feel proud when Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/IGUIConstants.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/IGUIConstants.java 2010-06-05 01:21:00 UTC (rev 8129) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/IGUIConstants.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -68,7 +68,7 @@ String ARCH_FILE = "archetypes"; // file with all arches - String PNG_FILE = "crossfire.0"; // file with all pngs + String PNG_FILE = "crossfire.0"; // file with all png files /** * File to store the animation tree information after arch collection. 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-05 01:21:00 UTC (rev 8129) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -66,7 +66,7 @@ private static final long serialVersionUID = 1L; /** - * The offset to map borders (32 for std. rect. maps, 0 for pickmaps). + * The offset to map borders (32 for std. rectangular maps, 0 for pickmaps). * @serial */ @NotNull Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java 2010-06-05 01:21:00 UTC (rev 8129) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -138,12 +138,12 @@ /** * Paint one square. - * @param grfx the graphics context to draw to + * @param graphics the graphics context to draw to * @param point the map coordinates of the square to draw */ - private void paintSquare(@NotNull final Graphics grfx, @NotNull final Point point) { + private void paintSquare(@NotNull final Graphics graphics, @NotNull final Point point) { if (mapModel.getMapSquare(point).isEmpty()) { - systemIcons.getEmptySquareIcon().paintIcon(this, grfx, point.x * IGUIConstants.SQUARE_WIDTH, point.y * IGUIConstants.SQUARE_HEIGHT); + systemIcons.getEmptySquareIcon().paintIcon(this, graphics, point.x * IGUIConstants.SQUARE_WIDTH, point.y * IGUIConstants.SQUARE_HEIGHT); return; } @@ -161,13 +161,13 @@ offset.x = IGUIConstants.SQUARE_WIDTH * (node.getArchetype().getMultiX() - node.getMinX()); offset.y = IGUIConstants.SQUARE_HEIGHT * (node.getArchetype().getMultiY() - node.getMinY()); } - grfx.drawImage(img.getImage(), point.x * IGUIConstants.SQUARE_WIDTH, point.y * IGUIConstants.SQUARE_HEIGHT, point.x * IGUIConstants.SQUARE_WIDTH + IGUIConstants.SQUARE_WIDTH, point.y * IGUIConstants.SQUARE_HEIGHT + IGUIConstants.SQUARE_HEIGHT, offset.x, offset.y, offset.x + IGUIConstants.SQUARE_WIDTH, offset.y + IGUIConstants.SQUARE_HEIGHT, this); + graphics.drawImage(img.getImage(), point.x * IGUIConstants.SQUARE_WIDTH, point.y * IGUIConstants.SQUARE_HEIGHT, point.x * IGUIConstants.SQUARE_WIDTH + IGUIConstants.SQUARE_WIDTH, point.y * IGUIConstants.SQUARE_HEIGHT + IGUIConstants.SQUARE_HEIGHT, offset.x, offset.y, offset.x + IGUIConstants.SQUARE_WIDTH, offset.y + IGUIConstants.SQUARE_HEIGHT, this); if (node.getAttributeInt("smoothlevel", true) > 0) { - smoothingRenderer.paintSmooth(grfx, point.x, point.y, node.getAttributeInt("smoothlevel", true), layer, false, new Point(0, 0)); + smoothingRenderer.paintSmooth(graphics, point.x, point.y, node.getAttributeInt("smoothlevel", true), layer, false, new Point(0, 0)); } } if (layer > -1) { - smoothingRenderer.paintSmooth(grfx, point.x, point.y, 1, layer + 1, true, new Point(0, 0)); + smoothingRenderer.paintSmooth(graphics, point.x, point.y, 1, layer + 1, true, new Point(0, 0)); } } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java 2010-06-05 01:21:00 UTC (rev 8129) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -71,25 +71,25 @@ } /** - * Draw the smoothing information at given postion of map, for a given limit - * smoothlevel, at a given layer. This operation may be recursive, if all - * layer above current are to be drawn too. - * @param grfx where to draw (graphics) - * @param x the x-coordinate of the mapsquare to draw, in map coordinates - * @param y the y-coordinate of the mapsquare to draw, in map coordinates - * @param level the limit smoothlevel (smoothlevels above this are drawn) + * Draw the smoothing information at given position of map, for a given + * limit smoothlevel, at a given layer. This operation may be recursive, if + * all layer above current are to be drawn too. + * @param graphics where to draw (graphics) + * @param x the x-coordinate of the map square to draw, in map coordinates + * @param y the y-coordinate of the map square to draw, in map coordinates + * @param level the limit smoothlevel (smooth levels above this are drawn) * @param layer the layer (map z coordinate) to draw. Note that invisible * objects are supposed to not use a layer, to stay coherent with client * behavior - * @param allLayers whever or not to draw also layers above current one + * @param allLayers whether or not to draw also layers above current one * @param borderOffset the border offset */ - public void paintSmooth(@NotNull final Graphics grfx, final int x, final int y, final int level, final int layer, final boolean allLayers, @NotNull final Point borderOffset) { + public void paintSmooth(@NotNull final Graphics graphics, final int x, final int y, final int level, final int layer, final boolean allLayers, @NotNull final Point borderOffset) { final net.sf.gridarta.model.gameobject.GameObject<?, ?, ?>[][] layerNode = { new net.sf.gridarta.model.gameobject.GameObject<?, ?, ?>[3], new net.sf.gridarta.model.gameobject.GameObject<?, ?, ?>[3], new net.sf.gridarta.model.gameobject.GameObject<?, ?, ?>[3] }; boolean foundLayer = false; - for (int deltax = -1; deltax <= 1; deltax++) { - for (int deltay = -1; deltay <= 1; deltay++) { - final Point where = new Point(x + deltax, y + deltay); + for (int deltaX = -1; deltaX <= 1; deltaX++) { + for (int deltaY = -1; deltaY <= 1; deltaY++) { + final Point where = new Point(x + deltaX, y + deltaY); if (mapModel.isPointValid(where)) { int currentLayer = -1; for (final net.sf.gridarta.model.gameobject.GameObject<GameObject, MapArchObject, Archetype> node : mapModel.getMapSquare(where)) { @@ -99,7 +99,7 @@ if (currentLayer == layer) { foundLayer = true; if (node.getAttributeInt("smoothlevel", true) > 0) { - layerNode[deltax + 1][deltay + 1] = node; + layerNode[deltaX + 1][deltaY + 1] = node; } break; } @@ -112,36 +112,36 @@ /*below is ripped and adapted from sdl client smooth renderer*/ final int[] dx = { 0, 1, 1, 1, 0, -1, -1, -1, }; final int[] dy = { -1, -1, 0, 1, 1, 1, 0, -1, }; - final int[] bweights = { 2, 0, 4, 0, 8, 0, 1, 0, }; - final int[] cweights = { 0, 2, 0, 4, 0, 8, 0, 1, }; + final int[] bWeights = { 2, 0, 4, 0, 8, 0, 1, 0, }; + final int[] cWeights = { 0, 2, 0, 4, 0, 8, 0, 1, }; final int[] bcExclude = { 1 + 2, /*north exclude northwest (bit0) and northeast(bit1)*/ 0, 2 + 4, /*east exclude northeast and southeast*/ 0, 4 + 8, /*and so on*/ 0, 8 + 1, 0 }; - final boolean[] partdone = { false, false, false, false, false, false, false, false, }; + final boolean[] partDone = { false, false, false, false, false, false, false, false, }; final Point src = new Point(); - final int[] slevels = new int[8]; - final FaceObject[] sfaces = new FaceObject[8]; + final int[] sLevels = new int[8]; + final FaceObject[] sFaces = new FaceObject[8]; for (int i = 0; i < 8; i++) { final int emx = 1 + dx[i]; final int emy = 1 + dy[i]; if (layerNode[emx][emy] == null || layerNode[emx][emy].getAttributeInt("smoothlevel", true) <= level) { - slevels[i] = 0; - sfaces[i] = null; /*black picture*/ + sLevels[i] = 0; + sFaces[i] = null; /*black picture*/ } else { - slevels[i] = layerNode[emx][emy].getAttributeInt("smoothlevel", true); - sfaces[i] = smoothFaces.getSmoothFace(layerNode[emx][emy]); + sLevels[i] = layerNode[emx][emy].getAttributeInt("smoothlevel", true); + sFaces[i] = smoothFaces.getSmoothFace(layerNode[emx][emy]); } } /* ok, now we have a list of smoothlevel higher than current square. * there are at most 8 different levels. so... let's check 8 times - * for the lowest one (we draw from botto to top!). + * for the lowest one (we draw from bottom to top!). */ while (true) { int lowest = -1; for (int i = 0; i < 8; i++) { - if (slevels[i] > 0 && !partdone[i] && (lowest < 0 || slevels[i] < slevels[lowest])) { + if (sLevels[i] > 0 && !partDone[i] && (lowest < 0 || sLevels[i] < sLevels[lowest])) { lowest = i; } } @@ -151,46 +151,46 @@ break; } /* we need to calculate the weight for border and weight for corners. - * then we 'markdone'the corresponding squares + * then we 'mark done' the corresponding squares */ /*first, the border, which may exclude some corners*/ int weight = 0; int weightC = 15; for (int i = 0; i < 8; i++) { /*check all nearby squares*/ - if (slevels[i] == slevels[lowest] && sfaces[i] == sfaces[lowest]) { - partdone[i] = true; - weight += bweights[i]; + if (sLevels[i] == sLevels[lowest] && sFaces[i] == sFaces[lowest]) { + partDone[i] = true; + weight += bWeights[i]; weightC &= ~bcExclude[i]; } else { /*must remove the weight of a corner if not in smoothing*/ - weightC &= ~cweights[i]; + weightC &= ~cWeights[i]; } } - if (sfaces[lowest] == null) { + if (sFaces[lowest] == null) { continue; /*Can't smooth black*/ } - final NamedObject smoothface = sfaces[lowest]; + final NamedObject smoothFace = sFaces[lowest]; /* now, it's quite easy. We must draw using a 32x32 part of - * the picture smoothface. + * the picture smooth face. * This part is located using the 2 weights calculated: * (32*weight,0) and (32*weightC,32) */ - final ImageIcon img = smoothface.getDisplayIcon(faceObjectProviders); + final ImageIcon img = smoothFace.getDisplayIcon(faceObjectProviders); if (weight > 0) { src.x = IGUIConstants.SQUARE_WIDTH * weight; src.y = 0; - grfx.drawImage(img.getImage(), borderOffset.x + x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + y * IGUIConstants.SQUARE_HEIGHT, borderOffset.x + x * IGUIConstants.SQUARE_WIDTH + IGUIConstants.SQUARE_WIDTH, borderOffset.y + y * IGUIConstants.SQUARE_HEIGHT + IGUIConstants.SQUARE_HEIGHT, src.x, src.y, src.x + IGUIConstants.SQUARE_WIDTH, src.y + IGUIConstants.SQUARE_HEIGHT, null); + graphics.drawImage(img.getImage(), borderOffset.x + x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + y * IGUIConstants.SQUARE_HEIGHT, borderOffset.x + x * IGUIConstants.SQUARE_WIDTH + IGUIConstants.SQUARE_WIDTH, borderOffset.y + y * IGUIConstants.SQUARE_HEIGHT + IGUIConstants.SQUARE_HEIGHT, src.x, src.y, src.x + IGUIConstants.SQUARE_WIDTH, src.y + IGUIConstants.SQUARE_HEIGHT, null); } if (weightC > 0) { src.x = IGUIConstants.SQUARE_WIDTH * weightC; src.y = IGUIConstants.SQUARE_HEIGHT; - grfx.drawImage(img.getImage(), borderOffset.x + x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + y * IGUIConstants.SQUARE_HEIGHT, borderOffset.x + x * IGUIConstants.SQUARE_WIDTH + IGUIConstants.SQUARE_WIDTH, borderOffset.y + y * IGUIConstants.SQUARE_HEIGHT + IGUIConstants.SQUARE_HEIGHT, src.x, src.y, src.x + IGUIConstants.SQUARE_WIDTH, src.y + IGUIConstants.SQUARE_HEIGHT, null); + graphics.drawImage(img.getImage(), borderOffset.x + x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + y * IGUIConstants.SQUARE_HEIGHT, borderOffset.x + x * IGUIConstants.SQUARE_WIDTH + IGUIConstants.SQUARE_WIDTH, borderOffset.y + y * IGUIConstants.SQUARE_HEIGHT + IGUIConstants.SQUARE_HEIGHT, src.x, src.y, src.x + IGUIConstants.SQUARE_WIDTH, src.y + IGUIConstants.SQUARE_HEIGHT, null); } } /*while there's some smooth to do*/ if (allLayers && foundLayer) { - paintSmooth(grfx, x, y, level, layer + 1, true, borderOffset); + paintSmooth(graphics, x, y, level, layer + 1, true, borderOffset); } } 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-05 01:21:00 UTC (rev 8129) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/CrossfireEditor.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -52,4 +52,4 @@ new GridartaEditor<GameObject, MapArchObject, Archetype>("net.sf.gridarta.var.crossfire.tod").run("net.sf.gridarta.var.crossfire", "CrossfireEditor.jar", new DefaultEditorFactory(), args); } -} // class CrossireEditor +} // class CrossfireEditor 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-05 01:21:00 UTC (rev 8129) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -31,14 +31,14 @@ import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.prefs.AppPreferencesModel; -import net.sf.gridarta.gui.prefs.AppPrefs; -import net.sf.gridarta.gui.prefs.DevPrefs; -import net.sf.gridarta.gui.prefs.GUIPrefs; -import net.sf.gridarta.gui.prefs.MapValidatorPrefs; -import net.sf.gridarta.gui.prefs.MiscPrefs; -import net.sf.gridarta.gui.prefs.NetPrefs; -import net.sf.gridarta.gui.prefs.ResPrefs; -import net.sf.gridarta.gui.prefs.UpdatePrefs; +import net.sf.gridarta.gui.prefs.AppPreferences; +import net.sf.gridarta.gui.prefs.DevPreferences; +import net.sf.gridarta.gui.prefs.GUIPreferences; +import net.sf.gridarta.gui.prefs.MapValidatorPreferences; +import net.sf.gridarta.gui.prefs.MiscPreferences; +import net.sf.gridarta.gui.prefs.NetPreferences; +import net.sf.gridarta.gui.prefs.ResPreferences; +import net.sf.gridarta.gui.prefs.UpdatePreferences; import net.sf.gridarta.gui.scripts.ScriptArchDataUtils; import net.sf.gridarta.gui.scripts.ScriptedEventEditor; import net.sf.gridarta.maincontrol.DefaultMainControl; @@ -396,7 +396,7 @@ @NotNull @Override public PreferencesGroup createPreferencesGroup(@NotNull final GlobalSettings globalSettings, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final AppPreferencesModel appPreferencesModel, @NotNull final ExitConnectorModel exitConnectorModel, @NotNull final ConfigSourceFactory configSourceFactory) { - return new PreferencesGroup("Gridarta for Crossfire", new ResPrefs(globalSettings, configSourceFactory), new AppPrefs(appPreferencesModel), new NetPrefs(), new GUIPrefs(globalSettings), new MiscPrefs(exitConnectorModel, globalSettings), new DevPrefs(), new UpdatePrefs(), new MapValidatorPrefs(validators, PREFERENCES_VALIDATOR_AUTO_DEFAULT)); + return new PreferencesGroup("Gridarta for Crossfire", new ResPreferences(globalSettings, configSourceFactory), new AppPreferences(appPreferencesModel), new NetPreferences(), new GUIPreferences(globalSettings), new MiscPreferences(exitConnectorModel, globalSettings), new DevPreferences(), new UpdatePreferences(), new MapValidatorPreferences(validators, PREFERENCES_VALIDATOR_AUTO_DEFAULT)); } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/Archetype.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/Archetype.java 2010-06-05 01:21:00 UTC (rev 8129) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/Archetype.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -33,7 +33,7 @@ int TYPE_WEAPON = 15; - int TYPE_BRESTPLATE_ARMOR = 16; + int TYPE_BREASTPLATE_ARMOR = 16; int TYPE_PEDESTAL = 17; 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-05 01:21:00 UTC (rev 8129) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -85,7 +85,7 @@ out.append("end\n"); - // process the multipart tails: + // process the multi-part tails: int result = 1; for (Archetype tail = arch.getMultiNext(); tail != null; tail = tail.getMultiNext()) { result++; 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-05 01:21:00 UTC (rev 8129) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/MapArchObjectParser.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -101,10 +101,10 @@ format.format("enter_y %d\n", mapArchObject.getEnterY()); } if (mapArchObject.getText().trim().length() > 0) { - format.format("msg\n%s\nendmsg\n", mapArchObject.getText().trim()); + format.format("msg\n" + "%s\n" + "endmsg\n", mapArchObject.getText().trim()); } if (mapArchObject.getLore().trim().length() > 0) { - format.format("maplore\n%s\nendmaplore\n", mapArchObject.getLore().trim()); + format.format("maplore\n" + "%s\n" + "endmaplore\n", mapArchObject.getLore().trim()); } if (mapArchObject.isUnique()) { appendable.append("unique 1\n"); Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/AbstractResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/AbstractResourcesReader.java 2010-06-05 01:21:00 UTC (rev 8129) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/AbstractResourcesReader.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -62,7 +62,7 @@ @Override protected String generateFaceName(@NotNull final String name) { if (archetypeSet.getImageSet() != null) { - // we have to snip out the imageset-information here from + // we have to snip out the image set information here from // the 'name', and the ".png": (e.g. blocked.base.111.png -> blocked.111) int firstDot = 0; int secondDot = 0; 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-05 01:21:00 UTC (rev 8129) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-05 10:43:15 UTC (rev 8130) @@ -121,7 +121,7 @@ log.info("Loaded " + (animationObjects.size() - animationObjectsS... [truncated message content] |
From: <aki...@us...> - 2010-06-05 11:14:29
|
Revision: 8137 http://gridarta.svn.sourceforge.net/gridarta/?rev=8137&view=rev Author: akirschbaum Date: 2010-06-05 11:14:23 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Replace string constants with named constants. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java trunk/gridarta.ipr 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-05 11:07:24 UTC (rev 8136) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java 2010-06-05 11:14:23 UTC (rev 8137) @@ -49,6 +49,30 @@ public class ArchetypeParser extends AbstractArchetypeParser<GameObject, MapArchObject, Archetype, DefaultArchetypeBuilder> { /** + * The tag starting the map lore. + */ + @NotNull + private static final String LORE = "lore"; + + /** + * The tag ending the map lore. + */ + @NotNull + private static final String ENDLORE = "endlore"; + + /** + * The tag for smoothing information. + */ + @NotNull + private static final String SMOOTHFACE = "smoothface"; + + /** + * The tag for smoothing information, including a trailing space. + */ + @NotNull + private static final String SMOOTHFACE_SPACE = SMOOTHFACE + " "; + + /** * The game object parser instance. */ private final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser; @@ -100,21 +124,21 @@ return true; } - if (line.equals("lore")) { + if (line.equals(LORE)) { parseLore(in, archetypeBuilder, errorViewCollector); return true; } - if (line.startsWith("smoothface ")) { - final String[] tmp = StringUtils.PATTERN_WHITESPACE.split(line.substring(11)); + if (line.startsWith(SMOOTHFACE_SPACE)) { + final String[] tmp = StringUtils.PATTERN_WHITESPACE.split(line.substring(SMOOTHFACE_SPACE.length())); if (tmp.length == 2) { try { smoothFaces.add(new SmoothFace(tmp[0], tmp[1])); } catch (final DuplicateSmoothFaceException ex) { - errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, archetypeBuilder.getArchetypeName() + ": duplicate smoothface '" + ex.getMessage() + "': " + line); + errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, archetypeBuilder.getArchetypeName() + ": duplicate " + SMOOTHFACE +" '" + ex.getMessage() + "': " + line); } } else { - errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, archetypeBuilder.getArchetypeName() + ": invalid smoothface info: " + line); + errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, archetypeBuilder.getArchetypeName() + ": invalid " + SMOOTHFACE + " info: " + line); } return true; } @@ -135,11 +159,11 @@ while (true) { final String thisLine = in.readLine(); if (thisLine == null) { - errorViewCollector.addError(ErrorViewCategory.ARCHETYPE_INVALID, "Truncated archetype: lore not terminated by endlore"); + errorViewCollector.addError(ErrorViewCategory.ARCHETYPE_INVALID, "Truncated archetype: " + LORE + " not terminated by " + ENDLORE); return; } - if (thisLine.trim().equals("endlore")) { + if (thisLine.trim().equals(ENDLORE)) { break; } Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2010-06-05 11:07:24 UTC (rev 8136) +++ trunk/gridarta.ipr 2010-06-05 11:14:23 UTC (rev 8137) @@ -1165,6 +1165,7 @@ <w>djava</w> <w>doctype</w> <w>encodings</w> + <w>endlore</w> <w>endmsg</w> <w>enums</w> <w>exiter</w> @@ -1245,6 +1246,7 @@ <w>shortdescriptionformat</w> <w>sigint</w> <w>slava</w> + <w>smoothface</w> <w>smtp</w> <w>solaris</w> <w>sourceforge</w> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 16:08:12
|
Revision: 8156 http://gridarta.svn.sourceforge.net/gridarta/?rev=8156&view=rev Author: akirschbaum Date: 2010-06-05 16:08:06 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Do not duplicate bookmarks when saving maps. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java trunk/src/test/net/sf/gridarta/gui/map/renderer/TestMapRenderer.java trunk/src/test/net/sf/gridarta/gui/map/renderer/TestRendererFactory.java trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java Added Paths: ----------- trunk/src/test/net/sf/gridarta/gui/mapmenu/ trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-05 16:03:08 UTC (rev 8155) +++ trunk/atrinik/ChangeLog 2010-06-05 16:08:06 UTC (rev 8156) @@ -1,3 +1,7 @@ +2010-06-05 Andreas Kirschbaum + + * Do not duplicate bookmarks when saving maps. + 2010-06-04 Andreas Kirschbaum * Implement #1714800 (Predefined locations / bookmarks) as Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-05 16:03:08 UTC (rev 8155) +++ trunk/crossfire/ChangeLog 2010-06-05 16:08:06 UTC (rev 8156) @@ -1,3 +1,7 @@ +2010-06-05 Andreas Kirschbaum + + * Do not duplicate bookmarks when saving maps. + 2010-06-04 Andreas Kirschbaum * Implement #1714800 (Predefined locations / bookmarks) as Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-05 16:03:08 UTC (rev 8155) +++ trunk/daimonin/ChangeLog 2010-06-05 16:08:06 UTC (rev 8156) @@ -1,3 +1,7 @@ +2010-06-05 Andreas Kirschbaum + + * Do not duplicate bookmarks when saving maps. + 2010-06-04 Andreas Kirschbaum * Implement #1714800 (Predefined locations / bookmarks) as Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java 2010-06-05 16:03:08 UTC (rev 8155) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java 2010-06-05 16:08:06 UTC (rev 8156) @@ -91,9 +91,9 @@ this.mapImageCache = mapImageCache; this.fileControl = fileControl; putValue(SHORT_DESCRIPTION, shortDescription); - putValue(SMALL_ICON, getIcon()); putValue(NAME, title); putValue(MNEMONIC_KEY, null); + updateIcon(); } /** @@ -173,4 +173,11 @@ } } + /** + * Updates the preview icon from the map model. + */ + public final void updateIcon() { + putValue(SMALL_ICON, getIcon()); + } + } // class MapMenuEntry Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java 2010-06-05 16:03:08 UTC (rev 8155) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java 2010-06-05 16:08:06 UTC (rev 8156) @@ -176,7 +176,8 @@ for (final MapMenuEntry<G, A, R> mapMenuEntry : mapMenuPreferences) { if (mapMenuEntry.getMapFile().equals(mapFile)) { - addRecent(mapModel, mapMenuEntry.getTitle()); + mapMenuEntry.updateIcon(); + updateRecent(); break; } } Modified: trunk/src/test/net/sf/gridarta/gui/map/renderer/TestMapRenderer.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/map/renderer/TestMapRenderer.java 2010-06-05 16:03:08 UTC (rev 8155) +++ trunk/src/test/net/sf/gridarta/gui/map/renderer/TestMapRenderer.java 2010-06-05 16:08:06 UTC (rev 8156) @@ -56,7 +56,7 @@ @NotNull @Override public BufferedImage getFullImage() { - throw new AssertionError(); + return new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); } /** Modified: trunk/src/test/net/sf/gridarta/gui/map/renderer/TestRendererFactory.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/map/renderer/TestRendererFactory.java 2010-06-05 16:03:08 UTC (rev 8155) +++ trunk/src/test/net/sf/gridarta/gui/map/renderer/TestRendererFactory.java 2010-06-05 16:08:06 UTC (rev 8156) @@ -38,7 +38,7 @@ @NotNull @Override public MapRenderer newSimpleMapRenderer(@NotNull final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel) { - throw new AssertionError(); + return new TestMapRenderer(mapModel); } /** Modified: trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java 2010-06-05 16:03:08 UTC (rev 8155) +++ trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java 2010-06-05 16:08:06 UTC (rev 8156) @@ -19,16 +19,23 @@ package net.sf.gridarta.gui.map.test; +import java.awt.Image; import java.awt.Point; +import java.awt.image.BufferedImage; import java.io.File; import java.util.regex.Pattern; import net.sf.gridarta.gui.copybuffer.CopyBuffer; import net.sf.gridarta.gui.map.mapview.MapView; import net.sf.gridarta.gui.map.mapview.MapViewBasic; +import net.sf.gridarta.gui.map.mapview.MapViewFactory; +import net.sf.gridarta.gui.map.mapview.MapViewsManager; +import net.sf.gridarta.gui.map.mapview.TestMapViewFactory; import net.sf.gridarta.gui.map.renderer.RendererFactory; import net.sf.gridarta.gui.map.renderer.TestRendererFactory; +import net.sf.gridarta.gui.mapimagecache.MapImageCache; import net.sf.gridarta.mapmanager.AbstractMapManager; import net.sf.gridarta.mapmanager.DefaultMapManager; +import net.sf.gridarta.mapmanager.FileControl; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.mapmanager.TestFileControl; import net.sf.gridarta.model.anim.AnimationObjects; @@ -52,6 +59,7 @@ import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.gameobject.TestGameObject; import net.sf.gridarta.model.gameobject.TestGameObjectFactory; +import net.sf.gridarta.model.io.CacheFiles; import net.sf.gridarta.model.io.MapReaderFactory; import net.sf.gridarta.model.io.MapWriter; import net.sf.gridarta.model.io.PathManager; @@ -121,6 +129,12 @@ private final MapManager<TestGameObject, TestMapArchObject, TestArchetype> mapManager; /** + * The pickmap {@link MapManager} instance. + */ + @NotNull + private final MapManager<TestGameObject, TestMapArchObject, TestArchetype> pickmapManager; + + /** * The {@link GameObjectFactory} instance. */ @NotNull @@ -179,7 +193,14 @@ */ @NotNull private final MapArchObjectFactory<TestMapArchObject> mapArchObjectFactory = new TestMapArchObjectFactory(); + /** + * The {@link FileControl} instance. + */ + @NotNull + private final FileControl<TestGameObject, TestMapArchObject, TestArchetype> fileControl = new TestFileControl(); + + /** * The {@link MapControlFactory} instance. */ @NotNull @@ -224,8 +245,11 @@ insertionModeSet.init(new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher()); mapControlFactory = new TestMapControlFactory(mapWriter, autojoinLists, archetypeChooserModel, gameObjectFactory, globalSettings, gameObjectMatchers, topmostInsertionMode); final AbstractMapManager<TestGameObject, TestMapArchObject, TestArchetype> tmpMapManager = new DefaultMapManager<TestGameObject, TestMapArchObject, TestArchetype>(mapReaderFactory, mapControlFactory, globalSettings); - tmpMapManager.setFileControl(new TestFileControl()); + tmpMapManager.setFileControl(fileControl); mapManager = tmpMapManager; + final AbstractMapManager<TestGameObject, TestMapArchObject, TestArchetype> tmpPickmapManager = new DefaultMapManager<TestGameObject, TestMapArchObject, TestArchetype>(mapReaderFactory, mapControlFactory, globalSettings); + tmpPickmapManager.setFileControl(fileControl); + pickmapManager = tmpPickmapManager; floorArchetype = new TestArchetype("floor", faceObjectProviders, animationObjects); floorArchetype.setAttributeString(BaseObject.TYPE, Integer.toString(FLOOR_TYPE)); @@ -517,4 +541,45 @@ return gameObjectFactory; } + /** + * Creates a new {@link MapViewsManager} instance. + * @return the map views manager instance + */ + @NotNull + public MapViewsManager<TestGameObject, TestMapArchObject, TestArchetype> newMapViewsManager() { + final RendererFactory<TestGameObject, TestMapArchObject, TestArchetype> rendererFactory = new TestRendererFactory(); + final MapViewFactory<TestGameObject, TestMapArchObject, TestArchetype> mapViewFactory = new TestMapViewFactory(rendererFactory, pathManager); + return new MapViewsManager<TestGameObject, TestMapArchObject, TestArchetype>(mapViewSettings, mapViewFactory, mapManager, pickmapManager); + } + + /** + * Creates a new {@link MapImageCache} instance. + * @return the map image cache instance + */ + @NotNull + public MapImageCache<TestGameObject, TestMapArchObject, TestArchetype> newMapImageCache() { + final RendererFactory<TestGameObject, TestMapArchObject, TestArchetype> rendererFactory = new TestRendererFactory(); + final Image defaultIcon = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); + final Image defaultPreview = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); + final CacheFiles cacheFiles = new CacheFiles() { + + @NotNull + @Override + public File getCacheFile(@NotNull final File file, @Nullable final String prefix) { + return file; + } + + }; + return new MapImageCache<TestGameObject, TestMapArchObject, TestArchetype>(mapManager, defaultIcon, defaultPreview, rendererFactory, cacheFiles); + } + + /** + * Returns the {@link FileControl} instance. + * @return the file control instance + */ + @NotNull + public FileControl<TestGameObject, TestMapArchObject, TestArchetype> getFileControl() { + return fileControl; + } + } // class TestMapControlCreator Added: trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java (rev 0) +++ trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java 2010-06-05 16:08:06 UTC (rev 8156) @@ -0,0 +1,104 @@ +/* + * 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.gui.mapmenu; + +import java.io.File; +import java.io.IOException; +import net.sf.gridarta.gui.map.mapview.MapViewsManager; +import net.sf.gridarta.gui.map.test.TestMapControlCreator; +import net.sf.gridarta.gui.mapimagecache.MapImageCache; +import net.sf.gridarta.model.archetype.DuplicateArchetypeException; +import net.sf.gridarta.model.archetype.TestArchetype; +import net.sf.gridarta.model.gameobject.TestGameObject; +import net.sf.gridarta.model.map.maparchobject.TestMapArchObject; +import net.sf.gridarta.model.map.mapcontrol.MapControl; +import net.sf.gridarta.utils.Size2D; +import org.jetbrains.annotations.NotNull; +import org.junit.Assert; +import org.junit.Test; + +/** + * Regression tests for {@link MapMenuManager}. + * @author Andreas Kirschbaum + */ +public class MapMenuManagerTest { + + /** + * Checks that {@link MapMenuManager} does not duplicate bookmark entries + * when a map is saved. + * @throws DuplicateArchetypeException if the test fails + * @throws IOException if the test fails + */ + @Test + public void testSaveBookmarks() throws DuplicateArchetypeException, IOException { + final TestMapControlCreator testMapControlCreator = new TestMapControlCreator(); + final MapViewsManager<TestGameObject, TestMapArchObject, TestArchetype> mapViewsManager = testMapControlCreator.newMapViewsManager(); + final MapImageCache<TestGameObject, TestMapArchObject, TestArchetype> mapImageCache = testMapControlCreator.newMapImageCache(); + final MapMenuPreferences<TestGameObject, TestMapArchObject, TestArchetype> mapMenuPreferences = new AbstractMapMenuPreferences<TestGameObject, TestMapArchObject, TestArchetype>(mapViewsManager, testMapControlCreator.getGlobalSettings(), mapImageCache, testMapControlCreator.getFileControl()) { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + @Override + protected void save() { + // ignore + } + + @Override + public void init() { + // ignore + } + + @NotNull + @Override + public String getTitle(final int index) { + return "title " + index; + } + + @NotNull + @Override + public File getMapFile(final int index) { + return new File("file " + index); + } + + @NotNull + @Override + public String getShortDescription(@NotNull final String title, @NotNull final String mapFile) { + return "description"; + } + + @Override + public void addMapMenuEntry(@NotNull final String title, @NotNull final File mapFile, final boolean doSave) { + final MapMenuEntry<TestGameObject, TestMapArchObject, TestArchetype> mapMenuEntry = newMapMenuEntry(title, mapFile); + addMapMenuEntry(getSize(), mapMenuEntry); + } + + }; + final MapMenuManager<TestGameObject, TestMapArchObject, TestArchetype> mapMenuManager = new MapMenuManager<TestGameObject, TestMapArchObject, TestArchetype>(testMapControlCreator.getMapManager(), mapMenuPreferences); + final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl1 = testMapControlCreator.newMapControl(new File("file"), "name1", new Size2D(1, 1)); + mapMenuManager.addRecent(mapControl1.getMapModel(), "title1"); + Assert.assertEquals(1, mapMenuPreferences.getSize()); + mapControl1.save(); + Assert.assertEquals(1, mapMenuPreferences.getSize()); + } + +} // class MapMenuManagerTest Property changes on: trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 19:33:38
|
Revision: 8159 http://gridarta.svn.sourceforge.net/gridarta/?rev=8159&view=rev Author: akirschbaum Date: 2010-06-05 19:33:32 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Fix direction chooser in archetype chooser. Now it is enabled for all archetypes that are either is_turnable or is_animated. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.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/UndefinedArchetype.java trunk/daimonin/ChangeLog trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetype.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java trunk/src/test/net/sf/gridarta/model/archetype/TestArchetype.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-05 16:11:49 UTC (rev 8158) +++ trunk/atrinik/ChangeLog 2010-06-05 19:33:32 UTC (rev 8159) @@ -1,5 +1,8 @@ 2010-06-05 Andreas Kirschbaum + * Fix direction chooser in archetype chooser. Now it is enabled + for all archetypes that are either is_turnable or is_animated. + * Do not duplicate bookmarks when saving maps. 2010-06-04 Andreas Kirschbaum 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-05 16:11:49 UTC (rev 8158) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java 2010-06-05 19:33:32 UTC (rev 8159) @@ -60,6 +60,14 @@ /** * {@inheritDoc} */ + @Override + public boolean usesDirection() { + return getAttributeInt("is_turnable") != 0 || getAttributeInt("is_animated") != 0; + } + + /** + * {@inheritDoc} + */ @NotNull @Override protected Archetype getThis() { 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-05 16:11:49 UTC (rev 8158) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java 2010-06-05 19:33:32 UTC (rev 8159) @@ -70,6 +70,14 @@ /** * {@inheritDoc} */ + @Override + public boolean usesDirection() { + return false; + } + + /** + * {@inheritDoc} + */ @NotNull @Override protected Archetype getThis() { 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-05 16:11:49 UTC (rev 8158) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java 2010-06-05 19:33:32 UTC (rev 8159) @@ -60,6 +60,14 @@ /** * {@inheritDoc} */ + @Override + public boolean usesDirection() { + return false; //getAttributeInt("is_turnable") != 0; + } + + /** + * {@inheritDoc} + */ @NotNull @Override protected Archetype getThis() { 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-05 16:11:49 UTC (rev 8158) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java 2010-06-05 19:33:32 UTC (rev 8159) @@ -70,6 +70,14 @@ /** * {@inheritDoc} */ + @Override + public boolean usesDirection() { + return false; + } + + /** + * {@inheritDoc} + */ @NotNull @Override protected Archetype getThis() { Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-05 16:11:49 UTC (rev 8158) +++ trunk/daimonin/ChangeLog 2010-06-05 19:33:32 UTC (rev 8159) @@ -1,5 +1,8 @@ 2010-06-05 Andreas Kirschbaum + * Fix direction chooser in archetype chooser. Now it is enabled + for all archetypes that are either is_turnable or is_animated. + * Do not duplicate bookmarks when saving maps. 2010-06-04 Andreas Kirschbaum Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetype.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetype.java 2010-06-05 16:11:49 UTC (rev 8158) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetype.java 2010-06-05 19:33:32 UTC (rev 8159) @@ -60,6 +60,14 @@ /** * {@inheritDoc} */ + @Override + public boolean usesDirection() { + return getAttributeInt("is_turnable") != 0 || getAttributeInt("is_animated") != 0; + } + + /** + * {@inheritDoc} + */ @NotNull @Override protected Archetype getThis() { Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java 2010-06-05 16:11:49 UTC (rev 8158) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java 2010-06-05 19:33:32 UTC (rev 8159) @@ -70,6 +70,14 @@ /** * {@inheritDoc} */ + @Override + public boolean usesDirection() { + return false; + } + + /** + * {@inheritDoc} + */ @NotNull @Override protected Archetype getThis() { Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-06-05 16:11:49 UTC (rev 8158) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-06-05 19:33:32 UTC (rev 8159) @@ -192,14 +192,6 @@ /** * {@inheritDoc} */ - @Override - public boolean usesDirection() { - return false; - } - - /** - * {@inheritDoc} - */ @NotNull @Override public String getArchetypeName() { Modified: trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-06-05 16:11:49 UTC (rev 8158) +++ trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-06-05 19:33:32 UTC (rev 8159) @@ -40,12 +40,6 @@ public interface Archetype<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends BaseObject<G, A, R, R> { /** - * Return whether this archetype uses the "direction" attribute. - * @return Whether this archetype uses the "direction" attribute. - */ - boolean usesDirection(); - - /** * Return all inventory objects. * @return An iterator returning all inventory objects. */ Modified: trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-06-05 16:11:49 UTC (rev 8158) +++ trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-06-05 19:33:32 UTC (rev 8159) @@ -541,4 +541,10 @@ */ void visit(@NotNull BaseObjectVisitor<G, A, R> baseObjectVisitor); + /** + * Return whether this base object uses the "direction" attribute. + * @return Whether this base object uses the "direction" attribute. + */ + boolean usesDirection(); + } // interface BaseObject Modified: trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java 2010-06-05 16:11:49 UTC (rev 8158) +++ trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java 2010-06-05 19:33:32 UTC (rev 8159) @@ -122,12 +122,6 @@ boolean isEmpty(); /** - * Return whether this archetype uses the "direction" attribute. - * @return Whether this archetype uses the "direction" attribute. - */ - boolean usesDirection(); - - /** * Returns the face for this game object according to the settings of a * {@link MapViewSettings} instance. * @param mapViewSettings the map view settings instance Modified: trunk/src/test/net/sf/gridarta/model/archetype/TestArchetype.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/archetype/TestArchetype.java 2010-06-05 16:11:49 UTC (rev 8158) +++ trunk/src/test/net/sf/gridarta/model/archetype/TestArchetype.java 2010-06-05 19:33:32 UTC (rev 8159) @@ -59,6 +59,14 @@ /** * {@inheritDoc} */ + @Override + public boolean usesDirection() { + return false; + } + + /** + * {@inheritDoc} + */ @NotNull @Override protected TestArchetype getThis() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-06 12:41:37
|
Revision: 8172 http://gridarta.svn.sourceforge.net/gridarta/?rev=8172&view=rev Author: akirschbaum Date: 2010-06-06 12:41:31 +0000 (Sun, 06 Jun 2010) Log Message: ----------- Allow to create more than one event script for the same type in game object attributes panel. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-06 12:16:52 UTC (rev 8171) +++ trunk/atrinik/ChangeLog 2010-06-06 12:41:31 UTC (rev 8172) @@ -1,3 +1,8 @@ +2010-06-06 Andreas Kirschbaum + + * Allow to create more than one event script for the same type in + game object attributes panel. + 2010-06-05 Andreas Kirschbaum * Fix direction chooser in archetype chooser. Now it is enabled Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-06 12:16:52 UTC (rev 8171) +++ trunk/crossfire/ChangeLog 2010-06-06 12:41:31 UTC (rev 8172) @@ -1,3 +1,8 @@ +2010-06-06 Andreas Kirschbaum + + * Allow to create more than one event script for the same type in + game object attributes panel. + 2010-06-05 Andreas Kirschbaum * Do not duplicate bookmarks when saving maps. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-06 12:16:52 UTC (rev 8171) +++ trunk/daimonin/ChangeLog 2010-06-06 12:41:31 UTC (rev 8172) @@ -1,3 +1,8 @@ +2010-06-06 Andreas Kirschbaum + + * Allow to create more than one event script for the same type in + game object attributes panel. + 2010-06-05 Andreas Kirschbaum * Fix direction chooser in archetype chooser. Now it is enabled Modified: trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java 2010-06-06 12:16:52 UTC (rev 8171) +++ trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java 2010-06-06 12:41:31 UTC (rev 8172) @@ -304,16 +304,6 @@ final File localMapDir = mapManager.getLocalMapDir(); - // first check if that event type is not already in use - final GameObject<G, A, R> replaceObject = scriptArchData.getScriptedEvent(eventType, gameObject); - if (replaceObject != null) { - // collision with existing event -> ask user: replace? - if (JOptionPane.showConfirmDialog(frame, "An event of type \"" + scriptArchUtils.typeName(eventType) + "\" already exists for this object.\n" + "Do you want to replace the existing event?", "Event exists", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.NO_OPTION) { - // bail out - return; - } - } - String absScriptPath; if (scriptPath.length() > 0 && scriptPath.charAt(0) == '/') { // script path is absolute @@ -349,9 +339,6 @@ JOptionPane.showMessageDialog(frame, "Cannot create event of type " + eventType + ":\n" + ex.getMessage() + ".", "Cannot create event", JOptionPane.ERROR_MESSAGE); return; } - if (replaceObject != null) { - replaceObject.remove(); - } gameObject.addLast(event.getEventArch()); frame.setVisible(false); // close dialog } @@ -391,9 +378,6 @@ JOptionPane.showMessageDialog(frame, "Cannot create event of type " + eventType + ":\n" + ex.getMessage() + ".", "Cannot create event", JOptionPane.ERROR_MESSAGE); return; } - if (replaceObject != null) { - replaceObject.remove(); - } gameObject.addLast(event.getEventArch()); frame.setVisible(false); // close dialog This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-06 13:47:48
|
Revision: 8174 http://gridarta.svn.sourceforge.net/gridarta/?rev=8174&view=rev Author: akirschbaum Date: 2010-06-06 13:47:41 +0000 (Sun, 06 Jun 2010) Log Message: ----------- Revert previous commit as it creates maps not supported by the server. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-06 12:53:04 UTC (rev 8173) +++ trunk/atrinik/ChangeLog 2010-06-06 13:47:41 UTC (rev 8174) @@ -1,8 +1,3 @@ -2010-06-06 Andreas Kirschbaum - - * Allow to create more than one event script for the same type in - game object attributes panel. - 2010-06-05 Andreas Kirschbaum * Fix direction chooser in archetype chooser. Now it is enabled Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-06 12:53:04 UTC (rev 8173) +++ trunk/crossfire/ChangeLog 2010-06-06 13:47:41 UTC (rev 8174) @@ -1,8 +1,3 @@ -2010-06-06 Andreas Kirschbaum - - * Allow to create more than one event script for the same type in - game object attributes panel. - 2010-06-05 Andreas Kirschbaum * Do not duplicate bookmarks when saving maps. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-06 12:53:04 UTC (rev 8173) +++ trunk/daimonin/ChangeLog 2010-06-06 13:47:41 UTC (rev 8174) @@ -1,8 +1,3 @@ -2010-06-06 Andreas Kirschbaum - - * Allow to create more than one event script for the same type in - game object attributes panel. - 2010-06-05 Andreas Kirschbaum * Fix direction chooser in archetype chooser. Now it is enabled Modified: trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java 2010-06-06 12:53:04 UTC (rev 8173) +++ trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java 2010-06-06 13:47:41 UTC (rev 8174) @@ -314,6 +314,16 @@ final File localMapDir = mapManager.getLocalMapDir(); + // first check if that event type is not already in use + final GameObject<G, A, R> replaceObject = scriptArchData.getScriptedEvent(eventType, gameObject); + if (replaceObject != null) { + // collision with existing event -> ask user: replace? + if (JOptionPane.showConfirmDialog(frame, "An event of type \"" + scriptArchUtils.typeName(eventType) + "\" already exists for this object.\n" + "Do you want to replace the existing event?", "Event exists", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.NO_OPTION) { + // bail out + return; + } + } + String absScriptPath; if (scriptPath.length() > 0 && scriptPath.charAt(0) == '/') { // script path is absolute @@ -349,6 +359,9 @@ JOptionPane.showMessageDialog(frame, "Cannot create event of type " + eventType + ":\n" + ex.getMessage() + ".", "Cannot create event", JOptionPane.ERROR_MESSAGE); return; } + if (replaceObject != null) { + replaceObject.remove(); + } gameObject.addLast(event.getEventArch()); frame.setVisible(false); // close dialog } @@ -388,6 +401,9 @@ JOptionPane.showMessageDialog(frame, "Cannot create event of type " + eventType + ":\n" + ex.getMessage() + ".", "Cannot create event", JOptionPane.ERROR_MESSAGE); return; } + if (replaceObject != null) { + replaceObject.remove(); + } gameObject.addLast(event.getEventArch()); frame.setVisible(false); // close dialog This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-06 15:47:45
|
Revision: 8175 http://gridarta.svn.sourceforge.net/gridarta/?rev=8175&view=rev Author: akirschbaum Date: 2010-06-06 15:47:38 +0000 (Sun, 06 Jun 2010) Log Message: ----------- Fix NullPointerException in "paste exit" when connecting to an unsaved map. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/exitconnector/ExitConnectorActions.java trunk/src/app/net/sf/gridarta/model/exitconnector/ExitLocation.java trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-06 13:47:41 UTC (rev 8174) +++ trunk/atrinik/ChangeLog 2010-06-06 15:47:38 UTC (rev 8175) @@ -1,3 +1,8 @@ +2010-06-06 Andreas Kirschbaum + + * Fix NullPointerException in "paste exit" when connecting to an + unsaved map. + 2010-06-05 Andreas Kirschbaum * Fix direction chooser in archetype chooser. Now it is enabled Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-06 13:47:41 UTC (rev 8174) +++ trunk/crossfire/ChangeLog 2010-06-06 15:47:38 UTC (rev 8175) @@ -1,3 +1,8 @@ +2010-06-06 Andreas Kirschbaum + + * Fix NullPointerException in "paste exit" when connecting to an + unsaved map. + 2010-06-05 Andreas Kirschbaum * Do not duplicate bookmarks when saving maps. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-06 13:47:41 UTC (rev 8174) +++ trunk/daimonin/ChangeLog 2010-06-06 15:47:38 UTC (rev 8175) @@ -1,3 +1,8 @@ +2010-06-06 Andreas Kirschbaum + + * Fix NullPointerException in "paste exit" when connecting to an + unsaved map. + 2010-06-05 Andreas Kirschbaum * Fix direction chooser in archetype chooser. Now it is enabled Modified: trunk/src/app/net/sf/gridarta/exitconnector/ExitConnectorActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/exitconnector/ExitConnectorActions.java 2010-06-06 13:47:41 UTC (rev 8174) +++ trunk/src/app/net/sf/gridarta/exitconnector/ExitConnectorActions.java 2010-06-06 15:47:38 UTC (rev 8175) @@ -160,11 +160,16 @@ return false; } + final File targetMapFile = targetMapModel.getMapFile(); + if (targetMapFile == null) { + return false; + } + if (targetExit != null) { // paste into existing exit if (performAction) { - pasteExit(targetExit, targetMapModel, sourceExitLocation); + pasteExit(targetExit, targetMapModel, sourceExitLocation, targetMapFile); } } else { // paste into newly created exit game object @@ -177,7 +182,7 @@ } if (performAction) { - if (!pasteExit(targetLocation, targetMapModel, targetArchetype, sourceExitLocation)) { + if (!pasteExit(targetLocation, targetMapModel, targetArchetype, sourceExitLocation, targetMapFile)) { return false; } } @@ -296,18 +301,18 @@ if (performAction) { final ExitLocation targetExitLocation = new ExitLocation(targetMapFile, targetLocation, targetMapModel.getMapArchObject().getMapName(), pathManager); if (sourceExit != null) { - pasteExit(sourceExit, sourceMapModel, targetExitLocation); + pasteExit(sourceExit, sourceMapModel, targetExitLocation, sourceMapFile); } else { - if (!pasteExit(sourceLocation, sourceMapModel, sourceArchetype, targetExitLocation)) { + if (!pasteExit(sourceLocation, sourceMapModel, sourceArchetype, targetExitLocation, sourceMapFile)) { return false; } } if (targetExit != null) { - pasteExit(targetExit, targetMapModel, sourceExitLocation); + pasteExit(targetExit, targetMapModel, sourceExitLocation, targetMapFile); } else { assert targetArchetype != null; - if (!pasteExit(targetLocation, targetMapModel, targetArchetype, sourceExitLocation)) { + if (!pasteExit(targetLocation, targetMapModel, targetArchetype, sourceExitLocation, targetMapFile)) { return false; } } @@ -321,11 +326,12 @@ * @param gameObject the exit game object to paste into * @param mapModel the map model to paste into * @param exitLocation the exit information to paste + * @param mapFile the map file to path */ - private void pasteExit(@NotNull final BaseObject<?, ?, ?, ?> gameObject, @NotNull final MapModel<G, A, R> mapModel, @NotNull final ExitLocation exitLocation) { + private void pasteExit(@NotNull final BaseObject<?, ?, ?, ?> gameObject, @NotNull final MapModel<G, A, R> mapModel, @NotNull final ExitLocation exitLocation, @NotNull final File mapFile) { mapModel.beginTransaction("paste exit"); try { - exitLocation.updateExitObject(gameObject, exitConnectorModel.isPasteExitName(), mapModel.getMapFile()); + exitLocation.updateExitObject(gameObject, exitConnectorModel.isPasteExitName(), mapFile); } finally { mapModel.endTransaction(); } @@ -337,9 +343,10 @@ * @param mapModel the map model to insert into * @param archetype the archetype to insert * @param exitLocation the exit information to use + * @param mapFile the map file to paste * @return whether insertion was successful */ - private boolean pasteExit(@NotNull final Point location, @NotNull final MapModel<G, A, R> mapModel, @NotNull final BaseObject<G, A, R, ?> archetype, @NotNull final ExitLocation exitLocation) { + private boolean pasteExit(@NotNull final Point location, @NotNull final MapModel<G, A, R> mapModel, @NotNull final BaseObject<G, A, R, ?> archetype, @NotNull final ExitLocation exitLocation, @NotNull final File mapFile) { mapModel.beginTransaction("paste exit"); try { final BaseObject<G, A, R, ?> newExit = mapModel.insertBaseObject(archetype, location, true, false, insertionModeSet.getTopmostInsertionMode()); @@ -347,7 +354,7 @@ return false; } - exitLocation.updateExitObject(newExit, exitConnectorModel.isPasteExitName(), mapModel.getMapFile()); + exitLocation.updateExitObject(newExit, exitConnectorModel.isPasteExitName(), mapFile); } finally { mapModel.endTransaction(); } Modified: trunk/src/app/net/sf/gridarta/model/exitconnector/ExitLocation.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/exitconnector/ExitLocation.java 2010-06-06 13:47:41 UTC (rev 8174) +++ trunk/src/app/net/sf/gridarta/model/exitconnector/ExitLocation.java 2010-06-06 15:47:38 UTC (rev 8175) @@ -91,7 +91,7 @@ * @param sourceMapFile the file of the map containing * <code>gameObject</code> */ - public void updateExitObject(@NotNull final BaseObject<?, ?, ?, ?> gameObject, final boolean updateName, @Nullable final File sourceMapFile) { + public void updateExitObject(@NotNull final BaseObject<?, ?, ?, ?> gameObject, final boolean updateName, @NotNull final File sourceMapFile) { final String sourceMapPath = pathManager.getMapPath(sourceMapFile); final String targetMapPath = pathManager.getMapPath(file); Modified: trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java 2010-06-06 13:47:41 UTC (rev 8174) +++ trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java 2010-06-06 15:47:38 UTC (rev 8175) @@ -143,6 +143,38 @@ } /** + * Checks that {@link ExitConnectorActions#doExitPaste(boolean, MapControl, + * Point)} does not crash when connecting to an unsaved map. + */ + @Test + public void testExitPaste2() { + final ExitConnectorModel model = new ExitConnectorModel(); + final ExitConnectorActions<TestGameObject, TestMapArchObject, TestArchetype> actions = createActions(model); + final Size2D mapSize = new Size2D(5, 5); + + assert testMapControlCreator != null; + final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl1 = testMapControlCreator.newMapControl(MAP_FILE1, MAP_NAME1, mapSize); + final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel1 = mapControl1.getMapModel(); + + final Point point1 = new Point(3, 4); + final Point point2 = new Point(1, 2); + + assert testMapControlCreator != null; + model.setExitLocation(new ExitLocation(MAP_FILE2, point2, MAP_NAME2, testMapControlCreator.getPathManager())); + + model.setAutoCreateExit(true); + model.setExitArchetypeName("exit"); + + // paste must fail for unsaved map + mapModel1.setMapFile(null); // pretend unsaved map + Assert.assertFalse(actions.doExitPaste(true, mapControl1, point1)); + + // paste must succeed for saved map + mapModel1.setMapFile(MAP_FILE1); // pretend saved map + Assert.assertTrue(actions.doExitPaste(true, mapControl1, point1)); + } + + /** * Checks that {@link ExitConnectorActions#doExitConnect(boolean, * MapControl, Point)} does work. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-06 18:43:57
|
Revision: 8183 http://gridarta.svn.sourceforge.net/gridarta/?rev=8183&view=rev Author: akirschbaum Date: 2010-06-06 18:43:50 +0000 (Sun, 06 Jun 2010) Log Message: ----------- Remove dependency GameObjectAttributesDialog -> SystemIcons. Modified Paths: -------------- trunk/gridarta.ipr 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/AnimTreeChooseAction.java trunk/src/app/net/sf/gridarta/gui/utils/AnimationComponent.java trunk/src/app/net/sf/gridarta/gui/utils/FaceComponent.java trunk/src/app/net/sf/gridarta/gui/utils/FaceTreeChooseAction.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2010-06-06 18:24:34 UTC (rev 8182) +++ trunk/gridarta.ipr 2010-06-06 18:43:50 UTC (rev 8183) @@ -52,7 +52,6 @@ <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" /> <option name="SPACE_WITHIN_ARRAY_INITIALIZER_BRACES" value="true" /> <option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" /> - <option name="PREFER_LONGER_NAMES" value="false" /> <option name="GENERATE_FINAL_LOCALS" value="true" /> <option name="GENERATE_FINAL_PARAMETERS" value="true" /> <option name="USE_FQ_CLASS_NAMES_IN_JAVADOC" value="false" /> Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-06 18:24:34 UTC (rev 8182) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-06 18:43:50 UTC (rev 8183) @@ -134,7 +134,6 @@ import net.sf.gridarta.utils.CommonConstants; import net.sf.gridarta.utils.Size2D; import net.sf.gridarta.utils.StringUtils; -import net.sf.gridarta.utils.SystemIcons; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.action.ActionMethod; @@ -250,12 +249,18 @@ private final TreasureTree treasureTree; /** - * The {@link SystemIcons} for creating icons. + * The {@link ImageIcon} for no animations. */ @NotNull - private final SystemIcons systemIcons; + private final ImageIcon noFaceSquareIcon; /** + * The {@link ImageIcon} for undefined animations. + */ + @NotNull + private final ImageIcon unknownSquareIcon; + + /** * The {@link GameObjectMatchers} to use. */ @NotNull @@ -402,7 +407,7 @@ public void visit(@NotNull final ArchetypeAttributeAnimationName archetypeAttribute) { final String attributeName = archetypeAttribute.getArchetypeAttributeName(); final String defaultText = gameObject.getAttributeString(attributeName); - final AnimationComponent input = new AnimationComponent(defaultText, animationObjects, faceObjectProviders, systemIcons); + final AnimationComponent input = new AnimationComponent(defaultText, animationObjects, faceObjectProviders, noFaceSquareIcon, unknownSquareIcon); final JLabel cLabel = new JLabel(archetypeAttribute.getAttributeName() + ": "); guiInfo = new GuiInfo<G, A, R, ArchetypeAttributeAnimationName>(new DialogAttributeAnimationName<G, A, R>(archetypeAttribute, input), cLabel, input, null, null, false); } @@ -460,7 +465,7 @@ public void visit(@NotNull final ArchetypeAttributeFaceName archetypeAttribute) { final String attributeName = archetypeAttribute.getArchetypeAttributeName(); final String defaultText = gameObject.getAttributeString(attributeName); - final FaceComponent input = new FaceComponent(defaultText, faceObjects, faceObjectProviders, systemIcons); + final FaceComponent input = new FaceComponent(defaultText, faceObjects, faceObjectProviders, noFaceSquareIcon, unknownSquareIcon); final JLabel cLabel = new JLabel(archetypeAttribute.getAttributeName() + ":"); guiInfo = new GuiInfo<G, A, R, ArchetypeAttributeFaceName>(new DialogAttributeFaceName<G, A, R>(archetypeAttribute, input), cLabel, input, null, null, false); } @@ -765,12 +770,13 @@ * @param numberSpells the numbered spells to use * @param undefinedSpellIndex the index for "no spell" * @param treasureTree the treasure tree to use - * @param systemIcons the system icons for creating icons + * @param noFaceSquareIcon the image icon for no animations + * @param unknownSquareIcon the image icon for undefined animations * @param gameObjectMatchers the game object matchers to use * @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 SystemIcons systemIcons, @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 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) { this.gameObjectAttributesDialogFactory = gameObjectAttributesDialogFactory; this.archetypeTypeSet = archetypeTypeSet; this.gameObject = gameObject; @@ -786,7 +792,8 @@ this.numberSpells = numberSpells; this.undefinedSpellIndex = undefinedSpellIndex; this.treasureTree = treasureTree; - this.systemIcons = systemIcons; + this.noFaceSquareIcon = noFaceSquareIcon; + this.unknownSquareIcon = unknownSquareIcon; this.gameObjectMatchers = gameObjectMatchers; this.textAreaDefaults = textAreaDefaults; this.mapManager = mapManager; Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java 2010-06-06 18:24:34 UTC (rev 8182) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java 2010-06-06 18:43:50 UTC (rev 8183) @@ -22,6 +22,7 @@ import java.awt.Window; import java.util.HashMap; import java.util.Map; +import javax.swing.ImageIcon; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.filechooser.FileFilter; @@ -41,7 +42,6 @@ import net.sf.gridarta.model.spells.Spells; import net.sf.gridarta.model.treasurelist.TreasureTree; import net.sf.gridarta.textedit.textarea.TextAreaDefaults; -import net.sf.gridarta.utils.SystemIcons; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; @@ -137,12 +137,18 @@ private final TreasureTree treasureTree; /** - * The {@link SystemIcons} for creating icons. + * The {@link ImageIcon} for no animations. */ @NotNull - private final SystemIcons systemIcons; + private final ImageIcon noFaceSquareIcon; /** + * The {@link ImageIcon} for undefined animations. + */ + @NotNull + private final ImageIcon unknownSquareIcon; + + /** * The {@link GameObjectMatchers} to use. */ @NotNull @@ -177,11 +183,12 @@ * @param numberSpells the numbered spells to use * @param undefinedSpellIndex the index for "no spell" * @param treasureTree the treasure tree to use - * @param systemIcons the system icons for creating icons + * @param noFaceSquareIcon the image icon for no animations + * @param unknownSquareIcon the image icon for undefined animations * @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 SystemIcons systemIcons, @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 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) { this.archetypeTypeSet = archetypeTypeSet; this.parent = parent; this.treasureListTree = treasureListTree; @@ -195,7 +202,8 @@ this.numberSpells = numberSpells; this.undefinedSpellIndex = undefinedSpellIndex; this.treasureTree = treasureTree; - this.systemIcons = systemIcons; + this.unknownSquareIcon = unknownSquareIcon; + this.noFaceSquareIcon = noFaceSquareIcon; this.gameObjectMatchers = gameObjectMatchers; this.mapManager = mapManager; } @@ -222,7 +230,7 @@ if (dialogs.containsKey(head)) { dialogs.get(head).toFront(); } else { - final GameObjectAttributesDialog<G, A, R> pane = new GameObjectAttributesDialog<G, A, R>(this, archetypeTypeSet, head, parent, treasureListTree, faceObjectProviders, animationObjects, globalSettings, mapFileFilter, scriptFileFilter, faceObjects, gameObjectSpells, numberSpells, undefinedSpellIndex, treasureTree, systemIcons, gameObjectMatchers, textAreaDefaults, mapManager); + final GameObjectAttributesDialog<G, A, R> pane = new GameObjectAttributesDialog<G, A, R>(this, archetypeTypeSet, head, parent, treasureListTree, faceObjectProviders, animationObjects, globalSettings, mapFileFilter, scriptFileFilter, faceObjects, gameObjectSpells, numberSpells, undefinedSpellIndex, treasureTree, noFaceSquareIcon, unknownSquareIcon, gameObjectMatchers, textAreaDefaults, mapManager); final JDialog dialog = pane.createDialog(); dialogs.put(head, dialog); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java 2010-06-06 18:24:34 UTC (rev 8182) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java 2010-06-06 18:43:50 UTC (rev 8183) @@ -24,6 +24,7 @@ import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import javax.swing.AbstractButton; +import javax.swing.ImageIcon; import javax.swing.JCheckBox; import javax.swing.JComponent; import javax.swing.JLabel; @@ -45,7 +46,6 @@ import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.model.map.mapmodel.MapModel; import net.sf.gridarta.model.map.mapmodel.MapSquare; -import net.sf.gridarta.utils.SystemIcons; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -160,14 +160,15 @@ * @param faceObjects the face objects for looking up faces * @param faceObjectProviders the face object providers to use * @param animationObjects the animation objects for looking up animations - * @param systemIcons the system icons for creating icons + * @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 SystemIcons systemIcons) { + 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) { super(gameObjectAttributesModel); this.faceObjects = faceObjects; this.animationObjects = animationObjects; - faceComponent = new FaceComponent("", faceObjects, faceObjectProviders, systemIcons); - animationComponent = new AnimationComponent("", animationObjects, faceObjectProviders, systemIcons); + faceComponent = new FaceComponent("", faceObjects, faceObjectProviders, noFaceSquareIcon, unknownSquareIcon); + animationComponent = new AnimationComponent("", animationObjects, faceObjectProviders, noFaceSquareIcon, unknownSquareIcon); final GridBagLayout gridBagLayout = new GridBagLayout(); final GridBagConstraints gbc = new GridBagConstraints(); Modified: trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java 2010-06-06 18:24:34 UTC (rev 8182) +++ trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java 2010-06-06 18:43:50 UTC (rev 8183) @@ -22,11 +22,11 @@ import java.awt.event.ActionEvent; import javax.swing.AbstractButton; import javax.swing.Icon; +import javax.swing.ImageIcon; import javax.swing.text.JTextComponent; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.data.NamedObject; import net.sf.gridarta.model.face.FaceObjectProviders; -import net.sf.gridarta.utils.SystemIcons; import org.jetbrains.annotations.NotNull; /** @@ -59,12 +59,18 @@ private final FaceObjectProviders faceObjectProviders; /** - * The {@link SystemIcons} for creating icons. + * The {@link ImageIcon} for no animations. */ @NotNull - private final SystemIcons systemIcons; + private final ImageIcon noFaceSquareIcon; /** + * The {@link ImageIcon} for undefined animations. + */ + @NotNull + private final ImageIcon unknownSquareIcon; + + /** * Create a TreeChooseAction. * @param text the text for the button * @param textComponent the text component that holds the current animation @@ -74,14 +80,16 @@ * names tree * @param faceObjectProviders the face object providers for looking up * faces - * @param systemIcons the system icons for creating icons + * @param noFaceSquareIcon the image icon for no animations + * @param unknownSquareIcon the image icon for undefined animations */ - public AnimTreeChooseAction(@NotNull final String text, @NotNull final JTextComponent textComponent, @NotNull final AbstractButton icon, @NotNull final AnimationObjects animationObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final SystemIcons systemIcons) { + public AnimTreeChooseAction(@NotNull final String text, @NotNull final JTextComponent textComponent, @NotNull final AbstractButton icon, @NotNull final AnimationObjects animationObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final ImageIcon noFaceSquareIcon, @NotNull final ImageIcon unknownSquareIcon) { super(text, textComponent, animationObjects, faceObjectProviders); this.icon = icon; this.animationObjects = animationObjects; this.faceObjectProviders = faceObjectProviders; - this.systemIcons = systemIcons; + this.unknownSquareIcon = unknownSquareIcon; + this.noFaceSquareIcon = noFaceSquareIcon; updateIconLabel(); } @@ -101,14 +109,14 @@ final String animationName = getFaceName(); final Icon face; if (animationName.isEmpty() || animationName.equals("NONE")) { - face = systemIcons.getNoFaceSquareIcon(); + face = noFaceSquareIcon; } else { final NamedObject animationObject = animationObjects.get(animationName); if (animationObject == null) { - face = systemIcons.getUnknownSquareIcon(); + face = unknownSquareIcon; } else { final Icon tmp = animationObject.getDisplayIcon(faceObjectProviders); - face = tmp == null ? systemIcons.getUnknownSquareIcon() : tmp; + face = tmp == null ? unknownSquareIcon : tmp; } } icon.setIcon(face); Modified: trunk/src/app/net/sf/gridarta/gui/utils/AnimationComponent.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/AnimationComponent.java 2010-06-06 18:24:34 UTC (rev 8182) +++ trunk/src/app/net/sf/gridarta/gui/utils/AnimationComponent.java 2010-06-06 18:43:50 UTC (rev 8183) @@ -26,12 +26,12 @@ import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import javax.swing.AbstractButton; +import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.JTextField; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.face.FaceObjectProviders; -import net.sf.gridarta.utils.SystemIcons; import org.jetbrains.annotations.NotNull; /** @@ -63,16 +63,17 @@ * @param animationObjects the animation objects to use * @param faceObjectProviders the face object providers for looking up * faces - * @param systemIcons the system icons for creating icons + * @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 SystemIcons systemIcons) { + 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); textField.setColumns(8); final AbstractButton label = new JButton(); label.setMargin(new Insets(0, 0, 0, 0)); - animTreeChooseAction = new AnimTreeChooseAction("...", textField, label, animationObjects, faceObjectProviders, systemIcons); + animTreeChooseAction = new AnimTreeChooseAction("...", textField, label, animationObjects, faceObjectProviders, noFaceSquareIcon, unknownSquareIcon); label.addActionListener(animTreeChooseAction); final AbstractButton button = new JButton(animTreeChooseAction); button.setMargin(new Insets(0, 1, 0, 1)); Modified: trunk/src/app/net/sf/gridarta/gui/utils/FaceComponent.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/FaceComponent.java 2010-06-06 18:24:34 UTC (rev 8182) +++ trunk/src/app/net/sf/gridarta/gui/utils/FaceComponent.java 2010-06-06 18:43:50 UTC (rev 8183) @@ -26,12 +26,12 @@ import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import javax.swing.AbstractButton; +import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.JTextField; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; -import net.sf.gridarta.utils.SystemIcons; import org.jetbrains.annotations.NotNull; /** @@ -63,16 +63,17 @@ * @param faceObjects the face objects to use * @param faceObjectProviders the face object providers for looking up * faces - * @param systemIcons the system icons for creating icons + * @param noFaceSquareIcon the image icon for no animations + * @param unknownSquareIcon the image icon for undefined animations */ - public FaceComponent(@NotNull final String faceName, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final SystemIcons systemIcons) { + public FaceComponent(@NotNull final String faceName, @NotNull final FaceObjects faceObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final ImageIcon noFaceSquareIcon, @NotNull final ImageIcon unknownSquareIcon) { super(new GridBagLayout()); textField.setText(faceName); textField.setColumns(8); final AbstractButton label = new JButton(); label.setMargin(new Insets(0, 0, 0, 0)); - faceTreeChooseAction = new FaceTreeChooseAction("...", textField, label, faceObjects, faceObjectProviders, systemIcons); + faceTreeChooseAction = new FaceTreeChooseAction("...", textField, label, faceObjects, faceObjectProviders, noFaceSquareIcon, unknownSquareIcon); label.addActionListener(faceTreeChooseAction); final AbstractButton button = new JButton(faceTreeChooseAction); button.setMargin(new Insets(0, 1, 0, 1)); Modified: trunk/src/app/net/sf/gridarta/gui/utils/FaceTreeChooseAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/FaceTreeChooseAction.java 2010-06-06 18:24:34 UTC (rev 8182) +++ trunk/src/app/net/sf/gridarta/gui/utils/FaceTreeChooseAction.java 2010-06-06 18:43:50 UTC (rev 8183) @@ -22,11 +22,11 @@ import java.awt.event.ActionEvent; import javax.swing.AbstractButton; import javax.swing.Icon; +import javax.swing.ImageIcon; import javax.swing.text.JTextComponent; import net.sf.gridarta.model.data.NamedObject; import net.sf.gridarta.model.data.NamedObjects; import net.sf.gridarta.model.face.FaceObjectProviders; -import net.sf.gridarta.utils.SystemIcons; import org.jetbrains.annotations.NotNull; /** @@ -53,12 +53,18 @@ private final FaceObjectProviders faceObjectProviders; /** - * The {@link SystemIcons} for creating icons. + * The {@link ImageIcon} for no animations. */ @NotNull - private final SystemIcons systemIcons; + private final ImageIcon noFaceSquareIcon; /** + * The {@link ImageIcon} for undefined animations. + */ + @NotNull + private final ImageIcon unknownSquareIcon; + + /** * Create a TreeChooseAction. * @param text the text for the button * @param textComponent the text component that holds the current @@ -66,13 +72,15 @@ * @param icon the label showing the icon * @param namedObjects the named objects providing the face names tree * @param faceObjectProviders the face provider for looking up icons - * @param systemIcons the system icons for creating icons + * @param noFaceSquareIcon the image icon for no animations + * @param unknownSquareIcon the image icon for undefined animations */ - public FaceTreeChooseAction(@NotNull final String text, @NotNull final JTextComponent textComponent, @NotNull final AbstractButton icon, @NotNull final NamedObjects<? extends NamedObject> namedObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final SystemIcons systemIcons) { + public FaceTreeChooseAction(@NotNull final String text, @NotNull final JTextComponent textComponent, @NotNull final AbstractButton icon, @NotNull final NamedObjects<? extends NamedObject> namedObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final ImageIcon noFaceSquareIcon, @NotNull final ImageIcon unknownSquareIcon) { super(text, textComponent, namedObjects, faceObjectProviders); this.icon = icon; this.faceObjectProviders = faceObjectProviders; - this.systemIcons = systemIcons; + this.unknownSquareIcon = unknownSquareIcon; + this.noFaceSquareIcon = noFaceSquareIcon; updateIconLabel(); } @@ -92,10 +100,10 @@ final String faceName = getFaceName(); final Icon face; if (faceName.isEmpty() || faceName.equals("NONE")) { - face = systemIcons.getNoFaceSquareIcon(); + face = noFaceSquareIcon; } else { final Icon tmp = faceObjectProviders.getImageIconForFacename(faceName); - face = tmp == null ? systemIcons.getUnknownSquareIcon() : tmp; + face = tmp == null ? unknownSquareIcon : tmp; } icon.setIcon(face); } Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-06 18:24:34 UTC (rev 8182) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-06 18:43:50 UTC (rev 8183) @@ -460,12 +460,14 @@ pickmapChooserControl = new PickmapChooserControl<G, A, R>(pickmapChooserModel, newMapDialogFactory, mapArchObjectFactory, mapReaderFactory, mapFolderTree, mapManager, mainViewFrame, pickmapManager, mapViewsManager); newMapDialogFactory.setPickmapChooserControl(pickmapChooserControl); final CFTreasureListTree<G, A, R> treasureListTree = new CFTreasureListTree<G, A, R>(treasureTree, mainViewFrame, archetypeSet, faceObjectProviders, systemIcons); - final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory = new GameObjectAttributesDialogFactory<G, A, R>(archetypeTypeSet, mainViewFrame, treasureListTree, faceObjectProviders, animationObjects, globalSettings, mapFileFilter, scriptFileFilter, faceObjects, gameObjectSpells, numberSpells, undefinedSpellIndex, treasureTree, systemIcons, gameObjectMatchers, mapManager); + final ImageIcon noFaceSquareIcon = systemIcons.getNoFaceSquareIcon(); + final ImageIcon unknownSquareIcon = systemIcons.getUnknownSquareIcon(); + final GameObjectAttributesDialogFactory<G, A, R> gameObjectAttributesDialogFactory = new GameObjectAttributesDialogFactory<G, A, R>(archetypeTypeSet, mainViewFrame, treasureListTree, faceObjectProviders, animationObjects, globalSettings, mapFileFilter, scriptFileFilter, faceObjects, gameObjectSpells, numberSpells, undefinedSpellIndex, treasureTree, noFaceSquareIcon, unknownSquareIcon, gameObjectMatchers, mapManager); final DefaultObjectChooser<G, A, R> objectChooser = new DefaultObjectChooser<G, A, R>(archetypeChooserControl, pickmapChooserControl, archetypeChooserModel, pickmapChooserModel, archetypeTypeSet); newMapDialogFactory.setObjectChooser(objectChooser); final SelectedSquareModel<G, A, R> selectedSquareModel = new SelectedSquareModel<G, A, R>(); final SelectedSquareActions<G, A, R> selectedSquareActions = new SelectedSquareActions<G, A, R>(selectedSquareModel); - final SelectedSquareControl<G, A, R> selectedSquareControl = new SelectedSquareControl<G, A, R>(selectedSquareModel, selectedSquareActions, gameObjectAttributesDialogFactory, objectChooser, mapManager, mapViewManager, mapViewSettings, compassIcon, faceObjectProviders, systemIcons.getUnknownSquareIcon()); + final SelectedSquareControl<G, A, R> selectedSquareControl = new SelectedSquareControl<G, A, R>(selectedSquareModel, selectedSquareActions, gameObjectAttributesDialogFactory, objectChooser, mapManager, mapViewManager, mapViewSettings, compassIcon, faceObjectProviders, unknownSquareIcon); final InsertionModeSet<G, A, R> insertionModeSet = new InsertionModeSet<G, A, R>(topmostInsertionMode); final CopyBuffer<G, A, R> copyBuffer = new CopyBuffer<G, A, R>(mapViewSettings, gameObjectFactory, mapArchObjectFactory, mapControlFactory, insertionModeSet); final ReplaceDialogManager<G, A, R> replaceDialogManager = new ReplaceDialogManager<G, A, R>(mainViewFrame, copyBuffer, objectChooser, mapViewManager, faceObjectProviders, insertionModeSet); @@ -582,7 +584,7 @@ gameObjectAttributesControl.addTab(new ArchTab<G, A, R>(archetypeTypeSet, gameObjectAttributesModel)); gameObjectAttributesControl.addTab(new MsgTextTab<G, A, R>(gameObjectAttributesModel)); gameObjectAttributesControl.addTab(new EventsTab<G, A, R>(mainViewFrame, mapManager, gameObjectAttributesModel, scriptArchEditor, scriptArchData, scriptArchDataUtils, scriptArchUtils)); - gameObjectAttributesControl.addTab(new FaceTab<G, A, R>(gameObjectAttributesModel, faceObjects, faceObjectProviders, animationObjects, systemIcons)); + gameObjectAttributesControl.addTab(new FaceTab<G, A, R>(gameObjectAttributesModel, faceObjects, faceObjectProviders, animationObjects, noFaceSquareIcon, unknownSquareIcon)); gameObjectAttributesControl.addTab(textEditorTab); mainView.addTab(new Tab("monsters", new MonsterControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, monsterMatcher).getView(), Location.BOTTOM, 4, false)); mainView.addTab(new Tab("connections", new ConnectionControl<G, A, R>(mapViewManager, delayedMapModelListenerManager).getView(), Location.BOTTOM, 5, false)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-06 19:26:10
|
Revision: 8184 http://gridarta.svn.sourceforge.net/gridarta/?rev=8184&view=rev Author: akirschbaum Date: 2010-06-06 19:26:02 +0000 (Sun, 06 Jun 2010) Log Message: ----------- Fix "reload faces". Modified Paths: -------------- trunk/atrinik/ChangeLog 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/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java trunk/daimonin/ChangeLog 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/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserView.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java trunk/src/app/net/sf/gridarta/gui/utils/FaceTreeChooseAction.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java trunk/src/app/net/sf/gridarta/mapmanager/DefaultMapManager.java trunk/src/app/net/sf/gridarta/mapmanager/DefaultPickmapManager.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModel.java trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java trunk/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java trunk/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.java trunk/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/model/face/FaceObjectProvidersListener.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/atrinik/ChangeLog 2010-06-06 19:26:02 UTC (rev 8184) @@ -1,5 +1,7 @@ 2010-06-06 Andreas Kirschbaum + * Fix "reload faces". + * Fix NullPointerException in "paste exit" when connecting to an unsaved map. 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-06 18:43:50 UTC (rev 8183) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -279,8 +279,8 @@ */ @NotNull @Override - public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) { - return new ArchetypeSet(archetypeFactory); + 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, faceObjectProviders); } /** 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-06 18:43:50 UTC (rev 8183) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -23,6 +23,7 @@ import java.io.Writer; import net.sf.gridarta.model.archetype.AbstractArchetypeSet; import net.sf.gridarta.model.archetype.ArchetypeFactory; +import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.var.atrinik.IGUIConstants; import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; @@ -40,9 +41,10 @@ /** * Create the ArchetypeSet. * @param archetypeFactory the archetype factory instance to use + * @param faceObjectProviders the face object providers */ - public ArchetypeSet(@NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory) { - super(archetypeFactory, IGUIConstants.ARCH_FILE); + public ArchetypeSet(@NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { + super(archetypeFactory, IGUIConstants.ARCH_FILE, faceObjectProviders); } /** 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-06 18:43:50 UTC (rev 8183) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -107,7 +107,7 @@ final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); final DefaultGameObjectFactory gameObjectFactory = new DefaultGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); - archetypeSet = new ArchetypeSet(archetypeFactory); + archetypeSet = new ArchetypeSet(archetypeFactory, faceObjectProviders); archetypeSet.setLoadedFromArchive(true); assert archetypeSet != null; final IsoMapSquareInfo isoMapSquareInfo = new IsoMapSquareInfo(1, 1, 1, 1); Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/crossfire/ChangeLog 2010-06-06 19:26:02 UTC (rev 8184) @@ -1,5 +1,7 @@ 2010-06-06 Andreas Kirschbaum + * Fix "reload faces". + * Fix NullPointerException in "paste exit" when connecting to an unsaved map. 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-06 18:43:50 UTC (rev 8183) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -229,8 +229,8 @@ */ @NotNull @Override - public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) { - return new ArchetypeSet(globalSettings.getImageSet(), archetypeFactory, gameObjectParser); + 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); } /** 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-06 18:43:50 UTC (rev 8183) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -23,6 +23,7 @@ import java.io.Writer; import net.sf.gridarta.model.archetype.AbstractArchetypeSet; import net.sf.gridarta.model.archetype.ArchetypeFactory; +import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.var.crossfire.IGUIConstants; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; @@ -55,9 +56,10 @@ * @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) { - super(archetypeFactory, IGUIConstants.ARCH_FILE); + public ArchetypeSet(@NotNull final String imageSet, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final FaceObjectProviders faceObjectProviders) { + super(archetypeFactory, IGUIConstants.ARCH_FILE, faceObjectProviders); this.imageSet = imageSet.equals("none") ? null : imageSet; this.gameObjectParser = gameObjectParser; } Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/daimonin/ChangeLog 2010-06-06 19:26:02 UTC (rev 8184) @@ -1,5 +1,7 @@ 2010-06-06 Andreas Kirschbaum + * Fix "reload faces". + * Fix NullPointerException in "paste exit" when connecting to an unsaved map. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -280,8 +280,8 @@ */ @NotNull @Override - public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) { - return new ArchetypeSet(archetypeFactory); + 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, faceObjectProviders); } /** Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -23,6 +23,7 @@ import java.io.Writer; import net.sf.gridarta.model.archetype.AbstractArchetypeSet; import net.sf.gridarta.model.archetype.ArchetypeFactory; +import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.var.daimonin.IGUIConstants; import net.sf.gridarta.var.daimonin.model.gameobject.GameObject; import net.sf.gridarta.var.daimonin.model.maparchobject.MapArchObject; @@ -40,9 +41,10 @@ /** * Create the ArchetypeSet. * @param archetypeFactory the archetype factory instance to use + * @param faceObjectProviders the face object providers */ - public ArchetypeSet(@NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory) { - super(archetypeFactory, IGUIConstants.ARCH_FILE); + public ArchetypeSet(@NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { + super(archetypeFactory, IGUIConstants.ARCH_FILE, faceObjectProviders); } /** Modified: trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserView.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserView.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -37,6 +37,7 @@ import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserPanel; import net.sf.gridarta.model.face.FaceObjectProviders; +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.ActionUtils; @@ -169,6 +170,23 @@ displayModeGameObjectNames = new DisplayNameCellRenderer<G, A, R>(faceObjectProviders); displayModeArchetypeNames = new ArchetypeNameCellRenderer<G, A, R>(faceObjectProviders); displayModeIconsOnly = new ArchetypeIconCellRenderer<G, A, R>(faceObjectProviders); + + final FaceObjectProvidersListener faceObjectProvidersListener = new FaceObjectProvidersListener() { + + @Override + public void facesReloaded() { + final ArchetypeChooserPanel<G, A, R> archetypeChooserPanel = archetypeChooserModel.getSelectedPanel(); + if (archetypeChooserPanel != null) { + final ArchetypePanel<G, A, R> archetypePanel = findPanel(archetypeChooserPanel.getName()); + if (archetypePanel != null) { + archetypePanel.repaint(); + } + } + } + + }; + faceObjectProviders.addFaceObjectProvidersListener(faceObjectProvidersListener); + final ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(buttonDisplayGameObjectNames); buttonGroup.add(buttonDisplayArchetypeNames); Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -111,6 +111,7 @@ import net.sf.gridarta.model.archetypetype.AttributeBitmask; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.face.FaceObjectProviders; +import net.sf.gridarta.model.face.FaceObjectProvidersListener; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.GameObjectUtils; @@ -751,6 +752,22 @@ }; /** + * The {@link FaceObjectProvidersListener} for detecting reloaded faces. + */ + @NotNull + private final FaceObjectProvidersListener faceObjectProvidersListener = new FaceObjectProvidersListener() { + + /** + * {@inheritDoc} + */ + @Override + public void facesReloaded() { + faceLabel.setIcon(getFace(gameObject)); + } + + }; + + /** * Create an AbstractGameObjectAttributesDialog. * @param gameObjectAttributesDialogFactory the associated factory * @param archetypeTypeSet Reference to the list of archetype types. @@ -846,6 +863,8 @@ summaryTextStyle = summaryTextPane.getStyle(StyleContext.DEFAULT_STYLE); StyleConstants.setForeground(summaryTextStyle, Color.black); + faceObjectProviders.addFaceObjectProvidersListener(faceObjectProvidersListener); + setMessage(contentPanel); } @@ -873,6 +892,7 @@ gameObjectAttributesDialogFactory.hideAttributeDialog(gameObject); mapModel.removeMapModelListener(mapModelListener); mapManager.removeMapManagerListener(mapManagerListener); + faceObjectProviders.removeFaceObjectProvidersListener(faceObjectProvidersListener); } } Modified: trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/gui/replacedialog/ReplaceDialog.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -50,6 +50,7 @@ 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.face.FaceObjectProvidersListener; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.model.map.mapcontrol.MapControl; @@ -224,6 +225,19 @@ }; /** + * The {@link FaceObjectProvidersListener} for detecting reloaded faces. + */ + @NotNull + private final FaceObjectProvidersListener faceObjectProvidersListener = new FaceObjectProvidersListener() { + + @Override + public void facesReloaded() { + updateArchSelection(objectChooser.getSelection(), false); + } + + }; + + /** * Creates a new instance. * @param parent the parent component for dialogs * @param copyBuffer the copy buffer's @@ -242,6 +256,7 @@ this.objectChooser = objectChooser; this.faceObjectProviders = faceObjectProviders; objectChooser.addObjectChooserListener(objectChooserListener); + faceObjectProviders.addFaceObjectProvidersListener(faceObjectProvidersListener); } /** Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -139,7 +139,7 @@ /** {@inheritDoc} */ @Override public void mapObjectsChanged(@NotNull final Set<G> gameObjects, @NotNull final Set<G> transientGameObjects) { - if (selectedSquareModel.isSelectedGameObjects(gameObjects)) { + if (selectedSquareModel.isSelectedGameObjects(gameObjects) || selectedSquareModel.isSelectedGameObjects(transientGameObjects)) { refresh(); } } Modified: trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -44,6 +44,7 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.face.FaceObjectProviders; +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.model.treasurelist.FolderTreasureObj; @@ -133,6 +134,16 @@ this.treasureTree = treasureTree; this.parent = parent; + final FaceObjectProvidersListener faceObjectProvidersListener = new FaceObjectProvidersListener() { + + @Override + public void facesReloaded() { + repaint(); + } + + }; + faceObjectProviders.addFaceObjectProvidersListener(faceObjectProvidersListener); + putClientProperty("JTree.lineStyle", "Angled"); setCellRenderer(new TreasureCellRenderer<G, A, R>(archetypeSet, treasureTree.getRoot(), faceObjectProviders, systemIcons)); Modified: trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -27,6 +27,7 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.data.NamedObject; import net.sf.gridarta.model.face.FaceObjectProviders; +import net.sf.gridarta.model.face.FaceObjectProvidersListener; import org.jetbrains.annotations.NotNull; /** @@ -90,6 +91,17 @@ this.faceObjectProviders = faceObjectProviders; this.unknownSquareIcon = unknownSquareIcon; this.noFaceSquareIcon = noFaceSquareIcon; + + final FaceObjectProvidersListener faceObjectProvidersListener = new FaceObjectProvidersListener() { + + @Override + public void facesReloaded() { + updateIconLabel(); + } + + }; + faceObjectProviders.addFaceObjectProvidersListener(faceObjectProvidersListener); + updateIconLabel(); } Modified: trunk/src/app/net/sf/gridarta/gui/utils/FaceTreeChooseAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/FaceTreeChooseAction.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/gui/utils/FaceTreeChooseAction.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -27,6 +27,7 @@ import net.sf.gridarta.model.data.NamedObject; import net.sf.gridarta.model.data.NamedObjects; import net.sf.gridarta.model.face.FaceObjectProviders; +import net.sf.gridarta.model.face.FaceObjectProvidersListener; import org.jetbrains.annotations.NotNull; /** @@ -79,8 +80,19 @@ super(text, textComponent, namedObjects, faceObjectProviders); this.icon = icon; this.faceObjectProviders = faceObjectProviders; + this.noFaceSquareIcon = noFaceSquareIcon; this.unknownSquareIcon = unknownSquareIcon; - this.noFaceSquareIcon = noFaceSquareIcon; + + final FaceObjectProvidersListener faceObjectProvidersListener = new FaceObjectProvidersListener() { + + @Override + public void facesReloaded() { + updateIconLabel(); + } + + }; + faceObjectProviders.addFaceObjectProvidersListener(faceObjectProvidersListener); + updateIconLabel(); } Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -179,10 +179,11 @@ * @param globalSettings the global settings to use * @param archetypeFactory the archetype factory to use * @param gameObjectParser the game object parser to use + * @param faceObjectProviders the face object providers to use * @return the new instance */ @NotNull - ArchetypeSet<G, A, R> newArchetypeSet(@NotNull GlobalSettings globalSettings, @NotNull ArchetypeFactory<G, A, R> archetypeFactory, @NotNull GameObjectParser<G, A, R> gameObjectParser); + ArchetypeSet<G, A, R> newArchetypeSet(@NotNull GlobalSettings globalSettings, @NotNull ArchetypeFactory<G, A, R> archetypeFactory, @NotNull GameObjectParser<G, A, R> gameObjectParser, @NotNull FaceObjectProviders faceObjectProviders); /** * Creates a new {@link MapControlFactory} instance. Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -234,7 +234,7 @@ final GameObjectParserFactory<G, A, R> gameObjectParserFactory = editorFactory.newGameObjectParserFactory(gameObjectFactory, gameObjectMatchers); final GameObjectParser<G, A, R> gameObjectParser = gameObjectParserFactory.newGameObjectParser(); final ArchetypeFactory<G, A, R> archetypeFactory = editorFactory.newArchetypeFactory(faceObjectProviders, animationObjects); - final ArchetypeSet<G, A, R> archetypeSet = editorFactory.newArchetypeSet(globalSettings, archetypeFactory, gameObjectParser); + final ArchetypeSet<G, A, R> archetypeSet = editorFactory.newArchetypeSet(globalSettings, archetypeFactory, gameObjectParser, faceObjectProviders); final MapArchObjectFactory<A> mapArchObjectFactory = editorFactory.newMapArchObjectFactory(globalSettings); final MapArchObjectParserFactory<A> mapArchObjectParserFactory = editorFactory.newMapArchObjectParserFactory(); final DefaultMapReaderFactory<G, A, R> mapReaderFactory = new DefaultMapReaderFactory<G, A, R>(mapArchObjectFactory, mapArchObjectParserFactory, gameObjectParserFactory, archetypeSet, mapViewSettings); @@ -243,8 +243,8 @@ final AutojoinLists<G, A, R> autojoinLists = new AutojoinLists<G, A, R>(mapViewSettings); final MapWriter<G, A, R> mapWriter = new DefaultMapWriter<G, A, R>(mapArchObjectParserFactory, gameObjectParser); final MapControlFactory<G, A, R> mapControlFactory = editorFactory.newMapControlFactory(archetypeChooserModel, autojoinLists, mapViewSettings, mapWriter, gameObjectFactory, gameObjectMatchers, globalSettings, topmostInsertionMode); - final AbstractMapManager<G, A, R> mapManager = new DefaultMapManager<G, A, R>(mapReaderFactory, mapControlFactory, globalSettings); - final MapManager<G, A, R> pickmapManager = new DefaultPickmapManager<G, A, R>(mapReaderFactory, mapControlFactory, globalSettings); + final AbstractMapManager<G, A, R> mapManager = new DefaultMapManager<G, A, R>(mapReaderFactory, mapControlFactory, globalSettings, faceObjectProviders); + final MapManager<G, A, R> pickmapManager = new DefaultPickmapManager<G, A, R>(mapReaderFactory, mapControlFactory, globalSettings, faceObjectProviders); final ScriptModel<G, A, R> scriptModel = new ScriptModel<G, A, R>(); final DelegatingMapValidator<G, A, R> validators = new DelegatingMapValidator<G, A, R>(); final ScriptedEventEditor<G, A, R> scriptedEventEditor = new ScriptedEventEditor<G, A, R>(globalSettings); Modified: trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -102,7 +102,7 @@ final GameObjectParserFactory<G, A, R> gameObjectParserFactory = editorFactory.newGameObjectParserFactory(gameObjectFactory, gameObjectMatchers); final ArchetypeFactory<G, A, R> archetypeFactory = editorFactory.newArchetypeFactory(faceObjectProviders, animationObjects); final GameObjectParser<G, A, R> gameObjectParser = gameObjectParserFactory.newGameObjectParser(); - final ArchetypeSet<G, A, R> archetypeSet = editorFactory.newArchetypeSet(globalSettings, archetypeFactory, gameObjectParser); + final ArchetypeSet<G, A, R> archetypeSet = editorFactory.newArchetypeSet(globalSettings, archetypeFactory, gameObjectParser, faceObjectProviders); final MapViewSettings mapViewSettings = new MapViewSettings(); final MapReaderFactory<G, A> mapReaderFactory = new DefaultMapReaderFactory<G, A, R>(mapArchObjectFactory, mapArchObjectParserFactory, gameObjectParserFactory, archetypeSet, mapViewSettings); final MapWriter<G, A, R> mapWriter = new DefaultMapWriter<G, A, R>(mapArchObjectParserFactory, gameObjectParser); @@ -110,7 +110,7 @@ final ArchetypeChooserModel<G, A, R> archetypeChooserModel = new ArchetypeChooserModel<G, A, R>(); final InsertionMode<G, A, R> topmostInsertionMode = new TopmostInsertionMode<G, A, R>(); final MapControlFactory<G, A, R> mapControlFactory = editorFactory.newMapControlFactory(archetypeChooserModel, autojoinLists, mapViewSettings, mapWriter, gameObjectFactory, gameObjectMatchers, globalSettings, topmostInsertionMode); - final MapManager<G, A, R> mapManager = new DefaultMapManager<G, A, R>(mapReaderFactory, mapControlFactory, globalSettings); + final MapManager<G, A, R> mapManager = new DefaultMapManager<G, A, R>(mapReaderFactory, mapControlFactory, globalSettings, faceObjectProviders); final Set<NamedGameObjectMatcher> matchers = new HashSet<NamedGameObjectMatcher>(); final NamedFilter defaultNamedFilterList = new NamedFilter(matchers); final FilterControl<G, A, R> filterControl = new DefaultFilterControl<G, A, R>(defaultNamedFilterList); Modified: trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -26,6 +26,8 @@ import java.util.Iterator; import java.util.List; import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.face.FaceObjectProviders; +import net.sf.gridarta.model.face.FaceObjectProvidersListener; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.io.MapReader; import net.sf.gridarta.model.io.MapReaderFactory; @@ -100,10 +102,23 @@ * Create a new map manager. * @param mapReaderFactory the map reader factory instance * @param globalSettings the global settings instance + * @param faceObjectProviders the face object providers */ - protected AbstractMapManager(@NotNull final MapReaderFactory<G, A> mapReaderFactory, @NotNull final GlobalSettings globalSettings) { + protected AbstractMapManager(@NotNull final MapReaderFactory<G, A> mapReaderFactory, @NotNull final GlobalSettings globalSettings, @NotNull final FaceObjectProviders faceObjectProviders) { this.globalSettings = globalSettings; this.mapReaderFactory = mapReaderFactory; + + final FaceObjectProvidersListener faceObjectProvidersListener = new FaceObjectProvidersListener() { + + @Override + public void facesReloaded() { + for (final MapControl<G, A, R> mapControl : mapControls) { + mapControl.getMapModel().facesReloaded(); + } + } + + }; + faceObjectProviders.addFaceObjectProvidersListener(faceObjectProvidersListener); } @Deprecated Modified: trunk/src/app/net/sf/gridarta/mapmanager/DefaultMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/DefaultMapManager.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/mapmanager/DefaultMapManager.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -22,6 +22,7 @@ import java.io.File; import java.util.List; import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.io.MapReaderFactory; import net.sf.gridarta.model.map.maparchobject.MapArchObject; @@ -48,9 +49,10 @@ * @param mapReaderFactory the map reader factory instance * @param mapControlFactory the map control factory instance * @param globalSettings the global settings instance + * @param faceObjectProviders the face object providers */ - public DefaultMapManager(@NotNull final MapReaderFactory<G, A> mapReaderFactory, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @NotNull final GlobalSettings globalSettings) { - super(mapReaderFactory, globalSettings); + public DefaultMapManager(@NotNull final MapReaderFactory<G, A> mapReaderFactory, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @NotNull final GlobalSettings globalSettings, @NotNull final FaceObjectProviders faceObjectProviders) { + super(mapReaderFactory, globalSettings, faceObjectProviders); this.mapControlFactory = mapControlFactory; } Modified: trunk/src/app/net/sf/gridarta/mapmanager/DefaultPickmapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/DefaultPickmapManager.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/mapmanager/DefaultPickmapManager.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -22,6 +22,7 @@ import java.io.File; import java.util.List; import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.io.MapReaderFactory; import net.sf.gridarta.model.map.maparchobject.MapArchObject; @@ -48,9 +49,10 @@ * @param mapReaderFactory the map reader factory instance * @param mapControlFactory the map control factory instance * @param globalSettings the global settings instance + * @param faceObjectProviders the face object providers */ - public DefaultPickmapManager(@NotNull final MapReaderFactory<G, A> mapReaderFactory, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @NotNull final GlobalSettings globalSettings) { - super(mapReaderFactory, globalSettings); + public DefaultPickmapManager(@NotNull final MapReaderFactory<G, A> mapReaderFactory, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @NotNull final GlobalSettings globalSettings, @NotNull final FaceObjectProviders faceObjectProviders) { + super(mapReaderFactory, globalSettings, faceObjectProviders); this.mapControlFactory = mapControlFactory; } Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -33,6 +33,8 @@ import java.util.Map; import java.util.TreeMap; import net.sf.gridarta.model.baseobject.BaseObject; +import net.sf.gridarta.model.face.FaceObjectProviders; +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.EventListenerList2; @@ -102,10 +104,21 @@ * Create an AbstractArchetypeSet. * @param archetypeFactory the archetype factory to use * @param archFile the collected archetypes file name + * @param faceObjectProviders the face object providers */ - protected AbstractArchetypeSet(@NotNull final ArchetypeFactory<G, A, R> archetypeFactory, @NotNull final String archFile) { + protected AbstractArchetypeSet(@NotNull final ArchetypeFactory<G, A, R> archetypeFactory, @NotNull final String archFile, @NotNull final FaceObjectProviders faceObjectProviders) { this.archetypeFactory = archetypeFactory; this.archFile = archFile; + + final FaceObjectProvidersListener faceObjectProvidersListener = new FaceObjectProvidersListener() { + + @Override + public void facesReloaded() { + connectFaces(); + } + + }; + faceObjectProviders.addFaceObjectProvidersListener(faceObjectProvidersListener); } /** Modified: trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -873,7 +873,7 @@ * Records that this game object has changed but need not be restored by * undo/redo actions. */ - private void transientGameObjectChange() { + protected void transientGameObjectChange() { if (multi == null) { notifyTransientChange(); } else { @@ -1073,6 +1073,15 @@ } /** + * {@inheritDoc} + */ + @Override + public void facesReloaded() { + normalFace = null; + transientGameObjectChange(); + } + + /** * Returns <code>this</code> as its real type. * @return <code>this<c/code> */ Modified: trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -547,4 +547,9 @@ */ boolean usesDirection(); + /** + * Will be called whenever the archetype faces have been reloaded. + */ + void facesReloaded(); + } // interface BaseObject Modified: trunk/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -29,6 +29,7 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.utils.AlphaImageFilterInstance; +import net.sf.gridarta.utils.EventListenerList2; import net.sf.gridarta.utils.SystemIcons; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -162,6 +163,13 @@ private final SystemIcons systemIcons; /** + * The {@link FaceObjectProvidersListener FaceObjectProvidersListeners} to + * notify about changes. + */ + @NotNull + private final EventListenerList2<FaceObjectProvidersListener> faceObjectProvidersListeners = new EventListenerList2<FaceObjectProvidersListener>(FaceObjectProvidersListener.class); + + /** * Creates a new instance. * @param doubleFaceOffset the offset for shifting double faces * @param faceObjects the face objects instance @@ -175,6 +183,22 @@ } /** + * Adds a {@link FaceObjectProvidersListener} to be notified about changes. + * @param listener the listener + */ + public void addFaceObjectProvidersListener(@NotNull final FaceObjectProvidersListener listener) { + faceObjectProvidersListeners.add(listener); + } + + /** + * Removes a {@link FaceObjectProvidersListener} to be notified about changes. + * @param listener the listener + */ + public void removeFaceObjectProvidersListener(@NotNull final FaceObjectProvidersListener listener) { + faceObjectProvidersListeners.remove(listener); + } + + /** * Reloads all providers provided by this FaceObjects. */ public void reloadAll() { @@ -184,6 +208,10 @@ for (final FaceProvider faceProvider : new FaceProvider[] { GRAY, RED, GREEN, BLUE, ALPHA, GRID, doubleFaceProvider, doubleAlphaFaceProvider }) { faceProvider.reload(); } + + for (final FaceObjectProvidersListener faceObjectProvidersListener : faceObjectProvidersListeners.getListeners()) { + faceObjectProvidersListener.facesReloaded(); + } } /** Added: trunk/src/app/net/sf/gridarta/model/face/FaceObjectProvidersListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/face/FaceObjectProvidersListener.java (rev 0) +++ trunk/src/app/net/sf/gridarta/model/face/FaceObjectProvidersListener.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -0,0 +1,36 @@ +/* + * 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.face; + +import java.util.EventListener; + +/** + * Interface for listeners interested in {@link FaceObjectProviders} related + * events. + * @author Andreas Kirschbaum + */ +public interface FaceObjectProvidersListener extends EventListener { + + /** + * Called whenever the faces have been reloaded. + */ + void facesReloaded(); + +} // interface FaceObjectProvidersListener Property changes on: trunk/src/app/net/sf/gridarta/model/face/FaceObjectProvidersListener.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -99,10 +99,10 @@ */ @Override public void setObjectFace() { - super.setObjectFace(); transFace = null; doubleFace = null; transDoubleFace = null; + super.setObjectFace(); } /** @@ -184,4 +184,15 @@ } } + /** + * {@inheritDoc} + */ + @Override + public void facesReloaded() { + transFace = null; + doubleFace = null; + transDoubleFace = null; + super.facesReloaded(); + } + } // class DefaultIsoGameObject Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -1040,6 +1040,23 @@ } /** + * {@inheritDoc} + */ + @Override + public void facesReloaded() { + beginTransaction("reload faces"); + try { + for (final Iterable<G> mapSquare : this) { + for (final G gameObject : mapSquare) { + gameObject.facesReloaded(); + } + } + } finally { + endTransaction(); + } + } + + /** * Marks the map as being modified. */ private void setModified() { Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModel.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModel.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -458,4 +458,9 @@ */ void resetModified(); + /** + * Will be called whenever the archetype faces have been reloaded. + */ + void facesReloaded(); + } // interface MapModel Modified: trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -229,12 +229,12 @@ final GameObjectMatcher exitGameObjectMatcher = new TypeNrsGameObjectMatcher(EXIT_TYPE); exitMatcher = new ExitMatcher<TestGameObject, TestMapArchObject, TestArchetype>(exitGameObjectMatcher); final ArchetypeFactory<TestGameObject, TestMapArchObject, TestArchetype> archetypeFactory = new TestArchetypeFactory(); - archetypeSet = new TestArchetypeSet(archetypeFactory, "archetypes"); + final FaceObjectProviders faceObjectProviders = newFaceObjectProviders(); + archetypeSet = new TestArchetypeSet(archetypeFactory, "archetypes", faceObjectProviders); final MapReaderFactory<TestGameObject, TestMapArchObject> mapReaderFactory = new TestMapReaderFactory(); globalSettings = new TestGlobalSettings(); mapViewSettings = new MapViewSettings(); final MapWriter<TestGameObject, TestMapArchObject, TestArchetype> mapWriter = new TestMapWriter(); - final FaceObjectProviders faceObjectProviders = newFaceObjectProviders(); final AutojoinLists<TestGameObject, TestMapArchObject, TestArchetype> autojoinLists = new AutojoinLists<TestGameObject, TestMapArchObject, TestArchetype>(mapViewSettings); final ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype> archetypeChooserModel = new ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype>(); pathManager = new PathManager(globalSettings); @@ -244,10 +244,10 @@ insertionModeSet = new InsertionModeSet<TestGameObject, TestMapArchObject, TestArchetype>(topmostInsertionMode); insertionModeSet.init(new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher()); mapControlFactory = new TestMapControlFactory(mapWriter, autojoinLists, archetypeChooserModel, gameObjectFactory, globalSettings, gameObjectMatchers, topmostInsertionMode); - final AbstractMapManager<TestGameObject, TestMapArchObject, TestArchetype> tmpMapManager = new DefaultMapManager<TestGameObject, TestMapArchObject, TestArchetype>(mapReaderFactory, mapControlFactory, globalSettings); + final AbstractMapManager<TestGameObject, TestMapArchObject, TestArchetype> tmpMapManager = new DefaultMapManager<TestGameObject, TestMapArchObject, TestArchetype>(mapReaderFactory, mapControlFactory, globalSettings, faceObjectProviders); tmpMapManager.setFileControl(fileControl); mapManager = tmpMapManager; - final AbstractMapManager<TestGameObject, TestMapArchObject, TestArchetype> tmpPickmapManager = new DefaultMapManager<TestGameObject, TestMapArchObject, TestArchetype>(mapReaderFactory, mapControlFactory, globalSettings); + final AbstractMapManager<TestGameObject, TestMapArchObject, TestArchetype> tmpPickmapManager = new DefaultMapManager<TestGameObject, TestMapArchObject, TestArchetype>(mapReaderFactory, mapControlFactory, globalSettings, faceObjectProviders); tmpPickmapManager.setFileControl(fileControl); pickmapManager = tmpPickmapManager; Modified: trunk/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -135,7 +135,7 @@ final TestGameObjectFactory gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); final TestArchetypeBuilder archetypeBuilder = new TestArchetypeBuilder(gameObjectFactory); final TestArchetypeFactory archetypeFactory = new TestArchetypeFactory(); - archetypeSet = new TestArchetypeSet(archetypeFactory, "archetypes"); + archetypeSet = new TestArchetypeSet(archetypeFactory, "archetypes", faceObjectProviders); archetypeSet.setLoadedFromArchive(true); assert archetypeSet != null; return new TestArchetypeParser(archetypeBuilder, animationObjects, archetypeSet); Modified: trunk/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -21,6 +21,7 @@ import java.io.IOException; import java.io.Writer; +import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.gameobject.TestGameObject; import net.sf.gridarta.model.map.maparchobject.TestMapArchObject; import org.jetbrains.annotations.NotNull; @@ -36,9 +37,10 @@ * Create an AbstractArchetypeSet. * @param archetypeFactory the archetype factory to use * @param archFile the collected archetypes file name + * @param faceObjectProviders the face object providers */ - public TestArchetypeSet(@NotNull final ArchetypeFactory<TestGameObject, TestMapArchObject, TestArchetype> archetypeFactory, @NotNull final String archFile) { - super(archetypeFactory, archFile); + public TestArchetypeSet(@NotNull final ArchetypeFactory<TestGameObject, TestMapArchObject, TestArchetype> archetypeFactory, @NotNull final String archFile, @NotNull final FaceObjectProviders faceObjectProviders) { + super(archetypeFactory, archFile, faceObjectProviders); } /** Modified: trunk/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java 2010-06-06 18:43:50 UTC (rev 8183) +++ trunk/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java 2010-06-06 19:26:02 UTC (rev 8184) @@ -67,12 +67,12 @@ @Test public void testMissingObject() throws DuplicateArchetypeException, IOException, UndefinedArchetypeException { final TestArchetypeFactory archetypeFactory = new TestArchetypeFactory(); - final TestArchetypeSet archetypeSet = new TestArchetypeSet(archetypeFactory, "archetypes"); - final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); + final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); final FaceObjects faceObjects = new DefaultFaceObjects("png", "facetree", Pattern.compile(".*"), "", archFaceProvider); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); + final TestArchetypeSet archetypeSet = new TestArchetypeSet(archetypeFactory, "archetypes", faceObjectProviders); final AnimationObjects animationObjects = new DefaultAnimationObjects("animtree"); final TestArchetype baseArchetype = new TestArchetype("base", faceObjectProviders, animationObjects); baseArchetype.setObjectText("sp 2\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-06 19:52:11
|
Revision: 8186 http://gridarta.svn.sourceforge.net/gridarta/?rev=8186&view=rev Author: akirschbaum Date: 2010-06-06 19:52:05 +0000 (Sun, 06 Jun 2010) Log Message: ----------- Do not flag tail parts of monsters in shops as "pait items". Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/validation/checks/AbstractShopSquareChecker.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-06 19:37:12 UTC (rev 8185) +++ trunk/atrinik/ChangeLog 2010-06-06 19:52:05 UTC (rev 8186) @@ -1,5 +1,7 @@ 2010-06-06 Andreas Kirschbaum + * Do not flag tail parts of monsters in shops as "pait items". + * Fix "reload faces". * Fix NullPointerException in "paste exit" when connecting to an Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-06 19:37:12 UTC (rev 8185) +++ trunk/crossfire/ChangeLog 2010-06-06 19:52:05 UTC (rev 8186) @@ -1,5 +1,7 @@ 2010-06-06 Andreas Kirschbaum + * Do not flag tail parts of monsters in shops as "pait items". + * Fix "reload faces". * Fix NullPointerException in "paste exit" when connecting to an Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-06 19:37:12 UTC (rev 8185) +++ trunk/daimonin/ChangeLog 2010-06-06 19:52:05 UTC (rev 8186) @@ -1,5 +1,7 @@ 2010-06-06 Andreas Kirschbaum + * Do not flag tail parts of monsters in shops as "pait items". + * Fix "reload faces". * Fix NullPointerException in "paste exit" when connecting to an Modified: trunk/src/app/net/sf/gridarta/validation/checks/AbstractShopSquareChecker.java =================================================================== --- trunk/src/app/net/sf/gridarta/validation/checks/AbstractShopSquareChecker.java 2010-06-06 19:37:12 UTC (rev 8185) +++ trunk/src/app/net/sf/gridarta/validation/checks/AbstractShopSquareChecker.java 2010-06-06 19:52:05 UTC (rev 8186) @@ -69,7 +69,7 @@ */ private boolean isMatching(@NotNull final Iterable<G> mapSquare, @NotNull final GameObjectMatcher matcher) { for (final GameObject<G, A, R> gameObject : mapSquare) { - if (matcher.isMatching(gameObject)) { + if (matcher.isMatching(gameObject.getHead())) { return true; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-06 20:30:54
|
Revision: 8191 http://gridarta.svn.sourceforge.net/gridarta/?rev=8191&view=rev Author: akirschbaum Date: 2010-06-06 20:30:47 +0000 (Sun, 06 Jun 2010) Log Message: ----------- Drop recent menu entries for maps with non-existent map files. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/mapmenu/RecentMapMenuPreferences.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-06 20:27:24 UTC (rev 8190) +++ trunk/atrinik/ChangeLog 2010-06-06 20:30:47 UTC (rev 8191) @@ -1,5 +1,7 @@ 2010-06-06 Andreas Kirschbaum + * Drop recent menu entries for maps with non-existent map files. + * Do not flag tail parts of monsters in shops as "pait items". * Fix "reload faces". Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-06 20:27:24 UTC (rev 8190) +++ trunk/crossfire/ChangeLog 2010-06-06 20:30:47 UTC (rev 8191) @@ -1,5 +1,7 @@ 2010-06-06 Andreas Kirschbaum + * Drop recent menu entries for maps with non-existent map files. + * Do not flag tail parts of monsters in shops as "pait items". * Fix "reload faces". Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-06 20:27:24 UTC (rev 8190) +++ trunk/daimonin/ChangeLog 2010-06-06 20:30:47 UTC (rev 8191) @@ -1,5 +1,7 @@ 2010-06-06 Andreas Kirschbaum + * Drop recent menu entries for maps with non-existent map files. + * Do not flag tail parts of monsters in shops as "pait items". * Fix "reload faces". Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/RecentMapMenuPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/RecentMapMenuPreferences.java 2010-06-06 20:27:24 UTC (rev 8190) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/RecentMapMenuPreferences.java 2010-06-06 20:30:47 UTC (rev 8191) @@ -75,9 +75,11 @@ public void init() { final int numRecents = preferences.getInt("recentNum", 0); for (int i = numRecents - 1; i >= 0; i--) { - final String title = getTitle(i); final File mapFile = getMapFile(i); - addMapMenuEntryInt(title, mapFile); + if (mapFile.exists()) { + final String title = getTitle(i); + addMapMenuEntryInt(title, mapFile); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-06 20:49:58
|
Revision: 8192 http://gridarta.svn.sourceforge.net/gridarta/?rev=8192&view=rev Author: akirschbaum Date: 2010-06-06 20:49:51 +0000 (Sun, 06 Jun 2010) Log Message: ----------- Fix typos. Modified Paths: -------------- trunk/INSTALL trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/crossfire/ChangeLog.old trunk/daimonin/ChangeLog trunk/gridarta.ipr trunk/src/doc/dev/changelog.xslt trunk/src/doc/dev/typeParameters.xhtml trunk/src/doc/ref/GameObjectMatcher.xhtml trunk/src/doc/sitestyle.css Modified: trunk/INSTALL =================================================================== --- trunk/INSTALL 2010-06-06 20:30:47 UTC (rev 8191) +++ trunk/INSTALL 2010-06-06 20:49:51 UTC (rev 8192) @@ -19,8 +19,8 @@ * Java Runtime Environment 5.0 or newer -Howto Build ------------ +How to Build +------------ Change to the directory of the version you want to build and run "ant". To find out options about building Gridarta, run "ant -projecthelp". @@ -37,14 +37,14 @@ ant -Howto Run ---------- +How to Run +---------- java -jar AtrinikEditor.jar java -jar CrossfireEditor.jar java -jar DaimoninEditor.jar -Howto Generate Documentation (Javadoc) --------------------------------------- +How to Generate Documentation (Javadoc) +--------------------------------------- Change to the main directory and run "ant javadoc". The documentation will be placed in dest/doc/api/. Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-06 20:30:47 UTC (rev 8191) +++ trunk/atrinik/ChangeLog 2010-06-06 20:49:51 UTC (rev 8192) @@ -2,7 +2,7 @@ * Drop recent menu entries for maps with non-existent map files. - * Do not flag tail parts of monsters in shops as "pait items". + * Do not flag tail parts of monsters in shops as "paid items". * Fix "reload faces". @@ -75,7 +75,7 @@ * Do not event objects having incorrect parameters when loading maps. - * Implement #1717845 (Multitile paste) as File|Paste Tiled: paste + * Implement #1717845 (Multi-square paste) as File|Paste Tiled: paste the copy buffer into the selection. If the selection is larger than the copy buffer, tiling happens. @@ -118,7 +118,7 @@ * Implement #2385930 (Alert when adding items in to a shop): add new map validator "Shop square contains paid item" that checks for - shop sqaures that contain at least one paid item. + shop squares that contain at least one paid item. 2010-05-13 Andreas Kirschbaum @@ -349,8 +349,8 @@ 2009-09-25 Andreas Kirschbaum - * Implement #2861454 (object filtering to work on invs): Add <Env> - element to GameObjectMatchers. + * Implement #2861454 (object filtering to work on inventories): + Add <Env> element to GameObjectMatchers. 2009-09-21 Andreas Kirschbaum Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-06 20:30:47 UTC (rev 8191) +++ trunk/crossfire/ChangeLog 2010-06-06 20:49:51 UTC (rev 8192) @@ -2,7 +2,7 @@ * Drop recent menu entries for maps with non-existent map files. - * Do not flag tail parts of monsters in shops as "pait items". + * Do not flag tail parts of monsters in shops as "paid items". * Fix "reload faces". @@ -65,7 +65,7 @@ * Do not remove event objects having incorrect parameters when loading maps. - * Implement #1717845 (Multitile paste) as File|Paste Tiled: paste + * Implement #1717845 (Multi-square paste) as File|Paste Tiled: paste the copy buffer into the selection. If the selection is larger than the copy buffer, tiling happens. @@ -106,7 +106,7 @@ * Implement #2385930 (Alert when adding items in to a shop): add new map validator "Shop square contains paid item" that checks for - shop sqaures that contain at least one paid item. + shop squares that contain at least one paid item. 2010-05-13 Andreas Kirschbaum @@ -340,8 +340,8 @@ * Add map validator "Shop tile allows magic and/or prayers": reports shop tiles that allow casting spells or prayers. - * Implement #2861454 (object filtering to work on invs): Add <Env> - element to GameObjectMatchers. + * Implement #2861454 (object filtering to work on inventories): + Add <Env> element to GameObjectMatchers. 2009-09-21 Andreas Kirschbaum @@ -479,7 +479,7 @@ * Fix possible NullPointerException while parsing types.xml. - * Remove support for doublelist types in types.xml. + * Remove support for double-list types in types.xml. 2009-05-08 Andreas Kirschbaum @@ -671,13 +671,13 @@ 2009-01-08 Andreas Kirschbaum * Fix #1842541 (File Options... Paths and Resources): always save - absolute path names; suppress spurious "Prefs changed" dialog. + absolute path names; suppress spurious "Preferences changed" dialog. 2009-01-07 Andreas Kirschbaum * Fix #1965884 (Display issue). - * Fix #2430127 (Lost shoprace information when editting, then + * Fix #2430127 (Lost shoprace information when editing, then saving a map). * Fix object choice display for pickmap chooser. @@ -773,7 +773,7 @@ * Do not crash when validating unsaved maps containing exits. - * Fix spells combobox in game object attributes dialog. + * Fix spells combo box in game object attributes dialog. 2008-10-28 Andreas Kirschbaum @@ -1189,7 +1189,7 @@ 2007-11-04 Andreas Kirschbaum * Implement #1555828 (Uses old spell numbers for the spell list - dropdown). + drop down). 2007-11-03 Andreas Kirschbaum @@ -1232,7 +1232,7 @@ * Allow multi-part objects in inventory. This allows generators spawning multi-part monsters. - * Suppress spurious error message "Multipart expansion for a + * Suppress spurious error message "Multi-part expansion for a GameObject inside a container requested." when loading maps with multi-parts in inventories. @@ -1272,7 +1272,7 @@ * Make scripts work if Gridarta is run outside the source directory: - - Load scripts from <mapdir>/editor/scripts; remove built-in + - Load scripts from <map_dir>/editor/scripts; remove built-in scripts. - Store scripts in separate .xml files instead in an aggregated scripts.xml file. @@ -1284,7 +1284,7 @@ 2007-10-09 Andreas Kirschbaum - * Load pickmaps from <mapdir>/editor/pickmaps; remove built-in + * Load pickmaps from <map_dir>/editor/pickmaps; remove built-in pickmaps. This makes pickmaps work if Gridarta is run outside the source directory. @@ -1568,7 +1568,7 @@ 2007-04-09 Andreas Kirschbaum - * Allow to replace from copybuffer in replace dialog. + * Allow to replace from copy buffer in replace dialog. 2007-04-06 Andreas Kirschbaum @@ -1597,7 +1597,7 @@ * Do not crash in "random fill above" when not filling from pickmap. - * Use different algorithm for floodfill. The new algorithm does + * Use different algorithm for flood-fill. The new algorithm does not anymore create out of memory errors for complicated fill areas. @@ -1622,7 +1622,7 @@ 2007-03-23 Andreas Kirschbaum - * Remove special handling of multipart objects when writing map + * Remove special handling of multi-part objects when writing map files. 2007-03-22 Andreas Kirschbaum @@ -1724,7 +1724,7 @@ * Fix #1613731 (Arch list tabs sometimes blank). - * Use pickmap selection for insert, replace, fill, floodfill. + * Use pickmap selection for insert, replace, fill, flood-fill. * Add context menu to pickmap chooser. @@ -1752,7 +1752,7 @@ * Do not reflect filter settings into pickmaps. - * Fix #1621873 (Analyze menus misrender on multi-tile objects). + * Fix #1621873 (Analyze menus mis-render on multi-tile objects). * Fix #1613729 (Monsters appear as "weak wall (0)"). (Previous fix did miss the game object attributes panel.) @@ -1838,13 +1838,13 @@ 2006-12-18 Andreas Kirschbaum - * Fix crash when pasting multipart objects. + * Fix crash when pasting multi-part objects. * Accelerate map drawing speed. 2006-12-17 Andreas Kirschbaum - * Split fill and floodfill into separate functions in user + * Split fill and flood-fill into separate functions in user interface. * Add replace of non-rectangular selections; make replacement of @@ -1980,7 +1980,7 @@ 2006-09-23 Andreas Kirschbaum * Make insertion and deletion in the map tile panel work - correctly. (Note that multipart objects from pickmaps still cannot + correctly. (Note that multi-part objects from pickmaps still cannot be inserted in the map tile panel.) 2006-09-18 Andreas Kirschbaum Modified: trunk/crossfire/ChangeLog.old =================================================================== --- trunk/crossfire/ChangeLog.old 2010-06-06 20:30:47 UTC (rev 8191) +++ trunk/crossfire/ChangeLog.old 2010-06-06 20:49:51 UTC (rev 8192) @@ -26,7 +26,7 @@ --- 27/06/2001 --- -add script parsing to +add script parsing to archText & some minor insanity checks for read/write maps --- 29/06/2001 --- @@ -47,7 +47,7 @@ The classification of objects used to be based on the "editable" value from the archetype (default arch). But that -was not useful, because it was so unrelyable. E.g. floor arches +was not useful, because it was so unreliable. E.g. floor arches can be changed into secret exits, the archetype won't indicate that. That's why I changed the editable values to be calculated at @@ -63,7 +63,7 @@ doubled background tiles. I corrected a bug in the parser that prevented the -"type" - attribute from being modified (Parser ignored it). +"type" - attribute from being modified (Parser ignored it). Finally, I inserted a new menu under "view"-> "Reset View". This works basically as a "Show All" for the view setting. @@ -73,7 +73,7 @@ --- 30/07/2001 --- Remove bug when map windows are cycled. Add x 16/y 16 hack -to map object in archfiles +to map object in archetype files --- 02/08/2001 --- @@ -87,9 +87,9 @@ There are two different fill-modes: - For rectangular fill, left click and drag to highlight a rectangular area. Then invoke fill. - - For floodfill, left click on an empty spot and do not + - For flood-fill, left click on an empty spot and do not drag. By invoking fill all connected empty squares are - floodfilled. + flood-filled. 3) Delete (middle mouse button): When you click on the map with the middle mouse button, @@ -129,11 +129,11 @@ Besides, Cut/Copy/Paste now works with containers and their inventory. -o I seperated the map arch from the ordinary arch objects. +o I separated the map arch from the ordinary arch objects. This was a big biiiig load of work. ('map arch' = first arch object in the file, containing map attributes like width, height etc). The map arch now has it's own class - (MapArchObject.java) with own fileparser and -writer methods. + (MapArchObject.java) with own file parser and -writer methods. This has a lot of advantages: The code is better organized, the map attributes are easy accessible, and the map arch can be expanded with new attributes at will without causing trouble. @@ -142,7 +142,7 @@ new (width, height, swap_time etc). Even the map_tiling paths. Still missing however is the proper user-interface for the map attributes. That's gonna be the next step... - + o On my way diving through the code, I did a lot of cosmetics and minor stuff. The file-modified '*' is now displayed a lot more accurate, panel background is now green... stuff like that. @@ -184,7 +184,7 @@ at this point. Today he sent me the last piece I needed to make it all work. -I'm sorry for the mess with the cvs directorys. CVS +I'm sorry for the mess with the cvs directories. CVS is hell of an inconvenient program when it comes to directory-management. @@ -212,7 +212,7 @@ Completed the "enter exit" feature. It works very similar to Crossedit: Select and exit on -the map, activate menu "enter exit" (Strg-E) and the +the map, activate menu "enter exit" (Ctrl-E) and the destination map gets loaded. --AndreasV @@ -220,7 +220,7 @@ --- 21/09/2001 --- I've reworked some parts of the layout. Icon-Toolbar -is now left and the arch-message window is on a seperate +is now left and the arch-message window is on a separate panel, for better size. Besides I optimized some code a bit to speed up dragging for insert/delete objects. @@ -234,7 +234,7 @@ then any walls will join in the right way (similar to crossedit). The "joining-definitions" are written in an easily -customizable textfile called "autojoin.txt". +customizable text file called "autojoin.txt". This feature is very fast and memory-efficient. It does not increase the loading time. @@ -244,8 +244,8 @@ --- 29/09/2001 --- Another big update for the CFJavaEditor: -Multipart objects are now saved and loaded according to the -"new" map format as head-arches only. That was neccessary +Multi-part objects are now saved and loaded according to the +"new" map format as head-arches only. That was necessary for the JavaEditor in order to cope with maps generated by recent versions of Crossedit. It also makes map-files a good deal shorter. @@ -264,12 +264,12 @@ map loading but when the settings are actually needed instead. Other optimizations followed. -In the process I tweaked the map-loading methods to be resistent -against numerous kinds of corrupt mapfiles. +In the process I tweaked the map-loading methods to be resistant +against numerous kinds of corrupt map files. Besides, I included a small new feature: The inventory of -multipart objects is now always stored in the multipart-head. -Every tile of a multipart now shows the one and same inventory. +multi-part objects is now always stored in the multi-part-head. +Every tile of a multi-part now shows the one and same inventory. --Andreas V. @@ -280,7 +280,7 @@ actions like select/insert/delete objects. Basically what I did was reducing the redraw actions of the -mapview to a minimum. Instead of drawing the entire map, +map view to a minimum. Instead of drawing the entire map, only the tiles that changed get redrawn. This works well for the standard (rectangular) view. @@ -289,19 +289,19 @@ I believe there is still an open end for speed improvements, though the editor is already quite fast now. Only the arch -loading is still awefull... +loading is still awful... --Andreas V. --- 02/10/2001 --- -Further improvements and finetuning to the new +Further improvements and fine-tuning to the new drawing methods: -Due to the direct drawing on the mapview, the tiles +Due to the direct drawing on the map view, the tiles used to "flicker" slightly when objects got drawn over each other. To prevent this, tiles are now drawn into -a temporare buffer, then displayed as a whole. +a temporary buffer, then displayed as a whole. This does not considerably slow anything down. Also corrected problems for tiles without background. @@ -311,7 +311,7 @@ --- 03/10/2001 --- I extended the cut/copy/paste methods to enable -copying of multisquare objects. So they are finally +copying of multi-square objects. So they are finally completed now, allowing to copy everything. I also did a few speed optimizations to the arch/image @@ -324,22 +324,22 @@ I've added a proper online help document to the CFJavaEditor. It's html, but I kept the style rather simple so far. -The online docu can be viewed by selecting the menu +The online documentation can be viewed by selecting the menu "Help->Online Help". (Of course the .html files can as well be viewed directly, with a browser). The online help so far describes how to use the editor, provides -some troubleshooting (->faq) and a few general guidelines +some troubleshooting (->faq) and a few general guidelines for map-making. I also added a file "INSTALL.txt" to the main folder, providing information on how to install (= compile and run) the editor. ---Andreas V. +--Andreas V. --- 5/11/01 --- -editor had collect bad archfiles. +editor had collect bad archetype files. Now he can write negatives offsets. --Michael T. @@ -359,7 +359,7 @@ --- 27/11/01 --- -Fixed some minor flaws in the archtext parser. +Fixed some minor flaws in the archetype text parser. --Andreas V. @@ -367,7 +367,7 @@ Added the attribute dialog feature, an interface that provides an "easy" layer over the terrible true -crossfire archtext syntax. +crossfire archetype text syntax. The syntax definitions are read from a well-readable plain text data file. Not all forms of input-values are supported yet, but the foundation is laid and the rest will follow. @@ -391,7 +391,7 @@ which caused JDK 1.4 to try producing a greyed-out icon from a png-imageProducer that didn't exist. This resulted in runtime errors whenever clicking -on the mapview. Fixed now. +on the map view. Fixed now. --AndreasV @@ -417,7 +417,7 @@ --- 19/02/2002 --- Great new feature in the JavaEditor: -Spellnumbers now get handled by the editor internally. +Spell numbers now get handled by the editor internally. In the attribute-window the mapmaker can choose spells by name conveniently, from a list. @@ -435,15 +435,15 @@ Added four new kinds of attributes for "types.txt": -- customized bool: for customizeable true/false values +- customized bool: for customizable true/false values instead of 1/0 - direction: for a list of CF direction values (north, northeast, east, ..., northwest) -- weapontype: for a list of CF weapontypes - (see weapotype code by Garbled) +- weapontype: for a list of CF weapon types + (see weapon type code by Garbled) - mood: for a list of CF moods (see moodfloor code) -The last three appear as choosebox-lists, like spells. +The last three appear as choose box-lists, like spells. With the help of these features, affected attributes are a lot more intuitive and easier to understand. @@ -475,7 +475,7 @@ Now the type definitions for the editor include almost everything that a mapmaker will need. -- A doubleclick on an archobject in the right-side +- A double-click on an archetype object in the right-side window of the editor now opens an attribute-dialog for this object. This works faster and is more convenient than pressing the "attribute"-button @@ -493,7 +493,7 @@ Added ant build files for the JavaEditor, also from Josh. -Extended the online help docu a little bit to +Extended the online help documentation a little bit to cover latest features. --AndreasV @@ -503,7 +503,7 @@ New version of the JavaEditor: featuring support for custom fonts. You can now choose a font from the "View->Choose Font"-menu. This is very helpful for using larger screen resolutions -(like with flatscreens), where the default fonts are too small. +(like with flat screens), where the default fonts are too small. Also done a lot of code cleanups, minor improvements and correcting of javadoc comments. @@ -515,7 +515,7 @@ I've added support for bitmask values in the attribute-dialog. No longer do mapmakers need to calculate those -ugly attacktype-, material- and spellpath values. +ugly attacktype-, material- and spell path values. The attribute-dialog GUI presents the bitmasks in text form now (like "physical, fire, cold" or "paper, iron") and they can be modified conveniently by an array of @@ -537,12 +537,12 @@ Added patches and new code concerning the attribute-dialog: There used to be a problem with arch-attributes that are not recognized from the type-definitions (in "types.txt"). -Such entrys in the archtext were deleted by the JavaEditor +Such entries in the archetype text were deleted by the JavaEditor when using the attribute-dialog interface. -Now this handled in a better way: Entrys which are not +Now this handled in a better way: Entries which are not recognized are framed "syntax errors" and the user is -able to choose wether to keep or dump them. +able to choose whether to keep or dump them. This is interesting as it often shows real errors in maps that would otherwise be overlooked. @@ -561,12 +561,12 @@ list only the most important ones here: o It is now possible to change (object-)types in the - attribute-dialog. Just select one from the choosebox! + attribute-dialog. Just select one from the choose box! The attribute dialog GUI will automatically change to show all sections and values for the new type. o Created a new CFileReader class which allows to - load the resource-textfiles from the jar archive if they + load the resource-text files from the jar archive if they don't exist in the directory. (Removed the ugly broken code that was trying to do this before) @@ -574,7 +574,7 @@ the CFJavaEditor for the first time on his machine. This used to be real twisted, now it looks as it should. -Also renamed the file "typdef.def" to "typenumbers.def". +Also renamed the file "typedef.def" to "typenumbers.def". The old name no longer fits, as the file will never get extended to contain more than type numbers. @@ -586,7 +586,7 @@ --- 04/05/2002, Version 0.975 --- -o Seperated map name from file name. When I first +o Separated map name from file name. When I first coded this, I misunderstood the concept of map names. It is now possible to have a different map name and map file-name, as it should be. @@ -628,27 +628,27 @@ The JavaEditor can now load arches from collected files. This reduces loading time to about one third! It is still an option -to load from individual archfiles (See menu "File->Options"). +to load from individual archetype files (See menu "File->Options"). And, to combine both, you can even collect arches (menu "Collect->Collect CF Arches"). So you don't need to worry when your collected files get outdated for example. From now on the JavaEditor has a collected version of the -archfiles included. That means you no longer need to worry about +archetype files included. That means you no longer need to worry about arches at all unless you want to create custom arches or images. Added "Fill Below" menu option. This is also a feature that had been requested a while ago. Works similar to the same thing known from Crossedit. -Updated the online help docu to cover latest features +Updated the online help documentation to cover latest features an changed functionality. This reminds me, I've also created a documentation version-number. Every time this number is increased, when a user updates his -editor and runs for the first time, the docu will popup automatically. +editor and runs for the first time, the documentation will popup automatically. In this way, I hope to get users more aware of the documentation and eventual changes/additions to it. In the past many users -did not know that a docu existed, even after long use of the editor. +did not know that a documentation existed, even after long use of the editor. --AndreasV @@ -659,7 +659,7 @@ Users are now able to pick arches either from the conventional arch-list, or from various pickmaps. -Both can be found in the archpanel to the left side. +Both can be found in the archetype panel to the left side. Use of pickmaps saves a lot of time, as pickmaps can show a lot more objects at once, in logical groups. @@ -680,29 +680,29 @@ In the previous version is was not possible to insert objects from a pickmap directly to the map-tile-window. -Now this can be done. +Now this can be done. I updated the type-definitions "types.txt" to support some -of the most important new attributes that have been added lately. +of the most important new attributes that have been added lately. Also updated the collected arch files to stay in sync -with CVS arches. +with CVS arches. --AndreasV --- 05/10/2002, Version 0.982 --- In the "Map"-menu there are now commands to move quickly between -tiled maps. This nice patch was contributed by Mark Wedel. +tiled maps. This nice patch was contributed by Mark Wedel. New Feature: It is now possible to create a full size png-image -from any map in the editor. Not necessary for mapmaking, but maybe +from any map in the editor. Not necessary for map-making, but maybe handsome for Crossfire fans who want to tile their bathroom with -map-images... who knows ;-) +map-images... who knows ;-) While selecting tiles on a map (left-click and drag mouse), the dimensions of the highlighted rectangle are now displayed in the -status-bar (bottom of window). +status-bar (bottom of window). Lots of bug fixes since last version of the editor. @@ -716,14 +716,14 @@ Of course this is also integrated into the attribute dialog: Just click on the "treasurelist" attribute and the treasurelist-view is directly opened. I have also included a fairly extensive piece of -online documenattion (for mapmakers) regarding this treasurelist-feature. -Lots of bug fixes since last version of the editor. +online documentation (for mapmakers) regarding this treasurelist-feature. +Lots of bug fixes since last version of the editor. I have applied a lot of GUI-improvements, but most of them -are not eye-catching changes. +are not eye-catching changes. Updated "types.txt" file with corrections about ac and run_away, -as well as some other minor corrections. +as well as some other minor corrections. --AndreasV @@ -732,17 +732,17 @@ The CFJavaEditor now features support for the python scripting plugin! Look at the "script" tab on the bottom-mid frame: All scripted events are fully managed in the editor. You can create/remove and edit -scripted events. But that's not all... +scripted events. But that's not all... CFJavaEditor now has it's very own ascii editor for viewing and writing python scripts. It has real python syntax highlighting, -even an auto-complete popup menu for the CFPython package functions. +even an auto-complete popup menu for the CFPython package functions. --AndreasV --- 26/04/2003, Version 0.984 --- -The primary datafile format is XML from now on. +The primary data file format is XML from now on. I have chosen to included the Crimson XML parser for this purpose, due to it's small size. The code is not dependant on this particular parser however - it could be exchanged by any other java XML parser. @@ -761,14 +761,14 @@ Added basic support for lore to the CFJavaEditor. In the map properties window (select menu "Map->Map Properties"), -there now is a lore tab with a textarea for map lore. +there now is a lore tab with a text area for map lore. For now, arch-lore gets parsed but not displayed, which practically disables lore in map-objects. The "replace" command is also new, which can be found in the edit menu. This allows to replace (or delete) all objects matching -a certain name or archtype. This makes it very easy to accomplish +a certain name or archetype. This makes it very easy to accomplish tasks like "replace all woodfloor with flagstones" or "delete all no_spell arches". @@ -781,7 +781,7 @@ pickmap with right-click, and delete from pickmaps with middle- click. That means pickmaps can be modified much like normal maps - Shifting objects between map and pickmap, in both ways, -becomes very easy and fast. It even works for multiparts too. +becomes very easy and fast. It even works for multi-parts too. There is an entire new menu "Pickmaps" in the menu bar. It offers commands to create new pickmaps, save pickmaps, Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-06 20:30:47 UTC (rev 8191) +++ trunk/daimonin/ChangeLog 2010-06-06 20:49:51 UTC (rev 8192) @@ -2,7 +2,7 @@ * Drop recent menu entries for maps with non-existent map files. - * Do not flag tail parts of monsters in shops as "pait items". + * Do not flag tail parts of monsters in shops as "paid items". * Fix "reload faces". @@ -70,7 +70,7 @@ * Do not remove event objects having incorrect parameters when loading maps. - * Implement #1717845 (Multitile paste) as File|Paste Tiled: paste + * Implement #1717845 (Multi-square paste) as File|Paste Tiled: paste the copy buffer into the selection. If the selection is larger than the copy buffer, tiling happens. @@ -113,7 +113,7 @@ * Implement #2385930 (Alert when adding items in to a shop): add new map validator "Shop square contains paid item" that checks for - shop sqaures that contain at least one paid item. + shop squares that contain at least one paid item. 2010-05-13 Andreas Kirschbaum @@ -336,8 +336,8 @@ * Add support for map validator "Shop tile allows magic and/or prayers": reports shop tiles that allow casting spells or prayers. - * Implement #2861454 (object filtering to work on invs): Add <Env> - element to GameObjectMatchers. + * Implement #2861454 (object filtering to work on inventories): + Add <Env> element to GameObjectMatchers. 2009-09-21 Andreas Kirschbaum @@ -484,7 +484,7 @@ * Fix possible NullPointerException while parsing types.xml. - * Remove support for doublelist types in types.xml. + * Remove support for double-list types in types.xml. 2009-05-14 Andreas Kirschbaum @@ -673,7 +673,7 @@ 2009-01-08 Andreas Kirschbaum * Fix #1842541 (File Options... Paths and Resources): always save - absolute path names; suppress spurious "Prefs changed" dialog. + absolute path names; suppress spurious "Preferences changed" dialog. 2009-01-07 Andreas Kirschbaum Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2010-06-06 20:30:47 UTC (rev 8191) +++ trunk/gridarta.ipr 2010-06-06 20:49:51 UTC (rev 8192) @@ -1126,6 +1126,7 @@ <words> <w>accel</w> <w>agentlib</w> + <w>angelion</w> <w>animname</w> <w>animtree</w> <w>antilure</w> @@ -1135,20 +1136,28 @@ <w>args</w> <w>asmlinkage</w> <w>atrinik</w> + <w>attlist</w> <w>attribute's</w> <w>autojoin</w> <w>autojoining</w> <w>backbuffer</w> <w>baseobject</w> + <w>batchpng</w> <w>beanshell</w> <w>bitmask</w> <w>bitmasks</w> <w>blitting</w> + <w>blog</w> <w>bmaps</w> <w>bmentry</w> + <w>bonczkowski</w> <w>bool</w> + <w>bulgrien</w> <w>callees</w> + <w>cfeditor</w> + <w>cfpython</w> <w>checkboxes</w> + <w>checklink</w> <w>checkstyle</w> <w>christianhujer</w> <w>cloneable</w> @@ -1156,17 +1165,25 @@ <w>collectable</w> <w>collectable...</w> <w>collectables</w> + <w>collectarches</w> <w>conf</w> <w>covariant</w> + <w>crossedit</w> + <w>cvsroot</w> <w>daimonin</w> + <w>daimonin's</w> + <w>debian</w> <w>dedit</w> <w>derivates</w> + <w>dest</w> <w>djava</w> <w>doctype</w> <w>encodings</w> <w>endlore</w> <w>endmsg</w> <w>enums</w> + <w>ergonomy</w> + <w>everyone's</w> <w>exiter</w> <w>externalizable</w> <w>facename</w> @@ -1177,20 +1194,27 @@ <w>fixme</w> <w>focusability</w> <w>formatter</w> + <w>freenode</w> <w>freshmeat</w> <w>g...</w> <w>gameobject</w> <w>gameobjectmatchers</w> <w>getenv</w> + <w>glibc</w> + <w>gnomovision</w> <w>goto</w> <w>gridarta</w> <w>gridarta's</w> <w>gridder</w> + <w>guildmaster</w> + <w>hotkey</w> <w>hprof</w> + <w>https</w> <w>hujer</w> <w>iconification</w> <w>iconified</w> <w>iconify</w> + <w>iconized</w> <w>ignorelists</w> <w>inconvertible</w> <w>indices</w> @@ -1200,21 +1224,34 @@ <w>javascript</w> <w>javax</w> <w>jvmti</w> + <w>keränen</w> + <w>lally</w> + <w>licensor</w> <w>lifesteal</w> <w>listentry</w> + <w>logentry</w> <w>longdescription</w> <w>lookups</w> <w>magicmap</w> + <w>mailto</w> + <w>mandriva</w> <w>mapcontrol</w> <w>matchers</w> <w>megaxslt</w> + <w>metalforge</w> <w>microsystems</w> <w>missorted</w> <w>mmorpg</w> <w>mpart</w> <w>multi</w> <w>nesw</w> + <w>nmtoken</w> + <w>nodeps</w> + <w>nogui</w> + <w>nokleberg</w> + <w>ohloh</w> <w>online</w> + <w>outfile</w> <w>oversized</w> <w>overstrike</w> <w>overstrikes</w> @@ -1226,32 +1263,45 @@ <w>pickmaps</w> <w>plugins</w> <w>popup</w> + <w>projecthelp</w> <w>psionic</w> <w>recents</w> <w>recurse</w> <w>recursing</w> + <w>redistributors</w> + <w>relativize</w> <w>renderers</w> + <w>resettime</w> <w>resize</w> <w>resized</w> <w>resizes</w> <w>rethrown</w> <w>revivable</w> + <w>riedquat</w> <w>rsync</w> <w>scansize</w> <w>screenshot</w> + <w>screenshots</w> <w>script<?, ?, ?></w> <w>sdefault</w> + <w>searchable</w> + <w>seikel</w> <w>shortdescription</w> <w>shortdescriptionformat</w> + <w>siddharta</w> <w>sigint</w> + <w>singlepng</w> + <w>sixlegs</w> <w>slava</w> <w>smoothface</w> <w>smtp</w> <w>solaris</w> <w>sourceforge</w> + <w>spawnpoint</w> <w>startup</w> <w>stoneglow</w> <w>strncmp</w> + <w>sublicense</w> <w>sweeped</w> <w>switchcheck</w> <w>teleporter</w> @@ -1261,6 +1311,7 @@ <w>tileset</w> <w>timestamp</w> <w>toennies</w> + <w>tokar</w> <w>tokenize</w> <w>tokenized</w> <w>tokenizes</w> @@ -1271,9 +1322,13 @@ <w>treasurelists</w> <w>tristate</w> <w>typedefs</w> + <w>typenumbers</w> + <w>tönnies</w> + <w>unapplied</w> <w>unconstructable</w> <w>undoable</w> <w>unexperienced</w> + <w>unislash</w> <w>unregister</w> <w>unregistering</w> <w>unsets</w> @@ -1281,16 +1336,25 @@ <w>validator's</w> <w>validator...</w> <w>variable's</w> + <w>viegas</w> + <w>viewcvs</w> <w>viewport</w> <w>vogl</w> <w>waypoint</w> + <w>webstart</w> + <w>wedel</w> <w>whitespaces</w> + <w>wiki</w> + <w>wildcards</w> <w>xdebug</w> <w>xhtml</w> <w>xlint</w> + <w>xmlns</w> <w>xnoagent</w> <w>xrunhprof</w> <w>xrunjdwp</w> + <w>yoyodyne</w> + <w>zergus</w> </words> </dictionary> </component> Modified: trunk/src/doc/dev/changelog.xslt =================================================================== --- trunk/src/doc/dev/changelog.xslt 2010-06-06 20:30:47 UTC (rev 8191) +++ trunk/src/doc/dev/changelog.xslt 2010-06-06 20:49:51 UTC (rev 8192) @@ -39,7 +39,7 @@ <th>Rev</th> <th>Developer</th> <th>Date</th> - <th>Commit Message / Changeset Description</th> + <th>Commit Message / Change Set Description</th> </tr> </thead> <tbody> Modified: trunk/src/doc/dev/typeParameters.xhtml =================================================================== --- trunk/src/doc/dev/typeParameters.xhtml 2010-06-06 20:30:47 UTC (rev 8191) +++ trunk/src/doc/dev/typeParameters.xhtml 2010-06-06 20:49:51 UTC (rev 8192) @@ -36,10 +36,10 @@ <li>R: A<strong>r</strong>chetype</li> <li>A: Map<strong>A</strong>rchObject</li> <li>M: Map<strong>M</strong>odel</li> - <li>T: <em><strong>T</strong>ype</em> - Some abstract specific datatype, + <li>T: <em><strong>T</strong>ype</em> - Some abstract specific data type, usually in non-collection sense. </li> - <li>E: <em><strong>E</strong>lement</em> - Some unspecific datatype, usually + <li>E: <em><strong>E</strong>lement</em> - Some unspecific data type, usually in collection sense. </li> </ul> Modified: trunk/src/doc/ref/GameObjectMatcher.xhtml =================================================================== --- trunk/src/doc/ref/GameObjectMatcher.xhtml 2010-06-06 20:30:47 UTC (rev 8191) +++ trunk/src/doc/ref/GameObjectMatcher.xhtml 2010-06-06 20:49:51 UTC (rev 8192) @@ -120,7 +120,7 @@ </li> <li> The insertion and deletion tools use the 'system_wall' (or - fallback 'wall') matcher for selecing wall game objects. + fallback 'wall') matcher for selecting wall game objects. </li> <li> The deletion tool uses the 'system_monster' (or fallback @@ -247,7 +247,7 @@ Matchers of type 'Attrib' check an game object attribute's value. -The 'name' attribute specifies the game object attribute's name; it is reqired. +The 'name' attribute specifies the game object attribute's name; it is required. The 'value' attribute specifies the expected attribute value; it's value defaults to "1". Modified: trunk/src/doc/sitestyle.css =================================================================== --- trunk/src/doc/sitestyle.css 2010-06-06 20:30:47 UTC (rev 8191) +++ trunk/src/doc/sitestyle.css 2010-06-06 20:49:51 UTC (rev 8192) @@ -12,7 +12,7 @@ background-position: 0 0; background-repeat: no-repeat;*/ font-family: Helvetica, "Trebuchet MS", Arial, sans-serif; - font-size: 1em; /* setting base font to user's prefered size */ + font-size: 1em; /* setting base font to user's preferred size */ line-height: 130%; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-06 22:07:57
|
Revision: 8207 http://gridarta.svn.sourceforge.net/gridarta/?rev=8207&view=rev Author: akirschbaum Date: 2010-06-06 22:07:50 +0000 (Sun, 06 Jun 2010) Log Message: ----------- Fix typos. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java trunk/src/app/net/sf/gridarta/model/archetype/ArchetypeParser.java 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-06 22:06:40 UTC (rev 8206) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java 2010-06-06 22:07:50 UTC (rev 8207) @@ -193,7 +193,7 @@ */ @Override protected boolean addToPanel(final boolean isInternPath, @Nullable final String editorFolder, @NotNull final Archetype archetype) { - return !isInternPath && !(editorFolder != null && editorFolder.contains(net.sf.gridarta.model.gameobject.GameObject.EDITOR_FOLDER_INTERN)) && !archetype.getArchetypeName().equals(STARTARCH_NAME); + return !isInternPath && !(editorFolder != null && editorFolder.contains(net.sf.gridarta.model.gameobject.GameObject.EDITOR_FOLDER_INTERN)) && !archetype.getArchetypeName().equals(START_ARCH_NAME); } } // class ArchetypeParser Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java 2010-06-06 22:06:40 UTC (rev 8206) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java 2010-06-06 22:07:50 UTC (rev 8207) @@ -174,14 +174,14 @@ } else if (thisLine.startsWith("magicmap ")) { errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, "Ignoring obsolete 'magicmap' attribute: " + archetypeBuilder.getArchetypeName()); } else if (thisLine.startsWith("x ")) { - if (!archMore && !archetypeBuilder.getArchetypeName().equals(STARTARCH_NAME)) { + if (!archMore && !archetypeBuilder.getArchetypeName().equals(START_ARCH_NAME)) { errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, ACTION_BUILDER.format("logFoundCoordInDefArchSingleSquareOrHead", "x", archetypeBuilder.getArchetypeName())); archetypeBuilder.addObjectText(thisLine); } else { archetypeBuilder.setMultiX(Integer.parseInt(thisLine.substring(2))); } } else if (thisLine.startsWith("y ")) { - if (!archMore && !archetypeBuilder.getArchetypeName().equals(STARTARCH_NAME)) { + if (!archMore && !archetypeBuilder.getArchetypeName().equals(START_ARCH_NAME)) { errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, ACTION_BUILDER.format("logFoundCoordInDefArchSingleSquareOrHead", "y", archetypeBuilder.getArchetypeName())); archetypeBuilder.addObjectText(thisLine); } else { Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java 2010-06-06 22:06:40 UTC (rev 8206) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java 2010-06-06 22:07:50 UTC (rev 8207) @@ -277,7 +277,7 @@ continue; } - if (arch.getArchetypeName().equals(ArchetypeParser.STARTARCH_NAME)) { + if (arch.getArchetypeName().equals(ArchetypeParser.START_ARCH_NAME)) { // process map arch collectStartArch(arch, out); count++; @@ -307,7 +307,7 @@ } /** - * Processes the special archetype {@link ArchetypeParser#STARTARCH_NAME}. + * Processes the special archetype {@link ArchetypeParser#START_ARCH_NAME}. * @param archetype the archetype * @param out the writer collecting into * @throws IOException if an I/O error occurs @@ -318,7 +318,7 @@ // map object hack: x/y is normally a reference for multi // part arches - i include this hack until we rework the // arch objects with more useful script names - if (archetype.getArchetypeName().equals(ArchetypeParser.STARTARCH_NAME)) { + if (archetype.getArchetypeName().equals(ArchetypeParser.START_ARCH_NAME)) { out.append("x ").append(Integer.toString(archetype.getMultiX())).append('\n'); out.append("y ").append(Integer.toString(archetype.getMultiY())).append('\n'); } Modified: trunk/src/app/net/sf/gridarta/model/archetype/ArchetypeParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/ArchetypeParser.java 2010-06-06 22:06:40 UTC (rev 8206) +++ trunk/src/app/net/sf/gridarta/model/archetype/ArchetypeParser.java 2010-06-06 22:07:50 UTC (rev 8207) @@ -37,11 +37,11 @@ /** * Name of the system-archetype containing path of starting map. */ - String STARTARCH_NAME = "map"; + String START_ARCH_NAME = "map"; /** - * Here we read an Archetype from a filestream, parse the data and put the - * result in the ArchetypeSet in CMainControl. + * Here we read an Archetype from a {@link BufferedReader}, parse the data + * and put the result in the ArchetypeSet in CMainControl. * @param in <code>BufferedReader</code> file stream of archetype data * @param prototype Prototype Archetype (only for artifacts) * @param line first line, pre-parsed (only for artifacts) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-06 22:08:59
|
Revision: 8199 http://gridarta.svn.sourceforge.net/gridarta/?rev=8199&view=rev Author: akirschbaum Date: 2010-06-06 21:40:29 +0000 (Sun, 06 Jun 2010) Log Message: ----------- Fix checkstyle issues. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/scripts/ScriptTask.java trunk/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java 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-06 21:37:19 UTC (rev 8198) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java 2010-06-06 21:40:29 UTC (rev 8199) @@ -135,7 +135,7 @@ try { smoothFaces.add(new SmoothFace(tmp[0], tmp[1])); } catch (final DuplicateSmoothFaceException ex) { - errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, archetypeBuilder.getArchetypeName() + ": duplicate " + SMOOTHFACE +" '" + ex.getMessage() + "': " + line); + errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, archetypeBuilder.getArchetypeName() + ": duplicate " + SMOOTHFACE + " '" + ex.getMessage() + "': " + line); } } else { errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, archetypeBuilder.getArchetypeName() + ": invalid " + SMOOTHFACE + " info: " + line); Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-06 21:37:19 UTC (rev 8198) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-06-06 21:40:29 UTC (rev 8199) @@ -864,7 +864,7 @@ StyleConstants.setForeground(summaryTextStyle, Color.black); faceObjectProviders.addFaceObjectProvidersListener(faceObjectProvidersListener); - + setMessage(contentPanel); } Modified: trunk/src/app/net/sf/gridarta/gui/scripts/ScriptTask.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/scripts/ScriptTask.java 2010-06-06 21:37:19 UTC (rev 8198) +++ trunk/src/app/net/sf/gridarta/gui/scripts/ScriptTask.java 2010-06-06 21:40:29 UTC (rev 8199) @@ -19,13 +19,10 @@ package net.sf.gridarta.gui.scripts; -import java.awt.Frame; -import javax.swing.JList; -import net.sf.gridarta.mapmanager.MapManager; - /** * Parameter for operation to perform in {@link ScriptArchDataUtils#modifyEventScript(int, - * int, JList, MapManager, Frame, Iterable)}. + * ScriptTask, javax.swing.JList, net.sf.gridarta.mapmanager.MapManager, + * java.awt.Frame, Iterable)}. * @author Andreas Kirschbaum */ public enum ScriptTask { Modified: trunk/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java 2010-06-06 21:37:19 UTC (rev 8198) +++ trunk/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java 2010-06-06 21:40:29 UTC (rev 8199) @@ -106,8 +106,8 @@ boolean inAnim = false; String animName = null; final StringBuilder animText = new StringBuilder(); - int lineNumber; - for (lineNumber = 1; ; lineNumber++) { + int lineNumber = 1; + while (true) { final String line2 = in.readLine(); if (line2 == null) { break; @@ -152,6 +152,8 @@ } else if (!ignoreOtherText) { throw new AnimationParseException(startKey + "...", line, lineNumber); } + + lineNumber++; } if (inAnim) { throw new AnimationParseException("mina", null, lineNumber); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-06 23:35:50
|
Revision: 8249 http://gridarta.svn.sourceforge.net/gridarta/?rev=8249&view=rev Author: akirschbaum Date: 2010-06-06 23:35:44 +0000 (Sun, 06 Jun 2010) Log Message: ----------- Add comments. Modified Paths: -------------- trunk/gridarta.ipr trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2010-06-06 23:30:47 UTC (rev 8248) +++ trunk/gridarta.ipr 2010-06-06 23:35:44 UTC (rev 8249) @@ -348,7 +348,7 @@ <inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true"> <option name="TOP_LEVEL_CLASS_OPTIONS"> <value> - <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" /> + <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="package" /> <option name="REQUIRED_TAGS" value="@author" /> </value> </option> Modified: trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java 2010-06-06 23:30:47 UTC (rev 8248) +++ trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java 2010-06-06 23:35:44 UTC (rev 8249) @@ -44,21 +44,25 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +/** + * Default {@link FileControl} implementation. Asks the user for directions. + * @author Andreas Kirschbaum + */ public class DefaultFileControl<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements FileControl<G, A, R> { /** - * Action Builder. + * The {@link ActionBuilder}. */ private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** - * The global settings instance. + * The {@link GlobalSettings}. */ @NotNull private final GlobalSettings globalSettings; /** - * The archetype set. + * The {@link ArchetypeSet}. */ @NotNull private final ArchetypeSet<G, A, R> archetypeSet; @@ -70,7 +74,7 @@ private final MapImageCache<G, A, R> mapImageCache; /** - * The map manager. + * The {@link MapManager}. */ @NotNull private final MapManager<G, A, R> mapManager; @@ -88,19 +92,19 @@ private final Component parent; /** - * The map file filter. + * The {@link FileFilter} for selecting map files. */ @NotNull private final FileFilter mapFileFilter; /** - * The script file filter. + * The {@link FileFilter} for selecting script files. */ @NotNull private final FileFilter scriptFileFilter; /** - * The new map dialog factory. + * The {@link NewMapDialogFactory}. */ @NotNull private final NewMapDialogFactory<G, A, R> newMapDialogFactory; @@ -118,7 +122,8 @@ private final ScriptEditControl scriptEditControl; /** - * JFileChooser for opening a file. + * The {@link JFileChooser} for opening a file. Set to <code>null</code> if + * not yet created. */ @Nullable private JFileChooser fileChooser = null; @@ -131,8 +136,8 @@ * @param mapManager the map manager * @param mapViewsManager the map views manager * @param parent the parent component for showing dialog boxes - * @param mapFileFilter the map file filter - * @param scriptFileFilter the script file filter + * @param mapFileFilter the file filter for selecting map files + * @param scriptFileFilter the file filter for selecting script files * @param newMapDialogFactory the new map dialog factory * @param scriptExtension the file extension for script files * @param scriptEditControl the script edit control to forward to @@ -190,7 +195,7 @@ /** * The user wants to open a file. The file filters and preselected file - * filter are set accordingly to <var>mapFilter</var>. + * filter are set accordingly to <code>mapFilter</code>. * @param mapFilter set to <code>true</code> if the user probably wants to * open a map, <code>false</code> otherwise */ @@ -316,6 +321,11 @@ return true; } + /** + * Displays a "save as" dialog. + * @param mapControl the map control for the dialog + * @return the selected file or <code>null</code> if cancelled + */ @Nullable private File saveMapAs(@NotNull final MapControl<G, A, R> mapControl) { final JFileChooser saveFileChooser = new JFileChooser(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |