From: <aki...@us...> - 2011-08-27 06:50:36
|
Revision: 8966 http://gridarta.svn.sourceforge.net/gridarta/?rev=8966&view=rev Author: akirschbaum Date: 2011-08-27 06:50:28 +0000 (Sat, 27 Aug 2011) Log Message: ----------- Add "Exits" panel to main window. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapLocation.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ConnectionControl.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/Control.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/LockedItemsControl.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/MonsterControl.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsControl.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsView.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-08-26 19:01:58 UTC (rev 8965) +++ trunk/atrinik/ChangeLog 2011-08-27 06:50:28 UTC (rev 8966) @@ -1,3 +1,9 @@ +2011-08-27 Andreas Kirschbaum + + * Add "Exits" panel to main window. It shows all exits leading + from the current map. Double-click on an entry opens the + destination map. + 2011-08-06 Andreas Kirschbaum * Improve plugin editor. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2011-08-26 19:01:58 UTC (rev 8965) +++ trunk/crossfire/ChangeLog 2011-08-27 06:50:28 UTC (rev 8966) @@ -1,3 +1,9 @@ +2011-08-27 Andreas Kirschbaum + + * Add "Exits" panel to main window. It shows all exits leading + from the current map. Double-click on an entry opens the + destination map. + 2011-08-06 Andreas Kirschbaum * Improve plugin editor. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2011-08-26 19:01:58 UTC (rev 8965) +++ trunk/daimonin/ChangeLog 2011-08-27 06:50:28 UTC (rev 8966) @@ -1,3 +1,9 @@ +2011-08-27 Andreas Kirschbaum + + * Add "Exits" panel to main window. It shows all exits leading + from the current map. Double-click on an entry opens the + destination map. + 2011-08-06 Andreas Kirschbaum * Improve plugin editor. Modified: trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java 2011-08-26 19:01:58 UTC (rev 8965) +++ trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java 2011-08-27 06:50:28 UTC (rev 8966) @@ -725,17 +725,17 @@ /** * Enter a map wanted. - * @param currentMapView the map view to leave + * @param mapView the map view to leave * @param path path to map that should be loaded * @param direction the direction to go * @param destinationPoint the desired destination point on the map (pass * 0|0 if unknown, and note that the point gets modified) * @return whether the destination map has been entered */ - private boolean enterMap(@NotNull final MapView<G, A, R> currentMapView, @NotNull final String path, @NotNull final Direction direction, @Nullable final Point destinationPoint) { + private boolean enterMap(@NotNull final MapView<G, A, R> mapView, @NotNull final String path, @NotNull final Direction direction, @Nullable final Point destinationPoint) { final File canonicalNewFile; try { - canonicalNewFile = mapPathNormalizer.normalizeMapPath(currentMapView.getMapControl().getMapModel(), path); + canonicalNewFile = mapPathNormalizer.normalizeMapPath(mapView.getMapControl().getMapModel(), path); } catch (final InvalidPathException ex) { ACTION_BUILDER.showMessageDialog(parent, "enterExitInvalidPath", ex.getFile().getAbsolutePath()); return false; @@ -748,28 +748,51 @@ } catch (final SameMapException ignored) { // path points to the same map if (destinationPoint != null) { - showLocation(currentMapView, destinationPoint); + showLocation(mapView, destinationPoint); } return true; } + return enterMap(mapView, canonicalNewFile, destinationPoint, direction); + } + /** + * Enters a map. + * @param mapFile the map file to enter + * @param destinationPoint the desired destination point on the map or + * <code>null</code> for default + */ + public void enterMap(@NotNull final File mapFile, @Nullable final Point destinationPoint) { + enterMap(currentMapView, mapFile, destinationPoint, Direction.NORTH); + } + + /** + * Enters a map. + * @param mapView the current map view; may be closed it + * non-<code>null</code> + * @param mapFile the map file to enter + * @param destinationPoint the desired destination point on the map or + * <code>null</code> for default + * @param direction the direction to go + * @return whether the destination map has been entered + */ + private boolean enterMap(@Nullable final MapView<G, A, R> mapView, @NotNull final File mapFile, @Nullable final Point destinationPoint, @NotNull final Direction direction) { final MapView<G, A, R> newMapView; try { - newMapView = mapViewsManager.openMapFileWithView(canonicalNewFile, null, destinationPoint); + newMapView = mapViewsManager.openMapFileWithView(mapFile, null, destinationPoint); } catch (final IOException ex) { - fileControl.reportLoadError(canonicalNewFile, ex.getMessage()); + fileControl.reportLoadError(mapFile, ex.getMessage()); return false; } if (destinationPoint != null) { showLocation(newMapView, destinationPoint); - } else { - newMapView.getMapViewBasic().getScrollPane().getViewport().setViewPosition(calculateNewViewPosition(currentMapView.getMapViewBasic().getScrollPane(), newMapView.getMapViewBasic().getScrollPane(), direction)); + } else if (mapView != null) { + newMapView.getMapViewBasic().getScrollPane().getViewport().setViewPosition(calculateNewViewPosition(mapView.getMapViewBasic().getScrollPane(), newMapView.getMapViewBasic().getScrollPane(), direction)); } - if (ACTION_BUILDER.showOnetimeConfirmDialog(parent, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, "enterExitClose") == JOptionPane.YES_OPTION) { + if (mapView != null && ACTION_BUILDER.showOnetimeConfirmDialog(parent, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, "enterExitClose") == JOptionPane.YES_OPTION) { // only close current map if a new file was opened and user wants to close it - mapViewsManager.closeMapView(currentMapView); + mapViewsManager.closeMapView(mapView); } return true; Modified: trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapLocation.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapLocation.java 2011-08-26 19:01:58 UTC (rev 8965) +++ trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapLocation.java 2011-08-27 06:50:28 UTC (rev 8966) @@ -20,8 +20,13 @@ package net.sf.gridarta.gui.map.mapactions; import java.awt.Point; +import java.io.File; import java.util.regex.Pattern; import net.sf.gridarta.model.baseobject.BaseObject; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.io.PathManager; +import net.sf.gridarta.model.mapmodel.MapModel; +import net.sf.gridarta.model.mapmodel.MapSquare; import net.sf.gridarta.utils.StringUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -70,10 +75,45 @@ * @throws NoExitPathException if the game object is not a valid exit */ public MapLocation(@NotNull final BaseObject<?, ?, ?, ?> gameObject, final boolean allowRandomMapParameters) throws NoExitPathException { - this(getMapPath(gameObject, allowRandomMapParameters), gameObject.getAttributeInt(BaseObject.HP), gameObject.getAttributeInt(BaseObject.SP)); + this(getMapPath(gameObject, allowRandomMapParameters), getMapX(gameObject), getMapY(gameObject)); } /** + * Creates a new instance from a {@link BaseObject} instance. The new + * <code>MapLocation</code> instance includes an absolute map path. + * @param gameObject the game object + * @param allowRandomMapParameters whether random map parameters should be + * considered + * @param pathManager the path manager for converting relative path names + * @return the new map location instance + * @throws NoExitPathException if the game object is not a valid exit + */ + @NotNull + public static MapLocation newAbsoluteMapLocation(@NotNull final GameObject<?, ?, ?> gameObject, final boolean allowRandomMapParameters, @NotNull final PathManager pathManager) throws NoExitPathException { + final String mapPath = getMapPath(gameObject, allowRandomMapParameters); + if (mapPath.isEmpty()) { + throw new NoExitPathException(gameObject); + } + final String baseMapPath; + final MapSquare<?, ?, ?> mapSquare = gameObject.getMapSquare(); + if (mapSquare == null) { + baseMapPath = "/"; + } else { + final MapModel<?, ?, ?> mapModel = mapSquare.getMapModel(); + final File mapFile = mapModel.getMapFile(); + if (mapFile == null) { + baseMapPath = "/"; + } else { + baseMapPath = pathManager.getMapPath(mapFile); + } + } + final String canonicalMapPath = PathManager.relativeToAbsolute(baseMapPath, mapPath); + final int mapX = getMapX(gameObject); + final int mapY = getMapY(gameObject); + return new MapLocation(canonicalMapPath, mapX, mapY); + } + + /** * Returns the map path. * @return the map path */ @@ -115,6 +155,24 @@ } /** + * Returns the exit x coordinate of a {@link BaseObject}. + * @param gameObject the game object + * @return the exit x coordinate + */ + private static int getMapY(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { + return gameObject.getAttributeInt(BaseObject.SP); + } + + /** + * Returns the exit y coordinate of a {@link BaseObject}. + * @param gameObject the game object + * @return the exit y coordinate + */ + private static int getMapX(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { + return gameObject.getAttributeInt(BaseObject.HP); + } + + /** * Returns the exit map path of a {@link BaseObject}. * @param gameObject the game object * @param allowRandomMapParameters whether random maps should be considered @@ -159,4 +217,13 @@ return null; } + /** + * {@inheritDoc} + */ + @NotNull + @Override + public String toString() { + return mapCoordinate.x + "/" + mapCoordinate.y + "@" + mapPath; + } + } // class MapLocation Modified: trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ConnectionControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ConnectionControl.java 2011-08-26 19:01:58 UTC (rev 8965) +++ trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ConnectionControl.java 2011-08-27 06:50:28 UTC (rev 8966) @@ -42,4 +42,12 @@ super(new ConnectionView<G, A, R>(mapViewManager, delayedMapModelListenerManager)); } + /** + * {@inheritDoc} + */ + @Override + protected void doubleClick(@NotNull final Connection<Integer> connection) { + // ignore + } + } // class ConnectionControl Modified: trunk/src/app/net/sf/gridarta/gui/panel/connectionview/Control.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/connectionview/Control.java 2011-08-26 19:01:58 UTC (rev 8965) +++ trunk/src/app/net/sf/gridarta/gui/panel/connectionview/Control.java 2011-08-27 06:50:28 UTC (rev 8966) @@ -22,6 +22,7 @@ import java.awt.Point; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.util.Iterator; import javax.swing.JPanel; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; @@ -70,11 +71,23 @@ @Override public void mousePressed(final MouseEvent e) { highlightSelectedEntries(); + if (e.getClickCount() == 2) { + final Iterator<Connection<K>> it = view.getSelectedConnections().iterator(); + if (it.hasNext()) { + doubleClick(it.next()); + } + } } }); } /** + * Called if an entry is double-clicked. + * @param connection the first selected connection + */ + protected abstract void doubleClick(@NotNull final Connection<K> connection); + + /** * Returns the view for this controller. * @return the view for this controller */ Added: trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsControl.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsControl.java 2011-08-27 06:50:28 UTC (rev 8966) @@ -0,0 +1,84 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.panel.connectionview; + +import java.io.File; +import net.sf.gridarta.gui.delayedmapmodel.DelayedMapModelListenerManager; +import net.sf.gridarta.gui.map.mapactions.MapActions; +import net.sf.gridarta.gui.map.mapactions.MapLocation; +import net.sf.gridarta.gui.map.mapview.MapViewManager; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.io.PathManager; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.match.GameObjectMatcher; +import net.sf.gridarta.model.settings.GlobalSettings; +import org.jetbrains.annotations.NotNull; + +/** + * The controller of the "Exits" panel. + * @author Andreas Kirschbaum + */ +public class ExitsControl<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends Control<MapLocation, G, A, R> { + + /** + * The {@link GlobalSettings} instance. + */ + @NotNull + private final GlobalSettings globalSettings; + + /** + * The {@link MapActions} instance for entering maps. + */ + @NotNull + private final MapActions<G, A, R> mapActions; + + /** + * Create a new instance. + * @param mapViewManager the map view manager + * @param delayedMapModelListenerManager the delayed map model listener + * manager to use + * @param exitGameObjectMatcher the game object matcher for selecting exits + * @param pathManager the path manager for converting relative exit paths + * @param globalSettings the global settings instance + * @param mapActions the map actions instance for entering maps + */ + public ExitsControl(@NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final DelayedMapModelListenerManager<G, A, R> delayedMapModelListenerManager, @NotNull final GameObjectMatcher exitGameObjectMatcher, @NotNull final PathManager pathManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapActions<G, A, R> mapActions) { + super(new ExitsView<G, A, R>(mapViewManager, delayedMapModelListenerManager, exitGameObjectMatcher, pathManager)); + this.globalSettings = globalSettings; + this.mapActions = mapActions; + } + + /** + * {@inheritDoc} + */ + @Override + protected void doubleClick(@NotNull final Connection<MapLocation> connection) { + final MapLocation mapLocation = connection.getKey(); + final String mapPath = mapLocation.getMapPath(); + if (!mapPath.startsWith("/")) { + return; + } + + final File mapFile = new File(globalSettings.getMapsDirectory().getAbsolutePath(), mapPath.substring(1)); + mapActions.enterMap(mapFile, mapLocation.getMapCoordinate()); + } + +} // class ExitsControl Property changes on: trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsControl.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsView.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsView.java 2011-08-27 06:50:28 UTC (rev 8966) @@ -0,0 +1,157 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.panel.connectionview; + +import java.awt.Point; +import java.util.Comparator; +import net.sf.gridarta.gui.delayedmapmodel.DelayedMapModelListenerManager; +import net.sf.gridarta.gui.map.mapactions.MapLocation; +import net.sf.gridarta.gui.map.mapactions.NoExitPathException; +import net.sf.gridarta.gui.map.mapview.MapViewManager; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.baseobject.BaseObject; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.io.PathManager; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.match.GameObjectMatcher; +import org.jetbrains.annotations.NotNull; + +/** + * The view part of the "Exits" panel. + * @author Andreas Kirschbaum + */ +public class ExitsView<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends View<MapLocation, G, A, R> { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * A {@link Comparator} that compares {@link MapLocation} instances by map + * path and map coordinate. + */ + @NotNull + private static final Comparator<MapLocation> mapLocationComparator = new Comparator<MapLocation>() { + + @Override + public int compare(@NotNull final MapLocation o1, @NotNull final MapLocation o2) { + final int cmp = o1.getMapPath().compareTo(o2.getMapPath()); + if (cmp != 0) { + return cmp; + } + + final Point p1 = o1.getMapCoordinate(); + final Point p2 = o2.getMapCoordinate(); + if (p1.x < p2.x) { + return -1; + } + if (p1.x > p2.x) { + return +1; + } + if (p1.y < p2.y) { + return -1; + } + if (p1.y > p2.y) { + return +1; + } + + return 0; + } + + }; + + /** + * The {@link GameObjectMatcher} for selecting exits. + */ + @NotNull + private final GameObjectMatcher exitGameObjectMatcher; + + /** + * The {@link PathManager} for converting relative exit paths. + */ + @NotNull + private final PathManager pathManager; + + /** + * Creates a new instance. + * @param mapViewManager the map view manager + * @param delayedMapModelListenerManager the delayed map model listener + * manager to use + * @param exitGameObjectMatcher the game object matcher for selecting exits + * @param pathManager the path manager for converting relative exit paths + */ + public ExitsView(@NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final DelayedMapModelListenerManager<G, A, R> delayedMapModelListenerManager, @NotNull final GameObjectMatcher exitGameObjectMatcher, @NotNull final PathManager pathManager) { + super(mapLocationComparator, new ExitsCellRenderer(), mapViewManager, delayedMapModelListenerManager); + this.exitGameObjectMatcher = exitGameObjectMatcher; + this.pathManager = pathManager; + } + + /** + * {@inheritDoc} + */ + @Override + protected void scanGameObjectForConnections(@NotNull final G gameObject) { + if (!exitGameObjectMatcher.isMatching(gameObject)) { + return; + } + + final MapLocation mapLocation; + try { + mapLocation = MapLocation.newAbsoluteMapLocation(gameObject, true, pathManager); + } catch (final NoExitPathException ignored) { + return; + } + addConnection(mapLocation, gameObject); + } + + /** + * A {@link CellRenderer} for the locked items view. + * @author Andreas Kirschbaum + */ + private static class ExitsCellRenderer extends CellRenderer<MapLocation> { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * {@inheritDoc} + */ + @NotNull + @Override + protected String formatKey(@NotNull final MapLocation key) { + final Point mapCoordinate = key.getMapCoordinate(); + return key.getMapPath() + "@" + mapCoordinate.x + "/" + mapCoordinate.y; + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + protected String formatValue(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { + return gameObject.getBestName(); + } + + } + +} // class ExitsView Property changes on: trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsView.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/gui/panel/connectionview/LockedItemsControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/connectionview/LockedItemsControl.java 2011-08-26 19:01:58 UTC (rev 8965) +++ trunk/src/app/net/sf/gridarta/gui/panel/connectionview/LockedItemsControl.java 2011-08-27 06:50:28 UTC (rev 8966) @@ -43,4 +43,12 @@ super(new LockedItemsView<G, A, R>(mapViewManager, delayedMapModelListenerManager, typeNumbers)); } + /** + * {@inheritDoc} + */ + @Override + protected void doubleClick(@NotNull final Connection<String> connection) { + // ignore + } + } // class LockedItemsControl Modified: trunk/src/app/net/sf/gridarta/gui/panel/connectionview/MonsterControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/connectionview/MonsterControl.java 2011-08-26 19:01:58 UTC (rev 8965) +++ trunk/src/app/net/sf/gridarta/gui/panel/connectionview/MonsterControl.java 2011-08-27 06:50:28 UTC (rev 8966) @@ -45,4 +45,12 @@ super(new MonsterView<G, A, R>(mapViewManager, delayedMapModelListenerManager, monsterMatcher)); } + /** + * {@inheritDoc} + */ + @Override + protected void doubleClick(@NotNull final Connection<GameObject<G, A, R>> connection) { + // ignore + } + } // class MonsterControl Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2011-08-26 19:01:58 UTC (rev 8965) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2011-08-27 06:50:28 UTC (rev 8966) @@ -89,6 +89,7 @@ import net.sf.gridarta.gui.panel.archetypechooser.ArchetypeChooserControl; import net.sf.gridarta.gui.panel.connectionview.ConnectionControl; import net.sf.gridarta.gui.panel.connectionview.Control; +import net.sf.gridarta.gui.panel.connectionview.ExitsControl; import net.sf.gridarta.gui.panel.connectionview.LockedItemsControl; import net.sf.gridarta.gui.panel.connectionview.MonsterControl; import net.sf.gridarta.gui.panel.gameobjectattributes.ArchTab; @@ -494,6 +495,8 @@ final MapPropertiesDialogFactory<G, A, R> mapPropertiesDialogFactory = editorFactory.newMapPropertiesDialogFactory(globalSettings, mapManager, mapPathNormalizer); final DelayedMapModelListenerManager<G, A, R> delayedMapModelListenerManager = new DelayedMapModelListenerManager<G, A, R>(mapManager, exiter); final Control<?, G, A, R> lockedItemsControl = new LockedItemsControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, lockedItemsTypeNumbers); + final MapActions<G, A, R> mapActions = new MapActions<G, A, R>(mainViewFrame, mainViewFrame, mapManager, mapViewManager, exitMatcher, GuiFileFilters.mapFileFilter, selectedSquareModel, directionMap, allowRandomMapParameters, mapPropertiesDialogFactory, mapViewSettings, mapPathNormalizer, mapViewsManager, fileControl); + final Control<?, G, A, R> exitsControl = new ExitsControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, exitGameObjectMatcher, pathManager, globalSettings, mapActions); final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel = new GameObjectAttributesModel<G, A, R>(); final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl = new GameObjectAttributesControl<G, A, R>(gameObjectAttributesModel, gameObjectAttributesDialogFactory, objectChooser, mapManager, selectedSquareModel, selectedSquareView, gameObjectFactory); final PluginParameterViewFactory<G, A, R> pluginParameterViewFactory = new PluginParameterViewFactory<G, A, R>(archetypeSet, gameObjectAttributesModel, objectChooser, mapManager, faceObjectProviders); @@ -513,8 +516,6 @@ new UndoControl<G, A, R>(mapManager, gameObjectFactory, gameObjectMatchers); final Action exitAction = ActionUtils.newAction(ACTION_BUILDER, "Other", this, "exit"); final MapFolderTreeActions<G, A, R> mapFolderTreeActions = new MapFolderTreeActions<G, A, R>(mapFolderTree, pickmapSettings, newMapDialogFactory, "createPickmapFolder", "deletePickmapFolder", "confirmDeletePickmapFolder", "deletePickmapFolderNotEmpty"); - //noinspection ResultOfObjectAllocationIgnored - new MapActions<G, A, R>(mainViewFrame, mainViewFrame, mapManager, mapViewManager, exitMatcher, GuiFileFilters.mapFileFilter, selectedSquareModel, directionMap, allowRandomMapParameters, mapPropertiesDialogFactory, mapViewSettings, mapPathNormalizer, mapViewsManager, fileControl); final ViewActions<G, A, R> viewActions = new ViewActions<G, A, R>(mapViewSettings, mapManager); //noinspection ResultOfObjectAllocationIgnored new MapFileActions<G, A, R>(imageCreator2, mapManager, mapViewsManager, mapViewManager, fileControl, mainViewFrame); @@ -588,8 +589,9 @@ mainView.addTab(new Tab("monsters", new MonsterControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, monsterMatcher).getView(), Location.BOTTOM, false, 4, false)); mainView.addTab(new Tab("connections", new ConnectionControl<G, A, R>(mapViewManager, delayedMapModelListenerManager).getView(), Location.BOTTOM, false, 5, false)); mainView.addTab(new Tab("lockedItems", lockedItemsControl.getView(), Location.BOTTOM, false, 6, false)); - mainView.addTab(new WarningsTab<G, A, R>("warnings", errorListView, Location.BOTTOM, false, 7, false)); - mainView.addTab(new GameObjectTextEditorTab<G, A, R>("textEditor", new GameObjectTextEditor(archetypeTypeSet), Location.RIGHT, true, 8, false, selectedSquareModel, mapManager)); + mainView.addTab(new Tab("exits", exitsControl.getView(), Location.BOTTOM, false, 7, false)); + mainView.addTab(new WarningsTab<G, A, R>("warnings", errorListView, Location.BOTTOM, false, 8, false)); + mainView.addTab(new GameObjectTextEditorTab<G, A, R>("textEditor", new GameObjectTextEditor(archetypeTypeSet), Location.RIGHT, true, 9, false, selectedSquareModel, mapManager)); new ArchetypeValidator(animationObjects, faceObjects, errorView).validate(archetypeSet); new AnimationValidator(faceObjects, errorView).validate(animationObjects); Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2011-08-26 19:01:58 UTC (rev 8965) +++ trunk/src/app/net/sf/gridarta/messages.properties 2011-08-27 06:50:28 UTC (rev 8966) @@ -1643,6 +1643,9 @@ tabButton.lockedItems.title1=Locked Items tabButton.lockedItems.title2={0}: Locked Items tabButton.lockedItems.shortdescription=Display the locked items of the current map. +tabButton.exits.title1=Exits +tabButton.exits.title2={0}: Exits +tabButton.exits.shortdescription=Display the exits from the current map. tabButton.textEditor.title1=Text Editor tabButton.textEditor.title2={0}: Text Editor tabButton.textEditor.shortdescription=Display the game object text editor for the selected game object. Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2011-08-26 19:01:58 UTC (rev 8965) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2011-08-27 06:50:28 UTC (rev 8966) @@ -1409,6 +1409,9 @@ tabButton.lockedItems.title1=Verriegelte Objekte tabButton.lockedItems.title2={0}: Verriegelte Objekte tabButton.lockedItems.shortdescription=Zeigt verriegelte T\u00fcren und Schl\u00fcssel in der aktuellen Karte. +tabButton.exits.title1=Ausg\xE4nge +tabButton.exits.title2={0}: Ausga\xE4nge +tabButton.exits.shortdescription=Zeigt Ausg\xE4nge aus der aktuellen Karte. tabButton.textEditor.title1=Text Editor tabButton.textEditor.title2={0}: Text Editor tabButton.textEditor.shortdescription=Zeigt den Objekt-Text des ausgew\u00e4hlten Objekts an. Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2011-08-26 19:01:58 UTC (rev 8965) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2011-08-27 06:50:28 UTC (rev 8966) @@ -1398,6 +1398,9 @@ tabButton.lockedItems.title1=Objets verrouill\u00e9s tabButton.lockedItems.title2={0} : Objets verrouill\u00e9s #tabButton.lockedItems.shortdescription= +#tabButton.exits.title1= +#tabButton.exits.title2= +#tabButton.exits.shortdescription= #tabButton.textEditor.title1= #tabButton.textEditor.title2= #tabButton.textEditor.shortdescription= Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2011-08-26 19:01:58 UTC (rev 8965) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2011-08-27 06:50:28 UTC (rev 8966) @@ -1397,6 +1397,9 @@ #tabButton.lockedItems.title1= #tabButton.lockedItems.title2= #tabButton.lockedItems.shortdescription= +#tabButton.exits.title1= +#tabButton.exits.title2= +#tabButton.exits.shortdescription= #tabButton.textEditor.title1= #tabButton.textEditor.title2= #tabButton.textEditor.shortdescription= This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |