From: <aki...@us...> - 2007-01-23 20:02:49
|
Revision: 1677 http://svn.sourceforge.net/gridarta/?rev=1677&view=rev Author: akirschbaum Date: 2007-01-23 12:02:06 -0800 (Tue, 23 Jan 2007) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/io/CMapWriter.java trunk/daimonin/src/daieditor/io/CMapWriter.java Modified: trunk/crossfire/src/cfeditor/io/CMapWriter.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapWriter.java 2007-01-23 19:54:37 UTC (rev 1676) +++ trunk/crossfire/src/cfeditor/io/CMapWriter.java 2007-01-23 20:02:06 UTC (rev 1677) @@ -81,11 +81,12 @@ } final String msgText = gameObject.getMsgText(); - if (msgText != null && !msgText.trim().equals((archetype == null || archetype.getMsgText() == null) ? "" : archetype.getMsgText().trim())) { + final String archMsgText = archetype.getMsgText(); + if (msgText != null && !msgText.trim().equals(archMsgText == null ? "" : archMsgText.trim())) { fields.put("msg", String.format("%s%sendmsg", msgText, msgText.endsWith("\n") ? "" : "\n")); } - if (archetype != null && gameObject.getArchTypNr() != archetype.getArchTypNr()) { + if (gameObject.getArchTypNr() != archetype.getArchTypNr()) { // this gameObject has special type if (gameObject.getObjectText().contains("type ")) { // oh oh - there might also be a type in the archtext which Modified: trunk/daimonin/src/daieditor/io/CMapWriter.java =================================================================== --- trunk/daimonin/src/daieditor/io/CMapWriter.java 2007-01-23 19:54:37 UTC (rev 1676) +++ trunk/daimonin/src/daieditor/io/CMapWriter.java 2007-01-23 20:02:06 UTC (rev 1677) @@ -86,7 +86,7 @@ format.format("msg\n%s%sendmsg\n", msgText, msgText.endsWith("\n") ? "" : "\n"); } - if (archetype != null && gameObject.getArchTypNr() != archetype.getArchTypNr()) { + if (gameObject.getArchTypNr() != archetype.getArchTypNr()) { // this gameObject has special type if (gameObject.getObjectText().contains("type ")) { // oh oh - there might also be a type in the archtext which This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-23 20:13:53
|
Revision: 1678 http://svn.sourceforge.net/gridarta/?rev=1678&view=rev Author: akirschbaum Date: 2007-01-23 12:13:47 -0800 (Tue, 23 Jan 2007) Log Message: ----------- Reset 'Msg Text' tab to black if game object text was unset. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java Modified: trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java 2007-01-23 20:02:06 UTC (rev 1677) +++ trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java 2007-01-23 20:13:47 UTC (rev 1678) @@ -507,9 +507,6 @@ private void setupTextPanel() { textPanel = new JPanel(new GridLayout(1, 1)); - archTextArea.setText(""); - archTextArea.setForeground(Color.blue); - // create ScrollPane for text scrolling final JScrollPane sta = new JScrollPane(archTextArea); sta.setBorder(new EtchedBorder()); @@ -622,7 +619,6 @@ archNameField.setText(""); archFaceText.setText("Image:"); archTypeText.setText("Type:"); - archTextArea.setText(""); archMapPos.setText("Status: "); // reset list @@ -634,6 +630,9 @@ eventList.setModel(new DefaultListModel()); // clear script event list } + archTextArea.setText(""); + archTextArea.setForeground(Color.black); + if (aNew != null && aRemove != null) { aNew.setEnabled(false); aModify.setEnabled(false); @@ -679,9 +678,7 @@ hasMessage = true; } archTextArea.setCaretPosition(0); - if (hasMessage) { - panelDesktop.setForegroundAt(1, Color.blue); - } + panelDesktop.setForegroundAt(1, hasMessage ? Color.blue : Color.black); // end msg text // SET FACE Modified: trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java =================================================================== --- trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java 2007-01-23 20:02:06 UTC (rev 1677) +++ trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java 2007-01-23 20:13:47 UTC (rev 1678) @@ -642,9 +642,6 @@ private void setupTextPanel() { textPanel = new JPanel(new GridLayout(1, 1)); - archTextArea.setText(""); - archTextArea.setForeground(Color.blue); - // create ScrollPane for text scrolling final JScrollPane sta = new JScrollPane(archTextArea); sta.setBorder(new EtchedBorder()); @@ -746,7 +743,6 @@ archNameField.setText(""); archFaceText.setText("Image:"); archTypeText.setText("Type:"); - archTextArea.setText(""); archMapPos.setText("Status: "); // reset list @@ -762,6 +758,9 @@ eventList.setModel(new DefaultListModel()); // clear script event list } + archTextArea.setText(""); + archTextArea.setForeground(Color.black); + if (aNew != null && aRemove != null) { aNew.setEnabled(false); aModify.setEnabled(false); @@ -822,9 +821,7 @@ hasMessage = true; } archTextArea.setCaretPosition(0); - if (hasMessage) { - panelDesktop.setForegroundAt(1, Color.blue); - } + panelDesktop.setForegroundAt(1, hasMessage ? Color.blue : Color.black); // end msg text if (gameObject.getAnimName() != null || archetype != null && archetype.getAnimName() != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-24 22:45:44
|
Revision: 1698 http://svn.sourceforge.net/gridarta/?rev=1698&view=rev Author: christianhujer Date: 2007-01-24 14:45:45 -0800 (Wed, 24 Jan 2007) Log Message: ----------- Added JavaDoc for getType(). Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/daimonin/src/daieditor/CFArchTypeList.java trunk/src/app/net/sf/gridarta/CFArchTypeList.java Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2007-01-24 20:51:11 UTC (rev 1697) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2007-01-24 22:45:45 UTC (rev 1698) @@ -93,6 +93,7 @@ return IGUIConstants.CONFIG_DIR; } + /** {@inheritDoc} */ @Nullable @Override public CFArchType getType(@NotNull final GameObject gameObject) { CFArchType result = null; for (final CFArchType type : archTypeList) { Modified: trunk/daimonin/src/daieditor/CFArchTypeList.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchTypeList.java 2007-01-24 20:51:11 UTC (rev 1697) +++ trunk/daimonin/src/daieditor/CFArchTypeList.java 2007-01-24 22:45:45 UTC (rev 1698) @@ -134,6 +134,7 @@ } } + /** {@inheritDoc} */ @Nullable @Override public CFArchType getType(@NotNull final GameObject gameObject) { for (final CFArchType type : archTypeList) { if (type.matches(gameObject)) { Modified: trunk/src/app/net/sf/gridarta/CFArchTypeList.java =================================================================== --- trunk/src/app/net/sf/gridarta/CFArchTypeList.java 2007-01-24 20:51:11 UTC (rev 1697) +++ trunk/src/app/net/sf/gridarta/CFArchTypeList.java 2007-01-24 22:45:45 UTC (rev 1698) @@ -380,7 +380,11 @@ return type == null ? archTypeList.get(0) : type; } - // TODO: Javadoc + /** + * Returns the CFArchType for the given GameObject. + * @param gameObject The GameObject to find the CFArchType for. + * @return The CFArchType for the given GameObject or <code>null</code> if no archetype was found. + */ @Nullable public abstract CFArchType getType(@NotNull final G gameObject); } // class CFArchTypeList This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-25 01:35:31
|
Revision: 1703 http://svn.sourceforge.net/gridarta/?rev=1703&view=rev Author: akirschbaum Date: 2007-01-24 15:25:59 -0800 (Wed, 24 Jan 2007) Log Message: ----------- Distinguish between 'GameObject' and 'Archetype'. Modified Paths: -------------- trunk/crossfire/src/cfeditor/AutojoinList.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/MapViewIFrame.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/crossfire/src/cfeditor/gui/ArchetypeChooser.java trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java trunk/crossfire/src/cfeditor/gui/InsertionObjectChooser.java trunk/crossfire/src/cfeditor/gui/ObjectChoiceDisplay.java trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java trunk/crossfire/src/cfeditor/gui/selectedsquare/CellRenderer.java trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java trunk/crossfire/src/cfeditor/io/CMapReader.java trunk/crossfire/src/cfeditor/io/CMapWriter.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/crossfire/src/cfeditor/map/MapModel.java trunk/crossfire/src/cfeditor/parameter/ArchParameter.java trunk/daimonin/src/daieditor/CFArchTypeList.java trunk/daimonin/src/daieditor/CFTreasureListTree.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/CopyBuffer.java trunk/daimonin/src/daieditor/MapViewIFrame.java trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java trunk/daimonin/src/daieditor/gui/ArchetypeChooser.java trunk/daimonin/src/daieditor/gui/GameObjectAttributesDialog.java trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java trunk/daimonin/src/daieditor/gui/InsertionObjectChooser.java trunk/daimonin/src/daieditor/gui/ObjectChoiceDisplay.java trunk/daimonin/src/daieditor/gui/ReplaceDialog.java trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java trunk/daimonin/src/daieditor/gui/map/tools/DeletionTool.java trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareControl.java trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java trunk/daimonin/src/daieditor/io/CMapReader.java trunk/daimonin/src/daieditor/io/CMapWriter.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/daimonin/src/daieditor/map/MapModel.java trunk/daimonin/src/daieditor/map/validation/DelegatingMapValidator.java trunk/daimonin/src/daieditor/map/validation/GameObjectsValidationError.java trunk/daimonin/src/daieditor/map/validation/SquareValidationError.java trunk/daimonin/src/daieditor/map/validation/SquareValidator.java trunk/daimonin/src/daieditor/map/validation/ValidationError.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedMobOrSpawnPointChecker.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedMobOrSpawnPointError.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareError.java trunk/daimonin/src/daieditor/map/validation/checks/DoubleLayerChecker.java trunk/daimonin/src/daieditor/map/validation/checks/DoubleLayerError.java trunk/daimonin/src/daieditor/map/validation/checks/DoubleTypeChecker.java trunk/daimonin/src/daieditor/map/validation/checks/DoubleTypeError.java trunk/daimonin/src/daieditor/map/validation/checks/SquareWithoutFloorChecker.java trunk/daimonin/src/daieditor/map/validation/checks/SquareWithoutFloorError.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java trunk/src/app/net/sf/gridarta/CFArchType.java trunk/src/app/net/sf/gridarta/CFArchTypeList.java trunk/src/app/net/sf/gridarta/MainControl.java trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSet.java trunk/src/app/net/sf/gridarta/gameobject/Archetype.java trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObjectContainer.java trunk/src/app/net/sf/gridarta/gameobject/MultiArchData.java trunk/src/app/net/sf/gridarta/gameobject/NotArchetypeException.java trunk/src/app/net/sf/gridarta/gameobject/RecursiveGameObjectIterator.java trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/ArchetypeChooser.java trunk/src/app/net/sf/gridarta/gui/InsertionObjectChooser.java trunk/src/app/net/sf/gridarta/gui/connectionview/ConnectionControl.java trunk/src/app/net/sf/gridarta/gui/connectionview/ConnectionView.java trunk/src/app/net/sf/gridarta/gui/maptilelist/MapTileSelection.java trunk/src/app/net/sf/gridarta/gui/maptilelist/MapTileSelectionCache.java trunk/src/app/net/sf/gridarta/io/AbstractMapReader.java trunk/src/app/net/sf/gridarta/io/AbstractMapWriter.java trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java trunk/src/app/net/sf/gridarta/map/AbstractMapModel.java trunk/src/app/net/sf/gridarta/map/MapControl.java trunk/src/app/net/sf/gridarta/map/MapFileActions.java trunk/src/app/net/sf/gridarta/map/MapModel.java trunk/src/app/net/sf/gridarta/map/MapModelEvent.java trunk/src/app/net/sf/gridarta/map/MapModelListener.java trunk/src/app/net/sf/gridarta/map/MapSquare.java trunk/src/app/net/sf/gridarta/map/MapState.java trunk/src/doc/dev/typeParameters.xhtml Added Paths: ----------- trunk/crossfire/src/cfeditor/gameobject/Archetype.java trunk/daimonin/src/daieditor/gameobject/Archetype.java Modified: trunk/crossfire/src/cfeditor/AutojoinList.java =================================================================== --- trunk/crossfire/src/cfeditor/AutojoinList.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/AutojoinList.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -19,15 +19,14 @@ package cfeditor; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; -import cfeditor.map.MapArchObject; import cfeditor.map.MapModel; import java.awt.Point; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.IOException; -import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.io.IOUtils; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -141,7 +140,7 @@ } else if (count < 16) { // add a new archid to the buffer - final Archetype<GameObject, MapArchObject> archetype = archstack.getArchetype(line); + final Archetype archetype = archstack.getArchetype(line); if (archetype != null) { nbuf[count] = line; @@ -339,7 +338,7 @@ * @param archetypeName Name of the archetype to connect with. */ private void connectArch(final GameObject gameObject, final String archetypeName) { - final GameObject archetype = stack.getArchetype(archetypeName); // new default arch + final Archetype archetype = stack.getArchetype(archetypeName); // new default arch if (!gameObject.getArchetypeName().equals(archetypeName)) { // set new archtype Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -19,6 +19,7 @@ package cfeditor; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import java.awt.Component; @@ -35,7 +36,7 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public final class CFArchTypeList extends net.sf.gridarta.CFArchTypeList<GameObject, MapArchObject> { +public final class CFArchTypeList extends net.sf.gridarta.CFArchTypeList<GameObject, MapArchObject, Archetype> { private static final Logger log = Logger.getLogger(CFArchTypeList.class); Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -19,8 +19,8 @@ package cfeditor; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.ArchetypeSet; -import cfeditor.gameobject.GameObject; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -903,7 +903,7 @@ // normal arch: display the face icon if (CMainControl.getInstance().getArchetypeSet().getLoadStatus() == ArchetypeSet.LoadStatus.COMPLETE) { final String archetypeName = content.getName(); - final GameObject archetype = CMainControl.getInstance().getArchetypeSet().getArchetype(archetypeName); + final Archetype archetype = CMainControl.getInstance().getArchetypeSet().getArchetype(archetypeName); if (archetype != null) { setIcon(CMainControl.getInstance().getArchetypeSet().getFace(archetype)); } else { Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -19,6 +19,7 @@ package cfeditor; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.ArchetypeParser; import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; @@ -81,7 +82,7 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author Andreas Kirschbaum */ -public final class CMainControl extends AbstractMainControl<GameObject, MapArchObject, MapControl> implements ThrowableHandler { +public final class CMainControl extends AbstractMainControl<GameObject, MapArchObject, Archetype, MapControl> implements ThrowableHandler { /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); @@ -964,7 +965,7 @@ // first: attach our map sucker to a default arch we have loaded for (final GameObject gameObject : objects) { - final GameObject archetype = archetypeSet.getArchetype(gameObject.getArchetypeName()); + final Archetype archetype = archetypeSet.getArchetype(gameObject.getArchetypeName()); if (archetype == null) { // we had an unknown arch here!! // showMessage("Error Loading Map File "+file.getName(), "\n Found Unknown Arch < "+arch.getArchetypeName()+" >"); Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -19,6 +19,7 @@ package cfeditor; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import cfeditor.gui.MapView; import cfeditor.gui.map.DefaultLevelRenderer; @@ -75,7 +76,7 @@ * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> */ -public final class CMapViewBasic extends JScrollPane implements MapModelListener<GameObject, MapArchObject>, MapCursorListener { +public final class CMapViewBasic extends JScrollPane implements MapModelListener<GameObject, MapArchObject, Archetype>, MapCursorListener { private static final Logger log = Logger.getLogger(CMapViewBasic.class); @@ -315,8 +316,8 @@ * Get the selected squares. * @return selected squares */ - public List<MapSquare<GameObject, MapArchObject>> getSelectedSquares() { - final List<MapSquare<GameObject, MapArchObject>> selection = new ArrayList<MapSquare<GameObject, MapArchObject>>(); + public List<MapSquare<GameObject, MapArchObject, Archetype>> getSelectedSquares() { + final List<MapSquare<GameObject, MapArchObject, Archetype>> selection = new ArrayList<MapSquare<GameObject, MapArchObject, Archetype>>(); final Size2D mapSize = mapModel.getMapSize(); final Point pos = new Point(); for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -19,6 +19,7 @@ package cfeditor; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; @@ -139,7 +140,7 @@ } final HashSet<GameObject> gameObjectsToDelete = new HashSet<GameObject>(); - for (final MapSquare<GameObject, MapArchObject> square : mapControl.getMapViewFrame().getView().getSelectedSquares()) { + for (final MapSquare<GameObject, MapArchObject, Archetype> square : mapControl.getMapViewFrame().getView().getSelectedSquares()) { final int posx = square.getMapX(); final int posy = square.getMapY(); for (final GameObject gameObject : square) { @@ -187,7 +188,7 @@ mapControl.getMapModel().beginTransaction("Paste"); // TODO: I18N/L10N final Point pos = new Point(); assert copyMap != null; - for (final MapSquare<GameObject, MapArchObject> square : copyMap) { + for (final MapSquare<GameObject, MapArchObject, Archetype> square : copyMap) { pos.setLocation(startp.x + square.getMapX(), startp.y + square.getMapY()); if (mapControl.isPointValid(pos)) { for (final GameObject gameObject : square) { @@ -200,7 +201,7 @@ } assert copyMapCtrl != null; - for (final MapSquare<GameObject, MapArchObject> square : copyMapCtrl.getMapModel()) { + for (final MapSquare<GameObject, MapArchObject, Archetype> square : copyMapCtrl.getMapModel()) { pos.setLocation(startp); pos.translate(square.getMapX(), square.getMapY()); if (mapControl.isPointValid(pos)) { @@ -313,11 +314,11 @@ return null; } final MapViewIFrame mapViewIFrame = mapControl.getMapViewFrame(); - final Iterable<MapSquare<GameObject, MapArchObject>> mapSquares; + final Iterable<MapSquare<GameObject, MapArchObject, Archetype>> mapSquares; if (mapViewIFrame == null) { mapSquares = mapControl.getAllSquares(); } else { - final List<MapSquare<GameObject, MapArchObject>> selectedMapSquares = mapViewIFrame.getView().getSelectedSquares(); + final List<MapSquare<GameObject, MapArchObject, Archetype>> selectedMapSquares = mapViewIFrame.getView().getSelectedSquares(); if (selectedMapSquares.isEmpty()) { mapSquares = mapControl.getAllSquares(); } else { @@ -325,7 +326,7 @@ } } final List<GameObject> objects = new ArrayList<GameObject>(max); - for (final MapSquare<GameObject, MapArchObject> mapSquare : mapSquares) { + for (final MapSquare<GameObject, MapArchObject, Archetype> mapSquare : mapSquares) { for (final GameObject node : mapSquare) { objects.add(node.getHead()); } Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -19,6 +19,7 @@ package cfeditor; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import cfeditor.gui.MapView; import cfeditor.map.MapArchObject; @@ -77,7 +78,7 @@ * The {@link MapModelListener} used to detect changes in the map model * that should be reflected in the window title. */ - private final MapModelListener<GameObject, MapArchObject> mapModelListener = new MapModelListener<GameObject, MapArchObject>() { + private final MapModelListener<GameObject, MapArchObject, Archetype> mapModelListener = new MapModelListener<GameObject, MapArchObject, Archetype>() { /** {@inheritDoc} */ public void mapSizeChanged(final MapModelEvent e) { Added: trunk/crossfire/src/cfeditor/gameobject/Archetype.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/Archetype.java (rev 0) +++ trunk/crossfire/src/cfeditor/gameobject/Archetype.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -0,0 +1,30 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 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 cfeditor.gameobject; + +import cfeditor.map.MapArchObject; + +/** + * <code>Archetype</code> implements Crossfire archetypes. + * @author Andreas Kirschbaum + */ +public interface Archetype extends net.sf.gridarta.gameobject.Archetype<GameObject, MapArchObject, Archetype> { + +} // class Archetype Property changes on: trunk/crossfire/src/cfeditor/gameobject/Archetype.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -40,7 +40,7 @@ * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ @SuppressWarnings({"HardcodedFileSeparator"}) -public final class ArchetypeParser extends AbstractArchetypeParser<GameObject, MapArchObject> { +public final class ArchetypeParser extends AbstractArchetypeParser<GameObject, MapArchObject, Archetype> { /** Logger. */ private static final Logger log = Logger.getLogger(ArchetypeParser.class); @@ -74,7 +74,7 @@ /** {@inheritDoc} */ @Nullable - public GameObject parseArchetypeFromStream(final BufferedReader in, @Nullable final GameObject prototype, @Nullable final String line, @Nullable final String archName, @NotNull final String panelName, @NotNull final String folderName, final String fname) throws IOException { + public Archetype parseArchetypeFromStream(final BufferedReader in, @Nullable final GameObject prototype, @Nullable final String line, @Nullable final String archName, @NotNull final String panelName, @NotNull final String folderName, final String fname) throws IOException { // start with new clean GameObject instance GameObject archetype; GameObject archlast = null; @@ -284,7 +284,7 @@ final String text = gameObject.getObjectText(); final int len = text.length(); - final GameObject archetype = gameObject.getArchetype(); + final Archetype archetype = gameObject.getArchetype(); gameObject.resetObjectText(); for (int i = 0, s = 0; i < len; i++) { Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -40,7 +40,6 @@ import java.util.Map; import javax.swing.ImageIcon; import net.sf.gridarta.gameobject.AbstractArchetypeSet; -import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import net.sf.gridarta.gameobject.face.DuplicateFaceException; import net.sf.gridarta.io.IOUtils; @@ -55,7 +54,7 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @todo move face storage to {@link FaceObjects}. */ -public final class ArchetypeSet extends AbstractArchetypeSet<GameObject, MapArchObject> { +public final class ArchetypeSet extends AbstractArchetypeSet<GameObject, MapArchObject, Archetype> { private static final Logger log = Logger.getLogger(ArchetypeSet.class); @@ -70,12 +69,8 @@ } /** {@inheritDoc} */ - @NotNull public ImageIcon getFace(@NotNull final GameObject gameObject) { - if (!gameObject.hasArchetype()) { - return CMainControl.getNoarchTileIcon(); - } - - final String faceName = gameObject.getFaceName(); + @NotNull public ImageIcon getFace(@NotNull final Archetype archetype) { + final String faceName = archetype.getFaceName(); if (faceName == null) { return CMainControl.getNofaceTileIcon(); } @@ -94,7 +89,7 @@ } /** {@inheritDoc} */ - @Override protected void handleDuplicate(final GameObject archetype) { + @Override protected void handleDuplicate(final Archetype archetype) { log.warn("addArchToList: duplicate archetype '" + archetype.getArchetypeName() + "'"); } @@ -471,7 +466,7 @@ try { int count = 0; // count how much arches we've collected - for (final GameObject arch : getArchetypes()) { + for (final Archetype arch : getArchetypes()) { if (arch.isTail()) { log.error("Collect Error: Multipart Tail in Panel found!"); @@ -545,7 +540,7 @@ } // finally we need to get the "map"-arch, which is not in the panels - final Archetype<GameObject, MapArchObject> maparch = getArchetype(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME); + final Archetype maparch = getArchetype(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME); if (maparch != null) { count++; @@ -591,9 +586,9 @@ * Returns an array with all Archetypes. * @return An array with all Archetypes. */ - public GameObject[] getArchList() { - final Collection<GameObject> archetypes = getArchetypes(); - return archetypes.toArray(new GameObject[archetypes.size()]); + public Archetype[] getArchList() { + final Collection<Archetype> archetypes = getArchetypes(); + return archetypes.toArray(new Archetype[archetypes.size()]); } } // class ArchetypeSet Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -37,7 +37,7 @@ * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> */ -public class GameObject extends net.sf.gridarta.gameobject.GameObject<GameObject, MapArchObject> implements Cloneable, Iterable<GameObject> { +public class GameObject extends net.sf.gridarta.gameobject.GameObject<GameObject, MapArchObject, Archetype> implements Archetype, Cloneable, Iterable<GameObject> { /** Logger. */ private static final Logger log = Logger.getLogger(GameObject.class); @@ -304,7 +304,7 @@ * {@inheritDoc} * @todo this method is too slow - find a faster way */ - @Override @NotNull public String diffArchText(@NotNull String atxt, final boolean ignoreValues) { + @NotNull public String diffArchText(@NotNull String atxt, final boolean ignoreValues) { int j; if (!atxt.endsWith("\n")) { @@ -659,17 +659,14 @@ } final GameObject arch = new GameObject(); arch.setArchetypeName(archetypeName); - arch.setArchetype(this); + arch.setArchetype(getArchetype()); arch.setFaceName(getFaceName()); arch.setMultiX(multiX); arch.setMultiY(multiY); return arch; } - /** - * Returns editor Folder. - * @return editor Folder - */ + /** {@inheritDoc} */ public String getEditorFolder() { return editorFolder; } Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -20,6 +20,7 @@ package cfeditor.gameobject.scripts; import cfeditor.CMainControl; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import java.awt.FlowLayout; import java.io.File; @@ -308,7 +309,7 @@ if (typeArchName == null) { throw new UndefinedEventArchetypeTypeException(eventType); } - final GameObject eventArch = CMainControl.getInstance().getArchetypeSet().getArchetype(typeArchName); + final Archetype eventArch = CMainControl.getInstance().getArchetypeSet().getArchetype(typeArchName); if (eventArch == null) { throw new UndefinedEventArchetypeNameException(typeArchName); } Modified: trunk/crossfire/src/cfeditor/gui/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -27,7 +27,7 @@ package cfeditor.gui; import cfeditor.CMainControl; -import cfeditor.gameobject.GameObject; +import cfeditor.gameobject.Archetype; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; @@ -94,7 +94,7 @@ private void editorEntryChange() { editor.lockEditor(); - final GameObject nearestMatch = archComboBoxModel.getNearsetMatch(editor.editor.getText()); + final Archetype nearestMatch = archComboBoxModel.getNearsetMatch(editor.editor.getText()); setSelectedItem(nearestMatch); editor.setItem(nearestMatch); editor.unlockEditor(); @@ -139,7 +139,7 @@ fromSelect.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { try { - final GameObject ao = archComboBoxModel.getNearsetMatch(mainControl.getArchPanelHighlight().getArchetypeName()); + final Archetype ao = archComboBoxModel.getNearsetMatch(mainControl.getArchPanelHighlight().getArchetypeName()); setSelectedItem(ao); setItem(ao); } catch (final Exception ex) {//null pointer exception @@ -151,7 +151,7 @@ fromActive.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { try { - final GameObject ao = archComboBoxModel.getNearsetMatch(mainControl.getMainView().getMapArchPanelObject().getArchetypeName()); + final Archetype ao = archComboBoxModel.getNearsetMatch(mainControl.getMainView().getMapArchPanelObject().getArchetypeName()); setSelectedItem(ao); setItem(ao); } catch (final Exception ex) {//null pointer exception @@ -260,7 +260,7 @@ * @see javax.swing.ComboBoxEditor#setItem(java.lang.Object) */ public void setItem(final Object anObject) { - final GameObject arch = (GameObject) anObject; + final Archetype arch = (Archetype) anObject; if (anObject == null) { icon.setIcon(null); icon.setText("No item selected"); @@ -287,7 +287,7 @@ private Object value = null; - private final GameObject[] archList; /*the current list*/ + private final Archetype[] archList; /*the current list*/ private String currentFilter = ""; @@ -295,8 +295,8 @@ public ArchComboBoxModel() { archList = mainControl.getArchetypeSet().getArchList(); - Arrays.sort(archList, new Comparator<GameObject>() { - public int compare(final GameObject o1, final GameObject o2) { + Arrays.sort(archList, new Comparator<Archetype>() { + public int compare(final Archetype o1, final Archetype o2) { return o1.getArchetypeName().toLowerCase().compareTo(o2.getArchetypeName().toLowerCase()); } }); @@ -347,18 +347,18 @@ // "abc" -> "abcd" } - private GameObject getNearsetMatch(final String name) { + private Archetype getNearsetMatch(final String name) { int pos = Arrays.binarySearch(archList, name, new Comparator<Object>() { public int compare(final Object o1, final Object o2) { final String s1; final String s2; - if (o1 instanceof GameObject) { - s1 = ((GameObject) o1).getArchetypeName().toLowerCase(); + if (o1 instanceof Archetype) { + s1 = ((Archetype) o1).getArchetypeName().toLowerCase(); } else { s1 = o1.toString().toLowerCase(); } - if (o2 instanceof GameObject) { - s2 = ((GameObject) o2).getArchetypeName().toLowerCase(); + if (o2 instanceof Archetype) { + s2 = ((Archetype) o2).getArchetypeName().toLowerCase(); } else { s2 = o2.toString().toLowerCase(); } @@ -405,7 +405,7 @@ /* We additionally set the JLabels icon property here. */ - final GameObject arch = (GameObject) value; + final Archetype arch = (Archetype) value; if (arch == null) { setText(""); setIcon(null); Modified: trunk/crossfire/src/cfeditor/gui/ArchetypeChooser.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchetypeChooser.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/gui/ArchetypeChooser.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -20,6 +20,7 @@ package cfeditor.gui; import cfeditor.CMainControl; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import java.awt.Component; @@ -34,7 +35,7 @@ * @author unknown * @author Andreas Kirschbaum */ -public final class ArchetypeChooser extends net.sf.gridarta.gui.ArchetypeChooser<GameObject, MapArchObject> { +public final class ArchetypeChooser extends net.sf.gridarta.gui.ArchetypeChooser<GameObject, MapArchObject, Archetype> { private static final Logger log = Logger.getLogger(ArchetypeChooser.class); Modified: trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -22,6 +22,8 @@ import cfeditor.CFArchTypeList; import cfeditor.CFTreasureListTree; import cfeditor.CMainControl; +import cfeditor.gameobject.Archetype; +import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import java.util.List; @@ -47,7 +49,7 @@ * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @fixme I suck */ -public final class GameObjectAttributesDialog extends AbstractGameObjectAttributesDialog<GameObject, MapArchObject> { +public final class GameObjectAttributesDialog extends AbstractGameObjectAttributesDialog<GameObject, MapArchObject, Archetype> { /** Logger. */ private static final Logger log = Logger.getLogger(GameObjectAttributesDialog.class); Modified: trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -24,6 +24,7 @@ import cfeditor.CSettings; import cfeditor.IGUIConstants; import cfeditor.gameobject.GameObject; +import cfeditor.map.MapArchObject; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; @@ -55,6 +56,7 @@ import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; import net.sf.gridarta.CFArchType; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gui.GSplitPane; import net.sf.gridarta.gui.connectionview.ConnectionControl; import net.sf.gridarta.map.MapModel; @@ -302,7 +304,7 @@ // are taken instead: final GameObject gameObject = activeArch.getHead(); - final GameObject archetype = gameObject.getArchetype(); + final Archetype archetype = gameObject.getArchetype(); if (archetype == null) { // hm, this should NOT happen System.err.println("trying to change a GameObject with null Archetype"); // TODO: use logging return; @@ -648,7 +650,7 @@ aAttrWin.setEnabled(true); aSubmitChange.setEnabled(true); - final GameObject archetype = gameObject.getArchetype(); + final Archetype archetype = gameObject.getArchetype(); // no text, we try to set the default text final boolean hasMessage; Modified: trunk/crossfire/src/cfeditor/gui/InsertionObjectChooser.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/InsertionObjectChooser.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/gui/InsertionObjectChooser.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -22,6 +22,7 @@ import cfeditor.CMainControl; import cfeditor.CSettings; import cfeditor.IGUIConstants; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import java.awt.BorderLayout; @@ -44,7 +45,7 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author Andreas Kirschbaum */ -public final class InsertionObjectChooser extends JPanel implements net.sf.gridarta.gui.InsertionObjectChooser<GameObject, MapArchObject> { +public final class InsertionObjectChooser extends JPanel implements net.sf.gridarta.gui.InsertionObjectChooser<GameObject, MapArchObject, Archetype> { private static final String ARCHPANEL_LOCATION_KEY = "MainWindowArchPanel.dividerLocation"; Modified: trunk/crossfire/src/cfeditor/gui/ObjectChoiceDisplay.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ObjectChoiceDisplay.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/gui/ObjectChoiceDisplay.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -20,6 +20,7 @@ package cfeditor.gui; import cfeditor.CMainControl; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import java.awt.Color; @@ -28,7 +29,6 @@ import javax.swing.JLabel; import javax.swing.JPanel; import net.sf.gridarta.CFArchType; -import net.sf.gridarta.gameobject.Archetype; import org.jetbrains.annotations.Nullable; /** @@ -110,7 +110,7 @@ final GameObject headObject = gameObject.getHead(); String objName = headObject.getObjName(); if (objName == null || objName.length() == 0) { - final Archetype<GameObject, MapArchObject> archetype = headObject.getArchetype(); + final Archetype archetype = headObject.getArchetype(); if (archetype == null || archetype == headObject) { objName = null; } else if ((objName = archetype.getObjName()) != null && objName.length() != 0) { Modified: trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -20,6 +20,7 @@ package cfeditor.gui; import cfeditor.CMainControl; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; @@ -313,7 +314,7 @@ final ArrayList<GameObject> objectsToReplace = new ArrayList<GameObject>(); final int replaceListSize = replaceList == null ? 0 : replaceList.size(); mapControl.getMapModel().beginTransaction("Replace"); // TODO: I18N/L10N - for (final MapSquare<GameObject, MapArchObject> square : entireMap ? mapControl.getMapModel() : mapViewIFrame.getView().getSelectedSquares()) { + for (final MapSquare<GameObject, MapArchObject, Archetype> square : entireMap ? mapControl.getMapModel() : mapViewIFrame.getView().getSelectedSquares()) { // find objects to replace objectsToReplace.clear(); for (final GameObject node : square) { Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -22,6 +22,7 @@ import cfeditor.CFilterControl; import cfeditor.CMainControl; import cfeditor.CMapViewBasic; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; @@ -95,16 +96,16 @@ /** * The map model listener to track changes in {@link #mapModel}. */ - private final MapModelListener<GameObject, MapArchObject> mapModelListener = new MapModelListener<GameObject, MapArchObject>() { + private final MapModelListener<GameObject, MapArchObject, Archetype> mapModelListener = new MapModelListener<GameObject, MapArchObject, Archetype>() { /** {@inheritDoc} */ - public void mapSizeChanged(final MapModelEvent<GameObject, MapArchObject> e) { + public void mapSizeChanged(final MapModelEvent<GameObject, MapArchObject, Archetype> e) { // ignore: will trigger an mapGridChanged() callback } /** {@inheritDoc} */ - public void mapSquaresChanged(final MapModelEvent<GameObject, MapArchObject> e) { - final MapSquare<GameObject, MapArchObject>[] squares = e.getSquares(); + public void mapSquaresChanged(final MapModelEvent<GameObject, MapArchObject, Archetype> e) { + final MapSquare<GameObject, MapArchObject, Archetype>[] squares = e.getSquares(); if (squares != null) { final Point point = new Point(); for (final MapSquare square : squares) { @@ -119,7 +120,7 @@ } /** {@inheritDoc} */ - public void mapObjectsChanged(final MapModelEvent<GameObject, MapArchObject> e) { + public void mapObjectsChanged(final MapModelEvent<GameObject, MapArchObject, Archetype> e) { final GameObject[] gameObjects = e.getGameObjects(); if (gameObjects != null) { final Point point = new Point(); Modified: trunk/crossfire/src/cfeditor/gui/selectedsquare/CellRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/selectedsquare/CellRenderer.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/gui/selectedsquare/CellRenderer.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -20,6 +20,7 @@ package cfeditor.gui.selectedsquare; import cfeditor.CMainControl; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; @@ -84,7 +85,7 @@ int indent = 0; for (;;) { - final GameObjectContainer<GameObject, MapArchObject> env = arch.getContainer(); + final GameObjectContainer<GameObject, MapArchObject, Archetype> env = arch.getContainer(); if (env == null || !(env instanceof GameObject)) { break; } Modified: trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -21,6 +21,7 @@ import cfeditor.CMainControl; import cfeditor.CMainView; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; @@ -184,7 +185,7 @@ return; } - final MapSquare<GameObject, MapArchObject> mapSquare = view.getCurrentMapSquare(); + final MapSquare<GameObject, MapArchObject, Archetype> mapSquare = view.getCurrentMapSquare(); if (mapSquare == null) { return; } @@ -228,7 +229,7 @@ return; } - final MapSquare<GameObject, MapArchObject> currentMapSquare = view.getCurrentMapSquare(); + final MapSquare<GameObject, MapArchObject, Archetype> currentMapSquare = view.getCurrentMapSquare(); if (currentMapSquare == null) { return; } Modified: trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -20,6 +20,7 @@ package cfeditor.gui.selectedsquare; import cfeditor.CMainControl; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; @@ -59,7 +60,7 @@ * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @todo turn this into a tree */ -public final class SelectedSquareView extends JPanel implements MainControlListener<MapControl>, MapCursorListener, MapModelListener<GameObject, MapArchObject> { +public final class SelectedSquareView extends JPanel implements MainControlListener<MapControl>, MapCursorListener, MapModelListener<GameObject, MapArchObject, Archetype> { /** Serial Version UID. */ private static final long serialVersionUID = 1L; @@ -83,12 +84,12 @@ /** * The cache to store selections for each map control. */ - @NotNull private final MapTileSelectionCache<GameObject, MapArchObject, MapControl> mapTileSelectionCache; + @NotNull private final MapTileSelectionCache<GameObject, MapArchObject, Archetype, MapControl> mapTileSelectionCache; /** * The currently selected map tile. */ - @Nullable private MapTileSelection<GameObject, MapArchObject, MapControl> selectedMapTile = null; + @Nullable private MapTileSelection<GameObject, MapArchObject, Archetype, MapControl> selectedMapTile = null; /** * Create a new instance. @@ -102,7 +103,7 @@ */ SelectedSquareView(@NotNull final SelectedSquareControl control, @NotNull final CMainControl mainControl, final boolean mapTileListBottom) { this.mainControl = mainControl; - mapTileSelectionCache = new MapTileSelectionCache<GameObject, MapArchObject, MapControl>(mainControl); + mapTileSelectionCache = new MapTileSelectionCache<GameObject, MapArchObject, Archetype, MapControl>(mainControl); setLayout(new BorderLayout()); @@ -150,7 +151,7 @@ * @return the currently selected map square, or <code>null</code> if no * tile is selected */ - @Nullable public MapSquare<GameObject, MapArchObject> getCurrentMapSquare() { + @Nullable public MapSquare<GameObject, MapArchObject, Archetype> getCurrentMapSquare() { return selectedMapTile == null ? null : selectedMapTile.getMapSquare(); } @@ -202,7 +203,7 @@ */ private void refresh() { final MapControl mapControl; - final MapSquare<GameObject, MapArchObject> mapSquare; + final MapSquare<GameObject, MapArchObject, Archetype> mapSquare; final GameObject gameObject; if (selectedMapTile == null) { mapControl = null; @@ -308,7 +309,7 @@ mapControl.removeMapModelListener(this); mapControl.removeMapCursorListener(this); - final MapTileSelection<GameObject, MapArchObject, MapControl> closedMapTile = mapTileSelectionCache.find(mapControl); + final MapTileSelection<GameObject, MapArchObject, Archetype, MapControl> closedMapTile = mapTileSelectionCache.find(mapControl); if (selectedMapTile != null && selectedMapTile == closedMapTile) { if (setSelectedMapTile(null)) { refresh(); @@ -332,7 +333,7 @@ return; } - final MapSquare<GameObject, MapArchObject> mapSquare = mapControl.getMapModel().getMapSquare(cursorPos); + final MapSquare<GameObject, MapArchObject, Archetype> mapSquare = mapControl.getMapModel().getMapSquare(cursorPos); if (setSelectedMapSquare(mapSquare)) { refresh(); } @@ -344,19 +345,19 @@ } /** {@inheritDoc} */ - public void mapSizeChanged(final MapModelEvent<GameObject, MapArchObject> e) { + public void mapSizeChanged(final MapModelEvent<GameObject, MapArchObject, Archetype> e) { if (selectedMapTile != null && selectedMapTile.getMapControl().getMapModel() == e.getMapModel() && selectedMapTile.validateMapSquare()) { refresh(); } } /** {@inheritDoc} */ - public void mapSquaresChanged(final MapModelEvent<GameObject, MapArchObject> e) { + public void mapSquaresChanged(final MapModelEvent<GameObject, MapArchObject, Archetype> e) { if (selectedMapTile == null) { return; } - for (final MapSquare<GameObject, MapArchObject> mapSquare : e.getSquares()) { + for (final MapSquare<GameObject, MapArchObject, Archetype> mapSquare : e.getSquares()) { if (selectedMapTile.checkForChangedMapSquare(mapSquare)) { refresh(); break; @@ -365,13 +366,13 @@ } /** {@inheritDoc} */ - public void mapObjectsChanged(final MapModelEvent<GameObject, MapArchObject> e) { + public void mapObjectsChanged(final MapModelEvent<GameObject, MapArchObject, Archetype> e) { if (selectedMapTile == null) { return; } for (final GameObject gameObject : e.getGameObjects()) { - final MapSquare<GameObject, MapArchObject> mapSquare = gameObject.getMapSquare(); + final MapSquare<GameObject, MapArchObject, Archetype> mapSquare = gameObject.getMapSquare(); if (mapSquare != null && selectedMapTile.checkForChangedMapSquare(mapSquare)) { refresh(); break; @@ -391,7 +392,7 @@ * * @return <code>true</code> if the selected map tile has changed */ - private boolean setSelectedMapTile(@Nullable final MapTileSelection<GameObject, MapArchObject, MapControl> mapTileSelection) { + private boolean setSelectedMapTile(@Nullable final MapTileSelection<GameObject, MapArchObject, Archetype, MapControl> mapTileSelection) { if (mapTileSelection == selectedMapTile) { return false; } @@ -407,7 +408,7 @@ * * @return <code>true</code> if the state has changed */ - private boolean setSelectedMapSquare(@Nullable final MapSquare<GameObject, MapArchObject> mapSquare) { + private boolean setSelectedMapSquare(@Nullable final MapSquare<GameObject, MapArchObject, Archetype> mapSquare) { if (selectedMapTile == null) { return false; } @@ -448,7 +449,7 @@ } if (gameObject != null) { - final MapSquare<GameObject, MapArchObject> mapSquare = gameObject.getTopContainer().getMapSquare(); + final MapSquare<GameObject, MapArchObject, Archetype> mapSquare = gameObject.getTopContainer().getMapSquare(); if (mapSquare == null) { log.warn("setSelectedGameObject: gameObject " + gameObject + " is not part of a map"); return; Modified: trunk/crossfire/src/cfeditor/io/CMapReader.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapReader.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/io/CMapReader.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -19,6 +19,7 @@ package cfeditor.io; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import java.io.File; @@ -39,7 +40,7 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public final class CMapReader extends AbstractMapReader<GameObject, MapArchObject> { +public final class CMapReader extends AbstractMapReader<GameObject, MapArchObject, Archetype> { /** Logger. */ private static final Logger log = Logger.getLogger(CMapReader.class); Modified: trunk/crossfire/src/cfeditor/io/CMapWriter.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapWriter.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/io/CMapWriter.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -19,6 +19,7 @@ package cfeditor.io; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import cfeditor.map.MapModel; @@ -31,7 +32,6 @@ import java.util.HashMap; import java.util.Map; import java.util.TreeMap; -import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.io.AbstractMapWriter; import net.sf.gridarta.io.MapWriter; import org.apache.log4j.Logger; @@ -43,7 +43,7 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public final class CMapWriter extends AbstractMapWriter<GameObject, MapArchObject, MapModel> { +public final class CMapWriter extends AbstractMapWriter<GameObject, MapArchObject, Archetype, MapModel> { /** Logger. */ private static final Logger log = Logger.getLogger(CMapWriter.class); @@ -65,7 +65,7 @@ * @throws IOException in case of I/O problems */ @Override protected void writeGameObject(@NotNull final GameObject gameObject, final int x, final int y) throws IOException { - final Archetype<GameObject, MapArchObject> archetype = gameObject.getArchetype(); + final Archetype archetype = gameObject.getArchetype(); // Collect all fields to write. final Map<String, String> fields = new TreeMap<String, String>(keyOrderComparator); // String key -> String value Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -27,6 +27,7 @@ import cfeditor.filter.FilterConfig; import cfeditor.filter.NamedFilterConfig; import cfeditor.filter.NamedFilterList; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import java.awt.Point; import java.util.List; @@ -40,7 +41,7 @@ * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> */ -public final class DefaultMapModel extends AbstractMapModel<GameObject, MapArchObject> implements MapModel { +public final class DefaultMapModel extends AbstractMapModel<GameObject, MapArchObject, Archetype> implements MapModel { /** Logger. */ private static final Logger log = Logger.getLogger(DefaultMapModel.class); @@ -82,7 +83,7 @@ /** {@inheritDoc} */ public boolean isMultiArchFittingToMap(final String archName, final Point pos, final boolean allowDouble) { - for (GameObject part = getArchetype(archName); part != null; part = part.getMultiNext()) { + for (Archetype part = getArchetype(archName); part != null; part = part.getMultiNext()) { final Point point = new Point(part.getMultiX(), part.getMultiY()); point.translate(pos.x, pos.y); // outside map @@ -112,7 +113,7 @@ return false; } - GameObject archetype = getArchetype(archName); + Archetype archetype = getArchetype(archName); if (archetype == null) { return false; } @@ -127,7 +128,7 @@ } GameObject head = null; - for (GameObject archetypePart = archetype; archetypePart != null; archetypePart = archetypePart.getMultiNext()) { + for (Archetype archetypePart = archetype; archetypePart != null; archetypePart = archetypePart.getMultiNext()) { final GameObject part = archetypePart.createArch(); if (archetypePart == archetype) { head = part; @@ -279,7 +280,7 @@ node.remove(); // do autojoining - final GameObject temp = getArchetype(node.getArchetypeName()); // get defarch + final Archetype temp = getArchetype(node.getArchetypeName()); // get defarch if (mainControl.isAutoJoin() && join == JOIN_ENABLE && mainControl.getJoinlist() != null && AutojoinLists.getAutojoinList(temp) != null && !temp.isMulti()) { // remove connections to the deleted arch AutojoinLists.getAutojoinList(temp).joinDelete(this, pos); @@ -328,7 +329,7 @@ * @return the Archetype corresponding to * <code>archName</code>, or <code>null</code> if it does not exist */ - @Nullable private GameObject getArchetype(final String archName) { + @Nullable private Archetype getArchetype(final String archName) { return mainControl.getArchetypeSet().getArchetype(archName); } Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -23,6 +23,7 @@ import cfeditor.CopyBuffer; import cfeditor.IGUIConstants; import cfeditor.MapViewIFrame; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import java.awt.Point; import java.io.File; @@ -44,7 +45,7 @@ * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> */ -public final class MapControl extends AbstractMapControl<GameObject, MapArchObject> { +public final class MapControl extends AbstractMapControl<GameObject, MapArchObject, Archetype> { /** * The main controller of this subcontroller. @@ -420,7 +421,7 @@ * Get Iterable of all MapSquares. * @return Iterable of all MapSquares */ - public Iterable<MapSquare<GameObject, MapArchObject>> getAllSquares() { + public Iterable<MapSquare<GameObject, MapArchObject, Archetype>> getAllSquares() { return mapModel; } @@ -469,12 +470,12 @@ } /** {@inheritDoc} */ - public void addMapModelListener(@NotNull final MapModelListener<GameObject, MapArchObject> listener) { + public void addMapModelListener(@NotNull final MapModelListener<GameObject, MapArchObject, Archetype> listener) { mapModel.addMapModelListener(listener); } /** {@inheritDoc} */ - public void removeMapModelListener(@NotNull final MapModelListener<GameObject, MapArchObject> listener) { + public void removeMapModelListener(@NotNull final MapModelListener<GameObject, MapArchObject, Archetype> listener) { mapModel.removeMapModelListener(listener); } Modified: trunk/crossfire/src/cfeditor/map/MapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapModel.java 2007-01-24 23:20:03 UTC (rev 1702) +++ trunk/crossfire/src/cfeditor/map/MapModel.java 2007-01-24 23:25:59 UTC (rev 1703) @@ -19,6 +19,7 @@ package cfeditor.map; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import java.awt.Point; import java.io.Serializable; @@ -28,7 +29,7 @@ * Interface for MapModels. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public interface MapModel extends net.sf.gridarta.map.MapModel<GameObject, MapArchObject>, Serializable { +public interface MapModel extends net.sf.gridarta.map.MapModel<GameObject, MapArchObject, Archetype>, Serializable { /** Enable autojoin when inserting objects. */ boolean ... [truncated message content] |
From: <aki...@us...> - 2007-01-25 01:35:33
|
Revision: 1696 http://svn.sourceforge.net/gridarta/?rev=1696&view=rev Author: akirschbaum Date: 2007-01-24 12:46:12 -0800 (Wed, 24 Jan 2007) Log Message: ----------- Use named objects framework to store faces. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java trunk/src/app/net/sf/gridarta/gameobject/face/FaceObject.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gameobject/face/DuplicateFaceException.java Removed Paths: ------------- trunk/daimonin/src/daieditor/gameobject/face/DuplicateFaceException.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-01-24 20:30:26 UTC (rev 1695) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-01-24 20:46:12 UTC (rev 1696) @@ -42,6 +42,7 @@ import net.sf.gridarta.gameobject.AbstractArchetypeSet; import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; +import net.sf.gridarta.gameobject.face.DuplicateFaceException; import net.sf.gridarta.io.IOUtils; import net.sf.japi.swing.misc.Progress; import org.apache.log4j.Logger; @@ -58,11 +59,6 @@ private static final Logger log = Logger.getLogger(ArchetypeSet.class); - /** - * Maps face names to {@link FaceObject}s. - */ - private final Map<String, FaceObject> faces = new HashMap<String, FaceObject>(); - private final CMainControl mainControl; /** @@ -84,7 +80,7 @@ return CMainControl.getNofaceTileIcon(); } - final FaceObject faceObject = faces.get(faceName); + final FaceObject faceObject = mainControl.getFaceObjects().get(faceName); if (faceObject == null) { return CMainControl.getUnknownTileIcon(); } @@ -393,14 +389,13 @@ } stream.reset(); // jump to beginning of png data - final FaceObject faceObject = new FaceObject(baseDir, IGUIConstants.PNG_FILE, filePosition, size); // lazy load object + try { + mainControl.getFaceObjects().addFaceObject(face.toString(), "null", baseDir, IGUIConstants.PNG_FILE, filePosition, size); + } catch (final DuplicateFaceException ex) { + log.warn("Duplicate face " + face.toString()); + } stream.skip(size); // FIXME: result of skip is ignored. filePosition += size; - // put this png into the list of faces - faceObject.setName(face.toString()); - faceObject.setPath("null"); - faces.put(face.toString(), faceObject); - mainControl.getFaceObjects().addFaceObject(faceObject); } } } while (r != -1); // loop till end of png file @@ -434,9 +429,6 @@ * @param name name of the png (e.g. blocked.111.png) */ private void addPNGFace(final String fname, final String name) { - final File f = new File(fname); - final FaceObject faceObject = new FaceObject(null, fname, 0, (int) f.length()); - // generating the face name: final String face; if (mainControl.getImageSet() != null) { @@ -464,10 +456,11 @@ face = name.substring(0, name.length() - 4); } - faceObject.setName(face); - faceObject.setPath(fname); - faces.put(face, faceObject); - mainControl.getFaceObjects().addFaceObject(faceObject); + try { + mainControl.getFaceObjects().addFaceObject(face, fname, null, fname, 0, (int) new File(fname).length()); + } catch (final DuplicateFaceException ex) { + log.warn("Duplicate face " + face); + } } /** {@inheritDoc} */ Modified: trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java 2007-01-24 20:30:26 UTC (rev 1695) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java 2007-01-24 20:46:12 UTC (rev 1696) @@ -41,37 +41,35 @@ //private ImageIcon face; private Object face; - private String name = ""; // name of face + /** The face name. */ + private final String name; - private String path; + /** The path name of the face file. */ + private final String path; - private int index; + private final int dataSize; - private int dataSize; + private final long dataStartIndex; - private long dataStartIndex; + private final String resourceName; - private String resourceName; + private final String resourceDirectory; - private String resourceDirectory; - private boolean isLazyLoading = false; - public FaceObject() { - super(null); - face = null; - index = -1; - } - /** * Creates a FaceObject along with information used for lazy loading. + * @param name the face name + * @param path the path name of the face file * @param resourceDirectory Directory to load data from. * @param resourceName Name of the file to load data from. * @param dataStartIndex Position in the file to load data from. * @param dataSize Length of data in the file to load. */ - public FaceObject(final String resourceDirectory, final String resourceName, final long dataStartIndex, final int dataSize) { + public FaceObject(final String name, final String path, final String resourceDirectory, final String resourceName, final long dataStartIndex, final int dataSize) { super(resourceDirectory); // FIXME: Directory isn't really correct. + this.name = name; + this.path = path; this.resourceDirectory = resourceDirectory; this.resourceName = resourceName; this.dataStartIndex = dataStartIndex; @@ -91,6 +89,24 @@ return getFace(); } + /** + * {@inheritDoc} + * @see #getName() + */ + public String getFaceName() { + return name; + } + + /** {@inheritDoc} */ + public String getOriginalFilename() { + return path; + } + + /** {@inheritDoc} */ + public String getFilename() { + return path; + } + public ImageIcon getFace() { if (isLazyLoading) { return loadFace(); @@ -152,20 +168,4 @@ return path; } - @Override public void setPath(final String path) { - this.path = path; - } - - public void setName(final String name) { - this.name = name; - } - - public int getIndex() { - return index; - } - - public void setIndex(final int index) { - this.index = index; - } - } // class FaceObject Modified: trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2007-01-24 20:30:26 UTC (rev 1695) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2007-01-24 20:46:12 UTC (rev 1696) @@ -28,7 +28,9 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; +import java.util.Iterator; import net.sf.gridarta.gameobject.face.AbstractFaceObjects; +import net.sf.gridarta.gameobject.face.DuplicateFaceException; import net.sf.japi.swing.misc.Progress; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -42,16 +44,16 @@ /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(FaceObjects.class); - private final FaceObject[] faceObjects = new FaceObject[10000]; - - private int faceListCount; // all loaded face pictures - /** * Adds a new face object. - * @param faceObject the face object to add + * @throws DuplicateFaceException in case the face was not unique */ - public void addFaceObject(final FaceObject faceObject) { - faceObjects[faceListCount++] = faceObject; + public void addFaceObject(final String faceName, final String pathName, final String resourceDirectory, final String resourceName, final long dataStartIndex, final int dataSize) throws DuplicateFaceException { + final FaceObject faceObject = new FaceObject(faceName, pathName, resourceDirectory, resourceName, dataStartIndex, dataSize); + if (containsKey(faceName)) { + throw new DuplicateFaceException(faceObject); + } + put(faceObject); } /** {@inheritDoc} */ @@ -67,14 +69,19 @@ final String def = "00000"; final String numstring = def.substring(0, 5 - num.length()) + num; + final Iterator<FaceObject> it = iterator(); + + if (!it.hasNext()) { + log.warn("You have to give me the name of a file to open."); + return; + } + + final FaceObject faceObject1 = it.next(); final FileInputStream fin1; try { - fin1 = new FileInputStream(faceObjects[0].getPath()); - } catch (final ArrayIndexOutOfBoundsException e) { - log.warn("You have to give me the name of a file to open."); - return; + fin1 = new FileInputStream(faceObject1.getPath()); } catch (final FileNotFoundException e) { - log.warn("Could not open input file " + faceObjects[0].getPath()); + log.warn("Could not open input file " + faceObject1.getPath()); return; } @@ -88,7 +95,7 @@ } if (numBytes == -1) { - log.error("Unexpected EOF: " + faceObjects[0].getPath() + " >> " + numBytes); + log.error("Unexpected EOF: " + faceObject1.getPath() + " >> " + numBytes); return; } @@ -97,18 +104,19 @@ out.write(b, 0, numBytes); // now write all pngs into the file - progress.setLabel("Collecting Images...", faceListCount); - for (int i = 0; i < faceListCount; i++) { + progress.setLabel("Collecting Images...", size()); + for (int i = 0; it.hasNext(); i++) { + final FaceObject faceObject2 = it.next(); final FileInputStream fin2; try { // try to open the png image file - fin2 = new FileInputStream(faceObjects[i].getPath()); + fin2 = new FileInputStream(faceObject2.getPath()); } catch (final ArrayIndexOutOfBoundsException e) { log.warn("You have to give me the name of a file to open."); return; } catch (final FileNotFoundException e) { - log.warn("Could not open input file " + faceObjects[i].getPath()); + log.warn("Could not open input file " + faceObject2.getPath()); return; } @@ -121,7 +129,7 @@ } if (numBytes == -1) { - log.warn("Unexpected EOF: " + faceObjects[i].getPath() + " >> " + numBytes); + log.warn("Unexpected EOF: " + faceObject2.getPath() + " >> " + numBytes); return; } @@ -131,27 +139,27 @@ // create path string final String pname1; int tmp; - if ((tmp = faceObjects[i].getPath().indexOf("arch" + File.separator)) >= 0) { + if ((tmp = faceObject2.getPath().indexOf("arch" + File.separator)) >= 0) { // cut off the path before "arch" - pname1 = faceObjects[i].getPath().substring(tmp).replace('\\', '/').replace('.', '%'); - } else if ((tmp = faceObjects[i].getPath().indexOf("arch")) >= 0) { + pname1 = faceObject2.getPath().substring(tmp).replace('\\', '/').replace('.', '%'); + } else if ((tmp = faceObject2.getPath().indexOf("arch")) >= 0) { // cut off the path before "arch" - pname1 = faceObjects[i].getPath().substring(tmp).replace('\\', '/').replace('.', '%'); + pname1 = faceObject2.getPath().substring(tmp).replace('\\', '/').replace('.', '%'); } else { // hope nobody renames his arch-dir and ends up in here - pname1 = "arch" + faceObjects[i].getPath().substring(CMainControl.getInstance().getArchDefaultFolder().length()).replace('\\', '/'); + pname1 = "arch" + faceObject2.getPath().substring(CMainControl.getInstance().getArchDefaultFolder().length()).replace('\\', '/'); } final String pname = "./" + pname1.substring(0, pname1.lastIndexOf("/") + 1); // now write this png data into the big collected png file - out.writeBytes("IMAGE " + numstring + " " + numBytes + " " + pname + faceObjects[i].getName() + "\n"); + out.writeBytes("IMAGE " + numstring + " " + numBytes + " " + pname + faceObject2.getName() + "\n"); out.write(b, 0, numBytes); if (i % 100 == 0) { progress.setValue(i); } } - progress.setValue(faceListCount); // finished + progress.setValue(size()); // finished progress.finished(); //getArchetypeCount(), faceListCount); // close png file Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-01-24 20:30:26 UTC (rev 1695) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-01-24 20:46:12 UTC (rev 1696) @@ -24,7 +24,6 @@ import daieditor.IGUIConstants; import daieditor.gameobject.anim.AnimationObjects; import daieditor.gameobject.face.ArchFaceProvider; -import daieditor.gameobject.face.DuplicateFaceException; import daieditor.gameobject.face.FaceObjects; import daieditor.map.MapArchObject; import java.awt.BorderLayout; @@ -52,6 +51,7 @@ import net.sf.gridarta.gameobject.AbstractArchetypeSet; import net.sf.gridarta.gameobject.anim.AnimationParseException; import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; +import net.sf.gridarta.gameobject.face.DuplicateFaceException; import net.sf.gridarta.io.IOUtils; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.misc.Progress; Deleted: trunk/daimonin/src/daieditor/gameobject/face/DuplicateFaceException.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/DuplicateFaceException.java 2007-01-24 20:30:26 UTC (rev 1695) +++ trunk/daimonin/src/daieditor/gameobject/face/DuplicateFaceException.java 2007-01-24 20:46:12 UTC (rev 1696) @@ -1,48 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 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 daieditor.gameobject.face; - -/** - * Exception that's thrown in case a face name was not unique. - * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> - */ -public class DuplicateFaceException extends Exception { - - /** FaceObject causing the problem. */ - private final FaceObject duplicate; - - /** - * Create a DuplicateFaceException. - * @param duplicate Duplicate face that's the cause - */ - public DuplicateFaceException(final FaceObject duplicate) { - super("Non-unique face " + duplicate.getFaceName() + " from " + duplicate.getOriginalFilename()); - this.duplicate = duplicate; - } - - /** - * Get the duplicate that caused this exception. - * @return duplicate - */ - public FaceObject getDuplicate() { - return duplicate; - } - -} // class DuplicateFaceException Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java 2007-01-24 20:30:26 UTC (rev 1695) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java 2007-01-24 20:46:12 UTC (rev 1696) @@ -110,20 +110,14 @@ } /** - * Get the faceName, which is the name - * of the face as usable - * by the "face" attribute. - * @return faceName + * {@inheritDoc} * @see #getName() */ public String getFaceName() { return faceName; } - /** - * Get the original filename of this face. - * @return filename where this face was originally found - */ + /** {@inheritDoc} */ public String getOriginalFilename() { return originalFilename; } @@ -136,10 +130,7 @@ return actualFilename; } - /** - * Get the filename of this face. - * @return filename of this face, actual filename if set, otherwise original filename - */ + /** {@inheritDoc} */ public String getFilename() { return actualFilename != null ? actualFilename : originalFilename; } Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2007-01-24 20:30:26 UTC (rev 1695) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2007-01-24 20:46:12 UTC (rev 1696) @@ -39,6 +39,7 @@ import java.io.OutputStreamWriter; import javax.swing.GrayFilter; import net.sf.gridarta.gameobject.face.AbstractFaceObjects; +import net.sf.gridarta.gameobject.face.DuplicateFaceException; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.misc.Progress; import org.apache.log4j.Logger; Copied: trunk/src/app/net/sf/gridarta/gameobject/face/DuplicateFaceException.java (from rev 1693, trunk/daimonin/src/daieditor/gameobject/face/DuplicateFaceException.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/face/DuplicateFaceException.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/face/DuplicateFaceException.java 2007-01-24 20:46:12 UTC (rev 1696) @@ -0,0 +1,48 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 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.gameobject.face; + +/** + * Exception that's thrown in case a face name was not unique. + * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> + */ +public class DuplicateFaceException extends Exception { + + /** FaceObject causing the problem. */ + private final FaceObject duplicate; + + /** + * Create a DuplicateFaceException. + * @param duplicate Duplicate face that's the cause + */ + public DuplicateFaceException(final FaceObject duplicate) { + super("Non-unique face " + duplicate.getFaceName() + " from " + duplicate.getOriginalFilename()); + this.duplicate = duplicate; + } + + /** + * Get the duplicate that caused this exception. + * @return duplicate + */ + public FaceObject getDuplicate() { + return duplicate; + } + +} // class DuplicateFaceException Modified: trunk/src/app/net/sf/gridarta/gameobject/face/FaceObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/face/FaceObject.java 2007-01-24 20:30:26 UTC (rev 1695) +++ trunk/src/app/net/sf/gridarta/gameobject/face/FaceObject.java 2007-01-24 20:46:12 UTC (rev 1696) @@ -27,4 +27,23 @@ */ public interface FaceObject extends NamedObject { + /** + * Get the faceName, which is the name of the face as usable by the "face" + * attribute. + * @return faceName + */ + String getFaceName(); + + /** + * Get the original filename of this face. + * @return filename where this face was originally found + */ + String getOriginalFilename(); + + /** + * Get the filename of this face. + * @return filename of this face, actual filename if set, otherwise original filename + */ + String getFilename(); + } // interface FaceObject This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-25 19:44:37
|
Revision: 1707 http://svn.sourceforge.net/gridarta/?rev=1707&view=rev Author: akirschbaum Date: 2007-01-25 11:44:34 -0800 (Thu, 25 Jan 2007) Log Message: ----------- Remove incorrect debug message. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2007-01-25 00:03:38 UTC (rev 1706) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2007-01-25 19:44:34 UTC (rev 1707) @@ -161,11 +161,6 @@ } else if (thisLine.startsWith("Object")) { log.error("Find inventory Object in def arch: " + thisLine); } else if (thisLine.startsWith("end")) { - //if (arch.getArchTypNr() == 0) { - if (log.isDebugEnabled()) { - log.debug("Arch " + archetype.getArchetypeName() + " has no type info!"); - } - //} // we got full arch parsearch = false; // we write this sucker Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2007-01-25 00:03:38 UTC (rev 1706) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2007-01-25 19:44:34 UTC (rev 1707) @@ -186,11 +186,6 @@ } else if (thisLine.startsWith("Object")) { log.warn(ACTION_FACTORY.format("inventoryInDefArch", thisLine)); } else if (thisLine.startsWith("end")) { - //if (arch.getArchTypNr() == 0) { - if (log.isDebugEnabled()) { - log.debug("Arch " + archetype.getArchetypeName() + " has no type info!"); - } - //} // we got full arch parsearch = false; // we write this sucker This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-25 21:31:44
|
Revision: 1709 http://svn.sourceforge.net/gridarta/?rev=1709&view=rev Author: akirschbaum Date: 2007-01-25 13:31:44 -0800 (Thu, 25 Jan 2007) Log Message: ----------- Do not crash when loading maps which reference undefined archetypes. Offer to delete the affected game objects. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/messages.properties trunk/crossfire/src/cfeditor/messages_de.properties trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/messages.properties trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSet.java trunk/src/app/net/sf/gridarta/gameobject/Archetype.java trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Added Paths: ----------- trunk/crossfire/src/cfeditor/gameobject/UndefinedArchetype.java trunk/daimonin/src/daieditor/gameobject/UndefinedArchetype.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-01-25 21:00:22 UTC (rev 1708) +++ trunk/crossfire/ChangeLog 2007-01-25 21:31:44 UTC (rev 1709) @@ -1,3 +1,8 @@ +2007-01-25 Andreas Kirschbaum + + * Do not crash when loading maps which reference undefined + archetypes. Offer to delete the affected game objects. + 2007-01-23 Andreas Kirschbaum * Make text fields in Game Object Attributes Dialog and Panel wrap Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-25 21:00:22 UTC (rev 1708) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-25 21:31:44 UTC (rev 1709) @@ -43,6 +43,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.TreeSet; import javax.swing.Action; import javax.swing.ImageIcon; import javax.swing.JFileChooser; @@ -924,7 +925,7 @@ if (typeList.isEmpty()) { // types.xml is missing! ACTION_FACTORY.showMessageDialog(mainView, "openAttrDialogNoTypes"); - } else if (gameObject != null && gameObject.hasArchetype()) { + } else if (gameObject != null && !gameObject.hasUndefinedArchetype()) { GameObjectAttributesDialog.showAttribDialog(typeList, gameObject, this); } else { ACTION_FACTORY.showMessageDialog(mainView, "openAttrDialogNoDefaultArch"); @@ -958,22 +959,23 @@ public void collectTempList(final List<GameObject> objects, final File file) { final List<GameObject> tailList = new ArrayList<GameObject>(); + final TreeSet<String> undefinedArchetypeNames = new TreeSet<String>(); + final ArrayList<GameObject> gameObjectsWithoutArchetype = new ArrayList<GameObject>(); + // first: attach our map sucker to a default arch we have loaded for (final GameObject gameObject : objects) { - final Archetype archetype = archetypeSet.getArchetype(gameObject.getArchetypeName()); - if (archetype == null) { - // we had an unknown arch here!! - // showMessage("Error Loading Map File "+file.getName(), "\n Found Unknown Arch < "+arch.getArchetypeName()+" >"); - // return false; - } else { - gameObject.setArchetype(archetype); + final Archetype archetype = archetypeSet.getOrCreateArchetype(gameObject.getArchetypeName()); + gameObject.setArchetype(archetype); + if (archetype.isUndefinedArchetype()) { + gameObjectsWithoutArchetype.add(gameObject); + undefinedArchetypeNames.add(gameObject.getArchetypeName()); } // 2nd: attach the right face... final String faceName = gameObject.getFaceName(); if (faceName == null) { // no face set => copy from archetype - gameObject.setFaceName(archetype != null ? archetype.getFaceName() : null); + gameObject.setFaceName(archetype.getFaceName()); } else if (faceName.length() == 0) { // empty face set => no face gameObject.setFaceName(null); @@ -990,6 +992,16 @@ for (final GameObject tail : tailList) { objects.add(tail); } + + if (!undefinedArchetypeNames.isEmpty()) { + final StringBuilder noarch = new StringBuilder(); + for (final String archetypeName : undefinedArchetypeNames) { + noarch.append(archetypeName).append('\n'); + } + if (ACTION_FACTORY.showQuestionDialog(mainView, "collectTemplistAutodelete", file, gameObjectsWithoutArchetype.size(), noarch)) { + objects.removeAll(gameObjectsWithoutArchetype); + } + } } /** {@inheritDoc} */ Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-01-25 21:00:22 UTC (rev 1708) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-01-25 21:31:44 UTC (rev 1709) @@ -70,6 +70,26 @@ /** {@inheritDoc} */ @NotNull public ImageIcon getFace(@NotNull final Archetype archetype) { + return getFace(archetype, archetype.isUndefinedArchetype()); + } + + /** {@inheritDoc} */ + @NotNull public ImageIcon getFace(@NotNull final GameObject gameObject) { + return getFace(gameObject, gameObject.hasUndefinedArchetype()); + } + + /** + * Returns the face of the Archetype as icon. + * @param archetype Archetype to get face for + * @param hasUndefinedArchetype if set, return the face for an game object + * referencing an undefined archetype + * @return the face of the Archetype as icon + */ + @NotNull private ImageIcon getFace(@NotNull Archetype archetype, final boolean hasUndefinedArchetype) { + if (hasUndefinedArchetype) { + return CMainControl.getNoarchTileIcon(); + } + final String faceName = archetype.getFaceName(); if (faceName == null) { return CMainControl.getNofaceTileIcon(); @@ -591,4 +611,9 @@ return archetypes.toArray(new Archetype[archetypes.size()]); } + /** {@inheritDoc} */ + @NotNull protected Archetype createUndefinedArchetype(@NotNull final String archetypeName) { + return new UndefinedArchetype(archetypeName); + } + } // class ArchetypeSet Added: trunk/crossfire/src/cfeditor/gameobject/UndefinedArchetype.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/UndefinedArchetype.java (rev 0) +++ trunk/crossfire/src/cfeditor/gameobject/UndefinedArchetype.java 2007-01-25 21:31:44 UTC (rev 1709) @@ -0,0 +1,47 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 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 cfeditor.gameobject; + +import org.jetbrains.annotations.NotNull; + +/** + * The class <code>UndefinedArchetype</code> implements an undefined Crossfire + * archetype. + */ +public class UndefinedArchetype extends GameObject implements Archetype { + + /** + * Create a new undefined archetype with the given archetype name. + * + * @param archetypeName the archetype name + */ + public UndefinedArchetype(@NotNull final String archetypeName) { + setArchetypeName(archetypeName); + setArchTypNr(0); + setIsArchetype(); + setEditorFolder("undefined"); + } + + /** {@inheritDoc} */ + public boolean isUndefinedArchetype() { + return true; + } + +} // class UndefinedArchetype Property changes on: trunk/crossfire/src/cfeditor/gameobject/UndefinedArchetype.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2007-01-25 21:00:22 UTC (rev 1708) +++ trunk/crossfire/src/cfeditor/messages.properties 2007-01-25 21:31:44 UTC (rev 1709) @@ -47,6 +47,9 @@ openFileWantedOutOfMemory.title=Cannot open map openFileWantedOutOfMemory.message=Out of memory while loading {0}. +collectTemplistAutodelete.title=Loading mapfile {0} +collectTemplistAutodelete.message=Found {1} game objects referencing\nthe following unknown archetypes:\n{2}\nDelete these game objects? + enterExitRandomDestination.title=Destination invalid enterExitRandomDestination.message=The destination of this exit is a random map. enterExitNotSaved.title=Map not saved Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2007-01-25 21:00:22 UTC (rev 1708) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2007-01-25 21:31:44 UTC (rev 1709) @@ -45,6 +45,9 @@ openFileWantedOutOfMemory.title=Kann Karte nicht \xF6ffnen openFileWantedOutOfMemory.message=Es ist nicht gen\xFCgend freier Speicher vorhanden, um die\nKarte {0} zu laden. +collectTemplistAutodelete.title=Karte {0} laden +collectTemplistAutodelete.message=Die Karte enth\xE4lt {1} Objekte, die die\nfolgenden unbekannten Archetypen verwenden:\n{2}\nSollen diese Objekte gel\xF6scht werden? + openAttrDialogNoTypes.title=Datei fehlt openAttrDialogNoTypes.message=Die Konfigurationsdatei \"types.xml\" fehlt. Der Dialog zum \xC4ndern von Object-Attributen funktioniert nicht ohne diese Datei. openAttrDialogNoDefaultArch.title=Attribute \xE4ndern @@ -55,6 +58,9 @@ createImageIOException.title=Kann Bild nicht erzeugen createImageIOException.message=Das Bild kann nicht erzeugt werden, da ein Ein-/Ausgabefehler\nbeim Schreiben von {0} aufgetreten ist:\n{1} +collectTemplistAutodelete.title=Karte {0} laden +collectTemplistAutodelete.message=Die Karte enth\xE4lt {1} Objekte, die die\nfolgenden unbekannten Archetypen verwenden:\n{2}\nSollen diese Objekte gel\xF6scht werden? + treasurelistForbidden.title=Ung\xFCltige Auswahl treasurelistForbidden.message=Die Schatzliste {0} darf in Karten nicht verwendet werden.\nSie wird vom Crossfire-Server intern verwendet. Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-01-25 21:00:22 UTC (rev 1708) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-01-25 21:31:44 UTC (rev 1709) @@ -77,6 +77,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.TreeSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -1167,7 +1168,7 @@ if (typeList.isEmpty()) { // types.xml is missing! ACTION_FACTORY.showMessageDialog(mainView, "openAttrDialogNoTypes"); - } else if (gameObject != null && gameObject.hasArchetype()) { + } else if (gameObject != null && !gameObject.hasUndefinedArchetype()) { GameObjectAttributesDialog.showAttribDialog(typeList, gameObject, this); } else { ACTION_FACTORY.showMessageDialog(mainView, "openAttrDialogNoDefaultArch"); @@ -1199,19 +1200,18 @@ * @param uri URI they were read from (for error messages). */ public void collectTempList(final List<GameObject> objects, final String uri) { - final StringBuilder noarch = new StringBuilder(); - int noarchcount = 0; final List<GameObject> tailList = new ArrayList<GameObject>(); + final TreeSet<String> undefinedArchetypeNames = new TreeSet<String>(); + final ArrayList<GameObject> gameObjectsWithoutArchetype = new ArrayList<GameObject>(); + // first: attach our map sucker to a default arch we have loaded - //noinspection ForLoopWithMissingComponent - for (final Iterator<GameObject> it = objects.iterator(); it.hasNext();) { - final GameObject gameObject = it.next(); - final Archetype archetype = archetypeSet.getArchetype(gameObject.getArchetypeName()); - if (archetype == null) { - noarch.append(gameObject.getArchetypeName()).append('\n'); - noarchcount++; - it.remove(); + for (final GameObject gameObject : objects) { + final Archetype archetype = archetypeSet.getOrCreateArchetype(gameObject.getArchetypeName()); + gameObject.setArchetype(archetype); + if (archetype.isUndefinedArchetype()) { + gameObjectsWithoutArchetype.add(gameObject); + undefinedArchetypeNames.add(gameObject.getArchetypeName()); } gameObject.setArchetype(archetype); // Ok, now is attached to default arch and loaded png @@ -1228,8 +1228,14 @@ objects.add(tail); } - if (noarchcount > 0) { - ACTION_FACTORY.showMessageDialog(mainView, "collectTemplistAutodelete", uri, noarchcount, noarch); + if (!undefinedArchetypeNames.isEmpty()) { + final StringBuilder noarch = new StringBuilder(); + for (final String archetypeName : undefinedArchetypeNames) { + noarch.append(archetypeName).append('\n'); + } + if (ACTION_FACTORY.showQuestionDialog(mainView, "collectTemplistAutodelete", uri, gameObjectsWithoutArchetype.size(), noarch)) { + objects.removeAll(gameObjectsWithoutArchetype); + } } } Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-01-25 21:00:22 UTC (rev 1708) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-01-25 21:31:44 UTC (rev 1709) @@ -100,7 +100,7 @@ * @param faceName faceName of face ImageIcon * @return face ImageIcon for face <var>faceName</var> */ - public ImageIcon getFace(final String faceName) { + @NotNull public ImageIcon getFace(final String faceName) { ImageIcon face = FaceObjects.normal.getImageIconForFacename(faceName); if (face == null) { face = CMainControl.getUnknownTileIcon(); @@ -109,10 +109,15 @@ } /** {@inheritDoc} */ - @Nullable public ImageIcon getFace(@NotNull final Archetype archetype) { + @NotNull public ImageIcon getFace(@NotNull final Archetype archetype) { return getFace(archetype.getFaceRealName()); } + /** {@inheritDoc} */ + @NotNull public ImageIcon getFace(@NotNull final GameObject gameObject) { + return getFace(gameObject.getFaceRealName()); + } + /** * Get the transparent face ImageIcon with a certain face name. * @param faceName faceName of face ImageIcon @@ -650,4 +655,9 @@ } } + /** {@inheritDoc} */ + @NotNull protected Archetype createUndefinedArchetype(@NotNull final String archetypeName) { + return new UndefinedArchetype(archetypeName); + } + } // class ArchetypeSet Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2007-01-25 21:00:22 UTC (rev 1708) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2007-01-25 21:31:44 UTC (rev 1709) @@ -48,7 +48,7 @@ * normal arches. * @todo this class is not always the best place for multipart object handling, see also {@link GameObjectContainer} for issues about this */ -public final class GameObject /*extends AbstractNamedObject*/ extends net.sf.gridarta.gameobject.GameObject<GameObject, MapArchObject, Archetype> implements Archetype, Cloneable, Serializable { +public class GameObject /*extends AbstractNamedObject*/ extends net.sf.gridarta.gameobject.GameObject<GameObject, MapArchObject, Archetype> implements Archetype, Cloneable, Serializable { /** Logger. */ private static final Logger log = Logger.getLogger(GameObject.class); Added: trunk/daimonin/src/daieditor/gameobject/UndefinedArchetype.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/UndefinedArchetype.java (rev 0) +++ trunk/daimonin/src/daieditor/gameobject/UndefinedArchetype.java 2007-01-25 21:31:44 UTC (rev 1709) @@ -0,0 +1,47 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 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 daieditor.gameobject; + +import org.jetbrains.annotations.NotNull; + +/** + * The class <code>UndefinedArchetype</code> implements an undefined Daimonin + * archetype. + */ +public class UndefinedArchetype extends GameObject implements Archetype { + + /** + * Create a new undefined archetype with the given archetype name. + * + * @param archetypeName the archetype name + */ + public UndefinedArchetype(@NotNull final String archetypeName) { + setArchetypeName(archetypeName); + setArchTypNr(0); + setIsArchetype(); + setEditorFolder("undefined"); + } + + /** {@inheritDoc} */ + public boolean isUndefinedArchetype() { + return true; + } + +} // class UndefinedArchetype Property changes on: trunk/daimonin/src/daieditor/gameobject/UndefinedArchetype.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2007-01-25 21:00:22 UTC (rev 1708) +++ trunk/daimonin/src/daieditor/messages.properties 2007-01-25 21:31:44 UTC (rev 1709) @@ -86,7 +86,7 @@ openFileLoadMap.message={0} collectTemplistAutodelete.title=Loading mapfile {0} -collectTemplistAutodelete.message=Found {1} unknown arch.\nAutodelete illegal arch:\n{2} +collectTemplistAutodelete.message=Found {1} game objects referencing\nthe following unknown archetypes:\n{2}\nDelete these game objects? enterExitClose.title=Close previous map? enterExitClose.message=You''ve opened a new map.\nShould I close the previous one? Modified: trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSet.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSet.java 2007-01-25 21:00:22 UTC (rev 1708) +++ trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSet.java 2007-01-25 21:31:44 UTC (rev 1709) @@ -19,9 +19,11 @@ package net.sf.gridarta.gameobject; +import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.TreeMap; @@ -57,6 +59,12 @@ private boolean loadedFromArchive; /** + * The archetypes used for game objects which reference undefined + * archetypes. It maps archetype name to archetype. + */ + private Map<String, WeakReference<R>> undefinedArchetypes = new HashMap<String, WeakReference<R>>(); + + /** * Create an AbstractArchetypeSet. */ protected AbstractArchetypeSet() { @@ -83,6 +91,35 @@ } /** {@inheritDoc} */ + @NotNull public R getOrCreateArchetype(@NotNull final String archetypeName) { + final R existingArchetype = getArchetype(archetypeName); + if (existingArchetype != null) { + return existingArchetype; + } + + synchronized (undefinedArchetypes) { + final WeakReference<R> existingUndefinedArchetypeRef = undefinedArchetypes.get(archetypeName); + if (existingUndefinedArchetypeRef != null) { + final R existingUndefinedArchetype = existingUndefinedArchetypeRef.get(); + if (existingUndefinedArchetype != null) { + return existingUndefinedArchetype; + } + } + + final R newArchetype = createUndefinedArchetype(archetypeName); + undefinedArchetypes.put(archetypeName, new WeakReference<R>(newArchetype)); + return newArchetype; + } + } + + /** + * Create a new archetype for an "undefined" archetype name. + * @param archetypeName the archetype name for the new archetype + * @return the created archetype + */ + @NotNull protected abstract R createUndefinedArchetype(@NotNull final String archetypeName); + + /** {@inheritDoc} */ public final void addArchetype(@NotNull final R archetype) { if (!archetype.isArchetype()) { throw new NotArchetypeException(archetype); Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2007-01-25 21:00:22 UTC (rev 1708) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2007-01-25 21:31:44 UTC (rev 1709) @@ -177,6 +177,13 @@ @NotNull String getObjectText(); /** + * Return whether this archetype denotes an undefined archetype. + * + * @return <code>true</code> if this archetype denotes an undefined archetype + */ + boolean isUndefinedArchetype(); + + /** * Get all entries from the given archtext 'atxt' that don't exist in * 'this' archtext. * @param atxt archtext to compare this GameObject with. Modified: trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java 2007-01-25 21:00:22 UTC (rev 1708) +++ trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java 2007-01-25 21:31:44 UTC (rev 1709) @@ -53,10 +53,20 @@ * @param archetypeName name of the Archetype to get * @return Archetype for <var>archetypeName</var> or <code>null</code> if no such Archetype * @see GameObject#createArch() for a similar method that instantiates. + * @see #getOrCreateArchetype(String) for a similar method that creates undefined archetypes */ @Nullable R getArchetype(@NotNull String archetypeName); /** + * Get an archetype by its name. If this archetype does not exist, return + * an {@link Archetype} which has {@link Archetype#isUndefined()} set. + * @param archetypeName the archetype name + * @return the archetype + * @see #getArchetype(String) + */ + R getOrCreateArchetype(@NotNull final String archetypeName); + + /** * Adds an Archetype to this Set. * @param archetype Archetype to add. * @throws IllegalArgumentException in case the added GameObject is not an Archetype. @@ -69,11 +79,18 @@ void loadArchetypes(); /** + * Returns the face of the Archetype as icon. + * @param archetype Archetype to get face for + * @return the face of the Archetype as icon or <code>null</code> if no face could be found. + */ + @NotNull ImageIcon getFace(@NotNull R gameObject); + + /** * Returns the face of the GameObject as icon. - * @param archetype GameObject to get face for + * @param gameObject GameObject to get face for * @return The face of the GameObject as icon or <code>null</code> if no face could be found. */ - @Nullable ImageIcon getFace(@NotNull R archetype); + @NotNull ImageIcon getFace(@NotNull G gameObject); /** * The load status of the ArchetypeSet. Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-01-25 21:00:22 UTC (rev 1708) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-01-25 21:31:44 UTC (rev 1709) @@ -506,7 +506,22 @@ return archetype == this; } + /** {@inheritDoc} */ + public boolean isUndefinedArchetype() { + return false; + } + /** + * Return whether this instance references an undefined archetype. + * + * @return <code>true</code> if this instance references an undefined + * archetype + */ + public boolean hasUndefinedArchetype() { + return getArchetype().isUndefinedArchetype(); + } + + /** * Check whether this GameObject has an Archetype. * @return <code>true</code> when this GameObject has an Archetype or is * an Archetype itself, otherwise <code>false</code> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-25 23:41:19
|
Revision: 1713 http://svn.sourceforge.net/gridarta/?rev=1713&view=rev Author: christianhujer Date: 2007-01-25 15:41:18 -0800 (Thu, 25 Jan 2007) Log Message: ----------- Removed some warnings, mainly javadoc and annotations related. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/UndefinedArchetype.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/UndefinedArchetype.java trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-01-25 23:09:09 UTC (rev 1712) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-01-25 23:41:18 UTC (rev 1713) @@ -36,8 +36,6 @@ import java.io.InputStream; import java.util.Arrays; import java.util.Collection; -import java.util.HashMap; -import java.util.Map; import javax.swing.ImageIcon; import net.sf.gridarta.gameobject.AbstractArchetypeSet; import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; @@ -46,7 +44,6 @@ import net.sf.japi.swing.misc.Progress; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * The <code>ArchetypeSet</code> contains all the Archetypes. @@ -612,7 +609,7 @@ } /** {@inheritDoc} */ - @NotNull protected Archetype createUndefinedArchetype(@NotNull final String archetypeName) { + @NotNull @Override protected Archetype createUndefinedArchetype(@NotNull final String archetypeName) { return new UndefinedArchetype(archetypeName); } Modified: trunk/crossfire/src/cfeditor/gameobject/UndefinedArchetype.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/UndefinedArchetype.java 2007-01-25 23:09:09 UTC (rev 1712) +++ trunk/crossfire/src/cfeditor/gameobject/UndefinedArchetype.java 2007-01-25 23:41:18 UTC (rev 1713) @@ -24,6 +24,7 @@ /** * The class <code>UndefinedArchetype</code> implements an undefined Crossfire * archetype. + * @author Andreas Kirschbaum */ public class UndefinedArchetype extends GameObject implements Archetype { @@ -40,7 +41,7 @@ } /** {@inheritDoc} */ - public boolean isUndefinedArchetype() { + @Override public boolean isUndefinedArchetype() { return true; } Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-01-25 23:09:09 UTC (rev 1712) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-01-25 23:41:18 UTC (rev 1713) @@ -57,7 +57,6 @@ import net.sf.japi.swing.misc.Progress; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * The <code>ArchetypeSet</code> contains all the Archetypes. @@ -656,7 +655,7 @@ } /** {@inheritDoc} */ - @NotNull protected Archetype createUndefinedArchetype(@NotNull final String archetypeName) { + @NotNull @Override protected Archetype createUndefinedArchetype(@NotNull final String archetypeName) { return new UndefinedArchetype(archetypeName); } Modified: trunk/daimonin/src/daieditor/gameobject/UndefinedArchetype.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/UndefinedArchetype.java 2007-01-25 23:09:09 UTC (rev 1712) +++ trunk/daimonin/src/daieditor/gameobject/UndefinedArchetype.java 2007-01-25 23:41:18 UTC (rev 1713) @@ -24,6 +24,7 @@ /** * The class <code>UndefinedArchetype</code> implements an undefined Daimonin * archetype. + * @author Andreas Kirschbaum */ public class UndefinedArchetype extends GameObject implements Archetype { @@ -40,7 +41,7 @@ } /** {@inheritDoc} */ - public boolean isUndefinedArchetype() { + @Override public boolean isUndefinedArchetype() { return true; } Modified: trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java 2007-01-25 23:09:09 UTC (rev 1712) +++ trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java 2007-01-25 23:41:18 UTC (rev 1713) @@ -59,7 +59,7 @@ /** * Get an archetype by its name. If this archetype does not exist, return - * an {@link Archetype} which has {@link Archetype#isUndefined()} set. + * an {@link Archetype} which has {@link Archetype#isUndefinedArchetype()} set. * @param archetypeName the archetype name * @return the archetype * @see #getArchetype(String) @@ -83,7 +83,7 @@ * @param archetype Archetype to get face for * @return the face of the Archetype as icon or <code>null</code> if no face could be found. */ - @NotNull ImageIcon getFace(@NotNull R gameObject); + @NotNull ImageIcon getFace(@NotNull R archetype); /** * Returns the face of the GameObject as icon. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-25 23:54:35
|
Revision: 1714 http://svn.sourceforge.net/gridarta/?rev=1714&view=rev Author: akirschbaum Date: 2007-01-25 15:54:35 -0800 (Thu, 25 Jan 2007) Log Message: ----------- Remove unchecked warnings. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java trunk/daimonin/src/daieditor/map/validation/GameObjectValidationError.java trunk/daimonin/src/daieditor/map/validation/GameObjectValidator.java trunk/daimonin/src/daieditor/map/validation/MapValidator.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareError.java trunk/daimonin/src/daieditor/map/validation/checks/ConnectedInsideContainerChecker.java trunk/daimonin/src/daieditor/map/validation/checks/ConnectedInsideContainerError.java trunk/daimonin/src/daieditor/map/validation/checks/ConnectedPickableChecker.java trunk/daimonin/src/daieditor/map/validation/checks/ConnectedPickableError.java trunk/daimonin/src/daieditor/map/validation/checks/EmptySpawnPointChecker.java trunk/daimonin/src/daieditor/map/validation/checks/EmptySpawnPointError.java trunk/daimonin/src/daieditor/map/validation/checks/ExitChecker.java trunk/daimonin/src/daieditor/map/validation/checks/ExitError.java trunk/daimonin/src/daieditor/map/validation/checks/MobOutsideSpawnPointChecker.java trunk/daimonin/src/daieditor/map/validation/checks/MobOutsideSpawnPointError.java trunk/daimonin/src/daieditor/map/validation/checks/SlayingChecker.java trunk/daimonin/src/daieditor/map/validation/checks/SlayingError.java trunk/daimonin/src/daieditor/map/validation/checks/SysObjectNotOnLayerZeroChecker.java trunk/daimonin/src/daieditor/map/validation/checks/SysObjectNotOnLayerZeroError.java trunk/src/app/net/sf/gridarta/MainControl.java trunk/src/app/net/sf/gridarta/MainControlListener.java trunk/src/app/net/sf/gridarta/gui/StatusBar.java trunk/src/app/net/sf/gridarta/gui/connectionview/ConnectionControl.java trunk/src/app/net/sf/gridarta/gui/connectionview/ConnectionView.java trunk/src/app/net/sf/gridarta/gui/maptilelist/MapTileSelectionCache.java trunk/src/app/net/sf/gridarta/map/MapFileActions.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -1357,7 +1357,7 @@ * @param mapControl the created map */ private void fireMapCreatedEvent(@NotNull final MapControl mapControl) { - for (final MainControlListener<MapControl> listener : listenerList.getListeners(MainControlListener.class)) { + for (final MainControlListener<GameObject, MapArchObject, Archetype, MapControl> listener : listenerList.getListeners(MainControlListener.class)) { listener.mapCreated(mapControl); } } @@ -1367,7 +1367,7 @@ * @param mapControl MapControl that's being closed. */ private void fireMapClosingEvent(@NotNull final MapControl mapControl) { - for (final MainControlListener<MapControl> listener : listenerList.getListeners(MainControlListener.class)) { + for (final MainControlListener<GameObject, MapArchObject, Archetype, MapControl> listener : listenerList.getListeners(MainControlListener.class)) { listener.mapClosing(mapControl); } } @@ -1376,18 +1376,18 @@ * Notify all listeners about a changed current map. */ private void fireCurrentMapChangedEvent() { - for (final MainControlListener<MapControl> listener : listenerList.getListeners(MainControlListener.class)) { + for (final MainControlListener<GameObject, MapArchObject, Archetype, MapControl> listener : listenerList.getListeners(MainControlListener.class)) { listener.currentMapChanged(currentMap); } } /** {@inheritDoc} */ - public void addMainControlListener(@NotNull final MainControlListener<MapControl> listener) { + public void addMainControlListener(@NotNull final MainControlListener<GameObject, MapArchObject, Archetype, MapControl> listener) { listenerList.add(MainControlListener.class, listener); } /** {@inheritDoc} */ - public void removeMainControlListener(@NotNull final MainControlListener<MapControl> listener) { + public void removeMainControlListener(@NotNull final MainControlListener<GameObject, MapArchObject, Archetype, MapControl> listener) { listenerList.remove(MainControlListener.class, listener); } @@ -1630,7 +1630,7 @@ /** * Encapsulates actions and related functions. */ - public static final class MainActions implements MainControlListener<MapControl>, MapCursorListener, MapGridListener { + public static final class MainActions implements MainControlListener<GameObject, MapArchObject, Archetype, MapControl>, MapCursorListener, MapGridListener { /** The MainControl. */ private final CMainControl mainControl; Modified: trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -22,8 +22,10 @@ import cfeditor.CMainControl; import cfeditor.CMainView; import cfeditor.IGUIConstants; +import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; import cfeditor.gui.selectedsquare.SelectedSquareControl; +import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; import java.awt.Point; import javax.swing.Action; @@ -76,7 +78,7 @@ /** * The main control listener used to detect changed current maps. */ - private final MainControlListener<MapControl> mainControlListener = new MainControlListener<MapControl>() { + private final MainControlListener<GameObject, MapArchObject, Archetype, MapControl> mainControlListener = new MainControlListener<GameObject, MapArchObject, Archetype, MapControl>() { /** {@inheritDoc} */ public void currentMapChanged(@Nullable final MapControl mapControl) { Modified: trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -60,7 +60,7 @@ * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @todo turn this into a tree */ -public final class SelectedSquareView extends JPanel implements MainControlListener<MapControl>, MapCursorListener, MapModelListener<GameObject, MapArchObject, Archetype> { +public final class SelectedSquareView extends JPanel implements MainControlListener<GameObject, MapArchObject, Archetype, MapControl>, MapCursorListener, MapModelListener<GameObject, MapArchObject, Archetype> { /** Serial Version UID. */ private static final long serialVersionUID = 1L; Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -1582,7 +1582,7 @@ * @param mapControl the created map */ private void fireMapCreatedEvent(@NotNull final MapControl mapControl) { - for (final MainControlListener<MapControl> listener : listenerList.getListeners(MainControlListener.class)) { + for (final MainControlListener<GameObject, MapArchObject, Archetype, MapControl> listener : listenerList.getListeners(MainControlListener.class)) { listener.mapCreated(mapControl); } } @@ -1592,7 +1592,7 @@ * @param mapControl MapControl that's being closed. */ private void fireMapClosingEvent(@NotNull final MapControl mapControl) { - for (final MainControlListener<MapControl> listener : listenerList.getListeners(MainControlListener.class)) { + for (final MainControlListener<GameObject, MapArchObject, Archetype, MapControl> listener : listenerList.getListeners(MainControlListener.class)) { listener.mapClosing(mapControl); } } @@ -1601,18 +1601,18 @@ * Notify all listeners about a changed current map. */ private void fireCurrentMapChangedEvent() { - for (final MainControlListener<MapControl> listener : listenerList.getListeners(MainControlListener.class)) { + for (final MainControlListener<GameObject, MapArchObject, Archetype, MapControl> listener : listenerList.getListeners(MainControlListener.class)) { listener.currentMapChanged(currentMap); } } /** {@inheritDoc} */ - public void addMainControlListener(@NotNull final MainControlListener<MapControl> listener) { + public void addMainControlListener(@NotNull final MainControlListener<GameObject, MapArchObject, Archetype, MapControl> listener) { listenerList.add(MainControlListener.class, listener); } /** {@inheritDoc} */ - public void removeMainControlListener(@NotNull final MainControlListener<MapControl> listener) { + public void removeMainControlListener(@NotNull final MainControlListener<GameObject, MapArchObject, Archetype, MapControl> listener) { listenerList.remove(MainControlListener.class, listener); } @@ -1976,7 +1976,7 @@ /** * Encapsulates actions and related functions. */ - public static final class MainActions implements MainControlListener<MapControl>, MapCursorListener, MapGridListener { + public static final class MainActions implements MainControlListener<GameObject, MapArchObject, Archetype, MapControl>, MapCursorListener, MapGridListener { /** The MainControl. */ private final CMainControl mainControl; Modified: trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -22,8 +22,10 @@ import daieditor.CMainControl; import daieditor.CMainView; import daieditor.IGUIConstants; +import daieditor.gameobject.Archetype; import daieditor.gameobject.GameObject; import daieditor.gui.selectedsquare.SelectedSquareControl; +import daieditor.map.MapArchObject; import daieditor.map.MapControl; import java.awt.Point; import javax.swing.Action; @@ -76,7 +78,7 @@ /** * The main control listener used to detect changed current maps. */ - private final MainControlListener<MapControl> mainControlListener = new MainControlListener<MapControl>() { + private final MainControlListener<GameObject, MapArchObject, Archetype, MapControl> mainControlListener = new MainControlListener<GameObject, MapArchObject, Archetype, MapControl>() { /** {@inheritDoc} */ public void currentMapChanged(@Nullable final MapControl mapControl) { Modified: trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -63,7 +63,7 @@ * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @todo turn this into a tree */ -public final class SelectedSquareView extends JPanel implements MainControlListener<MapControl>, MapCursorListener, MapModelListener<GameObject, MapArchObject, Archetype> { +public final class SelectedSquareView extends JPanel implements MainControlListener<GameObject, MapArchObject, Archetype, MapControl>, MapCursorListener, MapModelListener<GameObject, MapArchObject, Archetype> { /** Serial Version UID. */ private static final long serialVersionUID = 1L; Modified: trunk/daimonin/src/daieditor/map/validation/GameObjectValidationError.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/GameObjectValidationError.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/GameObjectValidationError.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -19,7 +19,9 @@ package daieditor.map.validation; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; /** * Class for validation errors related to an GameObject. @@ -34,7 +36,7 @@ * Create an GameObjectValidationError. * @param gameObject the GameObject on which the error occurred */ - public GameObjectValidationError(final GameObject gameObject) { + public GameObjectValidationError(final GameObject<? extends GameObject, ? extends MapArchObject, ? extends Archetype> gameObject) { super(gameObject.getMapSquare()); this.gameObject = gameObject; } Modified: trunk/daimonin/src/daieditor/map/validation/GameObjectValidator.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/GameObjectValidator.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/GameObjectValidator.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -19,7 +19,9 @@ package daieditor.map.validation; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; /** * Interface for GameObject Validators. @@ -33,6 +35,6 @@ * @param gameObject GameObject to validate * @param errorCollector Error collector to report errors to */ - void validate(GameObject gameObject, ErrorCollector errorCollector); + void validate(GameObject<? extends GameObject, ? extends MapArchObject, ? extends Archetype> gameObject, ErrorCollector errorCollector); } // interface GameObjectValidator Modified: trunk/daimonin/src/daieditor/map/validation/MapValidator.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/MapValidator.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/MapValidator.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -19,6 +19,9 @@ package daieditor.map.validation; +import net.sf.gridarta.gameobject.Archetype; +import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; import net.sf.gridarta.map.MapModel; /** @@ -33,6 +36,6 @@ * @param mapModel Map to validate * @param errorCollector Error collector to report errors to */ - void validate(MapModel mapModel, ErrorCollector errorCollector); + void validate(MapModel<? extends GameObject, ? extends MapArchObject, ? extends Archetype> mapModel, ErrorCollector errorCollector); } // interface MapValidator Modified: trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -40,8 +40,8 @@ public class BlockedSquareChecker extends AbstractValidator implements MapValidator { /** {@inheritDoc} */ - public void validate(final MapModel mapModel, final ErrorCollector errorCollector) { - for (final MapSquare completelyBlockedSquare : findCompletelyBlockedSquares(mapModel)) { + public void validate(final MapModel<? extends GameObject, ? extends MapArchObject, ? extends Archetype> mapModel, final ErrorCollector errorCollector) { + for (final MapSquare<? extends GameObject, ? extends MapArchObject, ? extends Archetype> completelyBlockedSquare : findCompletelyBlockedSquares(mapModel)) { errorCollector.collect(new BlockedSquareError(completelyBlockedSquare)); } } @@ -51,7 +51,7 @@ * @param mapModel Map Model to search for completely blocked squares * @return list with all completely blocked squares */ - public static List<MapSquare> findCompletelyBlockedSquares(final MapModel mapModel) { + public static List<MapSquare<? extends GameObject, ? extends MapArchObject, ? extends Archetype>> findCompletelyBlockedSquares(final MapModel<? extends GameObject, ? extends MapArchObject, ? extends Archetype> mapModel) { final Size2D mapSize = mapModel.getMapSize(); final int mapWidth = mapSize.getWidth(); final int mapHeight = mapSize.getHeight(); @@ -69,7 +69,7 @@ } } } - final List<MapSquare> completelyBlockedSquares = new ArrayList<MapSquare>(); + final List<MapSquare<? extends GameObject, ? extends MapArchObject, ? extends Archetype>> completelyBlockedSquares = new ArrayList<MapSquare<? extends GameObject, ? extends MapArchObject, ? extends Archetype>>(); for (int x = 0; x < mapWidth; x++) { pos.x = x; for (int y = 0; y < mapHeight; y++) { Modified: trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareError.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareError.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareError.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -37,7 +37,7 @@ * Create a BlockedMobOrSpawnPointError. * @param mapSquare the square on which the error occurred */ - public BlockedSquareError(final MapSquare<? extends GameObject, MapArchObject, ? extends Archetype> mapSquare) { + public BlockedSquareError(final MapSquare<? extends GameObject, ? extends MapArchObject, ? extends Archetype> mapSquare) { super(mapSquare); } Modified: trunk/daimonin/src/daieditor/map/validation/checks/ConnectedInsideContainerChecker.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/ConnectedInsideContainerChecker.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/checks/ConnectedInsideContainerChecker.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -22,7 +22,9 @@ import daieditor.map.validation.AbstractValidator; import daieditor.map.validation.ErrorCollector; import daieditor.map.validation.GameObjectValidator; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; /** * An GameObjectValidator to assert that containers do not contain connected objects. @@ -31,7 +33,7 @@ public class ConnectedInsideContainerChecker extends AbstractValidator implements GameObjectValidator { /** {@inheritDoc} */ - public void validate(final GameObject gameObject, final ErrorCollector errorCollector) { + public void validate(final GameObject<? extends GameObject, ? extends MapArchObject, ? extends Archetype> gameObject, final ErrorCollector errorCollector) { final String connection = gameObject.getAttributeString("connected", true); final boolean connected = connection != null && connection.length() > 0; if (connected && gameObject.isInContainer()) { Modified: trunk/daimonin/src/daieditor/map/validation/checks/ConnectedInsideContainerError.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/ConnectedInsideContainerError.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/checks/ConnectedInsideContainerError.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -22,7 +22,9 @@ import daieditor.map.validation.CorrectableError; import daieditor.map.validation.GameObjectValidationError; import java.awt.Component; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; /** * A MapValidator that checks for mobs outside spawn points. @@ -34,7 +36,7 @@ * Create a MobOutsideSpawnPointError. * @param gameObject the GameObject on which the error occurred */ - public ConnectedInsideContainerError(final GameObject gameObject) { + public ConnectedInsideContainerError(final GameObject<? extends GameObject, ? extends MapArchObject, ? extends Archetype> gameObject) { super(gameObject); } Modified: trunk/daimonin/src/daieditor/map/validation/checks/ConnectedPickableChecker.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/ConnectedPickableChecker.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/checks/ConnectedPickableChecker.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -22,7 +22,9 @@ import daieditor.map.validation.AbstractValidator; import daieditor.map.validation.ErrorCollector; import daieditor.map.validation.GameObjectValidator; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; /** * A Validator to assert that connected objects cannot be picked up. @@ -31,7 +33,7 @@ public class ConnectedPickableChecker extends AbstractValidator implements GameObjectValidator { /** {@inheritDoc} */ - public void validate(final GameObject gameObject, final ErrorCollector errorCollector) { + public void validate(final GameObject<? extends GameObject, ? extends MapArchObject, ? extends Archetype> gameObject, final ErrorCollector errorCollector) { final boolean pickable = gameObject.getAttributeInt("no_pick", true) == 0; final String connection = gameObject.getAttributeString("connected", true); final boolean connected = connection != null && connection.length() > 0; Modified: trunk/daimonin/src/daieditor/map/validation/checks/ConnectedPickableError.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/ConnectedPickableError.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/checks/ConnectedPickableError.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -22,7 +22,9 @@ import daieditor.map.validation.CorrectableError; import daieditor.map.validation.GameObjectValidationError; import java.awt.Component; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; /** * A MapValidator that checks for mobs outside spawn points. @@ -34,7 +36,7 @@ * Create a MobOutsideSpawnPointError. * @param gameObject the GameObject on which the error occurred */ - public ConnectedPickableError(final GameObject gameObject) { + public ConnectedPickableError(final GameObject<? extends GameObject, ? extends MapArchObject, ? extends Archetype> gameObject) { super(gameObject); } Modified: trunk/daimonin/src/daieditor/map/validation/checks/EmptySpawnPointChecker.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/EmptySpawnPointChecker.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/checks/EmptySpawnPointChecker.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -22,7 +22,9 @@ import daieditor.map.validation.AbstractValidator; import daieditor.map.validation.ErrorCollector; import daieditor.map.validation.GameObjectValidator; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; /** * An GameObjectValidator to assert that spawn points are not empty. @@ -31,7 +33,7 @@ public class EmptySpawnPointChecker extends AbstractValidator implements GameObjectValidator { /** {@inheritDoc} */ - public void validate(final GameObject gameObject, final ErrorCollector errorCollector) { + public void validate(final GameObject<? extends GameObject, ? extends MapArchObject, ? extends Archetype> gameObject, final ErrorCollector errorCollector) { if (gameObject.getArchTypNr() == 81) { if (gameObject.isEmpty()) { errorCollector.collect(new EmptySpawnPointError(gameObject)); Modified: trunk/daimonin/src/daieditor/map/validation/checks/EmptySpawnPointError.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/EmptySpawnPointError.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/checks/EmptySpawnPointError.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -22,7 +22,9 @@ import daieditor.map.validation.CorrectableError; import daieditor.map.validation.GameObjectValidationError; import java.awt.Component; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; /** * Validation error that's used when the EmptySpawnPointCheker detected a possible error on the map. @@ -34,7 +36,7 @@ * Create an EmptySpawnPointError. * @param gameObject the GameObject on which the error occurred */ - public EmptySpawnPointError(final GameObject gameObject) { + public EmptySpawnPointError(final GameObject<? extends GameObject, ? extends MapArchObject, ? extends Archetype> gameObject) { super(gameObject); } Modified: trunk/daimonin/src/daieditor/map/validation/checks/ExitChecker.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/ExitChecker.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/checks/ExitChecker.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -25,7 +25,9 @@ import daieditor.map.validation.ErrorCollector; import daieditor.map.validation.GameObjectValidator; import java.io.File; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; import org.jetbrains.annotations.NotNull; /** Modified: trunk/daimonin/src/daieditor/map/validation/checks/ExitError.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/ExitError.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/checks/ExitError.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -20,7 +20,9 @@ package daieditor.map.validation.checks; import daieditor.map.validation.GameObjectValidationError; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; /** * Validation error that's used when a map has wrong exit paths. @@ -36,7 +38,7 @@ * @param gameObject the GameObject on which the error occurred * @param exitPath exit path which was wrong */ - public ExitError(final GameObject gameObject, final String exitPath) { + public ExitError(final GameObject<? extends GameObject, ? extends MapArchObject, ? extends Archetype> gameObject, final String exitPath) { super(gameObject); this.exitPath = exitPath; } Modified: trunk/daimonin/src/daieditor/map/validation/checks/MobOutsideSpawnPointChecker.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/MobOutsideSpawnPointChecker.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/checks/MobOutsideSpawnPointChecker.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -22,7 +22,9 @@ import daieditor.map.validation.AbstractValidator; import daieditor.map.validation.ErrorCollector; import daieditor.map.validation.GameObjectValidator; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; /** * GameObjectValidator to assert that mobs are not outside spawn points. @@ -31,7 +33,7 @@ public class MobOutsideSpawnPointChecker extends AbstractValidator implements GameObjectValidator { /** {@inheritDoc} */ - public void validate(final GameObject gameObject, final ErrorCollector errorCollector) { + public void validate(final GameObject<? extends GameObject, ? extends MapArchObject, ? extends Archetype> gameObject, final ErrorCollector errorCollector) { if (gameObject.getArchTypNr() == 80) { errorCollector.collect(new MobOutsideSpawnPointError(gameObject)); } Modified: trunk/daimonin/src/daieditor/map/validation/checks/MobOutsideSpawnPointError.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/MobOutsideSpawnPointError.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/checks/MobOutsideSpawnPointError.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -22,7 +22,9 @@ import daieditor.map.validation.CorrectableError; import daieditor.map.validation.GameObjectValidationError; import java.awt.Component; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; /** * A MapValidator that checks for mobs outside spawn points. @@ -34,7 +36,7 @@ * Create a MobOutsideSpawnPointError. * @param gameObject the GameObject on which the error occurred */ - public MobOutsideSpawnPointError(final GameObject gameObject) { + public MobOutsideSpawnPointError(final GameObject<? extends GameObject, ? extends MapArchObject, ? extends Archetype> gameObject) { super(gameObject); } Modified: trunk/daimonin/src/daieditor/map/validation/checks/SlayingChecker.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/SlayingChecker.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/checks/SlayingChecker.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -22,7 +22,9 @@ import daieditor.map.validation.AbstractValidator; import daieditor.map.validation.ErrorCollector; import daieditor.map.validation.GameObjectValidator; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; /** * An GameObjectValidator to assert that arch objects do not have critical slaying strings. @@ -31,7 +33,7 @@ public class SlayingChecker extends AbstractValidator implements GameObjectValidator { /** {@inheritDoc} */ - public void validate(final GameObject gameObject, final ErrorCollector errorCollector) { + public void validate(final GameObject<? extends GameObject, ? extends MapArchObject, ? extends Archetype> gameObject, final ErrorCollector errorCollector) { final String slaying = gameObject.getAttributeString("slaying", true); if (slaying != null && !slaying.matches("^[a-zA-Z_0-9/.]*$")) { errorCollector.collect(new SlayingError(gameObject)); Modified: trunk/daimonin/src/daieditor/map/validation/checks/SlayingError.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/SlayingError.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/checks/SlayingError.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -22,7 +22,9 @@ import daieditor.map.validation.CorrectableError; import daieditor.map.validation.GameObjectValidationError; import java.awt.Component; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; /** * Validation error that's used when the SlayingChecker detected a possible error on the map. @@ -34,7 +36,7 @@ * Create a MobOutsideSpawnPointError. * @param gameObject the GameObject on which the error occurred */ - public SlayingError(final GameObject gameObject) { + public SlayingError(final GameObject<? extends GameObject, ? extends MapArchObject, ? extends Archetype> gameObject) { super(gameObject); } Modified: trunk/daimonin/src/daieditor/map/validation/checks/SysObjectNotOnLayerZeroChecker.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/SysObjectNotOnLayerZeroChecker.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/checks/SysObjectNotOnLayerZeroChecker.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -22,7 +22,9 @@ import daieditor.map.validation.AbstractValidator; import daieditor.map.validation.ErrorCollector; import daieditor.map.validation.GameObjectValidator; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; /** * A GameObjectValidator to assert that sys objects are only in layer 0. @@ -31,7 +33,7 @@ public class SysObjectNotOnLayerZeroChecker extends AbstractValidator implements GameObjectValidator { /** {@inheritDoc} */ - public void validate(final GameObject gameObject, final ErrorCollector errorCollector) { + public void validate(final GameObject<? extends GameObject, ? extends MapArchObject, ? extends Archetype> gameObject, final ErrorCollector errorCollector) { if (gameObject.getAttributeInt("sys_object", true) == 1 && gameObject.getAttributeInt("layer", true) != 0) { errorCollector.collect(new SysObjectNotOnLayerZeroError(gameObject)); } Modified: trunk/daimonin/src/daieditor/map/validation/checks/SysObjectNotOnLayerZeroError.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/SysObjectNotOnLayerZeroError.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/daimonin/src/daieditor/map/validation/checks/SysObjectNotOnLayerZeroError.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -22,7 +22,9 @@ import daieditor.map.validation.CorrectableError; import daieditor.map.validation.GameObjectValidationError; import java.awt.Component; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; /** * ValidationError that's used if an GameObject that is a SysObject is found on a layer other than 0. @@ -34,7 +36,7 @@ * Create a SysObjectNotOnLayerZeroError. * @param gameObject GameObject with error */ - public SysObjectNotOnLayerZeroError(final GameObject gameObject) { + public SysObjectNotOnLayerZeroError(final GameObject<? extends GameObject, ? extends MapArchObject, ? extends Archetype> gameObject) { super(gameObject); } Modified: trunk/src/app/net/sf/gridarta/MainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/MainControl.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/src/app/net/sf/gridarta/MainControl.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -124,13 +124,13 @@ * Register a MainControlListener. * @param listener MainControlListener to register */ - void addMainControlListener(@NotNull MainControlListener<C> listener); + void addMainControlListener(@NotNull MainControlListener<G, A, R, C> listener); /** * Remove a MainControlListener. * @param listener MainControlListener to remove */ - void removeMainControlListener(@NotNull MainControlListener<C> listener); + void removeMainControlListener(@NotNull MainControlListener<G, A, R, C> listener); void showArchPanelQuickObject(G gameObject); Modified: trunk/src/app/net/sf/gridarta/MainControlListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/MainControlListener.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/src/app/net/sf/gridarta/MainControlListener.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -20,6 +20,9 @@ package net.sf.gridarta; import java.util.EventListener; +import net.sf.gridarta.gameobject.Archetype; +import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.map.MapArchObject; import net.sf.gridarta.map.MapControl; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -29,7 +32,7 @@ * * @author Andreas Kirschbaum */ -public interface MainControlListener<C extends MapControl> extends EventListener { +public interface MainControlListener<G extends GameObject<G, A, R>, A extends MapArchObject, R extends Archetype<G, A, R>, C extends MapControl<G, A, R>> extends EventListener { /** * This event handler is called when the current map has changed. Modified: trunk/src/app/net/sf/gridarta/gui/StatusBar.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/StatusBar.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/src/app/net/sf/gridarta/gui/StatusBar.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -31,10 +31,13 @@ import javax.swing.border.BevelBorder; import net.sf.gridarta.MainControl; import net.sf.gridarta.MainControlListener; +import net.sf.gridarta.gameobject.Archetype; +import net.sf.gridarta.gameobject.GameObject; import net.sf.gridarta.gui.map.LevelRenderer; import net.sf.gridarta.gui.map.MapCursor; import net.sf.gridarta.gui.map.MapCursorEvent; import net.sf.gridarta.gui.map.MapCursorListener; +import net.sf.gridarta.map.MapArchObject; import net.sf.gridarta.map.MapControl; import net.sf.japi.swing.ActionFactory; import org.jetbrains.annotations.NotNull; @@ -103,7 +106,7 @@ /** * The main control listener to detect current map changes. */ - private final MainControlListener<MapControl> mainControlListener = new MainControlListener<MapControl>() { + private final MainControlListener mainControlListener = new MainControlListener() { /** {@inheritDoc} */ public void currentMapChanged(@Nullable final MapControl mapControl) { Modified: trunk/src/app/net/sf/gridarta/gui/connectionview/ConnectionControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/connectionview/ConnectionControl.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/src/app/net/sf/gridarta/gui/connectionview/ConnectionControl.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -37,21 +37,21 @@ * * @author Andreas Kirschbaum */ -public class ConnectionControl<G extends GameObject<G, A, R>, A extends MapArchObject, R extends Archetype<G, A, R>> { +public class ConnectionControl<G extends GameObject<G, A, R>, A extends MapArchObject, R extends Archetype<G, A, R>, C extends MapControl<G, A, R>> { /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ConnectionControl.class); /** The view for this controller. */ - @NotNull private final ConnectionView<G, A, R> view; + @NotNull private final ConnectionView<G, A, R, C> view; /* * Create a new instance. * * @param mainControl the main control to use */ - public ConnectionControl(@NotNull final MainControl mainControl) { - view = new ConnectionView<G, A, R>(mainControl); + public ConnectionControl(@NotNull final MainControl<G, A, R, C> mainControl) { + view = new ConnectionView<G, A, R, C>(mainControl); view.addListSelectionListener(new ListSelectionListener() { public void valueChanged(final ListSelectionEvent e) { @@ -65,7 +65,7 @@ * * @return the view for this controller */ - @NotNull public ConnectionView<G, A, R> getView() { + @NotNull public ConnectionView<G, A, R, C> getView() { return view; } Modified: trunk/src/app/net/sf/gridarta/gui/connectionview/ConnectionView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/connectionview/ConnectionView.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/src/app/net/sf/gridarta/gui/connectionview/ConnectionView.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -53,7 +53,7 @@ * @todo attach * @serial exclude */ -public final class ConnectionView<G extends GameObject<G, A, R>, A extends MapArchObject, R extends Archetype<G, A, R>> extends JPanel implements MainControlListener<MapControl<G, A, R>>, MapModelListener<G, A, R> { +public final class ConnectionView<G extends GameObject<G, A, R>, A extends MapArchObject, R extends Archetype<G, A, R>, C extends MapControl<G, A, R>> extends JPanel implements MainControlListener<G, A, R, C>, MapModelListener<G, A, R> { /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(ConnectionControl.class); @@ -71,7 +71,7 @@ * Create a ConnectionPanel. * @param mainControl MainControl. */ - public ConnectionView(@NotNull final MainControl mainControl) { + public ConnectionView(@NotNull final MainControl<G, A, R, C> mainControl) { setLayout(new BorderLayout()); connectionList.setCellRenderer(new CellRenderer()); add(new JScrollPane(connectionList)); @@ -130,18 +130,18 @@ } /** {@inheritDoc} */ - public void currentMapChanged(@Nullable final MapControl<G, A, R> mapControl) { + public void currentMapChanged(@Nullable final C mapControl) { this.mapControl = mapControl; scanMapForConnections(); } /** {@inheritDoc} */ - public void mapCreated(@NotNull final MapControl<G, A, R> mapControl) { + public void mapCreated(@NotNull final C mapControl) { mapControl.getMapModel().addMapModelListener(this); } /** {@inheritDoc} */ - public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) { + public void mapClosing(@NotNull final C mapControl) { mapControl.getMapModel().removeMapModelListener(this); } Modified: trunk/src/app/net/sf/gridarta/gui/maptilelist/MapTileSelectionCache.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/maptilelist/MapTileSelectionCache.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/src/app/net/sf/gridarta/gui/maptilelist/MapTileSelectionCache.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -36,7 +36,7 @@ * one {@link MapTileSelection} instance for each {@link MapControl} instance. * @author unknown */ -public class MapTileSelectionCache<G extends GameObject<G, A, R>, A extends MapArchObject, R extends Archetype<G, A, R>, C extends MapControl> { +public class MapTileSelectionCache<G extends GameObject<G, A, R>, A extends MapArchObject, R extends Archetype<G, A, R>, C extends MapControl<G, A, R>> { /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(MapTileSelectionCache.class.getName()); @@ -50,7 +50,7 @@ /** * The map control listener used to remove closed maps from {@link #cache}. */ - private final MainControlListener<C> mainControlListener = new MainControlListener<C>() { + private final MainControlListener<G, A, R, C> mainControlListener = new MainControlListener<G, A, R, C>() { /** {@inheritDoc} */ public void currentMapChanged(final @Nullable C mapControl) { Modified: trunk/src/app/net/sf/gridarta/map/MapFileActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapFileActions.java 2007-01-25 23:41:18 UTC (rev 1713) +++ trunk/src/app/net/sf/gridarta/map/MapFileActions.java 2007-01-25 23:54:35 UTC (rev 1714) @@ -101,7 +101,7 @@ * The main control listener which is attached to {@link #mainControl} if * the current map is tracked. Otherwise it is unused. */ - private final MainControlListener<C> mainControlListener = new MainControlListener<C>() { + private final MainControlListener<G, A, R, C> mainControlListener = new MainControlListener<G, A, R, C>() { /** {@inheritDoc} */ public void currentMapChanged(@Nullable final C mapControl) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-26 00:41:56
|
Revision: 1717 http://svn.sourceforge.net/gridarta/?rev=1717&view=rev Author: akirschbaum Date: 2007-01-25 16:41:56 -0800 (Thu, 25 Jan 2007) Log Message: ----------- Remove unused return value. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2007-01-26 00:24:33 UTC (rev 1716) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2007-01-26 00:41:56 UTC (rev 1717) @@ -74,7 +74,7 @@ /** {@inheritDoc} */ @Nullable - public Archetype parseArchetypeFromStream(final BufferedReader in, @Nullable final GameObject prototype, @Nullable final String line, @Nullable final String archName, @NotNull final String panelName, @NotNull final String folderName, final String fname) throws IOException { + public void parseArchetypeFromStream(final BufferedReader in, @Nullable final GameObject prototype, @Nullable final String line, @Nullable final String archName, @NotNull final String panelName, @NotNull final String folderName, final String fname) throws IOException { // start with new clean GameObject instance GameObject archetype; GameObject archlast = null; @@ -200,7 +200,7 @@ if (prototype != null) { archetype.addObjectText(archetype.diffArchText(prototype.getObjectText(), true)); } - return archetype; + return; } archlast = archetype; archetype = null; @@ -268,7 +268,6 @@ } thisLine2 = in.readLine(); } // while loop ends here - return null; } /** {@inheritDoc} */ Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2007-01-26 00:24:33 UTC (rev 1716) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2007-01-26 00:41:56 UTC (rev 1717) @@ -81,7 +81,7 @@ /** {@inheritDoc} */ @Nullable @SuppressWarnings({"StringContatenationInLoop", "ObjectAllocationInLoop"}) - public Archetype parseArchetypeFromStream(final BufferedReader in, @Nullable final GameObject prototype, @Nullable final String line, @Nullable final String archName, @NotNull final String panelName, @NotNull final String folderName, final String fname) throws IOException { + public void parseArchetypeFromStream(final BufferedReader in, @Nullable final GameObject prototype, @Nullable final String line, @Nullable final String archName, @NotNull final String panelName, @NotNull final String folderName, final String fname) throws IOException { // start with new clean GameObject instance GameObject archetype; GameObject archlast = null; @@ -235,7 +235,7 @@ if (prototype != null) { archetype.addObjectText(archetype.diffArchText(prototype.getObjectText(), true)); } - return archetype; + return; } archlast = archetype; archetype = null; @@ -342,7 +342,6 @@ } thisLine2 = in.readLine(); } // while loop ends here - return null; } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java 2007-01-26 00:24:33 UTC (rev 1716) +++ trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java 2007-01-26 00:41:56 UTC (rev 1717) @@ -68,11 +68,10 @@ * @param panelName the panel name to add the archetype to * @param folderName the folder name to add the archetype to * @param fname filename of the Archetype - * @return TODO * @throws IOException in case of I/O problems * @throws EOFException in case an uncomplete object was found */ - R parseArchetypeFromStream(BufferedReader in, @Nullable G prototype, @Nullable String line, @Nullable String archName, @NotNull String panelName, @NotNull String folderName, String fname) throws IOException; + void parseArchetypeFromStream(BufferedReader in, @Nullable G prototype, @Nullable String line, @Nullable String archName, @NotNull String panelName, @NotNull String folderName, String fname) throws IOException; /** * Short form of {@link #parseArchetypeFromStream(BufferedReader, GameObject, String, String, String, String, String)}. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-26 17:00:26
|
Revision: 1718 http://svn.sourceforge.net/gridarta/?rev=1718&view=rev Author: christianhujer Date: 2007-01-26 09:00:24 -0800 (Fri, 26 Jan 2007) Log Message: ----------- Removed bogus annotation. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2007-01-26 00:41:56 UTC (rev 1717) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2007-01-26 17:00:24 UTC (rev 1718) @@ -73,7 +73,6 @@ } /** {@inheritDoc} */ - @Nullable public void parseArchetypeFromStream(final BufferedReader in, @Nullable final GameObject prototype, @Nullable final String line, @Nullable final String archName, @NotNull final String panelName, @NotNull final String folderName, final String fname) throws IOException { // start with new clean GameObject instance GameObject archetype; Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2007-01-26 00:41:56 UTC (rev 1717) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2007-01-26 17:00:24 UTC (rev 1718) @@ -80,7 +80,7 @@ } /** {@inheritDoc} */ - @Nullable @SuppressWarnings({"StringContatenationInLoop", "ObjectAllocationInLoop"}) + @SuppressWarnings({"StringContatenationInLoop", "ObjectAllocationInLoop"}) public void parseArchetypeFromStream(final BufferedReader in, @Nullable final GameObject prototype, @Nullable final String line, @Nullable final String archName, @NotNull final String panelName, @NotNull final String folderName, final String fname) throws IOException { // start with new clean GameObject instance GameObject archetype; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-26 17:33:23
|
Revision: 1721 http://svn.sourceforge.net/gridarta/?rev=1721&view=rev Author: christianhujer Date: 2007-01-26 09:33:13 -0800 (Fri, 26 Jan 2007) Log Message: ----------- Moved pngFileFilter to common base class so it can be used by crossfire editor as well. Crossfire editor now uses pngFileFilter instead of an anonymous instance. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CPreview.java trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties trunk/daimonin/src/daieditor/messages_fr.properties trunk/daimonin/src/daieditor/messages_sv.properties trunk/src/app/net/sf/gridarta/AbstractMainControl.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-26 17:25:26 UTC (rev 1720) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-26 17:33:13 UTC (rev 1721) @@ -1054,16 +1054,8 @@ fileChooser.setMultiSelectionEnabled(false); fileChooser.setSelectedFile(new File(startFilename)); // set a file filter for "*.png" files - fileChooser.setFileFilter(new FileFilter() { - @Override public String getDescription() { - return "*.png"; - } + fileChooser.setFileFilter(pngFileFilter); - @Override public boolean accept(final File f) { - return f.isDirectory() || f.getName().endsWith(".png"); - } - }); - final int returnVal = fileChooser.showSaveDialog(mainView); if (returnVal == JFileChooser.APPROVE_OPTION) { // got the filepath, now create image Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-01-26 17:25:26 UTC (rev 1720) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-01-26 17:33:13 UTC (rev 1721) @@ -77,13 +77,12 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; -import java.util.TreeSet; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.ListIterator; import java.util.MissingResourceException; import static java.util.ResourceBundle.getBundle; +import java.util.TreeSet; import java.util.prefs.Preferences; import static java.util.prefs.Preferences.userNodeForPackage; import javax.swing.AbstractAction; @@ -707,9 +706,6 @@ /** Swing FileFilter for Lua scripts. */ public static final FileFilter luaFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.lua"), ".lua")); - /** Swing FileFilter for png graphics. */ - public static final FileFilter pngFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.png"), ".png")); - /** Swing FileFilter for .arc files. */ public static final FileFilter arcFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.arc"), ".arc")); Modified: trunk/daimonin/src/daieditor/CPreview.java =================================================================== --- trunk/daimonin/src/daieditor/CPreview.java 2007-01-26 17:25:26 UTC (rev 1720) +++ trunk/daimonin/src/daieditor/CPreview.java 2007-01-26 17:33:13 UTC (rev 1721) @@ -37,6 +37,7 @@ import javax.swing.JFrame; import javax.swing.JScrollPane; import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE; +import net.sf.gridarta.AbstractMainControl; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.ActionMethod; @@ -179,7 +180,7 @@ */ @ActionMethod public void zoomSave() { final JFileChooser chooser = new JFileChooser(); - chooser.setFileFilter(CMainControl.pngFileFilter); + chooser.setFileFilter(AbstractMainControl.pngFileFilter); if (chooser.showSaveDialog(frame) == JFileChooser.APPROVE_OPTION) { final File file = chooser.getSelectedFile(); if (!file.exists() || ACTION_FACTORY.showQuestionDialog(this, "overwriteOtherFile", file)) { Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2007-01-26 17:25:26 UTC (rev 1720) +++ trunk/daimonin/src/daieditor/messages.properties 2007-01-26 17:33:13 UTC (rev 1721) @@ -230,7 +230,6 @@ fileDialog.title=Open map or script files fileDialog.filter.maps=Map Files fileDialog.filter.lua=Lua Scripts -fileDialog.filter.png=PNG Images fileDialog.filter.arc=Archetype definitions fileDialog.filter.anim=Animation definitions fileDialog.filter.unignored=All supported file types Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2007-01-26 17:25:26 UTC (rev 1720) +++ trunk/daimonin/src/daieditor/messages_de.properties 2007-01-26 17:33:13 UTC (rev 1721) @@ -197,9 +197,7 @@ file.mnemonic=D fileDialog.title=Karten- oder Script-Dateien \xF6ffnen fileDialog.filter.maps=Karten-Dateien -fileDialog.filter.python=Python-Skripte fileDialog.filter.lua=Lua-Skripte -fileDialog.filter.png=PNG-Grafiken fileDialog.filter.arc=Archetypdefinitionen fileDialog.filter.anim=Animationsdefinitionen Modified: trunk/daimonin/src/daieditor/messages_fr.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_fr.properties 2007-01-26 17:25:26 UTC (rev 1720) +++ trunk/daimonin/src/daieditor/messages_fr.properties 2007-01-26 17:33:13 UTC (rev 1721) @@ -60,9 +60,7 @@ file.mnemonic=F fileDialog.title=Ouvrir fichier carte ou script fileDialog.filter.maps=Fichier carte -fileDialog.filter.python=Scripts python fileDialog.filter.lua=Scripts lua -fileDialog.filter.png=Images PNG createNew.text=Nouveau createNew.shortdescription=Cr\xE9er une nouvelle carte Modified: trunk/daimonin/src/daieditor/messages_sv.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_sv.properties 2007-01-26 17:25:26 UTC (rev 1720) +++ trunk/daimonin/src/daieditor/messages_sv.properties 2007-01-26 17:33:13 UTC (rev 1721) @@ -361,9 +361,7 @@ file.mnemonic=A fileDialog.title=\xD6ppna kart- eller scriptfiler fileDialog.filter.maps=Kartfiler -fileDialog.filter.python=Pythonscript fileDialog.filter.lua=Luascript -fileDialog.filter.png=PNG-bilder fileDialog.filter.arc=Arketypdefinitioner fileDialog.filter.anim=Animationdefinitioner Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2007-01-26 17:25:26 UTC (rev 1720) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2007-01-26 17:33:13 UTC (rev 1721) @@ -19,11 +19,14 @@ package net.sf.gridarta; +import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; +import net.sf.gridarta.gui.HideFileFilterProxy; import net.sf.gridarta.map.MapArchObject; import net.sf.gridarta.map.MapControl; import net.sf.japi.swing.ActionFactory; +import net.sf.japi.util.filter.file.EndingFileFilter; import org.apache.log4j.Logger; /** @@ -38,4 +41,7 @@ /** Logger. */ private static final Logger log = Logger.getLogger(AbstractMainControl.class); + /** Swing FileFilter for png graphics. */ + public static final FileFilter pngFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.png"), ".png")); + } // class AbstractMainControl Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2007-01-26 17:25:26 UTC (rev 1720) +++ trunk/src/app/net/sf/gridarta/messages.properties 2007-01-26 17:33:13 UTC (rev 1721) @@ -165,6 +165,7 @@ attribApply.text=Apply attribCancel.text=Cancel +fileDialog.filter.png=PNG Images fileDialog.filter.python=Python Scripts ############# Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2007-01-26 17:25:26 UTC (rev 1720) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2007-01-26 17:33:13 UTC (rev 1721) @@ -21,3 +21,6 @@ # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding arcDoc.htmlText=<html><head><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">{0}</h1><h3 style="colour:navy;">Funktionalität von {0}:</h3><p>{1}</p><h3 style="colour:navy;">Nutzungshinweise:</h3><p>{2}</p></body></html> + +fileDialog.filter.png=PNG-Grafiken +fileDialog.filter.python=Python-Skripte Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2007-01-26 17:25:26 UTC (rev 1720) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2007-01-26 17:33:13 UTC (rev 1721) @@ -21,3 +21,6 @@ # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding arcDoc.htmlText=<html><head><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Fonctionalit\xE9s de {0}</h3><p>{1}</p><h3 style="colour:navy;">Notes d'utilisation:</h3><p>{2}</p></body></html> + +fileDialog.filter.png=Images PNG +fileDialog.filter.python=Scripts python Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2007-01-26 17:25:26 UTC (rev 1720) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2007-01-26 17:33:13 UTC (rev 1721) @@ -21,3 +21,6 @@ # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding arcDoc.htmlText=<html><head><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Funktionalitet f\xF6r {0}</h3><p>{1}</p><h3 style="colour:navy;">Tips f\xF6r anv\xE4ndning:</h3><p>{2}</p></body></html> + +fileDialog.filter.png=PNG-bilder +fileDialog.filter.python=Pythonscript This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-26 19:03:42
|
Revision: 1723 http://svn.sourceforge.net/gridarta/?rev=1723&view=rev Author: christianhujer Date: 2007-01-26 11:03:40 -0800 (Fri, 26 Jan 2007) Log Message: ----------- Replaced non-constant String with StringBuilder. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-26 18:35:09 UTC (rev 1722) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-26 19:03:40 UTC (rev 1723) @@ -123,20 +123,21 @@ final String scriptPath = getScriptPath(); // trying to get the absolute path to scriptfile: - String path; + final StringBuilder tmpPath = new StringBuilder(); if (scriptPath.startsWith("/")) { // filepath is absolue (to map base directory): - path = mainControl.getMapDefaultFolder(); - path += scriptPath; + tmpPath.append(mainControl.getMapDefaultFolder()); + tmpPath.append(scriptPath); } else { // file path is relative to map dir - path = ScriptArchData.getLocalMapDir().getAbsolutePath(); - if (!path.endsWith("/")) { - path += '/'; // append slash to map dir + final String mapPath = ScriptArchData.getLocalMapDir().getAbsolutePath(); + tmpPath.append(mapPath); + if (!mapPath.endsWith("/")) { + tmpPath.append('/'); } - path += scriptPath; // append relative path to map dir - path = path.replace('\\', '/'); // make sure there's only one kind of slash + tmpPath.append(scriptPath); } + final String path = tmpPath.toString().replace('\\', '/'); // now see if that file really exists: final File scriptFile = new File(path); Modified: trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java 2007-01-26 18:35:09 UTC (rev 1722) +++ trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java 2007-01-26 19:03:40 UTC (rev 1723) @@ -51,7 +51,8 @@ /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); - private final GameObject event; // Our event object + /** The underlying game object that represents the event. */ + private final GameObject event; private static JTextField inputScriptPath; @@ -121,20 +122,21 @@ final String scriptPath = getScriptPath(); // trying to get the absolute path to scriptfile: - String path; + final StringBuilder tmpPath = new StringBuilder(); if (scriptPath.startsWith("/")) { // filepath is absolue (to map base directory): - path = mainControl.getMapDefaultFolder(); - path += scriptPath; + tmpPath.append(mainControl.getMapDefaultFolder()); + tmpPath.append(scriptPath); } else { // file path is relative to map dir - path = ScriptArchData.getLocalMapDir().getAbsolutePath(); - if (!path.endsWith("/")) { - path += '/'; // append slash to map dir + final String mapPath = ScriptArchData.getLocalMapDir().getAbsolutePath(); + tmpPath.append(mapPath); + if (!mapPath.endsWith("/")) { + tmpPath.append('/'); } - path += scriptPath; // append relative path to map dir - path = path.replace('\\', '/'); // make sure there's only one kind of slash + tmpPath.append(scriptPath); } + final String path = tmpPath.toString().replace('\\', '/'); // now see if that file really exists: final File scriptFile = new File(path); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-26 21:09:50
|
Revision: 1731 http://svn.sourceforge.net/gridarta/?rev=1731&view=rev Author: christianhujer Date: 2007-01-26 13:09:46 -0800 (Fri, 26 Jan 2007) Log Message: ----------- Corrected some constant conditions, especially regarding nullability. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java trunk/crossfire/src/cfeditor/gui/NewMapDialog.java trunk/crossfire/src/cfeditor/gui/ObjectChoiceDisplay.java trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gui/ArchetypeChooser.java trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java trunk/daimonin/src/daieditor/gui/NewMapDialog.java trunk/daimonin/src/daieditor/gui/ObjectChoiceDisplay.java trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/src/app/net/sf/gridarta/gameobject/Archetype.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -1253,7 +1253,7 @@ */ public void enterTileWanted(final int direction) { final String path = currentMap.getMapArchObject().getTilePath(direction); - if (path == null || path.length() == 0) { + if (path.length() == 0) { // tile direction not set (due to disabled menus this should normally not happen) ACTION_FACTORY.showMessageDialog(mainView, "enterTileNoTile"); } else { Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -271,9 +271,6 @@ /** {@inheritDoc} */ public void postParseGameObject(final GameObject gameObject, final int editType) { - if (gameObject.getArchetypeName() == null) { - return; - } final String text = gameObject.getObjectText(); final int len = text.length(); Modified: trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -24,7 +24,6 @@ import cfeditor.CSettings; import cfeditor.IGUIConstants; import cfeditor.gameobject.GameObject; -import cfeditor.map.MapArchObject; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; @@ -305,10 +304,6 @@ final GameObject gameObject = activeArch.getHead(); final Archetype archetype = gameObject.getArchetype(); - if (archetype == null) { // hm, this should NOT happen - System.err.println("trying to change a GameObject with null Archetype"); // TODO: use logging - return; - } final MapSquare mapSquare = gameObject.getMapSquare(); assert mapSquare != null; @@ -654,7 +649,7 @@ // no text, we try to set the default text final boolean hasMessage; - if (gameObject.getMsgText() == null && archetype != null) { + if (gameObject.getMsgText() == null) { archTextArea.setForeground(Color.black); if (archetype.getMsgText() == null) { archTextArea.setText(""); @@ -676,27 +671,19 @@ if (gameObject.getFaceName() != null) { // custom face archFaceField.setForeground(Color.blue); archFaceField.setText(gameObject.getFaceName()); - } else if (gameObject.getArchetypeName() != null) { + } else archFaceField.setForeground(Color.black); archFaceField.setText(archetype.getFaceName()); - } else { - archFaceField.setForeground(Color.black); - archFaceField.setText(""); - } // end face - if (gameObject.getAnimName() != null || archetype != null && archetype.getAnimName() != null) { + if (gameObject.getAnimName() != null || archetype.getAnimName() != null) { panelDesktop.setForegroundAt(3, Color.blue); } // *** OBJECT NAME *** - if (gameObject.getObjName() == null && archetype != null) { + if (gameObject.getObjName() == null) { archNameField.setForeground(Color.black); if (archetype.getObjName() == null) { // gameObject name - if (gameObject.getArchetypeName() != null) { - archNameField.setText(gameObject.getArchetypeName()); - } else { - archNameField.setText(""); - } + archNameField.setText(gameObject.getArchetypeName()); } else { // default name archNameField.setText(archetype.getObjName()); @@ -723,22 +710,14 @@ } if (gameObject.isInContainer()) { final GameObject cont = (GameObject) gameObject.getContainer(); - if (cont.getArchetypeName() != null) { - specialText.append(" (env: ").append(cont.getArchetypeName()).append(')'); - } else { - specialText.append(" (env: ><)"); - } + specialText.append(" (env: ").append(cont.getArchetypeName()).append(')'); } archMapPos.setText(specialText.toString()); final StringBuilder typeText = new StringBuilder(); - if (archetype != null) { - final CFArchType archType = mainControl.getTypeList().getType(gameObject); - typeText.append("Type: ").append(archType.getTypeName()).append(" (").append(archType.getTypeNr()).append(") [").append(gameObject.getArchetypeName()).append(']'); - } else { - typeText.append("Type: <unknown>"); - } + final CFArchType archType = mainControl.getTypeList().getType(gameObject); + typeText.append("Type: ").append(archType.getTypeName()).append(" (").append(archType.getTypeNr()).append(") [").append(gameObject.getArchetypeName()).append(']'); // check for multi tile if (gameObject.isMulti()) { @@ -755,8 +734,6 @@ final String faceName = gameObject.getFaceName(); if (faceName != null) { faceText.append(faceName.length() == 0 ? ">no face<" : faceName); - } else if (archetype == null) { - faceText.append(">no face<"); } else { final String archFaceName = archetype.getFaceName(); faceText.append(archFaceName == null ? ">no face<" : archFaceName); @@ -764,7 +741,7 @@ archFaceText.setText(faceText.toString()); String animName = gameObject.getAnimName(); - if (animName == null && archetype != null) { + if (animName == null) { animName = archetype.getAnimName(); } final StringBuilder animText = new StringBuilder("Animation: "); @@ -783,18 +760,14 @@ try { // Color.blue: the "special" attributes, differ from the default archetype StyleConstants.setForeground(currentAttributes, Color.blue); - if (gameObject.getObjectText() != null) { - document.insertString(document.getLength(), gameObject.getObjectText(), currentAttributes); - } + document.insertString(document.getLength(), gameObject.getObjectText(), currentAttributes); // document.insertString(document.getLength(), "ID#"+gameObject+ " inv#: "+gameObject.countInvObjects()+"\n", currentAttributes); // Color.black: the attributes from the default archetype // that don't exist among the "special" ones StyleConstants.setForeground(currentAttributes, Color.black); - if (gameObject.getObjectText() != null && archetype != null) { - document.insertString(document.getLength(), gameObject.diffArchText(archetype.getObjectText(), true), currentAttributes); - } + document.insertString(document.getLength(), gameObject.diffArchText(archetype.getObjectText(), true), currentAttributes); } catch (final BadLocationException e) { // TODO } Modified: trunk/crossfire/src/cfeditor/gui/NewMapDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/NewMapDialog.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/crossfire/src/cfeditor/gui/NewMapDialog.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -153,6 +153,7 @@ if (mapType == MapType.PICKMAP) { mapHeightField.setValue(IGUIConstants.DEF_PICKMAP_HEIGHT); } else { + //noinspection ConstantConditions assert mapType == MapType.GAMEMAP; mapHeightField.setValue(Integer.valueOf(settings.getProperty(DEFAULT_LEVEL_HEIGHT_KEY, String.valueOf(IGUIConstants.DEF_MAPSIZE)))); } Modified: trunk/crossfire/src/cfeditor/gui/ObjectChoiceDisplay.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ObjectChoiceDisplay.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/crossfire/src/cfeditor/gui/ObjectChoiceDisplay.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -22,7 +22,6 @@ import cfeditor.CMainControl; import cfeditor.gameobject.Archetype; import cfeditor.gameobject.GameObject; -import cfeditor.map.MapArchObject; import java.awt.Color; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; @@ -111,10 +110,10 @@ String objName = headObject.getObjName(); if (objName == null || objName.length() == 0) { final Archetype archetype = headObject.getArchetype(); - if (archetype == null || archetype == headObject) { + if (archetype == headObject) { objName = null; } else if ((objName = archetype.getObjName()) != null && objName.length() != 0) { - } else if ((objName = archetype.getArchetypeName()) != null && objName.length() != 0) { + } else if (objName.length() != 0) { } else { objName = null; } Modified: trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -252,7 +252,6 @@ final MapControl mapControl = mainControl.getCurrentMap(); assert mapControl != null; final MapCursor mapCursor = mapControl.getMapCursor(); - assert mapCursor != null; return mapCursor; } Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -210,7 +210,7 @@ /** {@inheritDoc} */ public boolean isPlainSaveEnabled() { final String mapFileName = getMapFileName(); - return mapFile != null && mapFileName != null && !mapFileName.equals(IGUIConstants.DEF_MAPFNAME); + return mapFile != null && !mapFileName.equals(IGUIConstants.DEF_MAPFNAME); } /** Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -1421,7 +1421,7 @@ exitPos.y = exit.getAttributeInt("sp"); final String path = exit.getAttributeString("slaying"); - if (path == null || path.length() == 0) { + if (path.length() == 0) { ACTION_FACTORY.showMessageDialog(mainView, "enterExitNoExit"); return; } @@ -1503,7 +1503,7 @@ return; // silently bail out if map is unsaved } } - if (d != null && (path.length() == 0 || currentMap.getMapFile() != null && newfile != null && newfile.equals(currentMap.getMapFile()))) { + if ((path.length() == 0 || currentMap.getMapFile() != null && newfile.equals(currentMap.getMapFile()))) { // path points to the same map if (d.x == 0 && d.y == 0) { ACTION_FACTORY.showMessageDialog(mainView, "enterExitNowhere"); Modified: trunk/daimonin/src/daieditor/gui/ArchetypeChooser.java =================================================================== --- trunk/daimonin/src/daieditor/gui/ArchetypeChooser.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/daimonin/src/daieditor/gui/ArchetypeChooser.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -94,11 +94,7 @@ setIcon(CMainControl.getNofaceTileIcon()); } else { final ImageIcon icon = CMainControl.getInstance().getArchetypeSet().getFace(archetype.getFaceRealName()); - if (icon == null) { - //setIcon(mainControl.nofaceTileIcon); - } else { - setIcon(icon); - } + setIcon(icon); } return this; Modified: trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java =================================================================== --- trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -23,7 +23,6 @@ import daieditor.CMainView; import daieditor.gameobject.Archetype; import daieditor.gameobject.GameObject; -import daieditor.map.MapArchObject; import daieditor.map.validation.ErrorCollector; import daieditor.map.validation.ErrorHandler; import java.awt.BorderLayout; @@ -331,10 +330,6 @@ final GameObject gameObject = activeArch.getHead(); final Archetype archetype = gameObject.getArchetype(); - if (archetype == null) { // hm, this should NOT happen - System.err.println("trying to change a GameObject with null Archetype"); // TODO: use logging - return; - } final MapSquare mapSquare = gameObject.getMapSquare(); assert mapSquare != null; @@ -398,9 +393,7 @@ /* check we have a face and set the real face obj for fast access */ final String face = gameObject.getAttributeString("face", false); // we have a new face name - if (face != null) { - gameObject.setRealFace(face); - } + gameObject.setRealFace(face); if (gameObject.getAttributeString("animation", false).length() > 0) { gameObject.setAnimName(gameObject.getAttributeString("animation", false)); } else { @@ -808,7 +801,7 @@ // no text, we try to set the default text final boolean hasMessage; - if (gameObject.getMsgText() == null && archetype != null) { + if (gameObject.getMsgText() == null) { archTextArea.setForeground(Color.black); if (archetype.getMsgText() == null) { archTextArea.setText(""); @@ -826,20 +819,16 @@ panelDesktop.setForegroundAt(1, hasMessage ? Color.blue : Color.black); // end msg text - if (gameObject.getAnimName() != null || archetype != null && archetype.getAnimName() != null) { + if (gameObject.getAnimName() != null || archetype.getAnimName() != null) { panelDesktop.setForegroundAt(3, Color.blue); } // *** OBJECT NAME *** - if (gameObject.getObjName() == null && archetype != null) { + if (gameObject.getObjName() == null) { archNameField.setForeground(Color.black); if (archetype.getObjName() == null) { // gameObject name - if (gameObject.getArchetypeName() != null) { - archNameField.setText(gameObject.getArchetypeName()); - } else { - archNameField.setText(""); - } + archNameField.setText(gameObject.getArchetypeName()); } else { // default name archNameField.setText(archetype.getObjName()); @@ -874,22 +863,14 @@ } if (gameObject.isInContainer()) { final GameObject cont = (GameObject) gameObject.getContainer(); - if (cont.getArchetypeName() != null) { - specialText.append(" (env: ").append(cont.getArchetypeName()).append(')'); - } else { - specialText.append(" (env: ><)"); - } + specialText.append(" (env: ").append(cont.getArchetypeName()).append(')'); } archMapPos.setText(specialText.toString()); final StringBuilder typeText = new StringBuilder(); - if (archetype != null) { - final CFArchType archType = mainControl.getTypeList().getType(gameObject); - typeText.append("Type: ").append(archType.getTypeName()).append(" (").append(archType.getTypeNr()).append(") [").append(gameObject.getArchetypeName()).append(']'); - } else { - typeText.append("Type: <unknown>"); - } + final CFArchType archType = mainControl.getTypeList().getType(gameObject); + typeText.append("Type: ").append(archType.getTypeName()).append(" (").append(archType.getTypeNr()).append(") [").append(gameObject.getArchetypeName()).append(']'); // check for multi tile if (gameObject.isMulti()) { @@ -930,7 +911,7 @@ archFaceText.setText(faceText.toString()); String animName = gameObject.getAnimName(); - if (animName == null && archetype != null) { + if (animName == null) { animName = archetype.getAnimName(); } final StringBuilder animText = new StringBuilder("Animation: "); @@ -949,18 +930,14 @@ try { // Color.blue: the "special" attributes, differ from the default archetype StyleConstants.setForeground(currentAttributes, Color.blue); - if (gameObject.getObjectText() != null) { - document.insertString(document.getLength(), gameObject.getObjectText(), currentAttributes); - } + document.insertString(document.getLength(), gameObject.getObjectText(), currentAttributes); // document.insertString(document.getLength(), "ID#"+gameObject+ " inv#: "+gameObject.countInvObjects()+"\n", currentAttributes); // Color.black: the attributes from the default archetype // that don't exist among the "special" ones StyleConstants.setForeground(currentAttributes, Color.black); - if (gameObject.getObjectText() != null && archetype != null) { - document.insertString(document.getLength(), gameObject.diffArchText(archetype.getObjectText(), true), currentAttributes); - } + document.insertString(document.getLength(), gameObject.diffArchText(archetype.getObjectText(), true), currentAttributes); } catch (final BadLocationException e) { // TODO } Modified: trunk/daimonin/src/daieditor/gui/NewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/NewMapDialog.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/daimonin/src/daieditor/gui/NewMapDialog.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -182,6 +182,7 @@ if (mapType == MapType.PICKMAP) { mapHeightField.setValue(IGUIConstants.DEF_PICKMAP_HEIGHT); } else { + //noinspection ConstantConditions assert mapType == MapType.GAMEMAP; mapHeightField.setValue(prefs.getInt(DEFAULT_LEVEL_HEIGHT_KEY, IGUIConstants.DEF_MAPSIZE)); } Modified: trunk/daimonin/src/daieditor/gui/ObjectChoiceDisplay.java =================================================================== --- trunk/daimonin/src/daieditor/gui/ObjectChoiceDisplay.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/daimonin/src/daieditor/gui/ObjectChoiceDisplay.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -22,7 +22,6 @@ import daieditor.CMainControl; import daieditor.gameobject.Archetype; import daieditor.gameobject.GameObject; -import daieditor.map.MapArchObject; import java.awt.Color; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; @@ -116,10 +115,10 @@ String objName = headObject.getObjName(); if (objName == null || objName.length() == 0) { final Archetype archetype = headObject.getArchetype(); - if (archetype == null || archetype == headObject) { + if (archetype == headObject) { objName = null; } else if ((objName = archetype.getObjName()) != null && objName.length() != 0) { - } else if ((objName = archetype.getArchetypeName()) != null && objName.length() != 0) { + } else if (objName.length() != 0) { } else { objName = null; } Modified: trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -252,7 +252,6 @@ final MapControl mapControl = mainControl.getCurrentMap(); assert mapControl != null; final MapCursor mapCursor = mapControl.getMapCursor(); - assert mapCursor != null; return mapCursor; } Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -170,7 +170,7 @@ * @return the pickmap to open as map, or <code>null</code> if "open * pickmap as map" is disabled */ - private MapControl getOpenPickmapMap() { + @Nullable private MapControl getOpenPickmapMap() { if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { return null; } @@ -189,7 +189,7 @@ * @return the pickmap to close, or <code>null</code> if "close active * pickmap" is disabled */ - private MapControl getClosePickmap() { + @Nullable private MapControl getClosePickmap() { if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { return null; } @@ -208,7 +208,7 @@ * @return the pickmap to save, or <code>null</code> if "save active * pickmap" is disabled */ - private MapControl getSavePickmap() { + @Nullable private MapControl getSavePickmap() { if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { return null; } @@ -227,7 +227,7 @@ * @return the pickmap to revert, or <code>null</code> if "revert active * pickmap" is disabled */ - private MapControl getRevertPickmap() { + @Nullable private MapControl getRevertPickmap() { if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { return null; } Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -220,7 +220,7 @@ /** {@inheritDoc} */ public boolean isPlainSaveEnabled() { final String mapFileName = getMapFileName(); - return mapFile != null && mapFileName != null && !mapFileName.equals(IGUIConstants.DEF_MAPFNAME); + return mapFile != null && !mapFileName.equals(IGUIConstants.DEF_MAPFNAME); } /** Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -42,11 +42,10 @@ /** * Get the name of this Archetype. + * All Archetypes have a name. * @return The name of this Archetype. - * @note For Archetypes this method must not return <code>null</code>. - * However, this method is currently also implemented by {@link GameObject}, where it may return <code>null</code>. */ - @Nullable String getArchetypeName(); + @NotNull String getArchetypeName(); /** * Returns an attribute value of this Archetype. Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-01-26 20:44:07 UTC (rev 1730) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-01-26 21:09:46 UTC (rev 1731) @@ -61,7 +61,7 @@ @NotNull private R archetype; /** The name of the Archetype associated with this GameObject or the Archetypes name itself if this GameObject is an Archetype. */ - @Nullable protected String archetypeName; + @NotNull protected String archetypeName; /** The name of this object. */ @Nullable protected String objName; @@ -562,7 +562,7 @@ * For an Archetype this method simply returns its name. * @return the name of the Archetype this GameObject is based on */ - @Nullable public String getArchetypeName() { + @NotNull public String getArchetypeName() { return archetypeName; } @@ -570,8 +570,8 @@ * Set the archetype name. * @param archetypeName the archetype name */ - public void setArchetypeName(final String archetypeName) { - this.archetypeName = archetypeName != null ? archetypeName.intern() : null; + public void setArchetypeName(@NotNull final String archetypeName) { + this.archetypeName = archetypeName.intern(); } /** {@inheritDoc} */ @@ -879,10 +879,9 @@ return archObjName; } else if (archetypeName != null && archetypeName.length() > 0) { return archetypeName; - } else if (archetype.getArchetypeName() != null) { + } else { return archetype.getArchetypeName(); } - return "???"; // this case should actually never happen } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-26 22:23:27
|
Revision: 1733 http://svn.sourceforge.net/gridarta/?rev=1733&view=rev Author: christianhujer Date: 2007-01-26 14:23:26 -0800 (Fri, 26 Jan 2007) Log Message: ----------- Added several missing @Nullable annotations. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CGUIUtils.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CSettings.java trunk/crossfire/src/cfeditor/PluginParameter.java trunk/crossfire/src/cfeditor/PluginParameterFactory.java trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java trunk/daimonin/src/daieditor/CGUIUtils.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java trunk/daimonin/src/daieditor/gui/map/MapTilePane.java trunk/daimonin/src/daieditor/map/validation/ValidationError.java trunk/src/app/net/sf/gridarta/data/NamedObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/CGUIUtils.java =================================================================== --- trunk/crossfire/src/cfeditor/CGUIUtils.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/crossfire/src/cfeditor/CGUIUtils.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -33,6 +33,7 @@ import javax.swing.JComponent; import javax.swing.JPanel; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; /** * <code>CGUtils</code> is a collection of GUI utility methods. @@ -62,7 +63,7 @@ * constants defined in IGUIConstants). * @return The image icon for the given icon name. */ - private static ImageIcon getResourceIcon(final String dirName, final String strIconName) { + @Nullable private static ImageIcon getResourceIcon(final String dirName, final String strIconName) { // first, look if this icon is already available in the Hashtable if (imageCache.containsKey(strIconName)) { return imageCache.get(strIconName); @@ -109,11 +110,11 @@ return icon; } - public static ImageIcon getIcon(final String strIconName) { + @Nullable public static ImageIcon getIcon(final String strIconName) { return getResourceIcon(IGUIConstants.ICON_DIR, strIconName); } - public static ImageIcon getSysIcon(final String strIconName) { + @Nullable public static ImageIcon getSysIcon(final String strIconName) { return getResourceIcon(IGUIConstants.SYSTEM_DIR, strIconName); } Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -573,12 +573,12 @@ } // ask arch panel which arches are selectd - public List<GameObject> getArchPanelSelection() { + @Nullable public List<GameObject> getArchPanelSelection() { return mainView.getArchPanelSelection(); } // ask arch panel which arch is highlighted - public GameObject getArchPanelHighlight() { + @Nullable public GameObject getArchPanelHighlight() { return mainView.getArchPanelHighlight(); } @@ -619,7 +619,7 @@ * Return name of the selected arch in arch panel. * @return name of selected arch in arch panel */ - public String getPanelArchName() { + @Nullable public String getPanelArchName() { return mainView.getPanelArch(); } @@ -859,7 +859,7 @@ * @param file mapfile * @return the map controller to manipulate this map */ - public MapControl openFile(final File file) { + @Nullable public MapControl openFile(final File file) { return openFile(file, true, null); } @@ -869,7 +869,7 @@ * @param show set to true to show the map in main view * @return the map controller to manipulate this map */ - public MapControl openFile(final File file, final boolean show) { + @Nullable public MapControl openFile(final File file, final boolean show) { return openFile(file, show, null); } @@ -1408,7 +1408,7 @@ * Returns all level windows that exist in the main view. * @return All level windows */ - List<MapViewIFrame> getAllLevelWindows() { + @Nullable List<MapViewIFrame> getAllLevelWindows() { return mainView.getAllLevelWindows(); } Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/crossfire/src/cfeditor/CMainView.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -401,7 +401,7 @@ return mapArchPanel.getMapArchPanelObject(); } - public GameObject getMapTileSelection() { + @Nullable public GameObject getMapTileSelection() { return selectedSquareControl.getMapTileSelection(); } @@ -430,7 +430,7 @@ * Return the name of the selected arch in arch panel. * @return name of selected arch in arch panel */ - public String getPanelArch() { + @Nullable public String getPanelArch() { return archPanel.getSelectedArch(); } Modified: trunk/crossfire/src/cfeditor/CSettings.java =================================================================== --- trunk/crossfire/src/cfeditor/CSettings.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/crossfire/src/cfeditor/CSettings.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -27,6 +27,7 @@ import java.util.Map; import java.util.Properties; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; /** * Static class that contains all the settings (properties) that are needed. @@ -131,7 +132,7 @@ * @param strDefaultValue the default value to use * @return Property value for the named key or <var>strDefaultValue</var> if the property is not set. */ - public synchronized String getProperty(final String strKey, final String strDefaultValue) { + @Nullable public synchronized String getProperty(final String strKey, final String strDefaultValue) { final String strValue = properties.getProperty(strKey); if (strValue == null) { if (strDefaultValue != null) { Modified: trunk/crossfire/src/cfeditor/PluginParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/PluginParameter.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/crossfire/src/cfeditor/PluginParameter.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -30,6 +30,7 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import org.jdom.Element; +import org.jetbrains.annotations.Nullable; /** * Parameter for a Plugin. @@ -130,7 +131,7 @@ setDescription("[description]"); } - @Override public Object clone() throws CloneNotSupportedException { + @Nullable @Override public Object clone() throws CloneNotSupportedException { return PluginParameterFactory.createParameter(toXML()); } Modified: trunk/crossfire/src/cfeditor/PluginParameterFactory.java =================================================================== --- trunk/crossfire/src/cfeditor/PluginParameterFactory.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/crossfire/src/cfeditor/PluginParameterFactory.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -63,7 +63,7 @@ throw new UnsupportedOperationException("Class PluginParameterFactory can not be instanciated"); } - public static PluginParameter createParameter(final Element parameterNode) { + @Nullable public static PluginParameter createParameter(final Element parameterNode) { return createParameter(parameterNode.getChildText("type"), parameterNode); } @@ -109,7 +109,7 @@ } } - public static PluginParameter createParameter() { + @Nullable public static PluginParameter createParameter() { return createParameter((String) null); } Modified: trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -22,6 +22,7 @@ import java.io.Serializable; import javax.swing.ImageIcon; import net.sf.gridarta.gameobject.anim.AbstractAnimationObject; +import org.jetbrains.annotations.Nullable; /** * A single animation object. @@ -52,7 +53,7 @@ } /** {@inheritDoc} */ - public ImageIcon getDisplayIcon() { + @Nullable public ImageIcon getDisplayIcon() { return null; // TODO } Modified: trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -85,7 +85,7 @@ } /** {@inheritDoc} */ - public ImageIcon getDisplayIcon() { + @Nullable public ImageIcon getDisplayIcon() { return getFace(); } @@ -107,7 +107,7 @@ return path; } - public ImageIcon getFace() { + @Nullable public ImageIcon getFace() { if (isLazyLoading) { return loadFace(); } else { Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -546,7 +546,7 @@ * @return the archetype name, or <code>null</code> if the event type is * invalid */ - public static String typeArchName(final int eventType) { + @Nullable public static String typeArchName(final int eventType) { if (eventType > 0 && eventType <= allEventTypes.length) { return "event_" + allEventTypes[eventType - 1]; } else { Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -161,7 +161,7 @@ * @return the pickmap to open as map, or <code>null</code> if "open * pickmap as map" is disabled */ - private MapControl getOpenPickmapMap() { + @Nullable private MapControl getOpenPickmapMap() { if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { return null; } @@ -180,7 +180,7 @@ * @return the pickmap to close, or <code>null</code> if "close active * pickmap" is disabled */ - private MapControl getClosePickmap() { + @Nullable private MapControl getClosePickmap() { if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { return null; } @@ -199,7 +199,7 @@ * @return the pickmap to save, or <code>null</code> if "save active * pickmap" is disabled */ - private MapControl getSavePickmap() { + @Nullable private MapControl getSavePickmap() { if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { return null; } @@ -218,7 +218,7 @@ * @return the pickmap to revert, or <code>null</code> if "revert active * pickmap" is disabled */ - private MapControl getRevertPickmap() { + @Nullable private MapControl getRevertPickmap() { if (control.isLockAllPickmaps() || !isLoadComplete() || !control.isPickmapActive()) { return null; } Modified: trunk/daimonin/src/daieditor/CGUIUtils.java =================================================================== --- trunk/daimonin/src/daieditor/CGUIUtils.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/daimonin/src/daieditor/CGUIUtils.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -25,6 +25,7 @@ import java.util.Map; import javax.swing.ImageIcon; import org.apache.log4j.Logger; +import org.jetbrains.annotations.Nullable; /** * <code>CGUtils</code> is a collection of GUI utility methods. @@ -55,7 +56,7 @@ * constants defined in IGUIConstants). * @return The image icon for the given icon name. */ - private static ImageIcon getResourceIcon(final String dirName, final String strIconName) { + @Nullable private static ImageIcon getResourceIcon(final String dirName, final String strIconName) { // first, look if this icon is already available in the Hashtable if (imageCache.containsKey(strIconName)) { return imageCache.get(strIconName); @@ -102,11 +103,11 @@ return icon; } - public static ImageIcon getIcon(final String strIconName) { + @Nullable public static ImageIcon getIcon(final String strIconName) { return getResourceIcon(IGUIConstants.ICON_DIR, strIconName); } - public static ImageIcon getSysIcon(final String strIconName) { + @Nullable public static ImageIcon getSysIcon(final String strIconName) { return getResourceIcon(IGUIConstants.SYSTEM_DIR, strIconName); } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -759,12 +759,12 @@ } // ask arch panel which arches are selectd - public List<GameObject> getArchPanelSelection() { + @Nullable public List<GameObject> getArchPanelSelection() { return mainView.getArchPanelSelection(); } // ask arch panel which arch is highlighted - public GameObject getArchPanelHighlight() { + @Nullable public GameObject getArchPanelHighlight() { return mainView.getArchPanelHighlight(); } @@ -805,7 +805,7 @@ * Return name of the selected arch in arch panel. * @return name of selected arch in arch panel */ - public String getPanelArchName() { + @Nullable public String getPanelArchName() { return mainView.getPanelArch(); } @@ -1837,7 +1837,7 @@ * Get controller of copybuffer. * @return Controller of copybuffer */ - public MapControl getCopyMapCtrl() { + @Nullable public MapControl getCopyMapCtrl() { return copybuffer.getCopyMapCtrl(); } @@ -1948,7 +1948,7 @@ * Get the icon of this file. * @return icon of this file */ - private ImageIcon getIcon() { + @Nullable private ImageIcon getIcon() { return mapPreviewAccessory.getMapIcon(new File(filename)); } Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/daimonin/src/daieditor/CMainView.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -359,7 +359,7 @@ mapArchPanel.setMapArchPanelObject(arch); } - public GameObject getMapTileSelection() { + @Nullable public GameObject getMapTileSelection() { return selectedSquareControl.getMapTileSelection(); } @@ -388,7 +388,7 @@ * Return the name of the selected arch in arch panel. * @return name of selected arch in arch panel */ - public String getPanelArch() { + @Nullable public String getPanelArch() { return archPanel.getSelectedArch(); } Modified: trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -222,7 +222,7 @@ * @param mapFile map file to get icon for * @return icon for file mapFile or <code>null</code> if the icon was neither cached nor loadable */ - public ImageIcon getMapIcon(final File mapFile) { + @Nullable public ImageIcon getMapIcon(final File mapFile) { return getCachedIcon(mapFile, icons, ".tile"); } @@ -231,7 +231,7 @@ * @param mapFile map file to get preview for * @return preview for file mapFile or <code>null</code> if the preview was neither cached nor loadable */ - private ImageIcon getMapPreview(final File mapFile) { + @Nullable private ImageIcon getMapPreview(final File mapFile) { return getCachedIcon(mapFile, previews, ".preview"); } Modified: trunk/daimonin/src/daieditor/gui/map/MapTilePane.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -734,7 +734,7 @@ } } - private TileMapHeader openMapFileHeader(final String path) { + @Nullable private TileMapHeader openMapFileHeader(final String path) { final File newfile; if (path.startsWith(File.pathSeparator) || path.startsWith("/")) { Modified: trunk/daimonin/src/daieditor/map/validation/ValidationError.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/ValidationError.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/daimonin/src/daieditor/map/validation/ValidationError.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -103,7 +103,7 @@ * {@inheritDoc} * The String representation of an error is its title. */ - @Override public String toString() { + @Nullable @Override public String toString() { return ACTION_FACTORY.getString(key + ".title"); } Modified: trunk/src/app/net/sf/gridarta/data/NamedObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/data/NamedObject.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/src/app/net/sf/gridarta/data/NamedObject.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -21,6 +21,7 @@ import java.io.Serializable; import javax.swing.ImageIcon; +import org.jetbrains.annotations.Nullable; /** * A <code>AbstractNamedObject</code> has a name and tree position source and provides an icon for display. @@ -63,7 +64,7 @@ * Get the display icon for this AbstractNamedObject. * @return display icon of this AbstractNamedObject */ - ImageIcon getDisplayIcon(); + @Nullable ImageIcon getDisplayIcon(); /** {@inheritDoc} */ int compareTo(NamedObject o); Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-01-26 21:16:36 UTC (rev 1732) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-01-26 22:23:26 UTC (rev 1733) @@ -874,6 +874,7 @@ final R archetype = getArchetype(); final String archObjName = archetype.getObjName(); if (objName != null && objName.length() > 0) { + assert objName != null; return objName; } else if (archObjName != null && archObjName.length() > 0) { return archObjName; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-27 02:36:16
|
Revision: 1734 http://svn.sourceforge.net/gridarta/?rev=1734&view=rev Author: akirschbaum Date: 2007-01-26 18:36:16 -0800 (Fri, 26 Jan 2007) Log Message: ----------- Fix memory leak when closing map windows. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/MapViewIFrame.java trunk/daimonin/src/daieditor/MapViewIFrame.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-01-26 22:23:26 UTC (rev 1733) +++ trunk/crossfire/ChangeLog 2007-01-27 02:36:16 UTC (rev 1734) @@ -1,3 +1,7 @@ +2007-01-27 Andreas Kirschbaum + + * Fix memory leak when closing map windows. + 2007-01-25 Andreas Kirschbaum * Do not crash when loading maps which reference undefined Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-26 22:23:26 UTC (rev 1733) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-27 02:36:16 UTC (rev 1734) @@ -31,8 +31,10 @@ import java.io.File; import java.io.IOException; import javax.swing.AbstractAction; +import javax.swing.AbstractButton; import javax.swing.JInternalFrame; import javax.swing.JViewport; +import javax.swing.MenuElement; import static javax.swing.KeyStroke.getKeyStroke; import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.gridarta.gui.map.MapGridListener; @@ -140,7 +142,7 @@ getContentPane().setLayout(new BorderLayout()); getContentPane().add(view, BorderLayout.CENTER); mapFileActions = null;//new MapFileActions(mainControl, mapControl); // XXX: uncomment this after JAPI can create multiple action sets - setJMenuBar(ACTION_FACTORY.createMenuBar(true, "mapwindow")); + setJMenuBar(ACTION_FACTORY.createMenuBar(false, "mapwindow")); mapControl.addMapControlListener(mapControlListener); mapControl.addMapModelListener(mapModelListener); @@ -153,10 +155,25 @@ view.closeNotify(); mapControl.removeMapControlListener(mapControlListener); mapControl.removeMapModelListener(mapModelListener); - setJMenuBar(null); + disposeMenuElement(getJMenuBar()); } /** + * Remove all actions attached to menu entries in a given menu element and + * its children. + * + * @param menuElement the menu element to process + */ + private static void disposeMenuElement(final MenuElement menuElement) { + for (final MenuElement child : menuElement.getSubElements()) { + disposeMenuElement(child); + if (child instanceof AbstractButton) { + ((AbstractButton) child).setAction(null); + } + } + } + + /** * Okay, this is a bit of a hack. True seperation of mapview and * frame-component would really mess up the code, or maybe make it * "cleaner" but blow things up tenfold. Modified: trunk/daimonin/src/daieditor/MapViewIFrame.java =================================================================== --- trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-01-26 22:23:26 UTC (rev 1733) +++ trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-01-27 02:36:16 UTC (rev 1734) @@ -30,10 +30,12 @@ import java.io.File; import java.io.IOException; import javax.swing.AbstractAction; +import javax.swing.AbstractButton; import static javax.swing.Action.SMALL_ICON; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JInternalFrame; +import javax.swing.MenuElement; import static javax.swing.KeyStroke.getKeyStroke; import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.gridarta.gui.map.MapGridListener; @@ -147,7 +149,7 @@ getContentPane().setLayout(new BorderLayout()); getContentPane().add(view, BorderLayout.CENTER); mapFileActions = null;//new MapFileActions(mainControl, mapControl); // XXX: uncomment this after JAPI can create multiple action sets - setJMenuBar(ACTION_FACTORY.createMenuBar(true, "mapwindow")); + setJMenuBar(ACTION_FACTORY.createMenuBar(false, "mapwindow")); final Image img = this.mapControl.getIconImage(); if (img != null) { setFrameIcon(new ImageIcon(img)); @@ -164,10 +166,25 @@ view.closeNotify(); mapControl.removeMapControlListener(mapControlListener); mapControl.removeMapModelListener(mapModelListener); - setJMenuBar(null); + disposeMenuElement(getJMenuBar()); } /** + * Remove all actions attached to menu entries in a given menu element and + * its children. + * + * @param menuElement the menu element to process + */ + private static void disposeMenuElement(final MenuElement menuElement) { + for (final MenuElement child : menuElement.getSubElements()) { + disposeMenuElement(child); + if (child instanceof AbstractButton) { + ((AbstractButton) child).setAction(null); + } + } + } + + /** * Okay, this is a bit of a hack. True seperation of mapview and * frame-component would really mess up the code, or maybe make it * "cleaner" but blow things up tenfold. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-27 02:43:01
|
Revision: 1735 http://svn.sourceforge.net/gridarta/?rev=1735&view=rev Author: akirschbaum Date: 2007-01-26 18:43:01 -0800 (Fri, 26 Jan 2007) Log Message: ----------- Prevent NullPointerException when creating a new script. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java trunk/src/app/net/sf/gridarta/textedit/textarea/TokenMarkerFactory.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-01-27 02:36:16 UTC (rev 1734) +++ trunk/crossfire/ChangeLog 2007-01-27 02:43:01 UTC (rev 1735) @@ -1,5 +1,7 @@ 2007-01-27 Andreas Kirschbaum + * Prevent NullPointerException when creating a new script. + * Fix memory leak when closing map windows. 2007-01-25 Andreas Kirschbaum Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java 2007-01-27 02:36:16 UTC (rev 1734) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java 2007-01-27 02:43:01 UTC (rev 1735) @@ -115,7 +115,7 @@ * @param title title of this script (filename) * @param file file where this script is stored, null if new script opened */ - public void addTab(final String title, final File file) { + public void addTab(final String title, @Nullable final File file) { final JEditTextArea ta = new JEditTextArea(); // open new TextArea //ta.setFont(new Font("Courier New", Font.PLAIN, 12)); ta.setDocument(new SyntaxDocument()); Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/TokenMarkerFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/TokenMarkerFactory.java 2007-01-27 02:36:16 UTC (rev 1734) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/TokenMarkerFactory.java 2007-01-27 02:43:01 UTC (rev 1735) @@ -22,6 +22,7 @@ import java.io.File; import java.util.HashMap; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * The class <code>TokenMarkerFactory</code> creates {@link TokenMarker} @@ -62,7 +63,11 @@ * * @return the created TokenMarker */ - @NotNull public static TokenMarker createTokenMarker(@NotNull final File file) { + @NotNull public static TokenMarker createTokenMarker(@Nullable final File file) { + if (file == null) { + return new EmptyTokenMarker(); + } + final String filename = file.getName(); final int dotIndex = filename.lastIndexOf('.'); if (dotIndex == -1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-30 21:12:34
|
Revision: 1737 http://svn.sourceforge.net/gridarta/?rev=1737&view=rev Author: akirschbaum Date: 2007-01-30 13:12:35 -0800 (Tue, 30 Jan 2007) Log Message: ----------- Fix memory leak in new map dialog. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/NewMapDialog.java trunk/daimonin/src/daieditor/gui/NewMapDialog.java Modified: trunk/crossfire/src/cfeditor/gui/NewMapDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/NewMapDialog.java 2007-01-28 18:54:09 UTC (rev 1736) +++ trunk/crossfire/src/cfeditor/gui/NewMapDialog.java 2007-01-30 21:12:35 UTC (rev 1737) @@ -39,6 +39,7 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; +import javax.swing.WindowConstants; import javax.swing.border.CompoundBorder; import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; @@ -100,6 +101,8 @@ /** JButton for cancel. */ private final JButton cancelButton = new JButton(ACTION_FACTORY.createAction(false, "mapCancel", this)); + private JDialog dialog = null; + /** * Constructs a new level dialog. Builds the dialog UI. * @param mainControl the controller of this dialog. @@ -169,12 +172,14 @@ public void mapOkay() { if (createNewLevel(this)) { setValue(okButton); + dialog.dispose(); } } /** Action method for cancel. */ public void mapCancel() { setValue(cancelButton); + dialog.dispose(); } /** @@ -270,11 +275,12 @@ */ public static void showNewMapDialog(final CMainControl mainControl, final Component parentComponent, final String filename, final MapType mapType) { final NewMapDialog pane = new NewMapDialog(mainControl, filename, mapType); - final JDialog dialog = pane.createDialog(parentComponent, ACTION_FACTORY.getString(mapType == MapType.PICKMAP ? "newPickmap.title" : "newMap.title")); - dialog.getRootPane().setDefaultButton(pane.okButton); - dialog.setModal(false); + pane.dialog = pane.createDialog(parentComponent, ACTION_FACTORY.getString(mapType == MapType.PICKMAP ? "newPickmap.title" : "newMap.title")); + pane.dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + pane.dialog.getRootPane().setDefaultButton(pane.okButton); + pane.dialog.setModal(false); - dialog.setVisible(true); + pane.dialog.setVisible(true); pane.mapNameField.selectAll(); pane.mapWidthField.selectAll(); pane.mapHeightField.selectAll(); Modified: trunk/daimonin/src/daieditor/gui/NewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/NewMapDialog.java 2007-01-28 18:54:09 UTC (rev 1736) +++ trunk/daimonin/src/daieditor/gui/NewMapDialog.java 2007-01-30 21:12:35 UTC (rev 1737) @@ -41,6 +41,7 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; +import javax.swing.WindowConstants; import javax.swing.border.CompoundBorder; import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; @@ -127,6 +128,8 @@ /** JButton for cancel. */ private final JButton cancelButton = new JButton(ACTION_FACTORY.createAction(false, "mapCancel", this)); + private JDialog dialog = null; + /** * Constructs a new level dialog. Builds the dialog UI. * @param mainControl the controller of this dialog. @@ -204,12 +207,14 @@ public void mapOkay() { if (createNewLevel(this)) { setValue(okButton); + dialog.dispose(); } } /** Action method for cancel. */ public void mapCancel() { setValue(cancelButton); + dialog.dispose(); } /** @@ -309,15 +314,16 @@ */ public static void showNewMapDialog(final CMainControl mainControl, final Component parentComponent, final String filename, final MapType mapType) { final NewMapDialog pane = new NewMapDialog(mainControl, filename, mapType); - final JDialog dialog = pane.createDialog(parentComponent, ACTION_FACTORY.getString(mapType == MapType.PICKMAP ? "newPickmap.title" : "newMap.title")); - dialog.getRootPane().setDefaultButton(pane.okButton); - dialog.setModal(false); + pane.dialog = pane.createDialog(parentComponent, ACTION_FACTORY.getString(mapType == MapType.PICKMAP ? "newPickmap.title" : "newMap.title")); + pane.dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + pane.dialog.getRootPane().setDefaultButton(pane.okButton); + pane.dialog.setModal(false); if (mapType != MapType.PICKMAP) { pane.setMapSizeDefault(true); } - dialog.setVisible(true); + pane.dialog.setVisible(true); pane.mapNameField.selectAll(); pane.mapWidthField.selectAll(); pane.mapHeightField.selectAll(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-31 18:21:54
|
Revision: 1738 http://svn.sourceforge.net/gridarta/?rev=1738&view=rev Author: akirschbaum Date: 2007-01-31 10:21:16 -0800 (Wed, 31 Jan 2007) Log Message: ----------- Fix memory leaks when closing map windows. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CScriptView.java trunk/crossfire/src/cfeditor/MapViewIFrame.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/MapViewIFrame.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/src/app/net/sf/gridarta/map/MapFileActions.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/Menu.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-30 21:12:35 UTC (rev 1737) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-31 18:21:16 UTC (rev 1738) @@ -791,7 +791,8 @@ mapControl.levelCloseNotify(); } else { // Notify the level about the closing - mapControl.levelCloseNotify(); + mapControl.removeMapGridListener(mainActions); + mapControl.removeMapCursorListener(mainActions); mainView.removeLevelView(mapControl.getMapViewFrame()); levels.remove(mapControl); @@ -801,6 +802,8 @@ } else { setCurrentLevel(null); } + + mapControl.levelCloseNotify(); } refreshMenusAndToolbars(); return true; Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2007-01-30 21:12:35 UTC (rev 1737) +++ trunk/crossfire/src/cfeditor/CMainView.java 2007-01-31 18:21:16 UTC (rev 1738) @@ -49,6 +49,7 @@ import javax.swing.JTabbedPane; import javax.swing.UIManager; import javax.swing.event.InternalFrameEvent; +import net.sf.gridarta.Menu; import net.sf.gridarta.gui.GSplitPane; import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.StatusBar; @@ -532,6 +533,7 @@ return; } + mapView.removeInternalFrameListener(this); mapViews.remove(mapView); mapDesktop.remove(mapView); // This is important: Removing a JInternalFrame from a JDesktopPane doesn't deselect it. @@ -741,7 +743,7 @@ */ private void rebuildWindowMenu() { final JMenu menuWindow = (JMenu) ACTION_FACTORY.find(getJMenuBar(), "window"); - menuWindow.removeAll(); + Menu.removeAll(menuWindow); menuWindow.add(aCloseAll); if (!mapViews.isEmpty()) { menuWindow.addSeparator(); Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2007-01-30 21:12:35 UTC (rev 1737) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2007-01-31 18:21:16 UTC (rev 1738) @@ -393,6 +393,14 @@ } /** + * Unregister a MapGridListener. + * @param listener MapGridListener to unregister + */ + public void removeMapGridListener(final MapGridListener listener) { + mapGrid.removeMapGridListener(listener); + } + + /** * Determines if this map has an active cursor. * * @return <code>true</code> if this map has an active cursor, Modified: trunk/crossfire/src/cfeditor/CScriptView.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptView.java 2007-01-30 21:12:35 UTC (rev 1737) +++ trunk/crossfire/src/cfeditor/CScriptView.java 2007-01-31 18:21:16 UTC (rev 1738) @@ -53,6 +53,7 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.filechooser.FileFilter; +import net.sf.gridarta.Menu; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.ReflectionAction; import org.apache.log4j.Logger; @@ -116,13 +117,7 @@ public synchronized void updateMenuEntries(final JMenu menu) { menuScripts = menu; - for (;;) { - final Component menuItem = menu.getMenuComponent(0); - if (menuItem == null || menuItem instanceof JSeparator) { - break; - } - menu.remove(0); - } + Menu.removeAllToSeparator(menu); final String[] scripts = ctrl.listScript(); final ArrayList<JMenuItem> visibleScripts = new ArrayList<JMenuItem>(); Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-30 21:12:35 UTC (rev 1737) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-31 18:21:16 UTC (rev 1738) @@ -36,6 +36,7 @@ import javax.swing.JViewport; import javax.swing.MenuElement; import static javax.swing.KeyStroke.getKeyStroke; +import net.sf.gridarta.Menu; import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.gridarta.gui.map.MapGridListener; import net.sf.gridarta.io.PathManager; @@ -152,28 +153,15 @@ * This function must be called when the view is closed. */ public void closeNotify() { + getContentPane().remove(view); view.closeNotify(); mapControl.removeMapControlListener(mapControlListener); mapControl.removeMapModelListener(mapModelListener); - disposeMenuElement(getJMenuBar()); + Menu.disposeMenuElement(getJMenuBar()); + //mapFileActions.closeNotify(); } /** - * Remove all actions attached to menu entries in a given menu element and - * its children. - * - * @param menuElement the menu element to process - */ - private static void disposeMenuElement(final MenuElement menuElement) { - for (final MenuElement child : menuElement.getSubElements()) { - disposeMenuElement(child); - if (child instanceof AbstractButton) { - ((AbstractButton) child).setAction(null); - } - } - } - - /** * Okay, this is a bit of a hack. True seperation of mapview and * frame-component would really mess up the code, or maybe make it * "cleaner" but blow things up tenfold. @@ -288,6 +276,14 @@ } /** + * Unregister a MapGridListener. + * @param listener MapGridListener to unregister + */ + public void removeMapGridListener(final MapGridListener listener) { + view.removeMapGridListener(listener); + } + + /** * Determines if this map has an active cursor. * * @return <code>true</code> if this map has an active cursor, Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-30 21:12:35 UTC (rev 1737) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-31 18:21:16 UTC (rev 1738) @@ -444,6 +444,14 @@ } /** + * Unregister a MapGridListener. + * @param listener MapGridListener to unregister + */ + public void removeMapGridListener(final MapGridListener listener) { + mapViewFrame.removeMapGridListener(listener); + } + + /** * Determines if this map has an active cursor. * * @return <code>true</code> if this map has an active cursor, Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-01-30 21:12:35 UTC (rev 1737) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-01-31 18:21:16 UTC (rev 1738) @@ -967,8 +967,6 @@ mainView.getPickmapChooserControl().closePickmap(mapControl); mapControl.levelCloseNotify(); } else { - // Notify the level about the closing - mapControl.levelCloseNotify(); while (mapControl.getMapViewFrame() != null) { mapControl.closeView(mapControl.getMapViewFrame()); } @@ -980,6 +978,7 @@ } else { setCurrentLevel(null); } + mapControl.levelCloseNotify(); } refreshMenusAndToolbars(); return true; Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2007-01-30 21:12:35 UTC (rev 1737) +++ trunk/daimonin/src/daieditor/CMainView.java 2007-01-31 18:21:16 UTC (rev 1738) @@ -50,6 +50,7 @@ import static javax.swing.JSplitPane.VERTICAL_SPLIT; import javax.swing.JTabbedPane; import javax.swing.event.InternalFrameEvent; +import net.sf.gridarta.Menu; import net.sf.gridarta.gui.GSplitPane; import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.StatusBar; @@ -485,6 +486,7 @@ public void removeLevelView(final MapViewIFrame mapView) { assert mapViews.contains(mapView); + mapView.removeInternalFrameListener(this); mapViews.remove(mapView); mapDesktop.remove(mapView); // This is important: Removing a JInternalFrame from a JDesktopPane doesn't deselect it. @@ -667,7 +669,7 @@ */ public void updateRecent(final List<CMainControl.Recent> recents) { final JMenu recentMenu = (JMenu) ACTION_FACTORY.find(getJMenuBar(), "recent"); - recentMenu.removeAll(); + Menu.removeAll(recentMenu); for (final CMainControl.Recent recent : recents) { recentMenu.add(recent); } @@ -678,7 +680,7 @@ */ private void rebuildWindowMenu() { final JMenu menuWindow = (JMenu) ACTION_FACTORY.find(getJMenuBar(), "window"); - menuWindow.removeAll(); + Menu.removeAll(menuWindow); menuWindow.add(aCloseAll); if (!mapViews.isEmpty()) { menuWindow.addSeparator(); Modified: trunk/daimonin/src/daieditor/CMapViewBasic.java =================================================================== --- trunk/daimonin/src/daieditor/CMapViewBasic.java 2007-01-30 21:12:35 UTC (rev 1737) +++ trunk/daimonin/src/daieditor/CMapViewBasic.java 2007-01-31 18:21:16 UTC (rev 1738) @@ -427,6 +427,14 @@ } /** + * Unregister a MapGridListener. + * @param listener MapGridListener to unregister + */ + public void removeMapGridListener(final MapGridListener listener) { + mapGrid.removeMapGridListener(listener); + } + + /** * Determines if this map has an active cursor. * * @return <code>true</code> if this map has an active cursor, Modified: trunk/daimonin/src/daieditor/MapViewIFrame.java =================================================================== --- trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-01-30 21:12:35 UTC (rev 1737) +++ trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-01-31 18:21:16 UTC (rev 1738) @@ -37,6 +37,7 @@ import javax.swing.JInternalFrame; import javax.swing.MenuElement; import static javax.swing.KeyStroke.getKeyStroke; +import net.sf.gridarta.Menu; import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.gridarta.gui.map.MapGridListener; import net.sf.gridarta.io.PathManager; @@ -163,28 +164,15 @@ * This function must be called when the view is closed. */ public void closeNotify() { + getContentPane().remove(view); view.closeNotify(); mapControl.removeMapControlListener(mapControlListener); mapControl.removeMapModelListener(mapModelListener); - disposeMenuElement(getJMenuBar()); + Menu.disposeMenuElement(getJMenuBar()); + //mapFileActions.closeNotify(); } /** - * Remove all actions attached to menu entries in a given menu element and - * its children. - * - * @param menuElement the menu element to process - */ - private static void disposeMenuElement(final MenuElement menuElement) { - for (final MenuElement child : menuElement.getSubElements()) { - disposeMenuElement(child); - if (child instanceof AbstractButton) { - ((AbstractButton) child).setAction(null); - } - } - } - - /** * Okay, this is a bit of a hack. True seperation of mapview and * frame-component would really mess up the code, or maybe make it * "cleaner" but blow things up tenfold. @@ -281,6 +269,14 @@ } /** + * Unregister a MapGridListener. + * @param listener MapGridListener to unregister + */ + public void removeMapGridListener(final MapGridListener listener) { + view.removeMapGridListener(listener); + } + + /** * Determines if this map has an active cursor. * * @return <code>true</code> if this map has an active cursor, Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-30 21:12:35 UTC (rev 1737) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-31 18:21:16 UTC (rev 1738) @@ -664,6 +664,14 @@ } /** + * Unregister a MapGridListener. + * @param listener MapGridListener to unregister + */ + public void removeMapGridListener(final MapGridListener listener) { + mapViewFrame.removeMapGridListener(listener); + } + + /** * Determines if this map has an active cursor. * * @return <code>true</code> if this map has an active cursor, Added: trunk/src/app/net/sf/gridarta/Menu.java =================================================================== --- trunk/src/app/net/sf/gridarta/Menu.java (rev 0) +++ trunk/src/app/net/sf/gridarta/Menu.java 2007-01-31 18:21:16 UTC (rev 1738) @@ -0,0 +1,85 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 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; + +import java.awt.Component; +import javax.swing.AbstractButton; +import javax.swing.JMenu; +import javax.swing.JSeparator; +import javax.swing.MenuElement; +import org.apache.log4j.Logger; + +/** + * Utility class implementing menu related functions. + */ +public class Menu { + + /** + * Private constructor to prevent instantiation. + */ + private Menu() { + } + + /** + * Remove all actions attached to menu entries in a given menu element and + * its children. + * + * @param menuElement the menu element to process + */ + public static void disposeMenuElement(final MenuElement menuElement) { + if (menuElement instanceof AbstractButton) { + ((AbstractButton) menuElement).setAction(null); + } + + for (final MenuElement child : menuElement.getSubElements()) { + disposeMenuElement(child); + } + } + + /** + * Remove all menu entries. + * + * @param menu the menu to remove the entries from + */ + public static void removeAll(final JMenu menu) { + for (final MenuElement child : menu.getSubElements()) { + disposeMenuElement(child); + } + } + + /** + * Remove all menu entries up to (but not including) the first separator. + * + * @param menu the menu to remove the entries from + */ + public static void removeAllToSeparator(final JMenu menu) { + for (;;) { + final Component menuItem = menu.getMenuComponent(0); + if (menuItem == null || menuItem instanceof JSeparator) { + break; + } + menu.remove(0); + if (menuItem instanceof MenuElement) { + disposeMenuElement((MenuElement) menuItem); + } + } + } + +} // class Menu Property changes on: trunk/src/app/net/sf/gridarta/Menu.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/map/MapFileActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapFileActions.java 2007-01-30 21:12:35 UTC (rev 1737) +++ trunk/src/app/net/sf/gridarta/map/MapFileActions.java 2007-01-31 18:21:16 UTC (rev 1738) @@ -152,6 +152,19 @@ } /** + * Unregister all registered listeners. Must be called when this instance + * is freed. + */ + public void closeNotify() { + if (mapControl == null) { + mainControl.removeMainControlListener(mainControlListener); + } + if (currentMap != null) { + currentMap.removeMapControlListener(mapControlListener); + } + } + + /** * Update the enabled/disabled state of all actions. */ private void updateActions() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-02-01 01:20:31
|
Revision: 1742 http://svn.sourceforge.net/gridarta/?rev=1742&view=rev Author: akirschbaum Date: 2007-01-31 17:20:32 -0800 (Wed, 31 Jan 2007) Log Message: ----------- Cleanup/unify text messages; add some more German translations. Modified Paths: -------------- trunk/crossfire/src/cfeditor/messages.properties trunk/crossfire/src/cfeditor/messages_de.properties trunk/crossfire/src/cfeditor/messages_fr.properties trunk/crossfire/src/cfeditor/messages_sv.properties trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties trunk/daimonin/src/daieditor/messages_fr.properties trunk/daimonin/src/daieditor/messages_sv.properties trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2007-01-31 22:10:03 UTC (rev 1741) +++ trunk/crossfire/src/cfeditor/messages.properties 2007-02-01 01:20:32 UTC (rev 1742) @@ -38,6 +38,9 @@ mapDirDoesntExist.title=Invalid map directory mapDirDoesntExist.message=The map directory "{0}" doesn''t exist.\nPlease select menu ''File->Options...'' and correct that. +closeLevelNullLevel.title=Close map +closeLevelNullLevel.message=Map does not exist: {1}; number of existing maps: {0}. + openFileWantedNoArches.title=Cannot open map openFileWantedNoArches.message=There are currently no arches avaliable!\nYou need to have arches loaded before opening a map. openFileWantedNotReady.title=Cannot open map @@ -55,11 +58,6 @@ enterExitNotSaved.title=Map not saved enterExitNotSaved.message=You must save the map first to follow a relative path. -importSpellsSuccess.title=Collect spells -importSpellsSuccess.message=Successfully collected {0} spells. -importSpellsFailed.title=Collect spells -importSpellsFailed.message=Collecting spells failed!\nMaybe the specified file is of wrong format. - openScriptNotFound.title=Script file not found openScriptNotFound.message=The file ''{0}'' does not exist.\nPlease correct the path. @@ -95,9 +93,13 @@ mapBottom=Bottom +##################### +# Preference Modules + # Options optionsImageSet=Image Set + ####### # File @@ -115,6 +117,7 @@ open.longdescription=Loads a new map from a map file open.mnemonic=O open.accel=ctrl pressed O +open.error.text=Error while loading options.text=Options... options.shortdescription=Shows options @@ -335,9 +338,9 @@ ######### # Analyze + analyze.text=Analyze analyze.mnemonic=Y - enabled.text= @@ -374,6 +377,7 @@ resetView.text=Reset view resetView.mnemonic=R + ######### # Plugins Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2007-01-31 22:10:03 UTC (rev 1741) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2007-02-01 01:20:32 UTC (rev 1742) @@ -48,259 +48,53 @@ collectTemplistAutodelete.title=Karte {0} laden collectTemplistAutodelete.message=Die Karte enth\xE4lt {1} Objekte, die die\nfolgenden unbekannten Archetypen verwenden:\n{2}\nSollen diese Objekte gel\xF6scht werden? -openAttrDialogNoTypes.title=Datei fehlt -openAttrDialogNoTypes.message=Die Konfigurationsdatei \"types.xml\" fehlt. Der Dialog zum \xC4ndern von Object-Attributen funktioniert nicht ohne diese Datei. -openAttrDialogNoDefaultArch.title=Attribute \xE4ndern -openAttrDialogNoDefaultArch.message=Attribute von Objekten ohne Archetype k\xF6nnen nicht ge\xE4ndert werden. -encodeMapFile.title=Fehler beim Sichern -encodeMapFile.message=Beim Sichern von {0}\nist ein Fehler aufgetreten:\n{1} - -createImageIOException.title=Kann Bild nicht erzeugen -createImageIOException.message=Das Bild kann nicht erzeugt werden, da ein Ein-/Ausgabefehler\nbeim Schreiben von {0} aufgetreten ist:\n{1} - -collectTemplistAutodelete.title=Karte {0} laden -collectTemplistAutodelete.message=Die Karte enth\xE4lt {1} Objekte, die die\nfolgenden unbekannten Archetypen verwenden:\n{2}\nSollen diese Objekte gel\xF6scht werden? - -treasurelistForbidden.title=Ung\xFCltige Auswahl -treasurelistForbidden.message=Die Schatzliste {0} darf in Karten nicht verwendet werden.\nSie wird vom Crossfire-Server intern verwendet. - -enterExitNoExit.title=Ausgang nicht gefunden -enterExitNoExit.message=Die Auswahl enth\xE4lt keinen Ausgang. -enterExitNowhere.title=Ziel ung\xFCltig -enterExitNowhere.message=Der Ausgang besitzt keine Zielkoordinaten. -enterExitOutside.title=Ziel ung\xFCltig -enterExitOutside.message=Der Ausgang besitzt Zielkoordinaten au\xDFerhalb der Karte. -enterExitInvalidPath.title=Ung\xFCltiger Pfad -enterExitInvalidPath.message=Der Ausgang zeigt auf einen ung\xFCltigen Dateinamen. enterExitRandomDestination.title=Ziel ung\xFCltig enterExitRandomDestination.message=Der Ausgang zeigt auf eine zuf\xE4llig generierte Karte. enterExitNotSaved.title=Karte nicht gesichert enterExitNotSaved.message=Der Ausgang verwendet einen relativen Dateinamen. Um ihm zu folgen m\xFCssen Sie die Karte vorher sichern. -importSpellsSuccess.title=Zauberspr\xFCche sammeln -importSpellsSuccess.message={0} Zauberspr\xFCche geladen. -importSpellsFailed.title=Zauberspr\xFCche sammeln -importSpellsFailed.message=Das Sammeln der Zauberspr\xFCche ist fehlgeschlagen.\nEvtl. ist das Dateiformat falsch? - -createNewEventNoMapPath.title=Kann Script-Pfad nicht ermitteln -createNewEventNoMapPath.message=Kann Script-Pfad nicht ermitteln, da die Karte noch nicht gespeichert ist. - openScriptNotFound.title=Script-Datei nicht gefunden openScriptNotFound.message=Die Datei ''{0}'' existiert nicht.\nBitte geben sie einen g\xFCltigen Dateinamen an. -enterTileNoTile.title=Ziel ung\xFCltig -enterTileNoTile.message=In die angegebene Richtung existiert kein Verbindungspfad. +# Treasure lists +treasurelistForbidden.title=Ung\xFCltige Auswahl +treasurelistForbidden.message=Die Schatzliste {0} darf in Karten nicht verwendet werden.\nSie wird vom Crossfire-Server intern verwendet. -revertPickmapGone.title=Kann \xC4nderungen nicht zur\xFCcknehmen -revertPickmapGone.message=F\xFCr die Pickmap ''{0}'' existiert keine Datei. - -confirmClosePickmap.title=Pickmap schlie\xDFen? -confirmClosePickmap.message=Die letzten \xC4nderungen gehen verloren,\nwenn Sie die Pickmap ''{0}'' schlie\xDFen.\nSind Sie sicher, dass Sie das wollen? - -confirmDeletePickmap.title=Pickmap l\xF6schen? -confirmDeletePickmap.message=Die Pickmap ''{0}'' wurde geschlossen.\nWollen Sie auch die Datei ''{1}'' l\xF6schen?\nDies wird die Pickmap endg\xFCltig l\xF6schen. - -confirmSaveChanges.title=\xC4nderungen sichern? -confirmSaveChanges.message=Wollen Sie die \xC4nderungen der Karte {0} sichern? - -confirmCreatePickmap.title=Kann pickmap nicht \xF6ffnen -confirmCreatePickmap.message=F\xFCr die Pickmap ''{0}'' existiert noch keine Datei.\nWollen Sie diese Datei durch Speichern der Pickmap erstellen? - -confirmRevertMap.title=\xC4nderungen in Karte zur\xFCcknehmen -confirmRevertMap.message=Die letzten \xC4nderungen der Karte ''{0}''\ngehen verloren, wenn Sie die Datei neu laden.\nSind Sie sicher, dass die das wollen? - -confirmRevertPickmap.title=\xC4nderungen in Pickmap zur\xFCcknehmen? -confirmRevertPickmap.message=Die letzten \xC4nderungen in der Pickmap ''{0}''\ngehen verlosen, wenn Sie die Datei neu laden.\nSind Sie sicher, dass die das wollen? - # New Map -newMap.title=Neue Karte erstellen -newPickmap.title=Neue Pickmap erstellen -newMapMapName=Name: -newMapParameters=Parameter -newMapPickmapName=Name: -newMapDimensionOutOfRange.title=Ung\xFCltiger Wert -newMapDimensionOutOfRange.message=Die Kartengr\xF6\xDFe muss positiv sein -newMapDimensionNotANumber.title=Ung\xFCltiger Wert -newMapDimensionNotANumber.message=Die Kartengr\xF6\xDFe muss ganzzahlig sein. -newMapNoName.title=Kartenname fehlt -newMapNoName.message=Der Kartenname fehlt. Jede Karte muss einen Namen besitzen.\nEr wird in-game verwendet und sollte die Karte beschreiben.\nKartennamen m\xFCssen nicht eindeutig sein. -newPickmapNoName.title=Pickmap fehlt -newPickmapNoName.message=Der Pickmapname fehlt. Es ist ein eindeutiger Name erforderlich. - -mapTitle={0} ({1}) - Karteneigenschaften -mapName=Name -mapRegion=Region -mapWidth=Breite -mapHeight=H\xF6he -mapOutdoor=Im Freien -mapFixedReset=Fixer Reset -mapEnterX=Startpunkt X -mapEnterY=Startpunkt Y -mapDifficulty=Schwierigkeit -mapDarkness=Dunkelheit -mapSwapTime=Swap-Zeit -mapNosmooth=Ohne Bild\xFCberg\xE4ng -mapUnique=Permanente Karte -mapResetTimeout=Reset-Zeit -mapNorth=Norden -mapEast=Osten -mapSouth=S\xFCden -mapWest=Westen -mapTop=Oben -mapBottom=Unten - -mapHelp.text=Hilfe -mapOkay.text=OK -mapRestore.text=Zur\xFCcksetzen -mapCancel.text=Abbrechen - -mapMapTabTitle=Karte mapParametersTabTitle=Parameter -mapTextTabTitle=Beschreibung -mapLoreTabTitle=Geschichte -mapTilesTabTitle=Verbindungspfade mapShopTabTitle=Gesch\xE4ft mapWeatherTabTitle=Wetter +mapTextTabTitle=Beschreibung +mapLoreTabTitle=Geschichte +mapErrorInvalidDarkness.title=Ung\xFCltiger Wert +mapErrorInvalidDarkness.message=Die Dunkelheit muss zwischen 0 und 5 liegen. +mapRegion=Region +mapUnique=Permanente Karte +mapOutdoor=Im Freien +mapNosmooth=Ohne Bild\xFCberg\xE4ng +mapShopType=Typ +mapShopGreed=Geldgier mapLowerPriceLimit=Mindestpreis mapUpperPriceLimit=Maximalpreis -mapShopGreed=Geldgier mapShopRace=Rasse -mapShopType=Typ - -mapHumidity=Luftfeuchte -mapPressure=Luftdruck -mapSkySetting=Wetterbedingung mapTemperature=Temperatur -mapWindDirection=Windrichtung +mapPressure=Luftdruck +mapHumidity=Luftfeuchte mapWindSpeed=Windgeschwindigkeit +mapWindDirection=Windrichtung +mapSkySetting=Wetterbedingung +mapTop=Oben +mapBottom=Unten -mapErrorMissingMapName.title=Kartenname fehlt -mapErrorMissingMapName.message=Dar Kartenname muss angegeben werden. -mapErrorIllegalSize.title=Ung\xFCltiger Wert -mapErrorIllegalSize.message=Die Kartengr\xF6\xDFe muss positiv sein. -mapErrorInvalidDarkness.title=Ung\xFCltiger Wert -mapErrorInvalidDarkness.message=Die Dunkelheit muss zwischen 0 und 5 liegen. -mapErrorInvalidEntry.title=Ung\xFCltiger Wert -mapErrorInvalidEntry.message=Ung\xFCltiger Wert:\n{0} -nameOfAnimationObject=Animation -nameOfFaceObject=Bild -pickmapExists.title=Kann Pickmap nicht erstellen -pickmapExists.message=Die Pickmap ''{0}'' existiert bereits.\nSie m\xFCssen die existierende Pickmap erst l\xF6schen oder einen anderen Namen w\xE4hlen. - -#replace -replaceOk.text=OK -replaceCancel.text=Abbrechen -replaceTitle=Ersetze -replaceOn=In -replaceOnMap=der ganzen Karte -replaceOnSelection=der Auswahl auf -replaceDelete=l\xF6sche Objekte mit -replaceBy=und ersetze durch -replaceByObject=Objekt -replaceByPickmap=Pickmap -replaceByNothing=nichts (=l\xF6schen) - -replaceMapGone.title=Karte nicht mehr verf\xFCgbar -replaceMapGone.message=Karte {0} ist nicht mehr verf\xFCgbar.\n -replaceMapNoSelection.title=Keine Selektion -replaceMapNoSelection.message=Ich kann ohne Selektion keine selektierten Felder\nauf der Karte "{0}" ersetzen. -replacedZero.title=Ersetzung fehlgeschlagen -replacedZero.message=Keine passenden Objekte gefunden. -replacedOne.title=Ersetzung erfolgreich -replacedOne.message=1 Objekt ersetzt. -replacedMany.title=Ersetzung erfolgreich -replacedMany.message={0} Objekte ersetzt. - -#attribute dialog -attribTitle=Objektattribute -attribHelp.text=Hilfe -attribSummary.text=Zusammenfassung -attribEdit.text=Bearbeiten -attribOk.text=Ok -attribApply.text=Anwenden -attribCancel.text=Abbrechen - -fileDialog.filter.python=Python-Skripte - -chooseNamedObject.title=Auswahl von {0} -archCollectArches=Sammle Archetypen... -archCollectErrorIOException.title=Fehler beim Sammeln -archCollectErrorIOException.message=Fehler beim Sammeln: In {0} ist ein Ein-/Ausgabefehler ist aufgetreten:\n{1} -dialogDontShowAgain=Diesen Dialog n\xE4chstes Mal wieder anzeigen. - -############# -# Status Bar -memory=({0}/{1}) Speicher: {2} belegt, {3} frei, {4} gesamt. - -################## -# Status Messages - -statusMouseOff=Mouse x:{0,number,integer} y:{1,number,integer} Maus nicht auf Karte -statusMouseOn=Mouse x:{0,number,integer} y:{1,number,integer} Karte x:{2,number,integer} y:{3,number,integer} -statusSelect=Cursor x:{0,number,integer} y:{1,number,integer} Offset x:{2,number,integer} y:{3,number,integer} -statusNormal=Cursor x:{0,number,integer} y:{1,number,integer} -statusCursorOff=Maus nicht auf Karte - -# Edit -undo.text=R\xFCckg\xE4ngig -undo.name=R\xFCckg\xE4ngig {0} -undo.shortdescription=Letze Aktion zur\xFCcknehmen -undo.longdescription=Nimmt die letzte durchgef\xFChrte Aktion zur\xFCck. -undo.mnemonic=R -undo.accel=ctrl pressed Z - -redo.text=Wiederholen -redo.name=Wiederholen {0} -redo.shortdescription=Letze Aktion wiederholen -redo.longdescription=Wiederholt die letzte durchgef\xFChrte Aktion. -redo.mnemonic=W -redo.accel=ctrl pressed Y - -################# -# Map Arch Panel - -mapArchApply.text=Anwenden -mapArchApply.shortdescription=\xDCbernimmt die \xC4nderungen - -mapArchAttrib.text=Attribute -mapArchAttrib.shortdescription=\xD6ffnet den Attribute-Dialog - -mapArchAddInv.text=Einf\xFCgen -mapArchAddInv.shortdescription=F\xFCgt ein Objekt zum Inventory hinzu - -scriptAddNew.text=Script hinzuf\xFCgen -scriptEditData.text=Daten \xE4ndern -scriptEdit.text=Script \xE4ndern -scriptRemove.text=Script l\xF6schen - ##################### # Preference Modules -prefsRes.title=Pfade & Ressourcen -prefsGUI.title=Aussehen - - # Options - -optionsLanguage=Sprache -optionsLayout=Layout-Einstellungen -optionsSepMapTile.text=Map-Tile-Panel unten anzeigen -optionsSepMapTile.shortdescription=Map-Tile-Panel unten (anstatt rechts) anzeigen -optionsLoadArchColl.text=Vorbereitete Archetypen laden -optionsGlobal=Global -optionsResPaths=Pfade -optionsResArch=Archetypen -optionsResArch.shortdescription=Dateiname der Archetypen-Datei -optionsResMaps=Karten -optionsResMaps.shortdescription=Verzeichnis f\xFCr Karten -optionsResScripts=Skripte -optionsResScripts.shortdescription=Verzeichnis f\xFCr Scripte optionsImageSet=Image Set -optionsRestart.title=Warnung -optionsRestart.message=Viele Optionen erfordern einen Programmneustart, um effektiv zu werden. + ####### # File @@ -318,35 +112,8 @@ open.longdescription=L\xE4dt eine Karte aus einer Datei open.mnemonic=F open.accel=ctrl pressed O +open.error.text=Fehler beim Laden -close.text=Schie\xDFen -close.shortdescription=Karte schlie\xDFen -close.longdescription=Schlie\xDFt die aktuelle Karte -close.mnemonic=C -close.accel=ctrl pressed W - -save.text=Speichern -save.shortdescription=Karte speichern -save.longdescription=Speichert die aktuelle Karte -save.mnemonic=S -save.accel=ctrl pressed S - -saveAs.text=Speichern als... -saveAs.shortdescription=Karte mit neuem Namen speichern -saveAs.longdescription=Speichert die Karte unter einem neuen Namen -saveAs.mnemonic=A -saveAs.accel=ctrl shift pressed S - -revert.text=Zur\xFCcksetzen -revert.shortdescription=Zuletzt gespeicherte Fassung -revert.longdescription=Macht alle \xC4nderungen r\xFCckg\xE4ngig und stellt die zuletzt gespeicherte Fassung wieder her -revert.mnemonic=R - -createImage.text=Bild speichern... -createImage.shortdescription=Bild der Karte speichern -createImage.longdescription=Erzeugt ein Foto der Karte und speichert es -createImage.mnemonic=I - options.text=Optionen... options.shortdescription=Optionen zeigen options.longdescription=Zeigt einen Dialog mit den Editoreinstellungen Modified: trunk/crossfire/src/cfeditor/messages_fr.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_fr.properties 2007-01-31 22:10:03 UTC (rev 1741) +++ trunk/crossfire/src/cfeditor/messages_fr.properties 2007-02-01 01:20:32 UTC (rev 1742) @@ -25,61 +25,77 @@ mainWindow.title=Gridarta for Crossfire # Dialogs +#overwriteOtherFile.title= overwriteOtherFile.message=Un fichier nomm\xE9 "{0}" existe d\xE9j\xE0.\n\nVoulez vous vraiment le remplacer? -mapTitle={0} ({1}) - Propri\xE9t\xE9s de la carte +#collectArchesNotReady.title= +#collectArchesNotReady.message= -#replace -replaceTitle=Remplacer -replaceOn=Dans -replaceOnMap=toute la carte -replaceOnSelection=les cases s\xE9lectionn\xE9es -replaceDelete=delete objects with -replaceBy=et remplace par -replaceByObject=objet -replaceByNothing=rien +#mapDirDoesntExist.title= +#mapDirDoesntExist.message= -replaceMapGone.message=La carte {0} n'est plus disponible.\n -replaceMapNoSelection.message=Vous avez choisi de remplacer les cases s\xE9lectionn\xE9es de la \ncarte \"{0}\", mais il n'y a pas de s\xE9lection. -replacedZero.message=Aucun objet correspondant trouv\xE9. -replacedOne.message=1 L'objet a \xE9t\xE9 remplac\xE9. -replacedMany.message={0} Les objets ont \xE9t\xE9 remplac\xE9s. +#closeLevelNullLevel.title= +#closeLevelNullLevel.message= -fileDialog.filter.python=Scripts python +#openFileWantedNoArches.title= +#openFileWantedNoArches.message= +#openFileWantedNotReady.title= +#openFileWantedNotReady.message= +#openFileWantedIOException.title= +#openFileWantedIOException.message= +#openFileWantedOutOfMemory.title= +#openFileWantedOutOfMemory.message= -############# -# Status Bar -memory=({0}/{1}) M\xE9moire: {2} utilis\xE9e, {3} libre, {4} total +#collectTemplistAutodelete.title= +#collectTemplistAutodelete.message= -################## -# Status Messages +#enterExitRandomDestination.title= +#enterExitRandomDestination.message= +#enterExitNotSaved.title= +#enterExitNotSaved.message= -statusMouseOff=Souris hors de la carte -statusSelect=Souris x:{0,number,integer} y:{1,number,integer} Carte x:{2,number,integer} y:{3,number,integer} Selectionn\xE9 x:{4,number,integer} y:{5,number,integer} -statusNormal=Souris x:{0,number,integer} y:{1,number,integer} Carte x:{2,number,integer} y:{3,number,integer} +#openScriptNotFound.title= +#openScriptNotFound.message= -# Edit -undo.text=Annuler -undo.shortdescription=Annuler la derni\xE8re action -undo.longdescription=Annule la derni\xE8re action si cela est possible -undo.mnemonic=U -undo.accel=ctrl pressed Z +# Treasure lists +#treasurelistForbidden.title= +#treasurelistForbidden.message= -redo.text=R\xE9p\xE9ter -redo.shortdescription=R\xE9p\xE9ter la derni\xE8re action annul\xE9e -redo.longdescription=R\xE9p\xE8te la derni\xE8re action annul\xE9e si cela est possible -redo.mnemonic=R -redo.accel=ctrl pressed Y +# Map Properties +#mapParametersTabTitle= +#mapShopTabTitle= +#mapWeatherTabTitle= +#mapTextTabTitle= +#mapLoreTabTitle= +#mapErrorInvalidDarkness.title= +#mapErrorInvalidDarkness.message= -################# -# Map Arch Panel +#mapRegion= +#mapUnique= +#mapOutdoor= +#mapNosmooth= +#mapShopType= +#mapShopGreed= +#mapUpperPriceLimit= +#mapLowerPriceLimit= +#mapShopRace= +#mapTemperature= +#mapPressure= +#mapHumidity= +#mapWindSpeed= +#mapWindDirection= +#mapSkySetting= +#mapTop= +#mapBottom= + ##################### # Preference Modules - # Options +#optionsImageSet= + ####### # File @@ -97,35 +113,8 @@ open.longdescription=Ouvre une carte \xE0 partir d'un fichier open.mnemonic=O open.accel=ctrl pressed O +open.error.text=Erreur lors du chargement. -close.text=Fermer -close.shortdescription=Fermer la carte -close.longdescription=Ferme la carte active -close.mnemonic=F -close.accel=ctrl pressed W - -save.text=Enregistrer -save.shortdescription=Enregistrer la carte -save.longdescription=Enregistre la carte active -save.mnemonic=E -save.accel=ctrl pressed S - -saveAs.text=Enregistrer sous... -saveAs.shortdescription=Enregistrer la carte sous un nouveau nom -saveAs.longdescription=Enregistre la carte dans un fichier portant un nom diff\xE9rent -saveAs.mnemonic=S -saveAs.accel=ctrl shift pressed S - -revert.text=Restaurer -revert.shortdescription=Restaure la carte -revert.longdescription=Restaure la carte selon la derni\xE8re version enregistr\xE9e -revert.mnemonic=R - -createImage.text=Cr\xE9er image -createImage.shortdescription=Cr\xE9er une image \xE0 partir de la carte -createImage.longdescription=Cr\xE9e une image \xE0 partir de la carte et l'enregistre dans un fichier -createImage.mnemonic=I - options.text=Options... options.shortdescription=Affiche les options options.longdescription=Affiche une fen\xEAtre d'options pour modifier les r\xE9glages de l'\xE9diteur @@ -146,17 +135,17 @@ edit.mnemonic=E clear.text=Effacer +clear.mnemonic=E clear.shortdescription=Effacer les cases s\xE9lectionn\xE9es clear.longdescription=Efface les cases s\xE9lectionn\xE9es -clear.mnemonic=E clear.accel=DELETE cut.text=Couper -cut.mnemonic=C +cut.mnemonic=O cut.accel=ctrl pressed X copy.text=Copier -copy.mnemonic=O +copy.mnemonic=C copy.accel=ctrl pressed C paste.text=Coller @@ -181,6 +170,8 @@ randFillBelow.text=Remplir en bas al\xE9atoirement randFillBelow.accel=ctrl shift pressed D +#floodfill.text= + selectAll.text=Tout s\xE9lectionner selectAll.mnemonic=T selectAll.accel=ctrl pressed A @@ -192,8 +183,12 @@ map.text=Carte map.mnemonic=C +#autoJoin.text= +#autoJoin.mnemonic= + gridVisible.text=Montrer la grille gridVisible.mnemonic=G +#gridVisible.shortdescription= gridVisible.accel=ctrl pressed G enterExit.text=Aller Sortie @@ -212,6 +207,12 @@ enterWestMap.text=Aller Carte Ouest enterWestMap.accel=ctrl pressed LEFT +#enterUpperMap.text= + +#enterLowerMap.text= + +#tileShow.text= + mapProperties.text=Propri\xE9t\xE9s de la carte mapProperties.mnemonic=P mapProperties.accel=ctrl pressed M @@ -220,7 +221,66 @@ ####### # Cursor +#cursor.text= +#cursor.mnemonic= +#moveCursor.text= + +#goNorth.text= +goNorth.accel=NUMPAD9 + +#goNorthEast.text= +goNorthEast.accel=NUMPAD6 + +#goEast.text= +goEast.accel=NUMPAD3 + +#goSouthEast.text= +goSouthEast.accel=NUMPAD2 + +#goSouth.text= +goSouth.accel=NUMPAD1 + +#goSouthWest.text= +goSouthWest.accel=NUMPAD4 + +#goWest.text= +goWest.accel=NUMPAD7 + +#goNorthWest.text= +goNorthWest.accel=NUMPAD8 + +#selectTile.text= +selectTile.accel=NUMPAD5 + +#startStopDrag.text= +startStopDrag.accel=SPACE + +#addToSelection.text= +addToSelection.accel=ADD + +#subFromSelection.text= +subFromSelection.accel=SUBTRACT + +#releaseDrag.text= +releaseDrag.accel=BACK_SPACE + +#insertArch.text= +insertArch.accel=NUMPAD0 + +#deleteArch.text= +deleteArch.accel=DECIMAL + +#selectArchAbove.text= +selectArchAbove.accel=DIVIDE + +#selectArchBelow.text= +selectArchBelow.accel=MULTIPLY + +#archAttributes.text= +archAttributes.accel=ENTER + + ########### # Pickmaps @@ -266,7 +326,7 @@ # Tools tools.text=Outils -tools.mnemonic=T +tools.mnemonic=O gc.text=Garbage Collection gc.mnemonic=G @@ -275,7 +335,11 @@ ######### # Analyze +#analyze.text= +#analyze.mnemonic= +#enabled.text= + ####### # View @@ -313,7 +377,25 @@ ######### # Plugins +#plugins.text= +#plugins.shortdescription= +#plugins.mnemonic= +#runPlugin.text= + +#editPlugins.text= +#editPlugins.mnemonic= + +#savePlugins.text= +#savePlugins.mnemonic= + +#exportPluginAs.text= +#exportPluginAs.mnemonic= + +#importPlugin.text= +#importPlugin.mnemonic= + + ######### # Window @@ -329,6 +411,8 @@ prevWindow.accel=shift pressed PAGE_DOWN closeAll.text=Tout fermer +#closeAll.shortdescription= +#closeAll.longdescription= closeAll.mnemonic=T closeAll.accel=ctrl shift pressed W @@ -346,7 +430,18 @@ about.text=\xC0 propos... about.mnemonic=P +#about.title= +#about= +#aboutTab.title= +#license.text= +#license.mnemonic= +#license.title= +#license.missing= + +#aboutRuntimeProperties.title= + + ############ # Map window @@ -359,5 +454,17 @@ mapwindowMap.text=Carte mapwindowMap.mnemonic=C +#mapwindowCursor.text= +#mapwindowCursor.mnemonic= + mapwindowView.text=Affichage mapwindowView.mnemonic=A + + +################# +# Map Arch Panel + +#moveTileTop.shortdescription= +#moveTileUp.shortdescription= +#moveTileDown.shortdescription= +#moveTileBottom.shortdescription= Modified: trunk/crossfire/src/cfeditor/messages_sv.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_sv.properties 2007-01-31 22:10:03 UTC (rev 1741) +++ trunk/crossfire/src/cfeditor/messages_sv.properties 2007-02-01 01:20:32 UTC (rev 1742) @@ -23,10 +23,14 @@ application.name=Gridarta for Crossfire mainWindow.title=Gridarta for Crossfire +########## # Dialogs overwriteOtherFile.title=Skriv \xF6ver existerande fil? overwriteOtherFile.message=En fil med namnet "{0}" existerar redan.\n\nVill du verkligen skriva \xF6ver den? +#collectArchesNotReady.title= +#collectArchesNotReady.message= + mapDirDoesntExist.title=Ogiltig katalog f\xF6r kartor. mapDirDoesntExist.message=Katalogen f\xF6r kartor, "{0}", finns inte.\nVar v\xE4nlig och v\xE4lj menyn ''Arkiv->Inst\xE4llningar...'' f\xF6r att byta katalog. @@ -35,206 +39,62 @@ openFileWantedNoArches.title=Kan inte \xF6ppna karta openFileWantedNoArches.message=Det finns inga arketyper (arches) tillg\xE4ngliga!\nDu m\xE5ste ha arketyperna innan du kan \xF6ppna en karta.\nL\xE4s i online-dokumentationen hur du kan skaffa Daimonins arketypfiler.. +#openFileWantedNotReady.title= +#openFileWantedNotReady.message= +#openFileWantedIOException.title= +#openFileWantedIOException.message= +#openFileWantedOutOfMemory.title= +#openFileWantedOutOfMemory.message= -openAttrDialogNoTypes.title=Fil saknas -openAttrDialogNoTypes.message=Defintionsfilen \"types.xml\" saknas!\nAttribut-gr\xE4nssnittet fungerar inte utan den filen. -openAttrDialogNoDefaultArch.title=Ingen standardarketyp -openAttrDialogNoDefaultArch.message=\xC4ndring av objektattribut utan tillg\xE5ng till standardarketyp \xE4r inte m\xF6jligt. -encodeMapFile.title=Misslyckades att spara karta -encodeMapFile.message=Kunde inte skriva fil {0}. +collectTemplistAutodelete.title=Laddar kartfil {0} +collectTemplistAutodelete.message=Hittade {1} ok\xE4nd arketyp.\nTar bort ogiltig arketyp:\n{2} -createImageIOException.title=Kunde inte skapa bild -createImageIOException.message=Bilden kunde inte skapas eftersom filen {0} inte g\xE5r att skriva till. +#enterExitRandomDestination.title= +#enterExitRandomDestination.message= +#enterExitNotSaved.title= +#enterExitNotSaved.message= -enterExitNoExit.title=Ingen utg\xE5ng -enterExitNoExit.message=Det finns ingen giltig utg\xE5ng p\xE5 den valda punkten. -enterExitNowhere.title=M\xE5let ogiltigt -enterExitNowhere.message=Denna utg\xE5ng leder ingenstans. -enterExitOutside.title=M\xE5let ogiltigt -enterExitOutside.message=M\xE5let f\xF6r utg\xE5ngen ligger utanf\xF6r kartan. -enterExitInvalidPath.title=Ogiltig s\xF6kv\xE4g -enterExitInvalidPath.message=Den angivna s\xF6kv\xE4gen \xE4r ogiltig. - -importSpellsSuccess.title=Sammanst\xE4ll trollformler -importSpellsSuccess.message=Lyckades sammanst\xE4lla {0} trollformler. -importSpellsFailed.title=Sammanst\xE4ll trollformler -importSpellsFailed.message=Sammanst\xE4llning av trollformler misslyckades.\nVar den angivna filen inte av r\xE4tt format? - openScriptNotFound.title=Kunde inte hitta scriptfil openScriptNotFound.message=Filen ''{0}'' finns inte.\nV\xE4r v\xE4nlig korrigera s\xF6kv\xE4gen. -enterTileNoTile.title=M\xE5let ogiltigt -enterTileNoTile.message=Det finns ingen karta \xE5t det h\xE5llet. +# Treasure lists +#treasurelistForbidden.title= +#treasurelistForbidden.message= -revertPickmapGone.title=Kan inte \xE5terst\xE4lla plockkartan. -revertPickmapGone.message=Filen f\xF6r plockkartan "{0}" existerar inte. +# Map Properties +#mapParametersTabTitle= +#mapShopTabTitle= +#mapWeatherTabTitle= +#mapTextTabTitle= +#mapLoreTabTitle= +#mapErrorInvalidDarkness.title= +#mapErrorInvalidDarkness.message= -confirmClosePickmap.title=St\xE4nga plockkarta? -confirmClosePickmap.message=Om du st\xE4nger plockkartan ''{0}'' kommer alla nyliga\n\xE4ndringar att f\xF6rloras.\n Vill du verkligen st\xE4nga den? - -confirmDeletePickmap.title=Radera fil f\xF6r plockkarta? -confirmDeletePickmap.message=Plockkartan ''{0}'' \xE4r st\xE4ngd.\nVill du ocks\xE5 ta bort filen ''{1}''?\nBorttagning av filen kommer att permanent radera plockkartan. - -confirmSaveChanges.title=Spara \xE4ndringar? -confirmSaveChanges.message=Vill du spara \xE4ndringar p\xE5 kartan {0}? - -confirmCreatePickmap.title=Kan inte \xF6ppna plockkarta -confirmCreatePickmap.message=Det finns ingen kartfil f\xF6r ''{0}''.\nVill du skapa den filen genom att spara denna plockkarta? - -confirmRevertMap.title=\xC5terst\xE4ll karta? -confirmRevertMap.message=Om du \xE5terst\xE4ller kartan ''{0}''\ntill dess senaste sparade version kommer alla nyliga \xE4ndringar att f\xF6rloras.\nVill du verkligen \xE5terst\xE4lla kartan? - -confirmRevertPickmap.title=\xC5terst\xE4ll plockkarta? -confirmRevertPickmap.message=Om du \xE5terst\xE4ller plockkartan ''{0}''\ntill dess senaste sparade version kommer alla nyliga \xE4ndringar att f\xF6rloras.\nVill du verkligen \xE5terst\xE4lla plockkartan? - -# New Map -newMap.title=Skapa ny karta -newPickmap.title=Skapa ny plockkarta -newMapMapName=Namn -newMapParameters=Inst\xE4llningar -newMapPickmapName=Namn -newMapDimensionOutOfRange.title=Ogiltigt v\xE4rde -newMapDimensionOutOfRange.message=Kartans dimensioner m\xE5ste st\xF6rre eller lika med 1 och mindre eller lika med 2147483647 -newMapDimensionNotANumber.title=Ogiltigt v\xE4rde -newMapDimensionNotANumber.message=Kartans dimensioner m\xE5ste vara heltalsv\xE4rden. -newMapNoName.title=Kartnamn saknas -newMapNoName.message=Du m\xE5ste ange ett kartnamn! Namnet syns i spelet,\n s\xE5 det b\xF6r vara ett beskrivande namn.\nNamn p\xE5 kartor beh\xF6ver inte vara unika. - -mapTitle={0} ({1}) - Kartegenskaper -mapName=Namn -mapWidth=Bredd -mapHeight=H\xF6jd +#mapRegion= +#mapUnique= mapOutdoor=Utomhus -mapFixedReset=Fixerad \xE5terst\xE4llning -mapEnterX=Ing\xE5ng X -mapEnterY=Ing\xE5ng Y -mapDifficulty=Sv\xE5righet -mapDarkness=M\xF6rker -mapSwapTime=Tid innan v\xE4xling -mapResetTimeout=Tid innan \xE5terst\xE4llning -mapNorth=Nord -mapEast=\xD6st -mapSouth=Syd -mapWest=V\xE4st +#mapNosmooth= +#mapShopType= +#mapShopGreed= +#mapUpperPriceLimit= +#mapLowerPriceLimit= +#mapShopRace= +#mapTemperature= +#mapPressure= +#mapHumidity= +#mapWindSpeed= +#mapWindDirection= +#mapSkySetting= +#mapTop= +#mapBottom= -mapHelp.text=Hj\xE4lp -mapOkay.text=Ok -mapRestore.text=\xC5terst\xE4ll -mapCancel.text=Avbryt -mapMapTabTitle=Karta -mapParametersTabTitle=Inst\xE4llningar -mapTextTabTitle=Karttext -mapTilesTabTitle=S\xF6kv\xE4gar - -mapErrorMissingMapName.title=Kartnamn saknas. -mapErrorMissingMapName.message=Du m\xE5ste ange ett kartnamn. -mapErrorIllegalSize.title=Ogiltigt v\xE4rde -mapErrorIllegalSize.message=Kartdimensioner m\xE5ste vara st\xF6rre \xE4n 0. -mapErrorInvalidEntry.title=Ogiltigt v\xE4rde -mapErrorInvalidEntry.message=Ogiltigt v\xE4rde:\n{0} - -nameOfAnimationObject=animation -nameOfFaceObject=bild -pickmapExists.title=Kan inte skapa plockkarta -pickmapExists.message=En plockkarta med namnet {0} finns redan.\nTa antingen bort den tidigare plockkartan eller v\xE4lj ett annat namn. - -#replace -replaceOk.text=Ok -replaceCancel.text=Avbryt -replaceTitle=Ers\xE4tt -replaceOn=P\xE5 -replaceOnMap=hela kartan -replaceOnSelection=markerade rutor p\xE5 -replaceDelete=radera objekt med -replaceBy=och ers\xE4tt med -replaceByObject=objekt -replaceByNothing=ingenting - -replaceMapGone.title=Fel under ers\xE4ttning -replaceMapGone.message=Kartan {0} is no longer available. -replaceMapNoSelection.title=Ingen markering -replaceMapNoSelection.message=Du valde att ers\xE4tta markerade rutor p\xE5 kartan \"{0}\",\n men det finns ingen markering. -replacedZero.title=Ers\xE4ttning misslyckades -replacedZero.message=Inga matchande objekt hittade. -replacedOne.title=Ers\xE4ttning lyckades -replacedOne.message=1 objekt har ersatts. -replacedMany.title=Ers\xE4ttning lyckades -replacedMany.message={0} objekt har ersatts. - -#attribute dialog -attribHelp.text=Hj\xE4lp -attribSummary.text=Sammanfattning -attribEdit.text=Redigera -attribOk.text=Ok -attribApply.text=Anv\xE4nd -attribCancel.text=Avbryt - -archCollectArches=Sammanst\xE4ller arketyper... -archCollectErrorIOException.title=Fel under sammanst\xE4llning -archCollectErrorIOException.message=Fel under sammanst\xE4llning: ett I/O-fel intr\xE4ffade f\xF6r filen {0}:\n{1} -dialogDontShowAgain=Visa inte denna dialog igen. - -############# -# Status Bar - -################## -# Status Messages - -statusMouseOff=Mus x:{0,number,integer} y:{1,number,integer} Mus utanf\xF6r kartan -statusMouseOn=Mus x:{0,number,integer} y:{1,number,integer} Karta x:{2,number,integer} y:{3,number,integer} -statusSelect=Mark\xF6r x:{0,number,integer} y:{1,number,integer} Offset x:{2,number,integer} y:{3,number,integer} -statusNormal=Mark\xF6r x:{0,number,integer} y:{1,number,integer} -statusCursorOff=Mark\xF6r utanf\xF6r karta - -# Edit -undo.text=\xC5ngra -undo.shortdescription=\xC5ngra senaste \xE4ndringen -undo.longdescription=\xC5terst\xE4ller senaste \xE4ndringen om m\xF6jligt -undo.mnemonic=N -undo.accel=ctrl pressed Z - -redo.text=G\xF6r om -redo.shortdescription=G\xF6r om senaste \xE4ndringen -redo.longdescription=G\xF6r om den senast \xE5ngrade \xE4ndringen om m\xF6jligt -redo.mnemonic=G -redo.accel=ctrl pressed Y - -################# -# Map Arch Panel - -mapArchApply.text=Anv\xE4nd -mapArchApply.shortdescription=Anv\xE4nd \xE4ndringarna i objektet - -mapArchAttrib.text=Attribut -mapArchAttrib.shortdescription=\xD6ppna attributdialogen - -mapArchAddInv.text=L\xE4gg inuti -mapArchAddInv.shortdescription=L\xE4gg objektet inuti - -scriptAddNew.text=Skapa nytt -scriptEditData.text=Redigera data -scriptEdit.text=Redigera script -scriptRemove.text=Ta bort script - ##################### # Preference Modules - # Options +#optionsImageSet= -optionsLanguage=Spr\xE5k -optionsLayout=Layout -optionsSepMapTile.text=Separat panel f\xF6r kartruta. -optionsSepMapTile.shortdescription=Detta flyttar panelen f\xF6r enstaka kartrutor till sk\xE4rmens h\xF6gra kant ist\xE4llet f\xF6r nedre h\xF6gra h\xF6rnet. -optionsLoadArchColl.text=L\xE4s arketyper fr\xE5n samling -optionsGlobal=Globalt -optionsResPaths=S\xF6kv\xE4gar f\xF6r resurser -optionsResArch=Arketypfiler -optionsResMaps=Kartor -optionsResScripts=Script -optionsRestart.title=Varning -optionsRestart.message=De flesta inst\xE4llningarna kr\xE4ver att editor startas om f\xF6r att g\xE4lla. ####### # File @@ -253,35 +113,8 @@ open.longdescription=\xD6ppnar en karta fr\xE5n fil open.mnemonic=P open.accel=ctrl pressed O +#open.error.text= -close.text=St\xE4ng -close.shortdescription=St\xE4ng karta -close.longdescription=St\xE4nger den aktuella kartan -close.mnemonic=T -close.accel=ctrl pressed W - -save.text=Spara -save.shortdescription=Spara karta -save.longdescription=Sparar den aktuella kartan -save.mnemonic=S -save.accel=ctrl pressed S - -saveAs.text=Spara som... -saveAs.shortdescription=Spara karta som ny fil -saveAs.longdescription=Sparar en karta under ett nytt filnamn -saveAs.mnemonic=A -saveAs.accel=ctrl shift pressed S - -revert.text=\xC5terst\xE4ll -revert.shortdescription=\xC5terst\xE4ller karta -revert.longdescription=\xC5terst\xE4ller kartan till den senast sparade versionen -revert.mnemonic=R - -createImage.text=Skapa bild -createImage.shortdescription=Skapa bild av kartan -createImage.longdescription=Skapar en bild av kartan och sparar till fil -createImage.mnemonic=B - options.text=Inst\xE4llningar... options.shortdescription=Justera inst\xE4llningar options.longdescription=\xD6ppnar dialogen f\xF6r att justera editorinst\xE4llningarna @@ -299,20 +132,20 @@ # Edit edit.text=Redigera -edit.mnemonic=E +edit.mnemonic=R clear.text=Rensa +clear.mnemonic=R clear.shortdescription=Rensa markerade rutor clear.longdescription=Rensar alla markerade rutor -clear.mnemonic=R clear.accel=DELETE cut.text=Klipp ut -cut.mnemonic=K +cut.mnemonic=U cut.accel=ctrl pressed X copy.text=Kopiera -copy.mnemonic=O +copy.mnemonic=K copy.accel=ctrl pressed C paste.text=Klistra in @@ -337,6 +170,8 @@ randFillBelow.text=Slumpfyll under randFillBelow.accel=ctrl shift pressed D +#floodfill.text= + selectAll.text=Markera allt selectAll.mnemonic=M selectAll.accel=ctrl pressed A @@ -348,6 +183,9 @@ map.text=Karta map.mnemonic=K +#autoJoin.text= +#autoJoin.mnemonic= + gridVisible.text=Visa rutn\xE4t gridVisible.mnemonic=V gridVisible.shortdescription=Rita ut rutn\xE4t f\xF6r att visa enstaka kartrutor @@ -369,6 +207,12 @@ enterWestMap.text=G\xE5 v\xE4st enterWestMap.accel=ctrl pressed NUMPAD7 +#enterUpperMap.text= + +#enterLowerMap.text= + +#tileShow.text= + mapProperties.text=Egenskaper... mapProperties.mnemonic=E mapProperties.accel=ctrl pressed M @@ -491,7 +335,11 @@ ######### # Analyze +#analyze.text= +#analyze.mnemonic= +#enabled.text= + ####### # View @@ -529,7 +377,25 @@ ######### # Plugins +#plugins.text= +#plugins.shortdescription= +#plugins.mnemonic= +#runPlugin.text= + +#editPlugins.text= +#editPlugins.mnemonic= + +#savePlugins.text= +#savePlugins.mnemonic= + +#exportPluginAs.text= +#exportPluginAs.mnemonic= + +#importPlugin.text= +#importPlugin.mnemonic= + + ######### # Window @@ -564,7 +430,18 @@ about.text=Om... about.mnemonic=O +about.title=Om Gridarta for Crossfire +about=<html><h1 align="center">Gridarta for Crossfire</h1><p>Editor for Crossfire MMORPG maps and arches</p><table><tr><td valign="top" align="right" width="50%">Copyright \xA9 2001-2007</td><td width="50%">Michael Toennies<br>Andreas Vogl<br>Peter Plischewsky<br>Gecko<br>Christian Hujer<br>Daniel Viegas<br>Andreas Kirschbaum</td></tr><tr><td align="right">Java version:</td><td>{0}</td></tr><tr><td align="right">Build number:</td><td>{1}</td></tr><tr><td align="right">av:</td><td>{2}</td></tr><tr><td align="right">datum:</td><td>{3}</td></tr></table></html> +aboutTab.title=Om +license.text=Licens... +license.mnemonic=L +license.title=Licens +license.missing=Kan inte hitta licensfilen. + +aboutRuntimeProperties.title=Runtime properties + + ############ # Map window @@ -572,7 +449,7 @@ mapwindowFile.mnemonic=A mapwindowEdit.text=Redigera -mapwindowEdit.mnemonic=E +mapwindowEdit.mnemonic=R mapwindowMap.text=Karta mapwindowMap.mnemonic=K @@ -587,5 +464,7 @@ ################# # Map Arch Panel +#moveTileTop.shortdescription= moveTileUp.shortdescription=Flytta upp objekt moveTileDown.shortdescription=Flytta ner objekt +#moveTileBottom.shortdescription= Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2007-01-31 22:10:03 UTC (rev 1741) +++ trunk/daimonin/src/daieditor/messages.properties 2007-02-01 01:20:32 UTC (rev 1742) @@ -23,6 +23,7 @@ application.name=Gridarta for Daimonin mainWindow.title=Gridarta for Daimonin {0} + # Zoom zoomMen.text=Zoom zoomMen.mnemonic=Z @@ -93,6 +94,7 @@ zoomAlgAreaAveraging.exception.java.lang.OutOfMemoryError.title=Out of Memory zoomAlgAreaAveraging.exception.java.lang.OutOfMemoryError.message=<html>Not enough memory to write zoomed image.<br>Try restarting with more memory,<br>use <code>-Xmx128m</code> or <code>-Xmx256m</code>.<br><br>{0} + ########## # Dialogs warning=Warning! @@ -108,6 +110,9 @@ mapDirDoesntExist.title=Invalid map directory mapDirDoesntExist.message=The map directory "{0}" doesn''t exist.\nPlease select menu ''File->Options...'' and correct that. +closeLevelNullLevel.title=Close map +closeLevelNullLevel.message=Map does not exist: {1}; number of existing maps: {0}. + openFileWantedNoArches.title=Cannot open map openFileWantedNoArches.message=There are currently no arches avaliable!\nYou need to have arches loaded before opening a map.\nLook into the online help on how to get Daimonin archfiles. openFileLoadMap.title=Couldn''t load map @@ -115,6 +120,7 @@ collectTemplistAutodelete.title=Loading mapfile {0} collectTemplistAutodelete.message=Found {1} game objects referencing\nthe following unknown archetypes:\n{2}\nDelete these game objects? + enterExitClose.title=Close previous map? enterExitClose.message=You''ve opened a new map.\nShould I close the previous one? @@ -245,11 +251,13 @@ archCollectErrorFileUnexpectedEOF.title=Collect error archCollectErrorFileUnexpectedEOF.message=Collect Error: Unexpected EOF in\n{0} + ################## # Status Messages mapImagesOutOfMemory=Out of memory creating map image + ####### # File @@ -280,12 +288,6 @@ recent.mnemonic=T recentItem.shortdescriptionformat=Opens map {0} ({1}) -closeAll.text=Close All -closeAll.shortdescription=Close all maps -closeAll.longdescription=Closes all opened maps -closeAll.mnemonic=L -closeAll.accel=ctrl shift pressed W - options.text=Options... options.shortdescription=Shows options options.longdescription=Shows an option dialog to change the editor settings @@ -309,7 +311,6 @@ clear.mnemonic=L clear.shortdescription=Clear selection clear.longdescription=Clears the selected tiles -#clear.accel=ctrl pressed DELETE clear.accel=DELETE cut.text=Cut @@ -395,11 +396,11 @@ ####### # Cursor -moveCursor.text=Move Cursor - cursor.text=Cursor cursor.mnemonic=C +moveCursor.text=Move Cursor + goNorth.text=Move Cursor North goNorth.accel=NUMPAD9 @@ -622,6 +623,7 @@ drawDouble.shortdescription=Check this to draw double faces (e.g. stacked walls) the same way the client does drawDouble.accel=ctrl shift pressed G + ######### # Window @@ -636,6 +638,13 @@ prevWindow.shortdescription=Display previous window prevWindow.accel=shift pressed PAGE_DOWN +closeAll.text=Close All +closeAll.shortdescription=Close all maps +closeAll.longdescription=Closes all opened maps +closeAll.mnemonic=L +closeAll.accel=ctrl shift pressed W + + ####### # Help @@ -653,7 +662,7 @@ about.mnemonic=A about.title=About Gridarta for Daimonin -about=<html><h1 align="center">Gridarta for Daimonin</h1><p>Editor for Daimonin MMORPG maps and arches</p><table><tr><td valign="top" align="right" width="50%">Copyright \xA9 2001-2007</td><td width="50%">Michael Toennies<br>Andreas Vogl<br>Peter Plischewsky<br>Gecko<br>Christian Hujer<br>Daniel Viegas<br>Andreas Kirschbaum</td></tr><tr><td align="right">Java version:</td><td>{0}</td></tr><tr><td align="right">Build number:</td><td>{1}</td></tr><tr><td align="right">by:</td><td>{2}</td></tr><tr><td align="right">at:</td><td>{3}</td></tr></table></html> +about=<html><h1 align="center">Gridarta for Daimonin</h1><p>Editor for Daimonin MMORPG maps and arches</p><table><tr><td valign="top" align="right" width="50%">Copyright \xA9 2001-2007</td><td width="50%">Michael Toennies<br>Andreas Vogl<br>Peter Plischewsky<br>Gecko<br>Christian Hujer<br>Daniel Viegas<br>Andreas Kirschbaum</td></tr><tr><td align="right">Java version:</td><td>{0}</td></tr><tr><td align="right">Version:</td><td>{1}</td></tr><tr><td align="right">by:</td><td>{2}</td></tr><tr><td align="right">at:</td><td>{3}</td></tr></table></html> aboutTab.title=About license.text=License... @@ -696,6 +705,7 @@ updateActiveVersionUnavailable.title=Update warning updateActiveVersionUnavailable.message=I was unable to determine my version.\nI will assume that the update is newer than your current version. + ############ # Map window @@ -711,6 +721,7 @@ mapwindowCursor.text=Cursor mapwindowCursor.mnemonic=C + ################# # Map Arch Panel @@ -739,6 +750,7 @@ moveTileDown.shortdescription=Move Object down in Square moveTileBottom.shortdescription=Move Object to bottom of Square + ##################### # Preference Modules @@ -757,6 +769,7 @@ autogenPreviews.text=Autogenerate Previews? genPreview.text=Generate Preview + ################# # Map Validation @@ -802,6 +815,7 @@ Validator.TilePaths.title=Tile path invalid Validator.TilePaths.msg=<html><h3>{0}</h3><p>This map has invalid tile paths.<br>Go to the map properties dialog and change the map tile paths. + ####################### # Various Log Messages canonIOE=IOException while canonizing path: {0} @@ -817,6 +831,7 @@ defArchWithInvalidDirection=Arch {0} has an invalid direction: {1} defArchWithInvalidMpartNr=Arch part {0} has mpart_nr {2}, but head part {1} has mpart_nr {3} + ################ # Other Strings nameOfAnimationObject=animation Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2007-01-31 22:10:03 UTC (rev 1741) +++ trunk/daimonin/src/daieditor/messages_de.properties 2007-02-01 01:20:32 UTC (rev 1742) @@ -20,6 +20,10 @@ # Warning: This file MUST be ISO-8859-1 # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding +application.name=Gridarta f\xFCr Daimonin +mainWindow.title=Gridarta f\xFCr Daimonin {0} + + # Zoom zoomMen.text=Vergr\xF6\xDFerung zoomMen.mnemonic=V @@ -39,56 +43,123 @@ zoomSave.mnemonic=S zoomSave.accel=ctrl pressed S zoomClose.text=Schlie\xDFen - zoomClose.mnemonic=C zoomClose.accel=ctrl pressed W -zoomOutOfMem.message=Nicht genug Speicher f\xFCr Vergr\xF6\xDFerungsstufe.\nVersuche, den Editor mit -Xmx128m oder -Xmx256m zu starten. -zoomOutOfMem.title=Out of Memory -zoomSaveOutOfMem.message=Not enough memory to save preview, sorry.\nTry restarting with -Xmx128m or -Xmx256m. -zoomSaveOutOfMem.title=Out of Memory +zoomSaveException.title=Vorschau speichern +zoomSave.exception.java.io.IOException.title=Ein-/Ausgabefehler +zoomSave.exception.java.io.IOException.message=Fehler beim Speichern:\n{0} +zoomSave.exception.java.lang.OutOfMemoryError.title=Speichermangel +#zoomSave.exception.java.lang.OutOfMemoryError.message= +zoom0.exception.java.lang.OutOfMemoryError.title=Speichermangel +#zoom0.exception.java.lang.OutOfMemoryError.message= +zoom12.exception.java.lang.OutOfMemoryError.title=Speichermangel +#zoom12.exception.java.lang.OutOfMemoryError.message= +zoom25.exception.java.lang.OutOfMemoryError.title=Speichermangel +#zoom25.exception.java.lang.OutOfMemoryError.message= +zoom50.exception.java.lang.OutOfMemoryError.title=Speichermangel +#zoom50.exception.java.lang.OutOfMemoryError.message= +zoom100.exception.java.lang.OutOfMemoryError.title=Speichermangel +#zoom100.exception.java.lang.OutOfMemoryError.message= +zoom150.exception.java.lang.OutOfMemoryError.title=Speichermangel +#zoom150.exception.java.lang.OutOfMemoryError.message= +zoom200.exception.java.lang.OutOfMemoryError.title=Speichermangel +#zoom200.exception.java.lang.OutOfMemoryError.message= +zoom250.exception.java.lang.OutOfMemoryError.title=Speichermangel +#zoom250.exception.java.lang.OutOfMemoryError.message= +zoom300.exception.java.lang.OutOfMemoryError.title=Speichermangel +#zoom300.exception.java.lang.OutOfMemoryError.message= +zoom400.exception.java.lang.OutOfMemoryError.title=Speichermangel +#zoom400.exception.java.lang.OutOfMemoryError.message= +#zoomAlg.text= +#zoomAlg.mnemonic= +#zoomAlgDefault.text= +#zoomAlgDefault.mnemonic= +zoomAlgDefault.exception.java.lang.OutOfMemoryError.title=Speichermangel +#zoomAlgDefault.exception.java.lang.OutOfMemoryError.message= +#zoomAlgFast.text= +#zoomAlgFast.mnemonic= +zoomAlgFast.exception.java.lang.OutOfMemoryError.title=Speichermangel +#zoomAlgFast.exception.java.lang.OutOfMemoryError.message= +#zoomAlgSmooth.text= +#zoomAlgSmooth.mnemonic= +zoomAlgSmooth.exception.java.lang.OutOfMemoryError.title=Speichermangel +#zoomAlgSmooth.exception.java.lang.OutOfMemoryError.message= +#zoomAlgReplicate.text= +#zoomAlgReplicate.mnemonic= +zoomAlgReplicate.exception.java.lang.OutOfMemoryError.title=Speichermangel +#zoomAlgReplicate.exception.java.lang.OutOfMemoryError.message= +#zoomAlgAreaAveraging.text= +#zoomAlgAreaAveraging.mnemonic= +zoomAlgAreaAveraging.exception.java.lang.OutOfMemoryError.title=Speichermangel +#zoomAlgAreaAveraging.exception.java.lang.OutOfMemoryError.message= + + ########## # Dialogs - warning=Warnung! overwriteOtherFile.title=Datei \xFCberschreiben? overwriteOtherFile.message=Eine Datei mit Namen "{0}" existiert bereits.\n\nWirklich \xFCberschreiben? -createImageIOException.title=Kann Bild nicht erzeugen -createImageIOException.message=Das Bild kann nicht erzeugt werden, da ein Ein-/Ausgabefehler\nbeim Schreiben von {0} aufgetreten ist:\n{1} +mapOutOfMemory.title=Speichermangel +mapOutOfMemory.message=Speichermangel +#mapUnsaved.title= +#mapUnsaved.message= + +mapDirDoesntExist.title=Ung\xFCltiges Verzeichnis +mapDirDoesntExist.message=Das Verzeichnis f\xFCr Karten "{0}" existiert nicht.\nBitte legen sie es unter ''Datei->Optionen...'' fest. + +closeLevelNullLevel.title=Kann Karte nicht schlie\xDFen +closeLevelNullLevel.message=Die Karte {1} existiert nicht; Anzahl existierender Karten: {0}. + +openFileWantedNoArches.title=Kann Karte nicht \xF6ffnen +openFileWantedNoArches.message=Es sind keine Archetypen verf\xFCgbar.\nDiese werden ben\xF6tigt, um eine Karte zu \xF6ffnen. +#openFileLoadMap.title= +#openFileLoadMap.message= + +collectTemplistAutodelete.title=Karte {0} laden +collectTemplistAutodelete.message=Die Karte enth\xE4lt {1} Objekte, die die\nfolgenden unbekannten Archetypen verwenden:\n{2}\nSollen diese Objekte gel\xF6scht werden? + +#enterExitClose.title= +#enterExitClose.message= + +#enterTileIOException.title= +#enterTileIOException.message= + +#importSpellsSuccess.title= +#importSpellsSuccess.message= +#importSpellsFailed.title= +#importSpellsFailed.message= +#loadArchesNoArchfiles.title= +#loadArchesNoArchfiles.message= +#openScriptNotFound.title= +#openScriptNotFound.message= +#newMapDifficultyNotANumber.title= +#newMapDifficultyNotANumber.message= +#newMapDifficultyOutOfRange.title= +#newMapDifficultyOutOfRange.message= + +#errCantLoadFaceTree.title= +#errCantLoadFaceTree.message= + +#loadDuplicateFace.title= +#loadDuplicateFace.message= +loadDuplicateArch.title= +#loadDuplicateArch.message.1= +#loadDuplicateArch.message.2.title.1= +#loadDuplicateArch.message.2.title.2= +#loadDuplicateArch.message.3= + +# Treasure lists treasurelistForbidden.title=Ung\xFCltige Auswahl treasurelistForbidden.message=Die Schatzliste {0} darf in Karten nicht verwendet werden.\nSie wird vom Crossfire-Server intern verwendet. -# New Map -newMap.title=Neue Karte erstellen -newPickmap.title=Neue Pickmap erstellen -newMapMapName=Name: -newMapParameters=Parameter -newMapPickmapName=Name: -newMapDimensionOutOfRange.title=Ung\xFCltiger Wert -newMapDimensionOutOfRange.message=Die Kartengr\xF6\xDFe muss positiv sein -newMapDimensionNotANumber.title=Ung\xFCltiger Wert -newMapDimensionNotANumber.message=Die Kartengr\xF6\xDFe muss ganzzahlig sein. -newMapNoName.title=Kartenname fehlt -newMapNoName.message=Der Kartenname fehlt. Jede Karte muss einen Namen besitzen.\nEr wird in-game verwendet und sollte die Karte beschreiben.\nKartennamen m\xFCssen nicht eindeutig sein. -newPickmapNoName.title=Pickmap fehlt -newPickmapNoName.message=Der Pickmapname fehlt. Es ist ein eindeutiger Name erforderlich. - -mapTitle={0} ({1}) - Karteneigenschaften +# Map Properties mapMap=Karte -mapName=Name -mapWidth=Breite -mapHeight=H\xF6he +#mapSound= mapOutdoor=Im Freien -mapFixedReset=Fixer Reset mapOptions=Optionen -mapEnterX=Startpunkt X -mapEnterY=Startpunkt Y -mapDifficulty=Schwierigkeit -mapDarkness=Dunkelheit -mapSwapTime=Swap-Zeit -mapResetTimeout=Reset-Zeit mapNoSave=Nicht speichern mapNoMagic=Keine Magie mapNoPrayers=Keine Gebete @@ -100,10 +171,6 @@ mapInstantDeath=Sofort-Tod mapPvP=Spieler gegen Spieler aktiv mapText=Kartentext -mapNorth=Norden -mapEast=Osten -mapSouth=S\xFCden -mapWest=Westen mapNorthEast=Nordosten mapNorthWest=Nordwesten mapSouthEast=S\xFCdosten @@ -114,10 +181,6 @@ mapTilesAttach.shortdescription=Verbindet die Karte automatisch in allen Richtungen mit ihren benachbarten Karten. mapTilesClear.text=Pfade l\xF6schen mapTilesClear.shortdescription=L\xF6scht die Verbindungspfade zu den benachbarten Karten. -mapHelp.text=Hilfe -mapOkay.text=OK -mapRestore.text=Zur\xFCcksetzen -mapCancel.text=Abbrechen mapSizeDefault.text=Standardgr\xF6\xDFe (24 \xD7 24) mapErrorUnsaved.title=Fehlender Dateipfad mapErrorUnsaved.message=Kann ungespeicherte Karte nicht verbinden.\nDie Karte muss zuerst im Kartenverzeichnis gespeichert werden! @@ -129,67 +192,72 @@ mapErrorPath2.message=Bitte \xFCberpr\xFCfe den Dateipfad f\xFCr die Karte: "{0}}". mapErrorInvalid.title=Ung\xFCltiger Kartenpfad mapErrorInvalid.message=In {0}: {1}\nder Pfad zu {2} ist ung\xFCltig.\nDer Pfad nach {3} ist {4}\nErzeugter Pfad:{5}\nVerbinden abbrechen? -mapTilePathMode.shortdescription=Zwischen relativem und absoluten Pfad wechseln -mapMapTabTitle=Karteneigenschaften -mapTilesTabTitle=Verbindungspfade +#mapErrorFatalPath.title= +#mapErrorFatalPath.message= +#mapErrorFatalWrite.title= +#mapErrorFatalWrite.message= +#mapErrorArchOutOfGrid.title= +#mapErrorArchOutOfGrid.message= +#mapErrorDifferentSize.title= +#mapErrorDifferentSize.message= +#mapTilesNoMapFileNoMapTilePane.title= +#mapTilesNoMapFileNoMapTilePane.message= mapTileRevert.shortdescription=Pfad auf gespeicherten Pfad zur\xFCcksetzen mapTileClear.shortdescription=Pfad l\xF6schen mapTileChoose.shortdescription=Pfad w\xE4hlen +mapTilePathMode.shortdescription=Zwischen relativem und absoluten Pfad wechseln -#replace -replaceTitle=Ersetze -replaceOn=In -replaceOnMap=der ganzen Karte -replaceOnSelection=der Auswahl auf -replaceDelete=l\xF6sche Objekte mit -replaceBy=und ersetze durch -replaceByObject=Objekt replaceByCopyBuffer=Zwischenablage -replaceByPickmap=Pickmap -replaceByNothing=nichts (=l\xF6schen) -replaceMapGone.message=Karte {0} ist nicht mehr verf\xFCgbar.\n -replaceMapNoSelection.message=Ich kann ohne Selektion keine selektierten Felder\nauf der Karte "{0}" ersetzen. -replacedZero.title=Ersetzung fehlgeschlagen -replacedZero.message=Keine passenden Objekte gefunden. -replacedOne.title=Ersetzung erfolgreich -replacedOne.message=1 Objekt ersetzt. -replacedMany.title=Ersetzung erfolgreich -replacedMany.message={0} Objekte ersetzt. - # Options optionsTitle=Optionen -optionsLanguage=Sprache -optionsLayout=Layout-Einstellungen -optionsSepMapTile.text=Map-Tile-Panel unten anzeigen +#optionsUpdate= optionsLoadArchColl.text=Vorbereitete Archetypen laden -optionsGlobal=Global -optionsResPaths=Pfade -optionsResArch=Archetypen -optionsResMaps=Karten -optionsResScripts=Scripte +#optionsResMedia= +#optionsResMedia.shortdescription= optionsMisc=Verschiedene Einstellungen optionsCheckMaps.text=Analysiere Kartendateien bei Dateiauswahl +#optionsCheckMaps.shortdescription= +#optionsSystemExit.text= +#optionsSystemExit.shortdescription= +#optionsUser= +#optionsApps= +#optionsAppServer= +#optionsAppClient= +#optionsAppEditor= +#optionsValidation= +#autoValidate.text= +#optionsValidators= +# Old Libraries +#oldLibsFound.message= +#oldLibsFound.title= -#attribute dialog -attribTitle=Objektattribute -attribHelp.text=Hilfe -attribSummary.text=Zusammenfassung -attribEdit.text=Bearbeiten -attribOk.text=Ok -attribApply.text=Anwenden -attribCancel.text=Abbrechen +#archCollectArches= +#archCollectAnimations= +#archCollectImages= +#archCollectDone= +#archCollectWarningMultipartTailInPanel.title= +#archCollectWarningMultipartTailInPanel.message= +#archCollectWarningMultipartTooShort.title= +#archCollectWarningMultipartTooShort.message= +#archCollectWarningMissed.title= +#archCollectWarningMissed.message= +#archCollectErrorFileNotFound.title= +#archCollectErrorFileNotFound.message= +#archCollectErrorFileUnexpectedEOF.title= +#archCollectErrorFileUnexpectedEOF.message= + + ################## # Status Messages -statusMouseOff=Maus au\xDFerhalb der Karte -statusSelect=Maus x:{0,number,integer} y:{1,number,integer} Karte x:{2,number,integer} y:{3,number,integer} Auswahl x:{4,number,integer} y:{5,number,integer} -statusNormal=Maus x:{0,number,integer} y:{1,number,integer} Karte x:{2,number,integer} y:{3,number,integer} +#mapImagesOutOfMemory= + ####### # File @@ -200,10 +268,11 @@ fileDialog.filter.lua=Lua-Skripte fileDialog.filter.arc=Archetypdefinitionen fileDialog.filter.anim=Animationsdefinitionen +#fileDialog.filter.unignored= createNew.text=Neu... createNew.shortdescription=Erzeuge neue Karte -createNew.longdescription=Erzeut eine neue Karte +createNew.longdescription=Erzeugt eine neue Karte createNew.mnemonic=N createNew.accel=ctrl pressed N @@ -214,41 +283,11 @@ open.accel=ctrl pressed O open.error.text=Fehler beim Laden -close.text=Schlie\xDFen -close.shortdescription=Karte schlie\xDFen -close.longdescription=Schlie\xDFt die aktuelle Karte -close.mnemonic=C -close.accel=ctrl pressed W +#recent.text= +#recent.shortdescription= +#recent.mnemonic= +#recentItem.shortdescriptionformat= -closeAll.text=Alle schlie\xDFen -closeAll.mnemonic=A - -save.text=Speichern -save.shortdescription=Karte speichern -save.longdescription=Speichert die aktuelle Karte -save.mnemonic=S -save.accel=ctrl pressed S -save.error.text=Fehler beim Speichern - -saveAs.text=Speichern als... -saveAs.shortdescription=Karte mit neuem Namen speichern -saveAs.longdescription=Speichert die Karte unter einem neuen Namen -saveAs.mnemonic=A -saveAs.accel=ctrl shift pressed S -saveAs.error.text=Fehler beim Speichern als - -revert.text=Zur\xFCcksetzen -revert.shortdescription=Zuletzt gespeicherte Fassung -revert.longdescription=Macht alle \xC4nderungen r\xFCckg\xE4ngig und stellt die zuletzt gespeicherte Fassung wieder her -revert.mnemonic=R -revert.error.text=Fehler beim Zur\xFCcksetzen - -createImage.text=Bild speichern... -createImage.shortdescription=Bild der Karte speichern -createImage.longdescription=Erzeugt ein Foto der Karte und speichert es -createImage.mnemonic=I -createImage.error.text=Fehler beim Bild speichern - options.text=Optionen... options.shortdescription=Optionen zeigen options.longdescription=Zeigt einen Dialog mit den Editoreinstellungen @@ -268,25 +307,10 @@ edit.text=Bearbeiten edit.mnemonic=B -undo.text=R\xFCckg\xE4ngig -undo.name=R\xFCckg\xE4ngig {0} -undo.shortdescription=Letze \xC4nderung r\xFCckg\xE4ngig -undo.longdescription=Macht die letzte \xC4nderung r\xFCckg\xE4ngig, falls m\xF6glich -undo.mnemonic=R -undo.accel=ctrl pressed Z - -redo.text=Wiederherstellen -redo.name=Wiederholen {0} -redo.shortdescription=Letztes R\xFCckg\xE4ngig wiederherstellen -redo.longdescription=Stellt die zuletzt r\xFCckg\xE4ngig gemachte \xC4nderung wieder her. -redo.mnemonic=W -redo.accel=ctrl pressed Y - clear.text=L\xF6schen clear.mnemonic=L clear.shortdescription=Auswahl l\xF6schen clear.longdescription=L\xF6scht den ausgew\xE4hlten Bereich. -#clear.accel=ctrl pressed DELETE clear.accel=DELETE cut.text=Ausschneiden @@ -322,6 +346,7 @@ floodfill.text=Freien Bereich f\xFCllen selectAll.text=Alles ausw\xE4hlen +selectAll.mnemonic=W selectAll.accel=ctrl pressed A @@ -333,28 +358,104 @@ enterExit.text=Gehe zu Ausgang enterExit.mnemonic=A +enterExit.accel=ctrl pressed NUMPAD5 +#enterExitIOException.title= +#enterExitIOException.message= enterNorthMap.text=Gehe zu Nord-Karte +enterNorthMap.accel=ctrl pressed NUMPAD9 enterNorthEastMap.text=Gehe zu Nordost-Karte +enterNorthEastMap.accel=ctrl pressed NUMPAD6 enterEastMap.text=Gehe zu Ost-Karte +enterEastMap.accel=ctrl pressed NUMPAD3 enterSouthEastMap.text=Gehe zu S\xFCdost-Karte +enterSouthEastMap.accel=ctrl pressed NUMPAD2 enterSouthMap.text=Gehe zu S\xFCd-Karte +enterSouthMap.accel=ctrl pressed NUMPAD1 enterSouthWestMap.text=Gehe zu S\xFCdwest-Karte +enterSouthWestMap.accel=ctrl pressed NUMPAD4 enterWestMap.text=Gehe zu West-Karte +enterWestMap.accel=ctrl pressed NUMPAD7 enterNorthWestMap.text=Gehe zu Nordwest-Karte +enterNorthWestMap.accel=ctrl pressed NUMPAD8 +#mapCreateView.text= + mapProperties.text=Karteneigenschaften mapProperties.mnemonic=K mapProperties.accel=ctrl pressed M +####### +# Cursor + +cursor.text=Cursor +cursor.mnemonic=C + +moveCursor.text=Cursor bewegen + +goNorth.text=Cursor nach Nord +goNorth.accel=NUMPAD9 + +goNorthEast.text=Cursor nach Nordost +goNorthEast.accel=NUMPAD6 + +goEast.text=Cursor nach Ost +goEast.accel=NUMPAD3 + +goSouthEast.text=Cursor nach S\xFCdost +goSouthEast.accel=NUMPAD2 + +goSouth.text=Cursor nach S\xFCd +goSouth.accel=NUMPAD1 + +goSouthWest.text=Cursor nach S\xFCdwest +goSouthWest.accel=NUMPAD4 + +goWest.text=Cursor nach West +go... [truncated message content] |
From: <aki...@us...> - 2007-02-02 18:15:26
|
Revision: 1744 http://svn.sourceforge.net/gridarta/?rev=1744&view=rev Author: akirschbaum Date: 2007-02-02 10:15:26 -0800 (Fri, 02 Feb 2007) Log Message: ----------- Create correct "editor_folder" entries when collecting archetypes. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/UndefinedArchetype.java trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/UndefinedArchetype.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-02-02 18:04:36 UTC (rev 1743) +++ trunk/crossfire/ChangeLog 2007-02-02 18:15:26 UTC (rev 1744) @@ -1,3 +1,8 @@ +2007-02-02 Andreas Kirschbaum + + * Create correct "editor_folder" entries when collecting + archetypes. + 2007-01-27 Andreas Kirschbaum * Prevent NullPointerException when creating a new script. Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2007-02-02 18:04:36 UTC (rev 1743) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2007-02-02 18:15:26 UTC (rev 1744) @@ -128,6 +128,8 @@ } else { archetype.setArchetypeName(archName); } + + editorFolder = null; } } else { if (msgflag) { @@ -183,11 +185,13 @@ folder = names.length >= 2 ? names[1] : names[0]; } mainControl.addArchPanelArchetype(panel, folder, archetype); - } + archetype.setEditorFolder(panel+"/"+folder); + } else { + archetype.setEditorFolder("intern"); + } } postParseArchetype(archetype); archetype.setIsArchetype(); - archetype.setEditorFolder(editorFolder); mainControl.getArchetypeSet().addArchetype(archetype); archmore = false; // we assume this is last... but perhaps.. Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-02-02 18:04:36 UTC (rev 1743) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-02-02 18:15:26 UTC (rev 1744) @@ -485,8 +485,12 @@ for (final Archetype arch : getArchetypes()) { + if (arch.isUndefinedArchetype()) { + continue; + } + if (arch.isTail()) { - log.error("Collect Error: Multipart Tail in Panel found!"); + continue; } out.writeBytes("Object " + arch.getArchetypeName() + "\n"); Modified: trunk/crossfire/src/cfeditor/gameobject/UndefinedArchetype.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/UndefinedArchetype.java 2007-02-02 18:04:36 UTC (rev 1743) +++ trunk/crossfire/src/cfeditor/gameobject/UndefinedArchetype.java 2007-02-02 18:15:26 UTC (rev 1744) @@ -37,7 +37,7 @@ setArchetypeName(archetypeName); setArchTypNr(0); setIsArchetype(); - setEditorFolder("undefined"); + setEditorFolder("intern"); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2007-02-02 18:04:36 UTC (rev 1743) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2007-02-02 18:15:26 UTC (rev 1744) @@ -156,6 +156,7 @@ } multiShapeID = 0; + editorFolder = null; } } else { if (msgflag) { @@ -216,11 +217,13 @@ folder = names.length >= 2 ? names[1] : names[0]; } mainControl.addArchPanelArchetype(panel, folder, archetype); + archetype.setEditorFolder(panel+"/"+folder); + } else { + archetype.setEditorFolder("intern"); } } postParseArchetype(archetype); archetype.setIsArchetype(); - archetype.setEditorFolder(editorFolder); mainControl.getArchetypeSet().addArchetype(archetype); if (archmore) { Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-02 18:04:36 UTC (rev 1743) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-02 18:15:26 UTC (rev 1744) @@ -506,6 +506,9 @@ artifactCount++; continue; } + if (arch.isUndefinedArchetype()) { + continue; + } if (arch.getArchetypeName().compareTo(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME) == 0) { // process map arch @@ -538,7 +541,6 @@ if (arch.isTail()) { continue; - //ACTION_FACTORY.showMessageDialog(pbar.getParentComponent(), WARNING_MESSAGE, "archCollectWarningMultipartTailInPanel"); } out.append("Object ").append(arch.getArchetypeName()).append('\n'); Modified: trunk/daimonin/src/daieditor/gameobject/UndefinedArchetype.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/UndefinedArchetype.java 2007-02-02 18:04:36 UTC (rev 1743) +++ trunk/daimonin/src/daieditor/gameobject/UndefinedArchetype.java 2007-02-02 18:15:26 UTC (rev 1744) @@ -37,7 +37,7 @@ setArchetypeName(archetypeName); setArchTypNr(0); setIsArchetype(); - setEditorFolder("undefined"); + setEditorFolder("intern"); } /** {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-02-02 22:05:13
|
Revision: 1748 http://svn.sourceforge.net/gridarta/?rev=1748&view=rev Author: akirschbaum Date: 2007-02-02 14:05:12 -0800 (Fri, 02 Feb 2007) Log Message: ----------- Use (default) type definition 'Misc' for game objects not matching any defined type. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/daimonin/src/daieditor/CFArchTypeList.java trunk/src/app/net/sf/gridarta/CFArchTypeList.java Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2007-02-02 22:04:39 UTC (rev 1747) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2007-02-02 22:05:12 UTC (rev 1748) @@ -94,19 +94,4 @@ return IGUIConstants.CONFIG_DIR; } - /** {@inheritDoc} */ - @Nullable @Override public CFArchType getType(@NotNull final GameObject gameObject) { - CFArchType result = null; - for (final CFArchType type : archTypeList) { - if (result == null) { - result = type; - } - if (type.matches(gameObject)) { - return type; - } - } - - return result; - } - } // class CFArchTypeList Modified: trunk/daimonin/src/daieditor/CFArchTypeList.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchTypeList.java 2007-02-02 22:04:39 UTC (rev 1747) +++ trunk/daimonin/src/daieditor/CFArchTypeList.java 2007-02-02 22:05:12 UTC (rev 1748) @@ -135,15 +135,4 @@ } } - /** {@inheritDoc} */ - @Nullable @Override public CFArchType getType(@NotNull final GameObject gameObject) { - for (final CFArchType type : archTypeList) { - if (type.matches(gameObject)) { - return type; - } - } - - return getArchType(0); - } - } // class CFArchTypeList Modified: trunk/src/app/net/sf/gridarta/CFArchTypeList.java =================================================================== --- trunk/src/app/net/sf/gridarta/CFArchTypeList.java 2007-02-02 22:04:39 UTC (rev 1747) +++ trunk/src/app/net/sf/gridarta/CFArchTypeList.java 2007-02-02 22:05:12 UTC (rev 1748) @@ -64,6 +64,12 @@ protected final CFArchType defaultArchType; /** + * The default (fallback) type used for game objects not matching any + * defined type. + */ + private CFArchType defaultType = null; + + /** * Lists with all CFArchTypes. * Contains all but the default CFArchType. * @todo verify whether the default CFArchType really is not included in this list. @@ -165,6 +171,11 @@ } catch (final XPathExpressionException e) { log.error("XPath error: " + e.getMessage()); } + + defaultType = archTypeNames.get("Misc"); + if (defaultType == null) { + defaultType = new CFArchType(defaultArchType); + } } private void parseBitmasks(final Element root) throws XPathExpressionException { @@ -339,8 +350,8 @@ } } } - // type of archobject not found - return first one (misc) - return archTypeList.get(0); + // type of archobject not found - return default type + return defaultType; } /** @@ -373,19 +384,28 @@ * in the attribute-dialog. * @param typeName Name of the type to get. * @return the <code>CFArchType</code> that matches, - * or the first (misc) type if no match is found. + * or the default ("Misc") type if no match is found. */ public CFArchType getTypeByName(final String typeName) { // return: matching type or first type (misc) if no other found final CFArchType type = archTypeNames.get(typeName.trim()); - return type == null ? archTypeList.get(0) : type; + return type == null ? defaultType : type; } /** * Returns the CFArchType for the given GameObject. * @param gameObject The GameObject to find the CFArchType for. - * @return The CFArchType for the given GameObject or <code>null</code> if no archetype was found. + * @return the CFArchType for the given GameObject or the default type if no match was found */ - @Nullable public abstract CFArchType getType(@NotNull final G gameObject); + @NotNull public CFArchType getType(@NotNull final GameObject gameObject) { + for (final CFArchType type : archTypeList) { + if (type.matches(gameObject)) { + return type; + } + } + return defaultType; + } + + } // class CFArchTypeList This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-02-02 22:38:53
|
Revision: 1754 http://svn.sourceforge.net/gridarta/?rev=1754&view=rev Author: christianhujer Date: 2007-02-02 14:38:53 -0800 (Fri, 02 Feb 2007) Log Message: ----------- Fixed some Javadoc errors. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java trunk/src/app/net/sf/gridarta/gui/map/package-info.java Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java 2007-02-02 22:17:36 UTC (rev 1753) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java 2007-02-02 22:38:53 UTC (rev 1754) @@ -56,7 +56,7 @@ * Stores and manages information about scripted events. * This data is only needed for those arches with one or more events defined. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @XXX This class is designed very badly, as it combines model and presentation. + * @xxx This class is designed very badly, as it combines model and presentation. */ public final class ScriptArchData { Modified: trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java 2007-02-02 22:17:36 UTC (rev 1753) +++ trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java 2007-02-02 22:38:53 UTC (rev 1754) @@ -58,7 +58,8 @@ * Stores and manages information about scripted events. * This data is only needed for those arches with one or more events defined. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @XXX This class is designed very badly, as it combines model and presentation. + * @xxx:w +his class is designed very badly, as it combines model and presentation. */ public final class ScriptArchData implements Serializable { Modified: trunk/src/app/net/sf/gridarta/gui/map/package-info.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/package-info.java 2007-02-02 22:17:36 UTC (rev 1753) +++ trunk/src/app/net/sf/gridarta/gui/map/package-info.java 2007-02-02 22:38:53 UTC (rev 1754) @@ -19,8 +19,8 @@ /** * Base classes for rendering maps. - * A {@link MapGrid} contains a 2D array of flags for highlighting tiles on a map. - * A {@link MapCursor} is used to modify selection and cursor position flags on this MapGrid. + * A {@link net.sf.gridarta.gui.map.MapGrid} contains a 2D array of flags for highlighting tiles on a map. + * A {@link net.sf.gridarta.gui.map.MapCursor} is used to modify selection and cursor position flags on this MapGrid. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ package net.sf.gridarta.gui.map; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-02-02 23:00:25
|
Revision: 1756 http://svn.sourceforge.net/gridarta/?rev=1756&view=rev Author: christianhujer Date: 2007-02-02 15:00:20 -0800 (Fri, 02 Feb 2007) Log Message: ----------- Fixed some Javadoc errors related to isEquals(). Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObjectContainer.java trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2007-02-02 22:42:15 UTC (rev 1755) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2007-02-02 23:00:20 UTC (rev 1756) @@ -680,7 +680,7 @@ } /** {@inheritDoc} */ - public boolean isEqual(@NotNull final GameObject gameObject) { + @Override public boolean isEqual(@NotNull final GameObject gameObject) { return super.isEqual(gameObject) && (gameObject.faceName == null ? faceName == null : gameObject.faceName.equals(faceName)) && (gameObject.animText == null ? animText == null : gameObject.animText.equals(animText)) Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2007-02-02 22:42:15 UTC (rev 1755) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2007-02-02 23:00:20 UTC (rev 1756) @@ -732,7 +732,7 @@ } /** {@inheritDoc} */ - public boolean isEqual(@NotNull final GameObject gameObject) { + @Override public boolean isEqual(@NotNull final GameObject gameObject) { return super.isEqual(gameObject) && (gameObject.faceObjName == null ? faceObjName == null : gameObject.faceObjName.equals(faceObjName)) && (gameObject.faceRealName == null ? faceRealName == null : gameObject.faceRealName.equals(faceRealName)) Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-02-02 22:42:15 UTC (rev 1755) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-02-02 23:00:20 UTC (rev 1756) @@ -980,8 +980,14 @@ return multiY; } - /** {@inheritDoc} */ - public boolean isEqual(@NotNull final GameObject<G, A, R> gameObject) { + /** + * Compare this object to another game object. + * + * @param gameObject the other game object + * + * @return <code>true</code> if this object equals the other object + */ + public boolean isEqual(@NotNull final G gameObject) { return super.isEqual(gameObject) && gameObject.artifact == artifact // ignore "container" Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObjectContainer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObjectContainer.java 2007-02-02 22:42:15 UTC (rev 1755) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObjectContainer.java 2007-02-02 23:00:20 UTC (rev 1756) @@ -387,7 +387,6 @@ } } - /** {@inheritDoc} */ // writeObject() is not required because this class doesn't require special handling during serialization. private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); Modified: trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java 2007-02-02 22:42:15 UTC (rev 1755) +++ trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java 2007-02-02 23:00:20 UTC (rev 1756) @@ -98,7 +98,6 @@ return modified; } - /** {@inheritDoc} */ public void resetModified() { if (!modified) { return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-02-03 09:49:31
|
Revision: 1758 http://svn.sourceforge.net/gridarta/?rev=1758&view=rev Author: akirschbaum Date: 2007-02-03 01:49:31 -0800 (Sat, 03 Feb 2007) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-02-03 09:26:08 UTC (rev 1757) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2007-02-03 09:49:31 UTC (rev 1758) @@ -494,104 +494,104 @@ continue; } - out.writeBytes("Object " + arch.getArchetypeName() + "\n"); + if (arch.getArchetypeName().compareTo(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME) == 0) { + // process map arch - if (arch.getObjName() != null) { - out.writeBytes("name " + arch.getObjName() + "\n"); - } - if (arch.getFaceName() != null) { - out.writeBytes("face " + arch.getFaceName() + "\n"); - } - if (arch.getArchTypNr() > 0) { - out.writeBytes("type " + arch.getArchTypNr() + "\n"); - } + out.writeBytes("Object " + arch.getArchetypeName() + "\n"); - // special: add a string-attribute with the display-category - out.writeBytes("editor_folder " + arch.getEditorFolder() + '\n'); + // 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 (arch.getArchetypeName().compareTo(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME) == 0) { + out.writeBytes("x " + arch.getMultiX() + "\n"); + out.writeBytes("y " + arch.getMultiY() + "\n"); + } - // add message text - if (arch.getMsgText() != null && arch.getMsgText().trim().length() > 0) { - out.writeBytes("msg\n" + arch.getMsgText().trim() + "\nendmsg\n"); - } + if (arch.getObjName() != null) { + out.writeBytes("name " + arch.getObjName() + "\n"); + } + if (arch.getFaceName() != null) { + out.writeBytes("face " + arch.getFaceName() + "\n"); + } + if (arch.getArchTypNr() > 0) { + out.writeBytes("type " + arch.getArchTypNr() + "\n"); + } - out.writeBytes(arch.getObjectText()); - if (arch.getObjectText().lastIndexOf(0x0a) != arch.getObjectText().length() - 1) { - out.writeBytes("\n"); - } + out.writeBytes(arch.getObjectText()); + if (arch.getObjectText().lastIndexOf(0x0a) != arch.getObjectText().length() - 1) { + out.writeBytes("\n"); + } - out.writeBytes("end\n"); - count++; - if (count % 100 == 0) { - progress.setValue(count); - } + out.writeBytes("end\n"); + } else { + out.writeBytes("Object " + arch.getArchetypeName() + "\n"); - // if multi-head, we must attach the tails - for (GameObject tail = arch.getMultiNext(); tail != null; tail = tail.getMultiNext()) { - out.writeBytes("More\n"); - - out.writeBytes("Object " + tail.getArchetypeName() + "\n"); - - if (tail.getObjName() != null) { - out.writeBytes("name " + tail.getObjName() + "\n"); + if (arch.getObjName() != null) { + out.writeBytes("name " + arch.getObjName() + "\n"); } - if (tail.getFaceName() != null) { - out.writeBytes("face " + tail.getFaceName() + "\n"); + if (arch.getFaceName() != null) { + out.writeBytes("face " + arch.getFaceName() + "\n"); } - if (tail.getArchTypNr() > 0) { - out.writeBytes("type " + tail.getArchTypNr() + "\n"); + if (arch.getArchTypNr() > 0) { + out.writeBytes("type " + arch.getArchTypNr() + "\n"); } - out.writeBytes(tail.getObjectText()); - if (tail.getObjectText().lastIndexOf(0x0a) != tail.getObjectText().length() - 1) { + // special: add a string-attribute with the display-category + out.writeBytes("editor_folder " + arch.getEditorFolder() + '\n'); + + // add message text + if (arch.getMsgText() != null && arch.getMsgText().trim().length() > 0) { + out.writeBytes("msg\n" + arch.getMsgText().trim() + "\nendmsg\n"); + } + + out.writeBytes(arch.getObjectText()); + if (arch.getObjectText().lastIndexOf(0x0a) != arch.getObjectText().length() - 1) { out.writeBytes("\n"); } - // position of multi relative to head - if (tail.getMultiX() != 0) { - out.writeBytes("x " + tail.getMultiX() + "\n"); - } - if (tail.getMultiY() != 0) { - out.writeBytes("y " + tail.getMultiY() + "\n"); - } out.writeBytes("end\n"); - count++; - if (count % 100 == 0) { - progress.setValue(count); - } - } - } - // finally we need to get the "map"-arch, which is not in the panels - final Archetype maparch = getArchetype(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME); - if (maparch != null) { - count++; + // if multi-head, we must attach the tails + for (GameObject tail = arch.getMultiNext(); tail != null; tail = tail.getMultiNext()) { + out.writeBytes("More\n"); - out.writeBytes("Object " + maparch.getArchetypeName() + "\n"); + out.writeBytes("Object " + tail.getArchetypeName() + "\n"); - // 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 (maparch.getArchetypeName().compareTo(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME) == 0) { - out.writeBytes("x " + maparch.getMultiX() + "\n"); - out.writeBytes("y " + maparch.getMultiY() + "\n"); - } + if (tail.getObjName() != null) { + out.writeBytes("name " + tail.getObjName() + "\n"); + } + if (tail.getFaceName() != null) { + out.writeBytes("face " + tail.getFaceName() + "\n"); + } + if (tail.getArchTypNr() > 0) { + out.writeBytes("type " + tail.getArchTypNr() + "\n"); + } - if (maparch.getObjName() != null) { - out.writeBytes("name " + maparch.getObjName() + "\n"); + out.writeBytes(tail.getObjectText()); + if (tail.getObjectText().lastIndexOf(0x0a) != tail.getObjectText().length() - 1) { + out.writeBytes("\n"); + } + + // position of multi relative to head + if (tail.getMultiX() != 0) { + out.writeBytes("x " + tail.getMultiX() + "\n"); + } + if (tail.getMultiY() != 0) { + out.writeBytes("y " + tail.getMultiY() + "\n"); + } + out.writeBytes("end\n"); + + count++; + if (count % 100 == 0) { + progress.setValue(count); + } + } } - if (maparch.getFaceName() != null) { - out.writeBytes("face " + maparch.getFaceName() + "\n"); - } - if (maparch.getArchTypNr() > 0) { - out.writeBytes("type " + maparch.getArchTypNr() + "\n"); - } - out.writeBytes(maparch.getObjectText()); - if (maparch.getObjectText().lastIndexOf(0x0a) != maparch.getObjectText().length() - 1) { - out.writeBytes("\n"); + count++; + if (count % 100 == 0) { + progress.setValue(count); } - - out.writeBytes("end\n"); } // check if we still missed any arches Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-03 09:26:08 UTC (rev 1757) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2007-02-03 09:49:31 UTC (rev 1758) @@ -539,7 +539,6 @@ } out.append("end\n"); } else { - if (arch.isTail()) { continue; } @@ -634,6 +633,7 @@ out.append("y ").append(Integer.toString(tail.getMultiY())).append('\n'); } out.append("end\n"); + count++; if (count % 100 == 0) { progress.setValue(count); @@ -641,6 +641,7 @@ } } } + count++; if (count % 100 == 0) { progress.setValue(count); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |