From: <aki...@us...> - 2008-05-17 11:55:18
|
Revision: 4022 http://gridarta.svn.sourceforge.net/gridarta/?rev=4022&view=rev Author: akirschbaum Date: 2008-05-17 04:55:25 -0700 (Sat, 17 May 2008) Log Message: ----------- Move FilterFaceProvider to common code base. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gameobject/face/FilterFaceProvider.java Removed Paths: ------------- trunk/daimonin/src/daieditor/gameobject/face/FilterFaceProvider.java Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2008-05-17 11:54:05 UTC (rev 4021) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2008-05-17 11:55:25 UTC (rev 4022) @@ -41,6 +41,7 @@ import net.sf.gridarta.gameobject.face.CollectedFaceProvider; import net.sf.gridarta.gameobject.face.DuplicateFaceException; import net.sf.gridarta.gameobject.face.FaceProvider; +import net.sf.gridarta.gameobject.face.FilterFaceProvider; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.misc.Progress; import org.apache.log4j.Logger; Deleted: trunk/daimonin/src/daieditor/gameobject/face/FilterFaceProvider.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FilterFaceProvider.java 2008-05-17 11:54:05 UTC (rev 4021) +++ trunk/daimonin/src/daieditor/gameobject/face/FilterFaceProvider.java 2008-05-17 11:55:25 UTC (rev 4022) @@ -1,91 +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; - -import java.awt.Toolkit; -import java.awt.image.FilteredImageSource; -import java.awt.image.ImageFilter; -import javax.swing.ImageIcon; -import net.sf.gridarta.gameobject.face.AbstractFaceProvider; -import net.sf.gridarta.gameobject.face.FaceProvider; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * A FilterFaceProvider provides modified versions of icons provided by another FaceProvider by applying a Filter. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public final class FilterFaceProvider extends AbstractFaceProvider { - - /** The FaceProvider to get the original icon from. */ - @Nullable private FaceProvider parent = null; - - /** The Filter to apply. */ - @NotNull private final ImageFilter filter; - - /** - * Create a FilterFaceProvider. - * The parent is unset. - * The parent must be set with {@link #setParent(FaceProvider)} bevore invoking {@link #getImageIconForFacename(String)} or {@link #createImage(String)} or getting - * a face resp. creating an image will throw an IllegalStateException. - * @param filter ImageFilter to apply for creating the images - */ - public FilterFaceProvider(@NotNull final ImageFilter filter) { - this.filter = filter; - } - - /** - * Create a FilterFaceProvider. - * @param parent parent provider to get unfiltered images from - * @param filter ImageFilter to apply for creating the images - */ - public FilterFaceProvider(@NotNull final FaceProvider parent, @NotNull final ImageFilter filter) { - this.parent = parent; - this.filter = filter; - } - - /** - * Sets a new provider as parent. - * @param parent parent provider to get unfiltered images from - */ - public void setParent(@NotNull final FaceProvider parent) { - this.parent = parent; - } - - /** {@inheritDoc} */ - @Nullable @Override protected ImageIcon createImage(@NotNull final String faceName) { - if (parent == null) { - return null; - } - final ImageIcon imageIcon = parent.getImageIconForFacename(faceName); - if (imageIcon == null) { - return null; - } - try { - return new ImageIcon(Toolkit.getDefaultToolkit().createImage(new FilteredImageSource(imageIcon.getImage().getSource(), filter))); - } catch (final Exception e) { - if (parent == null) { - throw new IllegalStateException("FilterFaceProvider in use but parent not set."); - } - return null; - } - } - -} // class FilterFaceProdiver Copied: trunk/src/app/net/sf/gridarta/gameobject/face/FilterFaceProvider.java (from rev 4019, trunk/daimonin/src/daieditor/gameobject/face/FilterFaceProvider.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/face/FilterFaceProvider.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/face/FilterFaceProvider.java 2008-05-17 11:55:25 UTC (rev 4022) @@ -0,0 +1,89 @@ +/* + * 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; + +import java.awt.Toolkit; +import java.awt.image.FilteredImageSource; +import java.awt.image.ImageFilter; +import javax.swing.ImageIcon; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * A FilterFaceProvider provides modified versions of icons provided by another FaceProvider by applying a Filter. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public final class FilterFaceProvider extends AbstractFaceProvider { + + /** The FaceProvider to get the original icon from. */ + @Nullable private FaceProvider parent = null; + + /** The Filter to apply. */ + @NotNull private final ImageFilter filter; + + /** + * Create a FilterFaceProvider. + * The parent is unset. + * The parent must be set with {@link #setParent(FaceProvider)} bevore invoking {@link #getImageIconForFacename(String)} or {@link #createImage(String)} or getting + * a face resp. creating an image will throw an IllegalStateException. + * @param filter ImageFilter to apply for creating the images + */ + public FilterFaceProvider(@NotNull final ImageFilter filter) { + this.filter = filter; + } + + /** + * Create a FilterFaceProvider. + * @param parent parent provider to get unfiltered images from + * @param filter ImageFilter to apply for creating the images + */ + public FilterFaceProvider(@NotNull final FaceProvider parent, @NotNull final ImageFilter filter) { + this.parent = parent; + this.filter = filter; + } + + /** + * Sets a new provider as parent. + * @param parent parent provider to get unfiltered images from + */ + public void setParent(@NotNull final FaceProvider parent) { + this.parent = parent; + } + + /** {@inheritDoc} */ + @Nullable @Override protected ImageIcon createImage(@NotNull final String faceName) { + if (parent == null) { + return null; + } + final ImageIcon imageIcon = parent.getImageIconForFacename(faceName); + if (imageIcon == null) { + return null; + } + try { + return new ImageIcon(Toolkit.getDefaultToolkit().createImage(new FilteredImageSource(imageIcon.getImage().getSource(), filter))); + } catch (final Exception e) { + if (parent == null) { + throw new IllegalStateException("FilterFaceProvider in use but parent not set."); + } + return null; + } + } + +} // class FilterFaceProdiver Property changes on: trunk/src/app/net/sf/gridarta/gameobject/face/FilterFaceProvider.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-05-17 18:23:45
|
Revision: 4036 http://gridarta.svn.sourceforge.net/gridarta/?rev=4036&view=rev Author: akirschbaum Date: 2008-05-17 11:23:39 -0700 (Sat, 17 May 2008) Log Message: ----------- Add/fix @Nullable annotations. 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 2008-05-17 18:21:21 UTC (rev 4035) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2008-05-17 18:23:39 UTC (rev 4036) @@ -45,6 +45,7 @@ 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. @@ -82,7 +83,7 @@ * referencing an undefined archetype * @return the face of the Archetype as icon */ - @NotNull private ImageIcon getFace(@NotNull final String faceName, final boolean hasUndefinedArchetype) { + @NotNull private ImageIcon getFace(@Nullable final String faceName, final boolean hasUndefinedArchetype) { if (hasUndefinedArchetype) { return SystemIcons.getNoarchTileIcon(); } Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2008-05-17 18:21:21 UTC (rev 4035) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2008-05-17 18:23:39 UTC (rev 4036) @@ -50,6 +50,7 @@ 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. @@ -93,7 +94,7 @@ * referencing an undefined archetype * @return face ImageIcon for face <var>faceName</var> */ - @NotNull private ImageIcon getFace(final String faceName, final boolean hasUndefinedArchetype) { + @NotNull private ImageIcon getFace(@Nullable final String faceName, final boolean hasUndefinedArchetype) { if (hasUndefinedArchetype) { return SystemIcons.getNoarchTileIcon(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-05-17 18:29:09
|
Revision: 4038 http://gridarta.svn.sourceforge.net/gridarta/?rev=4038&view=rev Author: akirschbaum Date: 2008-05-17 11:29:08 -0700 (Sat, 17 May 2008) Log Message: ----------- Unify comment. 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 2008-05-17 18:26:13 UTC (rev 4037) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2008-05-17 18:29:08 UTC (rev 4038) @@ -77,11 +77,11 @@ } /** - * Returns the face of the Archetype as icon. - * @param faceName the face name to display + * Returns the face ImageIcon with a certain face name. + * @param faceName the face name of face ImageIcon * @param hasUndefinedArchetype if set, return the face for an game object * referencing an undefined archetype - * @return the face of the Archetype as icon + * @return face ImageIcon for face <var>faceName</var> */ @NotNull private ImageIcon getFace(@Nullable final String faceName, final boolean hasUndefinedArchetype) { if (hasUndefinedArchetype) { Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2008-05-17 18:26:13 UTC (rev 4037) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2008-05-17 18:29:08 UTC (rev 4038) @@ -88,8 +88,8 @@ } /** - * Get the face ImageIcon with a certain face name. - * @param faceName faceName of face ImageIcon + * Returns the face ImageIcon with a certain face name. + * @param faceName the face name of face ImageIcon * @param hasUndefinedArchetype if set, return the face for an game object * referencing an undefined archetype * @return face ImageIcon for face <var>faceName</var> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-05-21 18:16:40
|
Revision: 4041 http://gridarta.svn.sourceforge.net/gridarta/?rev=4041&view=rev Author: akirschbaum Date: 2008-05-21 11:16:24 -0700 (Wed, 21 May 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gui/CMainView.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gui/CMainView.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java trunk/src/app/net/sf/gridarta/gui/MainView.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-05-17 18:38:17 UTC (rev 4040) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-05-21 18:16:24 UTC (rev 4041) @@ -46,7 +46,6 @@ import java.util.List; import java.util.Map; import java.util.MissingResourceException; -import java.util.ResourceBundle; import java.util.prefs.Preferences; import javax.swing.JFileChooser; import javax.swing.JMenu; @@ -893,14 +892,6 @@ return mapCursorControl; } - public static String getBuildNumberAsString() { - try { - return ResourceBundle.getBundle("build").getString("build.number"); - } catch (final MissingResourceException e) { - return "unknown version"; - } - } - /** {@inheritDoc} */ @NotNull public String getConfigurationDirectory() { return "resource/conf"; Modified: trunk/crossfire/src/cfeditor/gui/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/CMainView.java 2008-05-17 18:38:17 UTC (rev 4040) +++ trunk/crossfire/src/cfeditor/gui/CMainView.java 2008-05-21 18:16:24 UTC (rev 4041) @@ -144,7 +144,7 @@ * @param aCloseAll the action "close all map windows" */ public CMainView(@NotNull final CMainControl mainControl, @NotNull final ObjectChooser objectChooser, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, @NotNull final ActionFactory actionFactory, @NotNull final Action aCloseAll) { - super(mainControl, mapManager, actionFactory.format("mainWindow.title", CMainControl.getBuildNumberAsString())); + super(mainControl, mapManager, actionFactory); this.mainControl = mainControl; this.objectChooser = objectChooser; this.actionFactory = actionFactory; Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-05-17 18:38:17 UTC (rev 4040) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-05-21 18:16:24 UTC (rev 4041) @@ -49,7 +49,6 @@ import java.util.Collections; import java.util.Map; import java.util.MissingResourceException; -import java.util.ResourceBundle; import java.util.prefs.Preferences; import javax.swing.Action; import javax.swing.JFileChooser; @@ -1065,14 +1064,6 @@ return mapCursorControl; } - public static String getBuildNumberAsString() { - try { - return ResourceBundle.getBundle("build").getString("build.number"); - } catch (final MissingResourceException e) { - return "unknown version"; - } - } - /** {@inheritDoc} */ @NotNull public String getConfigurationDirectory() { return globalSettings.getArchDefaultFolder() + "/dev/editor/conf"; Modified: trunk/daimonin/src/daieditor/gui/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/gui/CMainView.java 2008-05-17 18:38:17 UTC (rev 4040) +++ trunk/daimonin/src/daieditor/gui/CMainView.java 2008-05-21 18:16:24 UTC (rev 4041) @@ -144,7 +144,7 @@ * @param aCloseAll the action "close all map windows" */ public CMainView(@NotNull final CMainControl mainControl, @NotNull final ObjectChooser objectChooser, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, @NotNull final ActionFactory actionFactory, @NotNull final Action aCloseAll) { - super(mainControl, mapManager, actionFactory.format("mainWindow.title", CMainControl.getBuildNumberAsString())); + super(mainControl, mapManager, actionFactory); this.mainControl = mainControl; this.objectChooser = objectChooser; this.actionFactory = actionFactory; Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-05-17 18:38:17 UTC (rev 4040) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-05-21 18:16:24 UTC (rev 4041) @@ -20,6 +20,8 @@ package net.sf.gridarta; import java.io.File; +import java.util.MissingResourceException; +import java.util.ResourceBundle; import javax.swing.ImageIcon; import javax.swing.JFileChooser; import javax.swing.filechooser.FileFilter; @@ -223,4 +225,12 @@ return mapFile.getParentFile(); } + public static String getBuildNumberAsString() { + try { + return ResourceBundle.getBundle("build").getString("build.number"); + } catch (final MissingResourceException e) { + return "unknown version"; + } + } + } // class AbstractMainControl Modified: trunk/src/app/net/sf/gridarta/gui/MainView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/MainView.java 2008-05-17 18:38:17 UTC (rev 4040) +++ trunk/src/app/net/sf/gridarta/gui/MainView.java 2008-05-21 18:16:24 UTC (rev 4041) @@ -27,6 +27,7 @@ import javax.swing.JFrame; import javax.swing.event.InternalFrameEvent; import javax.swing.event.InternalFrameListener; +import net.sf.gridarta.AbstractMainControl; import net.sf.gridarta.MainControl; import net.sf.gridarta.MapManager; import net.sf.gridarta.gameobject.Archetype; @@ -36,6 +37,7 @@ import net.sf.gridarta.gui.map.MapViewBasic; import net.sf.gridarta.help.Help; import net.sf.gridarta.map.MapArchObject; +import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -147,8 +149,8 @@ * @param mapManager the map manager * @param title Title */ - protected MainView(@NotNull final MainControl<G, A, R, V> mainControl, @NotNull final MapManager<G, A, R, V> mapManager, @NotNull final String title) { - super(title); + protected MainView(@NotNull final MainControl<G, A, R, V> mainControl, @NotNull final MapManager<G, A, R, V> mapManager, @NotNull final ActionFactory actionFactory) { + super(actionFactory.format("mainWindow.title", AbstractMainControl.getBuildNumberAsString())); this.mapManager = mapManager; mapFileAction = new MapFileActions<G, A, R, V>(mainControl, mapManager, null); statusBar = new StatusBar(mainControl); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-05-21 19:08:04
|
Revision: 4042 http://gridarta.svn.sourceforge.net/gridarta/?rev=4042&view=rev Author: akirschbaum Date: 2008-05-21 12:07:32 -0700 (Wed, 21 May 2008) Log Message: ----------- Move most of CMainView to common code base. Modified Paths: -------------- trunk/crossfire/resource/conf/crossfire.0 trunk/crossfire/src/cfeditor/gui/CMainView.java trunk/crossfire/src/cfeditor/gui/ObjectChooser.java trunk/daimonin/src/daieditor/gui/CMainView.java trunk/daimonin/src/daieditor/gui/ObjectChooser.java trunk/gridarta.ipr trunk/src/app/net/sf/gridarta/gui/AbstractObjectChooser.java trunk/src/app/net/sf/gridarta/gui/MainView.java Modified: trunk/crossfire/resource/conf/crossfire.0 =================================================================== (Binary files differ) Modified: trunk/crossfire/src/cfeditor/gui/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/CMainView.java 2008-05-21 18:16:24 UTC (rev 4041) +++ trunk/crossfire/src/cfeditor/gui/CMainView.java 2008-05-21 19:07:32 UTC (rev 4042) @@ -24,43 +24,14 @@ import cfeditor.gameobject.GameObject; import cfeditor.gui.map.CMapViewBasic; import cfeditor.map.MapArchObject; -import java.awt.BorderLayout; -import java.awt.Rectangle; -import java.awt.Toolkit; -import java.beans.PropertyVetoException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.prefs.PreferenceChangeEvent; -import java.util.prefs.PreferenceChangeListener; -import java.util.prefs.Preferences; import javax.swing.Action; -import javax.swing.ImageIcon; -import javax.swing.JMenu; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JSplitPane; -import javax.swing.JToolBar; -import net.sf.gridarta.CFArchTypeList; import net.sf.gridarta.MainControl; import net.sf.gridarta.MapManager; import net.sf.gridarta.gameobject.match.GameObjectMatcher; -import net.sf.gridarta.gameobject.match.GameObjectMatchers; -import net.sf.gridarta.gui.ArchetypesActions; -import net.sf.gridarta.gui.GSplitPane; -import net.sf.gridarta.gui.GUIConstants; -import net.sf.gridarta.gui.GUIUtils; import net.sf.gridarta.gui.MainView; -import net.sf.gridarta.gui.MenuHelper; import net.sf.gridarta.gui.connectionview.LockedItemsControl; -import net.sf.gridarta.gui.map.MapView; -import net.sf.gridarta.gui.map.ViewActions; -import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; -import net.sf.gridarta.map.MapControl; import net.sf.japi.swing.ActionFactory; -import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * The main view of the level editor. Contains the "desktop" for internal level @@ -71,70 +42,6 @@ */ public final class CMainView extends MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> { - /** Action Factory to create Actions. */ - private final ActionFactory actionFactory; - - /** Serial Version UID. */ - private static final long serialVersionUID = 1L; - - /** The Logger for printing log messages. */ - private static final Logger log = Logger.getLogger(CMainView.class); - - /** Preferences. */ - private static final Preferences prefs = Preferences.userNodeForPackage(MainControl.class); - - /** The key used to store the main window state in the preferences. */ - private static final String WINDOW_STATE = "WindowState"; - - /** Default value for {@link #MAP_TILE_LIST_BOTTOM_KEY}. */ - public static final boolean MAP_TILE_LIST_BOTTOM_DEFAULT = false; - - /** The controller of this view. */ - private final CMainControl mainControl; - - /** The panel that contains the object chooser. */ - private final ObjectChooser objectChooser; - - /** All open level views. */ - private final List<MapView<GameObject, MapArchObject, Archetype, CMapViewBasic>> mapViews = Collections.synchronizedList(new ArrayList<MapView<GameObject, MapArchObject, Archetype, CMapViewBasic>>()); - - /** Last known map view for generating change events. */ - private MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> currentMapView = null; - - /** Attributes panel (bottom). */ - private GameObjectAttributesPanel gameObjectAttributesPanel; - - private final Action aViewTreasurelists; - - /** The action for "close all map windows". */ - private final Action aCloseAll; - - /** Action for "prev window". */ - private final Action aPrevWindow; - - /** Action for "next window". */ - private final Action aNextWindow; - - private final ViewActions<GameObject, MapArchObject, Archetype, CMapViewBasic> viewActions; - - /** The actions of the "Archetypes" menu. */ - private ArchetypesActions<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypesActions; - - /** The toolbar. */ - private JToolBar mainToolbar = null; - - /** The listener to track preference changes. */ - private final PreferenceChangeListener preferenceChangeListener = new PreferenceChangeListener() - { - /** {@inheritDoc} */ - public void preferenceChange(final PreferenceChangeEvent evt) { - if (mainToolbar != null && evt.getKey().equals(SHOW_MAIN_TOOLBAR_KEY)) { - mainToolbar.setVisible(prefs.getBoolean(SHOW_MAIN_TOOLBAR_KEY, SHOW_MAIN_TOOLBAR_DEFAULT)); - } - } - - }; - /** * Constructs the main view and registers the given main controller. * @param mainControl MainControl to attach to. @@ -144,359 +51,12 @@ * @param aCloseAll the action "close all map windows" */ public CMainView(@NotNull final CMainControl mainControl, @NotNull final ObjectChooser objectChooser, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, @NotNull final ActionFactory actionFactory, @NotNull final Action aCloseAll) { - super(mainControl, mapManager, actionFactory); - this.mainControl = mainControl; - this.objectChooser = objectChooser; - this.actionFactory = actionFactory; - aViewTreasurelists = actionFactory.createAction(true, "viewTreasurelists", mainControl); - this.aCloseAll = aCloseAll; - aPrevWindow = actionFactory.createAction(true, "prevWindow", this); - aNextWindow = actionFactory.createAction(true, "nextWindow", this); - - viewActions = new ViewActions<GameObject, MapArchObject, Archetype, CMapViewBasic>(mainControl, mapManager); - - final ImageIcon icon = GUIUtils.getIcon(GUIConstants.APP_ICON); - if (icon != null) { - setIconImage(icon.getImage()); - } - - updateFocus(false); + super(mainControl, objectChooser, mapManager, actionFactory, aCloseAll); } - /** - * Initializes (builds) this view. - * @param lockedItemsControl the locked items control - * @param selectedSquareView the selected square view - * @param archTypeList the instance for looking up archetype types - * @param monsterMatcher the <code>GameObjectMatcher</code> for matching - * monster objects - * @param gameObjectMatchers the game object matchers - */ - public void init(@NotNull final LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic> lockedItemsControl, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, final CFArchTypeList archTypeList, final boolean mapTileListBottom, @NotNull final GameObjectMatcher monsterMatcher, @NotNull final GameObjectMatchers gameObjectMatchers) { - // calculate some default values in case there is no settings file - final Rectangle screen = getGraphicsConfiguration().getBounds(); - final int defwidth = (int) (0.9 * screen.getWidth()); - final int defheight = (int) (0.9 * screen.getHeight()); - - mainToolbar = createMainToolbar(); - - final JPanel toolbarPanel = new JPanel(new BorderLayout()); - toolbarPanel.add(mainToolbar, BorderLayout.NORTH); - toolbarPanel.add(createCenterPanel(defwidth, defheight, lockedItemsControl, selectedSquareView, mapTileListBottom, monsterMatcher), BorderLayout.CENTER); - add(toolbarPanel, BorderLayout.CENTER); - - archetypesActions = new ArchetypesActions<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, objectChooser.getArchetypeChooserControl(), objectChooser, archTypeList); - setJMenuBar(actionFactory.createMenuBar(true, "main")); - objectChooser.setPickmapFoldersMenu((JMenu) actionFactory.find(getJMenuBar(), "pickmapFolders")); - viewActions.init(gameObjectMatchers); - viewActions.setMenu((JMenu) actionFactory.find(getJMenuBar(), "view")); - - // set bounds (location and size) of the main frame - setBounds( - prefs.getInt(WINDOW_X, (int) (screen.getX() + (screen.getWidth() - defwidth) / 2.0)), - prefs.getInt(WINDOW_Y, (int) (screen.getY() + (screen.getHeight() - defheight) / 2.0)), - prefs.getInt(WINDOW_WIDTH, defwidth), - prefs.getInt(WINDOW_HEIGHT, defheight)); - setExtendedState(prefs.getInt(WINDOW_STATE, getExtendedState())); - - refreshMenus(); - } - - /** - * Creates the toolbar. - * @return the toolbar - */ - private JToolBar createMainToolbar() { - final JToolBar toolbar = actionFactory.createToolBar("main"); - prefs.addPreferenceChangeListener(preferenceChangeListener); - toolbar.setVisible(prefs.getBoolean(SHOW_MAIN_TOOLBAR_KEY, SHOW_MAIN_TOOLBAR_DEFAULT)); - return toolbar; - } - - /** - * Create the center panel. - * @param defwidth default width - * @param defheight default height - * @param lockedItemsControl the locked items control - * @param selectedSquareView the selected square view - * @param monsterMatcher the <code>GameObjectMatcher</code> for matching - * monster objects - * @return center panel - */ - private JPanel createCenterPanel(final int defwidth, final int defheight, @NotNull final LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic> lockedItemsControl, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, final boolean mapTileListBottom, @NotNull final GameObjectMatcher monsterMatcher) { - final JPanel centerPanel = new JPanel(new BorderLayout()); - - final int divLocationRight = prefs.getInt(DIVIDER_LOCATION_KEY3, (int) (defwidth * 0.62)); - final int divLocationDown = prefs.getInt(DIVIDER_LOCATION_KEY2, (int) (defheight * 0.76)); - final int divLocation = prefs.getInt(DIVIDER_LOCATION_KEY, (int) (defwidth * 0.17)); - - gameObjectAttributesPanel = new GameObjectAttributesPanel(mainControl, mapManager, this, lockedItemsControl, monsterMatcher); - - if (mapTileListBottom) { - splitRightPane = new GSplitPane(JSplitPane.HORIZONTAL_SPLIT, gameObjectAttributesPanel, selectedSquareView); - splitDownPane = new GSplitPane(JSplitPane.VERTICAL_SPLIT, mapDesktop, splitRightPane); - } else { - splitRightPane = new GSplitPane(JSplitPane.HORIZONTAL_SPLIT, mapDesktop, selectedSquareView); - splitDownPane = new GSplitPane(JSplitPane.VERTICAL_SPLIT, splitRightPane, gameObjectAttributesPanel); - } - splitRightPane.setDividerLocation(divLocationRight); - splitRightPane.setContinuousLayout(true); - splitRightPane.setResizeWeight(1); - splitDownPane.setDividerLocation(divLocationDown); - splitDownPane.setContinuousLayout(true); - splitDownPane.setResizeWeight(1); - splitPane = new GSplitPane(JSplitPane.HORIZONTAL_SPLIT, objectChooser, splitDownPane); - splitPane.setDividerLocation(divLocation); - splitPane.setContinuousLayout(true); - - centerPanel.add(splitPane, BorderLayout.CENTER); - return centerPanel; - } - - /** Notifies that the application is about to exit. */ - public void appExitNotify() { - // Store the location and size - final Rectangle bounds = getBounds(); - prefs.putInt(WINDOW_X, bounds.x); - prefs.putInt(WINDOW_Y, bounds.y); - prefs.putInt(WINDOW_WIDTH, bounds.width); - prefs.putInt(WINDOW_HEIGHT, bounds.height); - prefs.putInt(DIVIDER_LOCATION_KEY, splitPane.getDividerLocation()); - prefs.putInt(DIVIDER_LOCATION_KEY2, splitDownPane.getDividerLocation()); - prefs.putInt(DIVIDER_LOCATION_KEY3, splitRightPane.getDividerLocation()); - prefs.putInt(WINDOW_STATE, getExtendedState()); - - objectChooser.appExitNotify(); - gameObjectAttributesPanel.appExitNotify(); - } - /** {@inheritDoc} */ - public void addLevelView(final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView) { - assert !mapViews.contains(mapView); - mapViews.add(0, mapView); - mapView.addInternalFrameListener(internalFrameListener); - mapDesktop.add(mapView); - mapManager.fireMapViewCreatedEvent(mapView); - setCurrentLevelView(mapView); - mapView.setVisible(true); - mapView.setBounds(0, 0, mapDesktop.getWidth(), mapDesktop.getHeight()); - try { - mapView.setMaximum(true); - } catch (final PropertyVetoException e) { - System.err.println(e); - } - refreshMenus(); + @Override protected GameObjectAttributesPanel newGameObjectAttributesPanel(final MainControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mainControl, final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, final LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic> lockedItemsControl, final GameObjectMatcher monsterMatcher) { + return new GameObjectAttributesPanel(mainControl, mapManager, this, lockedItemsControl, monsterMatcher); } - /** {@inheritDoc} */ - public void removeLevelView(final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView) { - assert mapViews.contains(mapView); - if (!mapViews.contains(mapView)) { - return; - } - - mapView.removeInternalFrameListener(internalFrameListener); - mapViews.remove(mapView); - generateCurrentMapViewChangedEvent(); - mapManager.fireMapViewClosingEvent(mapView); - mapDesktop.remove(mapView); - // This is important: Removing a JInternalFrame from a JDesktopPane doesn't deselect it. - // Thus it will still be referenced. To prevent a closed map from being referenced by Swing, - // we check whether it's selected and if so deselect it. - if (mapDesktop.getSelectedFrame() == mapView) { - mapDesktop.setSelectedFrame(null); - } - mapView.dispose(); - mapDesktop.repaint(); - - updateFocus(true); - refreshMenus(); - } - - /** - * {@inheritDoc} - * This implementation displays the exception in a modal message dialog. - */ - public void handleThrowable(final Throwable t) { - Toolkit.getDefaultToolkit().beep(); - JOptionPane.showMessageDialog(this, t.getMessage(), "Error", JOptionPane.WARNING_MESSAGE); - } - - /** - * Updates the focus to the first non-iconified level window. - * @param fCareAboutIconification True if the focus update should ignore - * all windows iconified by the user. - */ - private void updateFocus(final boolean fCareAboutIconification) { - // Show the next level (if such exists) - for (final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView : mapViews) { - if (mapView.isIcon()) { - if (!fCareAboutIconification) { - try { - mapView.setIcon(false); - } catch (final PropertyVetoException e) { - log.warn(actionFactory.format("logUnexpectedException", e)); - } - activateAndRaiseMapView(mapView); - return; - } - } else { - activateAndRaiseMapView(mapView); - return; - } - } - - // No non-iconified level windows found - mapManager.setCurrentLevel(null); - } - - /** Gives focus to the next window. */ - public void prevWindow() { - final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView = getFrameForPrevWindow(); - if (mapView == null) { - return; - } - - // XXX I might work I might not work, use AWT/Swing focus traversal - mapViews.remove(mapView); - mapViews.add(mapView); - generateCurrentMapViewChangedEvent(); - updateFocus(false); - } - - /** Gives focus to the previous window. */ - public void nextWindow() { - final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView = getFrameForNextWindow(); - if (mapView == null) { - return; - } - - // XXX I might work I might not work, use AWT/Swing focus traversal - mapViews.remove(mapView); - mapViews.add(0, mapView); - generateCurrentMapViewChangedEvent(); - updateFocus(false); - } - - /** {@inheritDoc} */ - public void setCurrentLevelView(final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView) { - assert mapViews.contains(mapView); - mapViews.remove(mapView); - mapViews.add(0, mapView); - generateCurrentMapViewChangedEvent(); - - // Deiconify if necessary - if (mapView.isIcon()) { - try { - mapView.setIcon(false); - } catch (final PropertyVetoException e) { - log.warn(actionFactory.format("logUnexpectedException", e)); - } - activateMapView(mapView); - return; - } - updateFocus(true); - mapView.requestFocus(); - mapView.restoreSubcomponentFocus(); - } - - /** {@inheritDoc} */ - protected void levelViewFocusLostNotify(final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView) { - assert mapViews.contains(mapView); - if (mapViews.size() <= 1) { - return; - } - - mapViews.remove(mapView); - mapViews.add(mapView); - generateCurrentMapViewChangedEvent(); - updateFocus(true); - } - - /** {@inheritDoc} */ - protected void levelViewFocusGainedNotify(final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView) { - assert mapViews.contains(mapView); - mapViews.remove(mapView); - mapViews.add(0, mapView); - generateCurrentMapViewChangedEvent(); - final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> level = mapView.getMapControl(); - level.setFocus(mapView); - mapManager.setCurrentLevel(level); - //statusBar.setLevelInfo(level); - } - - /** - * Rebuild the window menu. - */ - private void rebuildWindowMenu() { - final JMenu menuWindow = (JMenu) actionFactory.find(getJMenuBar(), "window"); - MenuHelper.removeAll(menuWindow); - menuWindow.add(aCloseAll); - if (!mapViews.isEmpty()) { - menuWindow.addSeparator(); - } - int index = 0; - for (final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> frame : mapViews) { - frame.addWindowAction(menuWindow, index++); - } - } - - /** {@inheritDoc} */ - @NotNull public GameObjectAttributesPanel getGameObjectAttributesPanel() { - return gameObjectAttributesPanel; - } - - /** - * Returns the current top map view we are working with. - * @return the current top map view we are working with, or - * <code>null</code> if no map is open - */ - @Nullable public MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> getCurrentMapView() { - return !mapViews.isEmpty() ? mapViews.get(0) : null; - } - - /** - * Check if the current map view has changed; if it has changed fire an - * event. - */ - private void generateCurrentMapViewChangedEvent() { - rebuildWindowMenu(); - - final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> newCurrentMapView = getCurrentMapView(); - if (currentMapView == newCurrentMapView) { - return; - } - - currentMapView = newCurrentMapView; - mapManager.fireCurrentMapViewChangedEvent(currentMapView); - } - - /** - * Determine whether "prev window" should be enabled. - * - * @return the map view to activate, or <code>null</code> if "prev window" - * should be disabled - */ - @Nullable private MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> getFrameForPrevWindow() { - return mapViews.size() > 1 ? mapViews.get(0) : null; - } - - /** - * Determine whether "next window" should be enabled. - * - * @return the map view to activate, or <code>null</code> if "next window" - * should be disabled - */ - @Nullable private MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> getFrameForNextWindow() { - return mapViews.size() > 1 ? mapViews.get(mapViews.size() - 1) : null; - } - - /** - * Enabled/disable the menu entries according to the current state. - */ - private void refreshMenus() { - aPrevWindow.setEnabled(getFrameForPrevWindow() != null); - aNextWindow.setEnabled(getFrameForNextWindow() != null); - } - } // class CMainView Modified: trunk/crossfire/src/cfeditor/gui/ObjectChooser.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ObjectChooser.java 2008-05-21 18:16:24 UTC (rev 4041) +++ trunk/crossfire/src/cfeditor/gui/ObjectChooser.java 2008-05-21 19:07:32 UTC (rev 4042) @@ -136,6 +136,7 @@ objectChoiceDisplay.showObjectChooserQuickObject(gameObject); } + /** {@inheritDoc} */ public void appExitNotify() { prefs.putInt(ARCHPANEL_LOCATION_KEY, splitPane.getDividerLocation()); } Modified: trunk/daimonin/src/daieditor/gui/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/gui/CMainView.java 2008-05-21 18:16:24 UTC (rev 4041) +++ trunk/daimonin/src/daieditor/gui/CMainView.java 2008-05-21 19:07:32 UTC (rev 4042) @@ -24,43 +24,14 @@ import daieditor.gameobject.GameObject; import daieditor.gui.map.CMapViewBasic; import daieditor.map.MapArchObject; -import java.awt.BorderLayout; -import java.awt.Rectangle; -import java.awt.Toolkit; -import java.beans.PropertyVetoException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.prefs.PreferenceChangeEvent; -import java.util.prefs.PreferenceChangeListener; -import java.util.prefs.Preferences; import javax.swing.Action; -import javax.swing.ImageIcon; -import javax.swing.JMenu; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JSplitPane; -import javax.swing.JToolBar; -import net.sf.gridarta.CFArchTypeList; import net.sf.gridarta.MainControl; import net.sf.gridarta.MapManager; import net.sf.gridarta.gameobject.match.GameObjectMatcher; -import net.sf.gridarta.gameobject.match.GameObjectMatchers; -import net.sf.gridarta.gui.ArchetypesActions; -import net.sf.gridarta.gui.GSplitPane; -import net.sf.gridarta.gui.GUIConstants; -import net.sf.gridarta.gui.GUIUtils; import net.sf.gridarta.gui.MainView; -import net.sf.gridarta.gui.MenuHelper; import net.sf.gridarta.gui.connectionview.LockedItemsControl; -import net.sf.gridarta.gui.map.MapView; -import net.sf.gridarta.gui.map.ViewActions; -import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; -import net.sf.gridarta.map.MapControl; import net.sf.japi.swing.ActionFactory; -import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * The main view of the level editor. Contains the "desktop" for internal level @@ -71,70 +42,6 @@ */ public final class CMainView extends MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> { - /** Action Factory to create Actions. */ - private final ActionFactory actionFactory; - - /** Serial Version UID. */ - private static final long serialVersionUID = 1L; - - /** The Logger for printing log messages. */ - private static final Logger log = Logger.getLogger(CMainView.class); - - /** Preferences. */ - private static final Preferences prefs = Preferences.userNodeForPackage(MainControl.class); - - /** The key used to store the main window state in the preferences. */ - private static final String WINDOW_STATE = "WindowState"; - - /** Default value for {@link #MAP_TILE_LIST_BOTTOM_KEY}. */ - public static final boolean MAP_TILE_LIST_BOTTOM_DEFAULT = false; - - /** The controller of this view. */ - private final CMainControl mainControl; - - /** The panel that contains the object chooser. */ - private final ObjectChooser objectChooser; - - /** All open level views. */ - private final List<MapView<GameObject, MapArchObject, Archetype, CMapViewBasic>> mapViews = Collections.synchronizedList(new ArrayList<MapView<GameObject, MapArchObject, Archetype, CMapViewBasic>>()); - - /** Last known map view for generating change events. */ - private MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> currentMapView = null; - - /** Attributes panel (bottom). */ - private GameObjectAttributesPanel gameObjectAttributesPanel; - - private final Action aViewTreasurelists; - - /** The action for "close all map windows". */ - private final Action aCloseAll; - - /** Action for "prev window". */ - private final Action aPrevWindow; - - /** Action for "next window". */ - private final Action aNextWindow; - - private final ViewActions<GameObject, MapArchObject, Archetype, CMapViewBasic> viewActions; - - /** The actions of the "Archetypes" menu. */ - private ArchetypesActions<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypesActions; - - /** The toolbar. */ - private JToolBar mainToolbar = null; - - /** The listener to track preference changes. */ - private final PreferenceChangeListener preferenceChangeListener = new PreferenceChangeListener() - { - /** {@inheritDoc} */ - public void preferenceChange(final PreferenceChangeEvent evt) { - if (mainToolbar != null && evt.getKey().equals(SHOW_MAIN_TOOLBAR_KEY)) { - mainToolbar.setVisible(prefs.getBoolean(SHOW_MAIN_TOOLBAR_KEY, SHOW_MAIN_TOOLBAR_DEFAULT)); - } - } - - }; - /** * Constructs the main view and registers the given main controller. * @param mainControl MainControl to attach to. @@ -144,359 +51,12 @@ * @param aCloseAll the action "close all map windows" */ public CMainView(@NotNull final CMainControl mainControl, @NotNull final ObjectChooser objectChooser, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, @NotNull final ActionFactory actionFactory, @NotNull final Action aCloseAll) { - super(mainControl, mapManager, actionFactory); - this.mainControl = mainControl; - this.objectChooser = objectChooser; - this.actionFactory = actionFactory; - aViewTreasurelists = actionFactory.createAction(true, "viewTreasurelists", mainControl); - this.aCloseAll = aCloseAll; - aPrevWindow = actionFactory.createAction(true, "prevWindow", this); - aNextWindow = actionFactory.createAction(true, "nextWindow", this); - - viewActions = new ViewActions<GameObject, MapArchObject, Archetype, CMapViewBasic>(mainControl, mapManager); - - final ImageIcon icon = GUIUtils.getIcon(GUIConstants.APP_ICON); - if (icon != null) { - setIconImage(icon.getImage()); - } - - updateFocus(false); + super(mainControl, objectChooser, mapManager, actionFactory, aCloseAll); } - /** - * Initializes (builds) this view. - * @param lockedItemsControl the locked items control - * @param selectedSquareView the selected square view - * @param archTypeList the instance for looking up archetype types - * @param monsterMatcher the <code>GameObjectMatcher</code> for matching - * monster objects - * @param gameObjectMatchers the game object matchers - */ - public void init(@NotNull final LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic> lockedItemsControl, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, final CFArchTypeList archTypeList, final boolean mapTileListBottom, @NotNull final GameObjectMatcher monsterMatcher, @NotNull final GameObjectMatchers gameObjectMatchers) { - // calculate some default values in case there is no settings file - final Rectangle screen = getGraphicsConfiguration().getBounds(); - final int defwidth = (int) (0.9 * screen.getWidth()); - final int defheight = (int) (0.9 * screen.getHeight()); - - mainToolbar = createMainToolbar(); - - final JPanel toolbarPanel = new JPanel(new BorderLayout()); - toolbarPanel.add(mainToolbar, BorderLayout.NORTH); - toolbarPanel.add(createCenterPanel(defwidth, defheight, lockedItemsControl, selectedSquareView, mapTileListBottom, monsterMatcher), BorderLayout.CENTER); - add(toolbarPanel, BorderLayout.CENTER); - - archetypesActions = new ArchetypesActions<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, objectChooser.getArchetypeChooserControl(), objectChooser, archTypeList); - setJMenuBar(actionFactory.createMenuBar(true, "main")); - objectChooser.setPickmapFoldersMenu((JMenu) actionFactory.find(getJMenuBar(), "pickmapFolders")); - viewActions.init(gameObjectMatchers); - viewActions.setMenu((JMenu) actionFactory.find(getJMenuBar(), "view")); - - // set bounds (location and size) of the main frame - setBounds( - prefs.getInt(WINDOW_X, (int) (screen.getX() + (screen.getWidth() - defwidth) / 2.0)), - prefs.getInt(WINDOW_Y, (int) (screen.getY() + (screen.getHeight() - defheight) / 2.0)), - prefs.getInt(WINDOW_WIDTH, defwidth), - prefs.getInt(WINDOW_HEIGHT, defheight)); - setExtendedState(prefs.getInt(WINDOW_STATE, getExtendedState())); - - refreshMenus(); - } - - /** - * Creates the toolbar. - * @return the toolbar - */ - private JToolBar createMainToolbar() { - final JToolBar toolbar = actionFactory.createToolBar("main"); - prefs.addPreferenceChangeListener(preferenceChangeListener); - toolbar.setVisible(prefs.getBoolean(SHOW_MAIN_TOOLBAR_KEY, SHOW_MAIN_TOOLBAR_DEFAULT)); - return toolbar; - } - - /** - * Create the center panel. - * @param defwidth default width - * @param defheight default height - * @param lockedItemsControl the locked items control - * @param selectedSquareView the selected square view - * @param monsterMatcher the <code>GameObjectMatcher</code> for matching - * monster objects - * @return center panel - */ - private JPanel createCenterPanel(final int defwidth, final int defheight, @NotNull final LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic> lockedItemsControl, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, final boolean mapTileListBottom, @NotNull final GameObjectMatcher monsterMatcher) { - final JPanel centerPanel = new JPanel(new BorderLayout()); - - final int divLocationRight = prefs.getInt(DIVIDER_LOCATION_KEY3, (int) (defwidth * 0.62)); - final int divLocationDown = prefs.getInt(DIVIDER_LOCATION_KEY2, (int) (defheight * 0.76)); - final int divLocation = prefs.getInt(DIVIDER_LOCATION_KEY, (int) (defwidth * 0.17)); - - gameObjectAttributesPanel = new GameObjectAttributesPanel(mainControl, mapManager, this, lockedItemsControl, monsterMatcher); - - if (mapTileListBottom) { - splitRightPane = new GSplitPane(JSplitPane.HORIZONTAL_SPLIT, gameObjectAttributesPanel, selectedSquareView); - splitDownPane = new GSplitPane(JSplitPane.VERTICAL_SPLIT, mapDesktop, splitRightPane); - } else { - splitRightPane = new GSplitPane(JSplitPane.HORIZONTAL_SPLIT, mapDesktop, selectedSquareView); - splitDownPane = new GSplitPane(JSplitPane.VERTICAL_SPLIT, splitRightPane, gameObjectAttributesPanel); - } - splitRightPane.setDividerLocation(divLocationRight); - splitRightPane.setContinuousLayout(true); - splitRightPane.setResizeWeight(1); - splitDownPane.setDividerLocation(divLocationDown); - splitDownPane.setContinuousLayout(true); - splitDownPane.setResizeWeight(1); - splitPane = new GSplitPane(JSplitPane.HORIZONTAL_SPLIT, objectChooser, splitDownPane); - splitPane.setDividerLocation(divLocation); - splitPane.setContinuousLayout(true); - - centerPanel.add(splitPane, BorderLayout.CENTER); - return centerPanel; - } - - /** Notifies that the application is about to exit. */ - public void appExitNotify() { - // Store the location and size - final Rectangle bounds = getBounds(); - prefs.putInt(WINDOW_X, bounds.x); - prefs.putInt(WINDOW_Y, bounds.y); - prefs.putInt(WINDOW_WIDTH, bounds.width); - prefs.putInt(WINDOW_HEIGHT, bounds.height); - prefs.putInt(DIVIDER_LOCATION_KEY, splitPane.getDividerLocation()); - prefs.putInt(DIVIDER_LOCATION_KEY2, splitDownPane.getDividerLocation()); - prefs.putInt(DIVIDER_LOCATION_KEY3, splitRightPane.getDividerLocation()); - prefs.putInt(WINDOW_STATE, getExtendedState()); - - objectChooser.appExitNotify(); - gameObjectAttributesPanel.appExitNotify(); - } - /** {@inheritDoc} */ - public void addLevelView(final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView) { - assert !mapViews.contains(mapView); - mapViews.add(0, mapView); - mapView.addInternalFrameListener(internalFrameListener); - mapDesktop.add(mapView); - mapManager.fireMapViewCreatedEvent(mapView); - setCurrentLevelView(mapView); - mapView.setVisible(true); - mapView.setBounds(0, 0, mapDesktop.getWidth(), mapDesktop.getHeight()); - try { - mapView.setMaximum(true); - } catch (final PropertyVetoException e) { - System.err.println(e); - } - refreshMenus(); + @Override protected GameObjectAttributesPanel newGameObjectAttributesPanel(final MainControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mainControl, final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, final LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic> lockedItemsControl, final GameObjectMatcher monsterMatcher) { + return new GameObjectAttributesPanel(mainControl, mapManager, this, lockedItemsControl, monsterMatcher); } - /** {@inheritDoc} */ - public void removeLevelView(final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView) { - assert mapViews.contains(mapView); - if (!mapViews.contains(mapView)) { - return; - } - - mapView.removeInternalFrameListener(internalFrameListener); - mapViews.remove(mapView); - generateCurrentMapViewChangedEvent(); - mapManager.fireMapViewClosingEvent(mapView); - mapDesktop.remove(mapView); - // This is important: Removing a JInternalFrame from a JDesktopPane doesn't deselect it. - // Thus it will still be referenced. To prevent a closed map from being referenced by Swing, - // we check whether it's selected and if so deselect it. - if (mapDesktop.getSelectedFrame() == mapView) { - mapDesktop.setSelectedFrame(null); - } - mapView.dispose(); - mapDesktop.repaint(); - - updateFocus(true); - refreshMenus(); - } - - /** - * {@inheritDoc} - * This implementation displays the exception in a modal message dialog. - */ - public void handleThrowable(final Throwable t) { - Toolkit.getDefaultToolkit().beep(); - JOptionPane.showMessageDialog(this, t.getMessage(), "Error", JOptionPane.WARNING_MESSAGE); - } - - /** - * Updates the focus to the first non-iconified level window. - * @param fCareAboutIconification True if the focus update should ignore - * all windows iconified by the user. - */ - private void updateFocus(final boolean fCareAboutIconification) { - // Show the next level (if such exists) - for (final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView : mapViews) { - if (mapView.isIcon()) { - if (!fCareAboutIconification) { - try { - mapView.setIcon(false); - } catch (final PropertyVetoException e) { - log.warn(actionFactory.format("logUnexpectedException", e)); - } - activateAndRaiseMapView(mapView); - return; - } - } else { - activateAndRaiseMapView(mapView); - return; - } - } - - // No non-iconified level windows found - mapManager.setCurrentLevel(null); - } - - /** Gives focus to the next window. */ - public void prevWindow() { - final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView = getFrameForPrevWindow(); - if (mapView == null) { - return; - } - - // XXX I might work I might not work, use AWT/Swing focus traversal - mapViews.remove(mapView); - mapViews.add(mapView); - generateCurrentMapViewChangedEvent(); - updateFocus(false); - } - - /** Gives focus to the previous window. */ - public void nextWindow() { - final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView = getFrameForNextWindow(); - if (mapView == null) { - return; - } - - // XXX I might work I might not work, use AWT/Swing focus traversal - mapViews.remove(mapView); - mapViews.add(0, mapView); - generateCurrentMapViewChangedEvent(); - updateFocus(false); - } - - /** {@inheritDoc} */ - public void setCurrentLevelView(final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView) { - assert mapViews.contains(mapView); - mapViews.remove(mapView); - mapViews.add(0, mapView); - generateCurrentMapViewChangedEvent(); - - // Deiconify if necessary - if (mapView.isIcon()) { - try { - mapView.setIcon(false); - } catch (final PropertyVetoException e) { - log.warn(actionFactory.format("logUnexpectedException", e)); - } - activateMapView(mapView); - return; - } - updateFocus(true); - mapView.requestFocus(); - mapView.restoreSubcomponentFocus(); - } - - /** {@inheritDoc} */ - protected void levelViewFocusLostNotify(final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView) { - assert mapViews.contains(mapView); - if (mapViews.size() <= 1) { - return; - } - - mapViews.remove(mapView); - mapViews.add(mapView); - generateCurrentMapViewChangedEvent(); - updateFocus(true); - } - - /** {@inheritDoc} */ - protected void levelViewFocusGainedNotify(final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView) { - assert mapViews.contains(mapView); - mapViews.remove(mapView); - mapViews.add(0, mapView); - generateCurrentMapViewChangedEvent(); - final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> level = mapView.getMapControl(); - level.setFocus(mapView); - mapManager.setCurrentLevel(level); - //statusBar.setLevelInfo(level); - } - - /** - * Rebuild the window menu. - */ - private void rebuildWindowMenu() { - final JMenu menuWindow = (JMenu) actionFactory.find(getJMenuBar(), "window"); - MenuHelper.removeAll(menuWindow); - menuWindow.add(aCloseAll); - if (!mapViews.isEmpty()) { - menuWindow.addSeparator(); - } - int index = 0; - for (final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> frame : mapViews) { - frame.addWindowAction(menuWindow, index++); - } - } - - /** {@inheritDoc} */ - @NotNull public GameObjectAttributesPanel getGameObjectAttributesPanel() { - return gameObjectAttributesPanel; - } - - /** - * Returns the current top map view we are working with. - * @return the current top map view we are working with, or - * <code>null</code> if no map is open - */ - @Nullable public MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> getCurrentMapView() { - return !mapViews.isEmpty() ? mapViews.get(0) : null; - } - - /** - * Check if the current map view has changed; if it has changed fire an - * event. - */ - private void generateCurrentMapViewChangedEvent() { - rebuildWindowMenu(); - - final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> newCurrentMapView = getCurrentMapView(); - if (currentMapView == newCurrentMapView) { - return; - } - - currentMapView = newCurrentMapView; - mapManager.fireCurrentMapViewChangedEvent(currentMapView); - } - - /** - * Determine whether "prev window" should be enabled. - * - * @return the map view to activate, or <code>null</code> if "prev window" - * should be disabled - */ - @Nullable private MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> getFrameForPrevWindow() { - return mapViews.size() > 1 ? mapViews.get(0) : null; - } - - /** - * Determine whether "next window" should be enabled. - * - * @return the map view to activate, or <code>null</code> if "next window" - * should be disabled - */ - @Nullable private MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> getFrameForNextWindow() { - return mapViews.size() > 1 ? mapViews.get(mapViews.size() - 1) : null; - } - - /** - * Enabled/disable the menu entries according to the current state. - */ - private void refreshMenus() { - aPrevWindow.setEnabled(getFrameForPrevWindow() != null); - aNextWindow.setEnabled(getFrameForNextWindow() != null); - } - } // class CMainView Modified: trunk/daimonin/src/daieditor/gui/ObjectChooser.java =================================================================== --- trunk/daimonin/src/daieditor/gui/ObjectChooser.java 2008-05-21 18:16:24 UTC (rev 4041) +++ trunk/daimonin/src/daieditor/gui/ObjectChooser.java 2008-05-21 19:07:32 UTC (rev 4042) @@ -127,6 +127,7 @@ objectChoiceDisplay.showObjectChooserQuickObject(gameObject); } + /** {@inheritDoc} */ public void appExitNotify() { } Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2008-05-21 18:16:24 UTC (rev 4041) +++ trunk/gridarta.ipr 2008-05-21 19:07:32 UTC (rev 4042) @@ -2423,6 +2423,308 @@ <inspection_tool class="StaticImport" level="WARNING" enabled="true" /> <inspection_tool class="UnusedImport" level="WARNING" enabled="true" /> </profile> + <profile version="1.0" is_locked="false"> + <option name="myName" value="null-checks" /> + <option name="myLocal" value="false" /> + <inspection_tool class="FieldCanBeLocal" level="WARNING" enabled="false" /> + <inspection_tool class="UnnecessaryModuleDependencyInspection" level="WARNING" enabled="false" /> + <inspection_tool class="WebProperties" level="ERROR" enabled="false" /> + <inspection_tool class="RedundantTypeArguments" level="WARNING" enabled="false" /> + <inspection_tool class="CssOverwrittenProperties" level="WARNING" enabled="false" /> + <inspection_tool class="CheckJsfComponentUnderViewTag" level="INFO" enabled="false" /> + <inspection_tool class="EmptyCatchBlock" level="WARNING" enabled="false"> + <option name="m_includeComments" value="true" /> + <option name="m_ignoreTestCases" value="true" /> + <option name="m_ignoreIgnoreParameter" value="true" /> + </inspection_tool> + <inspection_tool class="StringToString" level="WARNING" enabled="false" /> + <inspection_tool class="MalformedRegex" level="WARNING" enabled="false" /> + <inspection_tool class="TrivialIfJS" level="WARNING" enabled="false" /> + <inspection_tool class="EjbWarningInspection" level="WARNING" enabled="false" /> + <inspection_tool class="AntMissingPropertiesFileInspection" level="ERROR" enabled="false" /> + <inspection_tool class="NonSerializableServiceParameters" level="ERROR" enabled="false" /> + <inspection_tool class="MissingMnemonic" level="WARNING" enabled="false" /> + <inspection_tool class="OneButtonGroup" level="WARNING" enabled="false" /> + <inspection_tool class="SuspiciousSystemArraycopy" level="WARNING" enabled="false" /> + <inspection_tool class="BadExpressionStatementJS" level="WARNING" enabled="false" /> + <inspection_tool class="UnusedLabel" level="WARNING" enabled="false" /> + <inspection_tool class="ComponentRegistrationProblems" level="ERROR" enabled="false"> + <option name="CHECK_PLUGIN_XML" value="true" /> + <option name="CHECK_JAVA_CODE" value="true" /> + <option name="CHECK_ACTIONS" value="true" /> + </inspection_tool> + <inspection_tool class="SimplifiableIfStatement" level="WARNING" enabled="false" /> + <inspection_tool class="ReturnFromFinallyBlock" level="WARNING" enabled="false" /> + <inspection_tool class="InfiniteRecursion" level="WARNING" enabled="false" /> + <inspection_tool class="ConstantConditions" level="WARNING" enabled="false"> + <option name="SUGGEST_NULLABLE_ANNOTATIONS" value="false" /> + <option name="DONT_REPORT_TRUE_ASSERT_STATEMENTS" value="false" /> + </inspection_tool> + <inspection_tool class="IgnoreResultOfCall" level="WARNING" enabled="false"> + <option name="m_reportAllNonLibraryCalls" value="false" /> + <option name="callCheckString" value="java.io.InputStream,read,java.io.InputStream,skip,java.lang.StringBuffer,toString,java.lang.StringBuilder,toString,java.lang.String,.*,java.math.BigInteger,.*,java.math.BigDecimal,.*,java.net.InetAddress,.*" /> + </inspection_tool> + <inspection_tool class="Deprecation" level="WARNING" enabled="false" /> + <inspection_tool class="UnnecessaryBoxing" level="WARNING" enabled="false" /> + <inspection_tool class="PrimitiveArrayArgumentToVariableArgMethod" level="WARNING" enabled="false" /> + <inspection_tool class="StrutsValidatorInspection" level="ERROR" enabled="false" /> + <inspection_tool class="StringConstructor" level="WARNING" enabled="false"> + <option name="ignoreSubstringArguments" value="false" /> + </inspection_tool> + <inspection_tool class="FunctionWithInconsistentReturnsJS" level="WARNING" enabled="false" /> + <inspection_tool class="UnnecessaryLocalVariableJS" level="WARNING" enabled="false"> + <option name="m_ignoreImmediatelyReturnedVariables" value="false" /> + <option name="m_ignoreAnnotatedVariables" value="false" /> + </inspection_tool> + <inspection_tool class="UnhandledExceptionInJSP" level="WARNING" enabled="false" /> + <inspection_tool class="ContinueOrBreakFromFinallyBlock" level="WARNING" enabled="false" /> + <inspection_tool class="StrutsInspection" level="ERROR" enabled="false" /> + <inspection_tool class="InfiniteLoopStatement" level="WARNING" enabled="false" /> + <inspection_tool class="EjbDomInspection" level="ERROR" enabled="false" /> + <inspection_tool class="FinallyBlockCannotCompleteNormally" level="WARNING" enabled="false" /> + <inspection_tool class="UnnecessaryLabelOnContinueStatement" level="WARNING" enabled="false" /> + <inspection_tool class="FacesModelInspection" level="ERROR" enabled="false" /> + <inspection_tool class="EmptyStatementBody" level="WARNING" enabled="false"> + <option name="m_reportEmptyBlocks" value="false" /> + </inspection_tool> + <inspection_tool class="ShiftOutOfRangeJS" level="WARNING" enabled="false" /> + <inspection_tool class="RequiredAttributes" level="WARNING" enabled="false"> + <option name="myAdditionalRequiredHtmlAttributes" value="" /> + </inspection_tool> + <inspection_tool class="ArrayEquals" level="WARNING" enabled="false" /> + <inspection_tool class="UnusedMessageFormatParameter" level="WARNING" enabled="false" /> + <inspection_tool class="DuplicateMnemonic" level="WARNING" enabled="false" /> + <inspection_tool class="RedundantCast" level="WARNING" enabled="false" /> + <inspection_tool class="TrivialIf" level="WARNING" enabled="false" /> + <inspection_tool class="ThrowFromFinallyBlockJS" level="WARNING" enabled="false" /> + <inspection_tool class="AntDuplicateImportedTargetsInspection" level="WARNING" enabled="false" /> + <inspection_tool class="CanBeFinal" level="WARNING" enabled="false"> + <option name="REPORT_CLASSES" value="false" /> + <option name="REPORT_METHODS" value="false" /> + <option name="REPORT_FIELDS" value="true" /> + </inspection_tool> + <inspection_tool class="DefaultFileTemplate" level="WARNING" enabled="false"> + <option name="CHECK_FILE_HEADER" value="true" /> + <option name="CHECK_TRY_CATCH_SECTION" value="true" /> + <option name="CHECK_METHOD_BODY" value="true" /> + </inspection_tool> + <inspection_tool class="UnnecessaryLabelOnBreakStatementJS" level="WARNING" enabled="false" /> + <inspection_tool class="NoLabelFor" level="WARNING" enabled="false" /> + <inspection_tool class="UnnecessaryReturn" level="WARNING" enabled="false" /> + <inspection_tool class="DuplicateCaseLabelJS" level="WARNING" enabled="false" /> + <inspection_tool class="InfiniteLoopJS" level="WARNING" enabled="false" /> + <inspection_tool class="GwtServiceNotRegistered" level="ERROR" enabled="false" /> + <inspection_tool class="BooleanMethodIsAlwaysInverted" level="WARNING" enabled="false" /> + <inspection_tool class="UnnecessaryUnboxing" level="WARNING" enabled="false" /> + <inspection_tool class="NonJREEmulationClassesInClientCode" level="ERROR" enabled="false" /> + <inspection_tool class="PointlessBitwiseExpression" level="WARNING" enabled="false"> + <option name="m_ignoreExpressionsContainingConstants" value="false" /> + </inspection_tool> + <inspection_tool class="MismatchedArrayReadWrite" level="WARNING" enabled="false" /> + <inspection_tool class="JSUnresolvedFunction" level="INFO" enabled="false" /> + <inspection_tool class="ELValidationInJSP" level="WARNING" enabled="false" /> + <inspection_tool class="UnnecessaryTemporaryOnConversionFromString" level="WARNING" enabled="false" /> + <inspection_tool class="EqualsWhichDoesntCheckParameterClass" level="WARNING" enabled="false" /> + <inspection_tool class="FinalStaticMethod" level="WARNING" enabled="false" /> + <inspection_tool class="SameParameterValue" level="WARNING" enabled="false" /> + <inspection_tool class="AntDuplicateTargetsInspection" level="ERROR" enabled="false" /> + <inspection_tool class="ReservedWordUsedAsNameJS" level="WARNING" enabled="false" /> + <inspection_tool class="ComponentNotRegistered" level="WARNING" enabled="false"> + <option name="CHECK_ACTIONS" value="true" /> + <option name="IGNORE_NON_PUBLIC" value="true" /> + </inspection_tool> + <inspection_tool class="ReflectionForUnavailableAnnotation" level="WARNING" enabled="false" /> + <inspection_tool class="ExceptionCaughtLocallyJS" level="WARNING" enabled="false" /> + <inspection_tool class="PointlessBooleanExpressionJS" level="WARNING" enabled="false" /> + <inspection_tool class="WeakerAccess" level="WARNING" enabled="false"> + <option name="SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS" value="true" /> + <option name="SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES" value="true" /> + <option name="SUGGEST_PRIVATE_FOR_INNERS" value="false" /> + </inspection_tool> + <inspection_tool class="Glassfish" level="ERROR" enabled="false" /> + <inspection_tool class="WrongPackageStatement" level="ERROR" enabled="false" /> + <inspection_tool class="UnusedReturnValue" level="WARNING" enabled="false" /> + <inspection_tool class="GWTRemoteServiceAsyncCheck" level="ERROR" enabled="false" /> + <inspection_tool class="GwtToHtmlReferences" level="ERROR" enabled="false" /> + <inspection_tool class="InfiniteRecursionJS" level="WARNING" enabled="false" /> + <inspection_tool class="UnusedAssignment" level="WARNING" enabled="false"> + <option name="REPORT_PREFIX_EXPRESSIONS" value="false" /> + <option name="REPORT_POSTFIX_EXPRESSIONS" value="true" /> + <option name="REPORT_REDUNDANT_INITIALIZER" value="true" /> + </inspection_tool> + <inspection_tool class="SimplifiableConditionalExpression" level="WARNING" enabled="false" /> + <inspection_tool class="IncompatibleMask" level="WARNING" enabled="false" /> + <inspection_tool class="Dependency" level="ERROR" enabled="false" /> + <inspection_tool class="SillyAssignmentJS" level="WARNING" enabled="false" /> + <inspection_tool class="GwtInconsistentI18nInterface" level="ERROR" enabled="false" /> + <inspection_tool class="FinalPrivateMethod" level="WARNING" enabled="false" /> + <inspection_tool class="UnnecessaryLabelOnContinueStatementJS" level="WARNING" enabled="false" /> + <inspection_tool class="CssUnitlessNumber" level="WARNING" enabled="false" /> + <inspection_tool class="BooleanConstructor" level="WARNING" enabled="false" /> + <inspection_tool class="EjbQlInspection" level="ERROR" enabled="false" /> + <inspection_tool class="UnusedParameters" level="WARNING" enabled="false" /> + <inspection_tool class="PointlessArithmeticExpressionJS" level="WARNING" enabled="false" /> + <inspection_tool class="ConstantIfStatement" level="WARNING" enabled="false" /> + <inspection_tool class="JSUnresolvedVariable" level="INFO" enabled="false" /> + <inspection_tool class="CheckValidXmlInScriptTagBody" level="ERROR" enabled="false" /> + <inspection_tool class="PointlessBitwiseExpressionJS" level="WARNING" enabled="false"> + <option name="m_ignoreExpressionsContainingConstants" value="false" /> + </inspection_tool> + <inspection_tool class="StrutsTilesInspection" level="ERROR" enabled="false" /> + <inspection_tool class="PointlessArithmeticExpression" level="WARNING" enabled="false"> + <option name="m_ignoreExpressionsContainingConstants" value="false" /> + </inspection_tool> + <inspection_tool class="UnnecessaryLocalVariable" level="WARNING" enabled="false"> + <option name="m_ignoreImmediatelyReturnedVariables" value="false" /> + <option name="m_ignoreAnnotatedVariables" value="false" /> + </inspection_tool> + <inspection_tool class="FinalizeCallsSuperFinalize" level="WARNING" enabled="false"> + <option name="m_ignoreForObjectSubclasses" value="false" /> + </inspection_tool> + <inspection_tool class="SynchronizeOnNonFinalField" level="WARNING" enabled="false" /> + <inspection_tool class="OctalLiteral" level="WARNING" enabled="false" /> + <inspection_tool class="Geronimo" level="ERROR" enabled="false" /> + <inspection_tool class="UnnecessarySemicolon" level="WARNING" enabled="false" /> + <inspection_tool class="PointlessBooleanExpression" level="WARNING" enabled="false"> + <option name="m_ignoreExpressionsContainingConstants" value="false" /> + </inspection_tool> + <inspection_tool class="BoundFieldAssignment" level="WARNING" enabled="false" /> + <inspection_tool class="GWTStyleCheck" level="ERROR" enabled="false" /> + <inspection_tool class="ExtendsAnnotation" level="WARNING" enabled="false" /> + <inspection_tool class="ShiftOutOfRange" level="WARNING" enabled="false" /> + <inspection_tool class="MismatchedCollectionQueryUpdate" level="WARNING" enabled="false" /> + <inspection_tool class="SuspiciousMethodCalls" level="WARNING" enabled="false"> + <option name="REPORT_CONVERTIBLE_METHOD_CALLS" value="true" /> + </inspection_tool> + <inspection_tool class="ManualArrayCopy" level="WARNING" enabled="false" /> + <inspection_tool class="UnnecessaryLabelOnBreakStatement" level="WARNING" enabled="false" /> + <inspection_tool class="StringEquality" level="WARNING" enabled="false" /> + <inspection_tool class="RedundantArrayCreation" level="WARNING" enabled="false" /> + <inspection_tool class="UnnecessaryReturnJS" level="WARNING" enabled="false" /> + <inspection_tool class="SelfIncludingJspFiles" level="ERROR" enabled="false" /> + <inspection_tool class="DuplicatePropertyOnObjectJS" level="WARNING" enabled="false" /> + <inspection_tool class="SameReturnValue" level="WARNING" enabled="false" /> + <inspection_tool class="UnreachableCodeJS" level="WARNING" enabled="false" /> + <inspection_tool class="EmptyTryBlock" level="WARNING" enabled="false" /> + <inspection_tool class="ConstantConditionalExpression" level="WARNING" enabled="false" /> + <inspection_tool class="LoopStatementThatDoesntLoopJS" level="WARNING" enabled="false" /> + <inspection_tool class="NoExplicitFinalizeCalls" level="WARNING" enabled="false" /> + <inspection_tool class="ThrowFromFinallyBlock" level="WARNING" enabled="false" /> + <inspection_tool class="AccessStaticViaInstance" level="WARNING" enabled="false" /> + <inspection_tool class="ObjectEqualsNull" level="WARNING" enabled="false" /> + <inspection_tool class="InstantiatingObjectToGetClassObject" level="WARNING" enabled="false" /> + <inspection_tool class="UnusedDeclaration" level="WARNING" enabled="false"> + <option name="ADD_MAINS_TO_ENTRIES" value="true" /> + <option name="ADD_APPLET_TO_ENTRIES" value="true" /> + <option name="ADD_SERVLET_TO_ENTRIES" value="true" /> + <option name="ADD_NONJAVA_TO_ENTRIES" value="true" /> + <option name="ADDITIONAL_ANNOTATIONS"> + <value> + <list size="0" /> + </value> + </option> + <option name="ADD_EJB_TO_ENTRIES" value="true" /> + <option name="ADD_JUNIT_TO_ENTRIES" value="true" /> + <option name="ADD_TESTNG_TO_ENTRIES" value="true" /> + </inspection_tool> + <inspection_tool class="DuplicateThrows" level="WARNING" enabled="false" /> + <inspection_tool class="ForCanBeForeach" level="WARNING" enabled="false"> + <option name="REPORT_INDEXED_LOOP" value="true" /> + </inspection_tool> + <inspection_tool class="MalformedXPath" level="WARNING" enabled="false" /> + <inspection_tool class="MalformedFormatString" level="WARNING"... [truncated message content] |
From: <aki...@us...> - 2008-05-21 19:50:27
|
Revision: 4043 http://gridarta.svn.sourceforge.net/gridarta/?rev=4043&view=rev Author: akirschbaum Date: 2008-05-21 12:42:18 -0700 (Wed, 21 May 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gui/CMainView.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gui/CMainView.java trunk/src/app/net/sf/gridarta/gui/MainView.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-05-21 19:07:32 UTC (rev 4042) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-05-21 19:42:18 UTC (rev 4043) @@ -30,6 +30,7 @@ import cfeditor.gameobject.scripts.ScriptArchUtils; import cfeditor.gui.CMainView; import cfeditor.gui.GameObjectAttributesDialog; +import cfeditor.gui.GameObjectAttributesPanel; import cfeditor.gui.ObjectChooser; import cfeditor.gui.map.CMapViewBasic; import cfeditor.gui.prefs.GUIPrefs; @@ -290,7 +291,9 @@ log.fatal("GameObjectMatcher 'monster' does not exist"); throw new MissingResourceException("GameObjectMatcher 'monster' does not exist", null, null); } - mainView.init(new LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(getMapManager(), Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER), selectedSquareControl.getSelectedSquareView(), typeList, mapTileListBottom, monsterMatcher, gameObjectMatchers); + final LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic> lockedItemsControl = new LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(getMapManager(), Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER); + final GameObjectAttributesPanel gameObjectAttributesPanel = new GameObjectAttributesPanel(this, getMapManager(), mainView, lockedItemsControl, monsterMatcher); + mainView.init(gameObjectAttributesPanel, selectedSquareControl.getSelectedSquareView(), typeList, mapTileListBottom, gameObjectMatchers); mapActions.updateMenuState(); scriptControl.getView().setMenu((JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "plugins")); archetypeParser = new ArchetypeParser(this, objectChooser.getArchetypeChooserControl(), animationObjects); Modified: trunk/crossfire/src/cfeditor/gui/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/CMainView.java 2008-05-21 19:07:32 UTC (rev 4042) +++ trunk/crossfire/src/cfeditor/gui/CMainView.java 2008-05-21 19:42:18 UTC (rev 4043) @@ -25,11 +25,8 @@ import cfeditor.gui.map.CMapViewBasic; import cfeditor.map.MapArchObject; import javax.swing.Action; -import net.sf.gridarta.MainControl; import net.sf.gridarta.MapManager; -import net.sf.gridarta.gameobject.match.GameObjectMatcher; import net.sf.gridarta.gui.MainView; -import net.sf.gridarta.gui.connectionview.LockedItemsControl; import net.sf.japi.swing.ActionFactory; import org.jetbrains.annotations.NotNull; @@ -54,9 +51,4 @@ super(mainControl, objectChooser, mapManager, actionFactory, aCloseAll); } - /** {@inheritDoc} */ - @Override protected GameObjectAttributesPanel newGameObjectAttributesPanel(final MainControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mainControl, final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, final LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic> lockedItemsControl, final GameObjectMatcher monsterMatcher) { - return new GameObjectAttributesPanel(mainControl, mapManager, this, lockedItemsControl, monsterMatcher); - } - } // class CMainView Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-05-21 19:07:32 UTC (rev 4042) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-05-21 19:42:18 UTC (rev 4043) @@ -28,6 +28,7 @@ import daieditor.gameobject.scripts.ScriptArchEditor; import daieditor.gui.CMainView; import daieditor.gui.GameObjectAttributesDialog; +import daieditor.gui.GameObjectAttributesPanel; import daieditor.gui.ObjectChooser; import daieditor.gui.map.CMapViewBasic; import daieditor.gui.map.DefaultLevelRenderer; @@ -347,7 +348,9 @@ log.fatal("GameObjectMatcher 'monster' does not exist"); throw new MissingResourceException("GameObjectMatcher 'monster' does not exist", null, null); } - mainView.init(new LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(getMapManager(), Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER), selectedSquareControl.getSelectedSquareView(), typeList, mapTileListBottom, monsterMatcher, gameObjectMatchers); + final LockedItemsControl lockedItemsControl = new LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(getMapManager(), Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER); + final GameObjectAttributesPanel gameObjectAttributesPanel = new GameObjectAttributesPanel(this, getMapManager(), mainView, lockedItemsControl, monsterMatcher); + mainView.init(gameObjectAttributesPanel, selectedSquareControl.getSelectedSquareView(), typeList, mapTileListBottom, gameObjectMatchers); mapActions.updateMenuState(); archetypeParser = new ArchetypeParser(this, objectChooser.getArchetypeChooserControl(), animationObjects); faceObjects = new FaceObjects(mainView); Modified: trunk/daimonin/src/daieditor/gui/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/gui/CMainView.java 2008-05-21 19:07:32 UTC (rev 4042) +++ trunk/daimonin/src/daieditor/gui/CMainView.java 2008-05-21 19:42:18 UTC (rev 4043) @@ -25,11 +25,8 @@ import daieditor.gui.map.CMapViewBasic; import daieditor.map.MapArchObject; import javax.swing.Action; -import net.sf.gridarta.MainControl; import net.sf.gridarta.MapManager; -import net.sf.gridarta.gameobject.match.GameObjectMatcher; import net.sf.gridarta.gui.MainView; -import net.sf.gridarta.gui.connectionview.LockedItemsControl; import net.sf.japi.swing.ActionFactory; import org.jetbrains.annotations.NotNull; @@ -54,9 +51,4 @@ super(mainControl, objectChooser, mapManager, actionFactory, aCloseAll); } - /** {@inheritDoc} */ - @Override protected GameObjectAttributesPanel newGameObjectAttributesPanel(final MainControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mainControl, final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, final LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic> lockedItemsControl, final GameObjectMatcher monsterMatcher) { - return new GameObjectAttributesPanel(mainControl, mapManager, this, lockedItemsControl, monsterMatcher); - } - } // class CMainView Modified: trunk/src/app/net/sf/gridarta/gui/MainView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/MainView.java 2008-05-21 19:07:32 UTC (rev 4042) +++ trunk/src/app/net/sf/gridarta/gui/MainView.java 2008-05-21 19:42:18 UTC (rev 4043) @@ -48,9 +48,7 @@ import net.sf.gridarta.MapManager; import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; -import net.sf.gridarta.gameobject.match.GameObjectMatcher; import net.sf.gridarta.gameobject.match.GameObjectMatchers; -import net.sf.gridarta.gui.connectionview.LockedItemsControl; import net.sf.gridarta.gui.map.MapFileActions; import net.sf.gridarta.gui.map.MapView; import net.sf.gridarta.gui.map.MapViewBasic; @@ -431,16 +429,17 @@ /** * Initializes (builds) this view. - * @param lockedItemsControl the locked items control + * @param gameObjectAttributesPanel the game object attributes panel * @param selectedSquareView the selected square view * @param archTypeList the instance for looking up archetype types * @param mapTileListBottom whether the map tile view should be on the * bottom - * @param monsterMatcher the <code>GameObjectMatcher</code> for matching * monster objects * @param gameObjectMatchers the game object matchers */ - public void init(@NotNull final LockedItemsControl<G, A, R, V> lockedItemsControl, @NotNull final SelectedSquareView<G, A, R, V> selectedSquareView, final CFArchTypeList archTypeList, final boolean mapTileListBottom, @NotNull final GameObjectMatcher monsterMatcher, @NotNull final GameObjectMatchers gameObjectMatchers) { + public void init(@NotNull final GameObjectAttributesPanel<G, A, R, V> gameObjectAttributesPanel, @NotNull final SelectedSquareView<G, A, R, V> selectedSquareView, final CFArchTypeList archTypeList, final boolean mapTileListBottom, @NotNull final GameObjectMatchers gameObjectMatchers) { + this.gameObjectAttributesPanel = gameObjectAttributesPanel; + // calculate some default values in case there is no settings file final Rectangle screen = getGraphicsConfiguration().getBounds(); final int defwidth = (int) (0.9 * screen.getWidth()); @@ -450,7 +449,7 @@ final JPanel toolbarPanel = new JPanel(new BorderLayout()); toolbarPanel.add(mainToolbar, BorderLayout.NORTH); - toolbarPanel.add(createCenterPanel(defwidth, defheight, lockedItemsControl, selectedSquareView, mapTileListBottom, monsterMatcher), BorderLayout.CENTER); + toolbarPanel.add(createCenterPanel(defwidth, defheight, selectedSquareView, mapTileListBottom), BorderLayout.CENTER); add(toolbarPanel, BorderLayout.CENTER); archetypesActions = new ArchetypesActions<G, A, R, V>(this, objectChooser.getArchetypeChooserControl(), objectChooser, archTypeList); @@ -485,22 +484,17 @@ * Create the center panel. * @param defwidth default width * @param defheight default height - * @param lockedItemsControl the locked items control * @param selectedSquareView the selected square view * @param mapTileListBottom whether the map tile should be at the bottom - * @param monsterMatcher the <code>GameObjectMatcher</code> for matching - * monster objects * @return center panel */ - private JPanel createCenterPanel(final int defwidth, final int defheight, @NotNull final LockedItemsControl<G, A, R, V> lockedItemsControl, @NotNull final SelectedSquareView<G, A, R, V> selectedSquareView, final boolean mapTileListBottom, @NotNull final GameObjectMatcher monsterMatcher) { + private JPanel createCenterPanel(final int defwidth, final int defheight, @NotNull final SelectedSquareView<G, A, R, V> selectedSquareView, final boolean mapTileListBottom) { final JPanel centerPanel = new JPanel(new BorderLayout()); final int divLocationRight = prefs.getInt(DIVIDER_LOCATION_KEY3, (int) (defwidth * 0.62)); final int divLocationDown = prefs.getInt(DIVIDER_LOCATION_KEY2, (int) (defheight * 0.76)); final int divLocation = prefs.getInt(DIVIDER_LOCATION_KEY, (int) (defwidth * 0.17)); - gameObjectAttributesPanel = newGameObjectAttributesPanel(mainControl, mapManager, lockedItemsControl, monsterMatcher); - if (mapTileListBottom) { splitRightPane = new GSplitPane(JSplitPane.HORIZONTAL_SPLIT, gameObjectAttributesPanel, selectedSquareView); splitDownPane = new GSplitPane(JSplitPane.VERTICAL_SPLIT, mapDesktop, splitRightPane); @@ -522,8 +516,6 @@ return centerPanel; } - protected abstract GameObjectAttributesPanel<G, A, R, V> newGameObjectAttributesPanel(final MainControl<G, A, R, V> mainControl, final MapManager<G, A, R, V> mapManager, final LockedItemsControl<G, A, R, V> lockedItemsControl, final GameObjectMatcher monsterMatcher); - /** Notifies that the application is about to exit. */ public void appExitNotify() { // Store the location and size This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-05-21 20:33:21
|
Revision: 4044 http://gridarta.svn.sourceforge.net/gridarta/?rev=4044&view=rev Author: akirschbaum Date: 2008-05-21 13:32:23 -0700 (Wed, 21 May 2008) Log Message: ----------- Remove CMainView. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java trunk/gridarta.ipr trunk/src/app/net/sf/gridarta/gui/MainView.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/gui/CMainView.java trunk/daimonin/src/daieditor/gui/CMainView.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-05-21 19:42:18 UTC (rev 4043) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-05-21 20:32:23 UTC (rev 4044) @@ -28,7 +28,6 @@ import cfeditor.gameobject.face.FaceObjects; import cfeditor.gameobject.scripts.ScriptArchEditor; import cfeditor.gameobject.scripts.ScriptArchUtils; -import cfeditor.gui.CMainView; import cfeditor.gui.GameObjectAttributesDialog; import cfeditor.gui.GameObjectAttributesPanel; import cfeditor.gui.ObjectChooser; @@ -154,7 +153,7 @@ private final ObjectChooser objectChooser; /** The main view. */ - private final CMainView mainView; + private final MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> mainView; /** The undo control. */ @NotNull private final UndoControl<GameObject, MapArchObject, Archetype, CMapViewBasic> undoControl; @@ -237,7 +236,7 @@ globalSettings.readGlobalSettings(); PathManager.setGlobalSettings(globalSettings); objectChooser = new ObjectChooser(newMapDialogFactory, this, new File(globalSettings.getMapDir(), IGUIConstants.PICKMAP_DIR)); - mainView = new CMainView(this, objectChooser, getMapManager(), ACTION_FACTORY, mapManagerActions.getCloseAllAction()); + mainView = new MainView<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, objectChooser, getMapManager(), ACTION_FACTORY, mapManagerActions.getCloseAllAction()); new About("cfeditor", mainView); undoControl = new UndoControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(getMapManager()); updaterManager = new UpdaterManager("cfeditor", this, mainView, "CrossfireEditor.jar"); @@ -283,7 +282,7 @@ ScriptArchEditor.initEventTypeBoxes(".py", "Python"); - final boolean mapTileListBottom = prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT); + final boolean mapTileListBottom = prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, MainView.MAP_TILE_LIST_BOTTOM_DEFAULT); selectedSquareControl = new SelectedSquareControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(ACTION_FACTORY, this, mainView, mapTileListBottom, null); // Initialize the main view final GameObjectMatcher monsterMatcher = GameObjectMatchers.getMatcher("monster"); @@ -517,7 +516,7 @@ * Returns the main view. * @return the main view */ - public CMainView getMainView() { + public MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> getMainView() { return mainView; } Deleted: trunk/crossfire/src/cfeditor/gui/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/CMainView.java 2008-05-21 19:42:18 UTC (rev 4043) +++ trunk/crossfire/src/cfeditor/gui/CMainView.java 2008-05-21 20:32:23 UTC (rev 4044) @@ -1,54 +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 cfeditor.gui; - -import cfeditor.CMainControl; -import cfeditor.gameobject.Archetype; -import cfeditor.gameobject.GameObject; -import cfeditor.gui.map.CMapViewBasic; -import cfeditor.map.MapArchObject; -import javax.swing.Action; -import net.sf.gridarta.MapManager; -import net.sf.gridarta.gui.MainView; -import net.sf.japi.swing.ActionFactory; -import org.jetbrains.annotations.NotNull; - -/** - * The main view of the level editor. Contains the "desktop" for internal level - * windows, tile palette, menu, status- and toolbar. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public final class CMainView extends MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> { - - /** - * Constructs the main view and registers the given main controller. - * @param mainControl MainControl to attach to. - * @param objectChooser the object chooser - * @param mapManager the map manager - * @param actionFactory the action factory to use - * @param aCloseAll the action "close all map windows" - */ - public CMainView(@NotNull final CMainControl mainControl, @NotNull final ObjectChooser objectChooser, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, @NotNull final ActionFactory actionFactory, @NotNull final Action aCloseAll) { - super(mainControl, objectChooser, mapManager, actionFactory, aCloseAll); - } - -} // class CMainView Modified: trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java 2008-05-21 19:42:18 UTC (rev 4043) +++ trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java 2008-05-21 20:32:23 UTC (rev 4044) @@ -19,7 +19,6 @@ package cfeditor.gui.prefs; -import cfeditor.gui.CMainView; import java.awt.Component; import java.util.Arrays; import java.util.Locale; @@ -107,14 +106,14 @@ public void revert() { final String current = prefs.get(MainControl.PREFS_LANGUAGE, null); localeBox.setSelectedIndex(Arrays.binarySearch(locales, current != null ? new Locale(current) : null, comp)); - mapPanelBottom.setSelected(prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT)); + mapPanelBottom.setSelected(prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, MainView.MAP_TILE_LIST_BOTTOM_DEFAULT)); showMainToolbar.setSelected(prefs.getBoolean(MainView.SHOW_MAIN_TOOLBAR_KEY, MainView.SHOW_MAIN_TOOLBAR_DEFAULT)); } /** {@inheritDoc} */ public void defaults() { localeBox.setSelectedIndex(Arrays.binarySearch(locales, null, comp)); - mapPanelBottom.setSelected(CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT); + mapPanelBottom.setSelected(MainView.MAP_TILE_LIST_BOTTOM_DEFAULT); showMainToolbar.setSelected(MainView.SHOW_MAIN_TOOLBAR_DEFAULT); } @@ -125,7 +124,7 @@ final Locale current = currentName != null ? new Locale(currentName) : null; return !( (loc == null ? current == null : loc.equals(current)) - && mapPanelBottom.isSelected() == prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT) + && mapPanelBottom.isSelected() == prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, MainView.MAP_TILE_LIST_BOTTOM_DEFAULT) && showMainToolbar.isSelected() == prefs.getBoolean(MainView.SHOW_MAIN_TOOLBAR_KEY, MainView.SHOW_MAIN_TOOLBAR_DEFAULT) ); } @@ -180,7 +179,7 @@ layoutPanel.setBorder(createTitledBorder("optionsLayout")); mapPanelBottom = new JCheckBox(ACTION_FACTORY.createAction(false, "optionsSepMapTile")); - mapPanelBottom.setSelected(prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT)); + mapPanelBottom.setSelected(prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, MainView.MAP_TILE_LIST_BOTTOM_DEFAULT)); layoutPanel.add(mapPanelBottom); showMainToolbar = new JCheckBox(ACTION_FACTORY.createAction(false, "optionsShowMainToolbar")); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-05-21 19:42:18 UTC (rev 4043) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-05-21 20:32:23 UTC (rev 4044) @@ -26,7 +26,6 @@ import daieditor.gameobject.anim.AnimationObjects; import daieditor.gameobject.face.FaceObjects; import daieditor.gameobject.scripts.ScriptArchEditor; -import daieditor.gui.CMainView; import daieditor.gui.GameObjectAttributesDialog; import daieditor.gui.GameObjectAttributesPanel; import daieditor.gui.ObjectChooser; @@ -192,7 +191,7 @@ private final ObjectChooser objectChooser; /** The main view. */ - private final CMainView mainView; + private final MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> mainView; /** The undo control. */ @NotNull private final UndoControl<GameObject, MapArchObject, Archetype, CMapViewBasic> undoControl; @@ -292,7 +291,7 @@ globalSettings.readGlobalSettings(); PathManager.setGlobalSettings(globalSettings); objectChooser = new ObjectChooser(newMapDialogFactory, this, new File(globalSettings.getArchDefaultFolder(), IGUIConstants.PICKMAP_DIR)); - mainView = new CMainView(this, objectChooser, getMapManager(), ACTION_FACTORY, mapManagerActions.getCloseAllAction()); + mainView = new MainView<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, objectChooser, getMapManager(), ACTION_FACTORY, mapManagerActions.getCloseAllAction()); new About("daieditor", mainView); undoControl = new UndoControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(getMapManager()); updaterManager = new UpdaterManager("daieditor", this, mainView, "DaimoninEditor.jar"); @@ -340,7 +339,7 @@ ScriptArchEditor.initEventTypeBoxes(".lua", "Lua"); - final boolean mapTileListBottom = prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT); + final boolean mapTileListBottom = prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, MainView.MAP_TILE_LIST_BOTTOM_DEFAULT); selectedSquareControl = new SelectedSquareControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(ACTION_FACTORY, this, mainView, mapTileListBottom, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH)); // Initialize the main view final GameObjectMatcher monsterMatcher = gameObjectMatchers.getMatcher("monster"); @@ -691,7 +690,7 @@ * Returns the main view. * @return the main view */ - public CMainView getMainView() { + public MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> getMainView() { return mainView; } Deleted: trunk/daimonin/src/daieditor/gui/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/gui/CMainView.java 2008-05-21 19:42:18 UTC (rev 4043) +++ trunk/daimonin/src/daieditor/gui/CMainView.java 2008-05-21 20:32:23 UTC (rev 4044) @@ -1,54 +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.gui; - -import daieditor.CMainControl; -import daieditor.gameobject.Archetype; -import daieditor.gameobject.GameObject; -import daieditor.gui.map.CMapViewBasic; -import daieditor.map.MapArchObject; -import javax.swing.Action; -import net.sf.gridarta.MapManager; -import net.sf.gridarta.gui.MainView; -import net.sf.japi.swing.ActionFactory; -import org.jetbrains.annotations.NotNull; - -/** - * The main view of the level editor. Contains the "desktop" for internal level - * windows, tile palette, menu, status- and toolbar. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public final class CMainView extends MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> { - - /** - * Constructs the main view and registers the given main controller. - * @param mainControl MainControl to attach to. - * @param objectChooser the object chooser - * @param mapManager the map manager - * @param actionFactory the action factory to use - * @param aCloseAll the action "close all map windows" - */ - public CMainView(@NotNull final CMainControl mainControl, @NotNull final ObjectChooser objectChooser, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, @NotNull final ActionFactory actionFactory, @NotNull final Action aCloseAll) { - super(mainControl, objectChooser, mapManager, actionFactory, aCloseAll); - } - -} // class CMainView Modified: trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java 2008-05-21 19:42:18 UTC (rev 4043) +++ trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java 2008-05-21 20:32:23 UTC (rev 4044) @@ -19,7 +19,6 @@ package daieditor.gui.prefs; -import daieditor.gui.CMainView; import java.awt.Component; import java.util.Arrays; import java.util.Locale; @@ -107,14 +106,14 @@ public void revert() { final String current = prefs.get(MainControl.PREFS_LANGUAGE, null); localeBox.setSelectedIndex(Arrays.binarySearch(locales, current != null ? new Locale(current) : null, comp)); - mapPanelBottom.setSelected(prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT)); + mapPanelBottom.setSelected(prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, MainView.MAP_TILE_LIST_BOTTOM_DEFAULT)); showMainToolbar.setSelected(prefs.getBoolean(MainView.SHOW_MAIN_TOOLBAR_KEY, MainView.SHOW_MAIN_TOOLBAR_DEFAULT)); } /** {@inheritDoc} */ public void defaults() { localeBox.setSelectedIndex(Arrays.binarySearch(locales, null, comp)); - mapPanelBottom.setSelected(CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT); + mapPanelBottom.setSelected(MainView.MAP_TILE_LIST_BOTTOM_DEFAULT); showMainToolbar.setSelected(MainView.SHOW_MAIN_TOOLBAR_DEFAULT); } @@ -125,7 +124,7 @@ final Locale current = currentName != null ? new Locale(currentName) : null; return !( (loc == null ? current == null : loc.equals(current)) - && mapPanelBottom.isSelected() == prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT) + && mapPanelBottom.isSelected() == prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, MainView.MAP_TILE_LIST_BOTTOM_DEFAULT) && showMainToolbar.isSelected() == prefs.getBoolean(MainView.SHOW_MAIN_TOOLBAR_KEY, MainView.SHOW_MAIN_TOOLBAR_DEFAULT) ); } @@ -180,7 +179,7 @@ layoutPanel.setBorder(createTitledBorder("optionsLayout")); mapPanelBottom = new JCheckBox(ACTION_FACTORY.createAction(false, "optionsSepMapTile")); - mapPanelBottom.setSelected(prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT)); + mapPanelBottom.setSelected(prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, MainView.MAP_TILE_LIST_BOTTOM_DEFAULT)); layoutPanel.add(mapPanelBottom); showMainToolbar = new JCheckBox(ACTION_FACTORY.createAction(false, "optionsShowMainToolbar")); Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2008-05-21 19:42:18 UTC (rev 4043) +++ trunk/gridarta.ipr 2008-05-21 20:32:23 UTC (rev 4044) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<project relativePaths="false" version="4"> +<project version="4" relativePaths="false"> <component name="AntConfiguration"> <defaultAnt bundledAnt="true" /> </component> @@ -33,7 +33,7 @@ <package name="" withSubpackages="true" /> </value> </option> - <option name="RIGHT_MARGIN" value="80" /> + <option name="RIGHT_MARGIN" value="160" /> <option name="IF_BRACE_FORCE" value="3" /> <option name="DOWHILE_BRACE_FORCE" value="3" /> <option name="WHILE_BRACE_FORCE" value="3" /> @@ -50,15 +50,6 @@ <option name="CLASS_ANNOTATION_WRAP" value="1" /> <option name="FIELD_ANNOTATION_WRAP" value="1" /> <option name="ENUM_CONSTANTS_WRAP" value="2" /> - <ADDITIONAL_INDENT_OPTIONS fileType="js"> - <option name="INDENT_SIZE" value="4" /> - <option name="CONTINUATION_INDENT_SIZE" value="8" /> - <option name="TAB_SIZE" value="4" /> - <option name="USE_TAB_CHARACTER" value="false" /> - <option name="SMART_TABS" value="false" /> - <option name="LABEL_INDENT_SIZE" value="0" /> - <option name="LABEL_INDENT_ABSOLUTE" value="false" /> - </ADDITIONAL_INDENT_OPTIONS> </value> </option> <option name="USE_PER_PROJECT_SETTINGS" value="true" /> @@ -83,12 +74,11 @@ <entry name="?*.testdata" /> </wildcardResourcePatterns> </component> - <component name="CppTools.Loader" warnedAboutFileOutOfSourceRoot="true" /> + <component name="DataSourceManagerImpl" /> <component name="DependenciesAnalyzeManager"> <option name="myForwardDirection" value="false" /> </component> <component name="DependencyValidationManager"> - <option name="SKIP_IMPORT_STATEMENTS" value="false" /> <scope name="Project without textedit" pattern="!src[gridarta]:net.sf.gridarta.textedit.scripteditor..*&&!src[gridarta]:net.sf.gridarta.textedit.textarea..*&&!src[textedit]:*..*" /> </component> <component name="EclipseCompilerSettings"> @@ -106,13 +96,14 @@ <option name="MAXIMUM_HEAP_SIZE" value="128" /> </component> <component name="EntryPointsManager"> - <entry_points version="2.0" /> + <entry_points /> </component> <component name="ExportToHTMLSettings"> <option name="PRINT_LINE_NUMBERS" value="false" /> <option name="OPEN_IN_BROWSER" value="false" /> <option name="OUTPUT_DIRECTORY" /> </component> + <component name="GUI Designer component loader factory" /> <component name="IdProvider" IDEtalkID="2C998304C446463F0F811673874877B6" /> <component name="InspectionProjectProfileManager"> <option name="PROJECT_PROFILE" value="No errors allowed here" /> @@ -122,6 +113,24 @@ <profile version="1.0" is_locked="false"> <option name="myName" value="Javadoc Issues" /> <option name="myLocal" value="false" /> + <used_levels> + <error> + <option name="myName" value="ERROR" /> + <option name="myVal" value="400" /> + </error> + <warning> + <option name="myName" value="WARNING" /> + <option name="myVal" value="300" /> + </warning> + <information> + <option name="myName" value="INFO" /> + <option name="myVal" value="200" /> + </information> + <server> + <option name="myName" value="SERVER PROBLEM" /> + <option name="myVal" value="100" /> + </server> + </used_levels> <inspection_tool class="CheckEmptyScriptTag" level="WARNING" enabled="false" /> <inspection_tool class="FunctionWithInconsistentReturnsJS" level="WARNING" enabled="false" /> <inspection_tool class="InfiniteLoopStatement" level="WARNING" enabled="false" /> @@ -141,9 +150,13 @@ </inspection_tool> <inspection_tool class="GwtInconsistentI18nInterface" level="ERROR" enabled="false" /> <inspection_tool class="StringToString" level="WARNING" enabled="false" /> + <inspection_tool class="AnalyzingStaticVariables" level="ERROR" enabled="false"> + <option name="CHECKED_TYPES" value="javax.servlet.http.HttpSession;com.ulcjava.base.application.ULCProxy" /> + </inspection_tool> <inspection_tool class="BoundFieldAssignment" level="WARNING" enabled="false" /> <inspection_tool class="NullArgumentToVariableArgMethod" level="WARNING" enabled="false" /> <inspection_tool class="JSUndeclaredVariable" level="INFO" enabled="false" /> + <inspection_tool class="PersistenceModelErrorInspection" level="ERROR" enabled="false" /> <inspection_tool class="LoopStatementsThatDontLoop" level="WARNING" enabled="false" /> <inspection_tool class="RedundantThrows" level="WARNING" enabled="false" /> <inspection_tool class="StrutsValidatorFormInspection" level="ERROR" enabled="false" /> @@ -160,10 +173,10 @@ <inspection_tool class="Glassfish" level="ERROR" enabled="false" /> <inspection_tool class="ConstantConditions" level="WARNING" enabled="false"> <option name="SUGGEST_NULLABLE_ANNOTATIONS" value="false" /> - <option name="DONT_REPORT_TRUE_ASSERT_STATEMENTS" value="false" /> </inspection_tool> <inspection_tool class="GwtServiceNotRegistered" level="ERROR" enabled="false" /> <inspection_tool class="EjbErrorInspection" level="ERROR" enabled="false" /> + <inspection_tool class="PersistenceDataSourceORMInspection" level="ERROR" enabled="false" /> <inspection_tool class="CanBeFinal" level="WARNING" enabled="false"> <option name="REPORT_CLASSES" value="false" /> <option name="REPORT_METHODS" value="false" /> @@ -178,10 +191,18 @@ <option name="REPORT_POSTFIX_EXPRESSIONS" value="true" /> <option name="REPORT_REDUNDANT_INITIALIZER" value="true" /> </inspection_tool> + <inspection_tool class="AnalyzingVariableNaming" level="WARNING" enabled="false"> + <option name="IGNORE_SERIAL_VERSION_UID" value="true" /> + <option name="CHECK_STATIC_FINAL_FIELDS" value="true" /> + <option name="CHECK_STATIC_FIELDS" value="true" /> + <option name="CHECK_FIELDS" value="true" /> + <option name="CHECK_PARAMETERS" value="true" /> + </inspection_tool> <inspection_tool class="WebProperties" level="ERROR" enabled="false" /> <inspection_tool class="PointlessArithmeticExpressionJS" level="WARNING" enabled="false" /> <inspection_tool class="UnnecessaryConditionalExpression" level="WARNING" enabled="false" /> <inspection_tool class="StringConcatenationInsideStringBufferAppend" level="WARNING" enabled="false" /> + <inspection_tool class="AnalyzingJLSModifierOrder" level="WARNING" enabled="false" /> <inspection_tool class="AntDuplicateImportedTargetsInspection" level="WARNING" enabled="false" /> <inspection_tool class="UNUSED_SYMBOL" level="WARNING" enabled="false"> <option name="LOCAL_VARIABLE" value="true" /> @@ -189,7 +210,6 @@ <option name="METHOD" value="true" /> <option name="CLASS" value="true" /> <option name="PARAMETER" value="true" /> - <option name="REPORT_PARAMETER_FOR_PUBLIC_METHODS" value="true" /> <option name="INJECTION_ANNOS"> <value> <list size="0" /> @@ -227,6 +247,7 @@ <inspection_tool class="CheckValidXmlInScriptTagBody" level="ERROR" enabled="false" /> <inspection_tool class="ManualArrayCopy" level="WARNING" enabled="false" /> <inspection_tool class="Weblogic" level="ERROR" enabled="false" /> + <inspection_tool class="PersistenceDataSourceORMDomInspection" level="ERROR" enabled="false" /> <inspection_tool class="FallthroughInSwitchStatementJS" level="WARNING" enabled="false" /> <inspection_tool class="IgnoreResultOfCall" level="WARNING" enabled="false"> <option name="m_reportAllNonLibraryCalls" value="false" /> @@ -236,13 +257,18 @@ <inspection_tool class="RedundantCast" level="WARNING" enabled="false" /> <inspection_tool class="UnnecessaryReturn" level="WARNING" enabled="false" /> <inspection_tool class="FinalStaticMethod" level="WARNING" enabled="false" /> - <inspection_tool class="SuspiciousMethodCalls" level="WARNING" enabled="false"> - <option name="REPORT_CONVERTIBLE_METHOD_CALLS" value="true" /> + <inspection_tool class="SuspiciousMethodCalls" level="WARNING" enabled="false" /> + <inspection_tool class="HTML" level="WARNING" enabled="false"> + <option name="myAdditionalHtmlTags" value="embed,nobr,noembed,comment,script" /> + <option name="myAdditionalHtmlAttributes" value="type,wmode,src,width,height" /> + <option name="myCheckHtmlTags" value="true" /> + <option name="myCheckHtmlAttributes" value="true" /> </inspection_tool> <inspection_tool class="UnnecessaryUnboxing" level="WARNING" enabled="false" /> <inspection_tool class="SameParameterValue" level="WARNING" enabled="false" /> <inspection_tool class="NoExplicitFinalizeCalls" level="WARNING" enabled="false" /> <inspection_tool class="FinalPrivateMethod" level="WARNING" enabled="false" /> + <inspection_tool class="AnalyzingRedundantFieldInitialization" level="WARNING" enabled="false" /> <inspection_tool class="ReservedWordUsedAsNameJS" level="WARNING" enabled="false" /> <inspection_tool class="ExtendsAnnotation" level="WARNING" enabled="false" /> <inspection_tool class="UnnecessaryReturnJS" level="WARNING" enabled="false" /> @@ -254,15 +280,17 @@ <inspection_tool class="UnnecessaryLabelOnContinueStatement" level="WARNING" enabled="false" /> <inspection_tool class="NoLabelFor" level="WARNING" enabled="false" /> <inspection_tool class="SynchronizeOnNonFinalField" level="WARNING" enabled="false" /> + <inspection_tool class="AnalyzingLoggingWithoutLogLevelCheck" level="WARNING" enabled="false"> + <option name="CHECK_DEBUG" value="true" /> + <option name="CHECK_INFO" value="true" /> + <option name="IGNORE_SIMPLE_STATEMENTS" value="true" /> + </inspection_tool> <inspection_tool class="AntDuplicateTargetsInspection" level="ERROR" enabled="false" /> <inspection_tool class="NullableProblems" level="WARNING" enabled="false"> <option name="REPORT_NULLABLE_METHOD_OVERRIDES_NOTNULL" value="true" /> <option name="REPORT_NOT_ANNOTATED_METHOD_OVERRIDES_NOTNULL" value="true" /> <option name="REPORT_NOTNULL_PARAMETER_OVERRIDES_NULLABLE" value="true" /> <option name="REPORT_NOT_ANNOTATED_PARAMETER_OVERRIDES_NOTNULL" value="true" /> - <option name="REPORT_NOT_ANNOTATED_GETTER" value="true" /> - <option name="REPORT_NOT_ANNOTATED_SETTER_PARAMETER" value="true" /> - <option name="REPORT_ANNOTATION_NOT_PROPAGATED_TO_OVERRIDERS" value="true" /> </inspection_tool> <inspection_tool class="ReferencesToClassesFromDefaultPackagesInJSPFile" level="ERROR" enabled="false" /> <inspection_tool class="TrivialIf" level="WARNING" enabled="false" /> @@ -285,6 +313,11 @@ <inspection_tool class="IncompatibleMaskJS" level="WARNING" enabled="false" /> <inspection_tool class="NonJREEmulationClassesInClientCode" level="ERROR" enabled="false" /> <inspection_tool class="OctalLiteral" level="WARNING" enabled="false" /> + <inspection_tool class="AnalyzingRedundantModifier" level="WARNING" enabled="false"> + <option name="CHECK_FINAL_METHODS" value="true" /> + <option name="CHECK_PUBLIC_INTERFACE_METHODS" value="true" /> + <option name="CHECK_TRANSIENT_STATIC_FIELDS" value="true" /> + </inspection_tool> <inspection_tool class="WhileCanBeForeach" level="WARNING" enabled="false" /> <inspection_tool class="InfiniteRecursion" level="WARNING" enabled="false" /> <inspection_tool class="Geronimo" level="ERROR" enabled="false" /> @@ -296,7 +329,6 @@ <inspection_tool class="EmptyCatchBlock" level="WARNING" enabled="false"> <option name="m_includeComments" value="true" /> <option name="m_ignoreTestCases" value="true" /> - <option name="m_ignoreIgnoreParameter" value="true" /> </inspection_tool> <inspection_tool class="Dependency" level="ERROR" enabled="false" /> <inspection_tool class="UnnecessaryLocalVariable" level="WARNING" enabled="false"> @@ -309,9 +341,8 @@ <option name="m_reportEmptyBlocks" value="false" /> </inspection_tool> <inspection_tool class="ThrowFromFinallyBlockJS" level="WARNING" enabled="false" /> - <inspection_tool class="ForCanBeForeach" level="WARNING" enabled="false"> - <option name="REPORT_INDEXED_LOOP" value="true" /> - </inspection_tool> + <inspection_tool class="PersistenceORMDomInspection" level="ERROR" enabled="false" /> + <inspection_tool class="ForCanBeForeach" level="WARNING" enabled="false" /> <inspection_tool class="TypeParameterExtendsObject" level="WARNING" enabled="false" /> <inspection_tool class="FieldCanBeLocal" level="WARNING" enabled="false" /> <inspection_tool class="UNCHECKED_WARNING" level="WARNING" enabled="false" /> @@ -327,7 +358,9 @@ <inspection_tool class="TrivialIfJS" level="WARNING" enabled="false" /> <inspection_tool class="SimplifiableConditionalExpression" level="WARNING" enabled="false" /> <inspection_tool class="IncompatibleMask" level="WARNING" enabled="false" /> + <inspection_tool class="UNUSED_IMPORT" level="WARNING" enabled="false" /> <inspection_tool class="DuplicateCaseLabelJS" level="WARNING" enabled="false" /> + <inspection_tool class="PersistenceModelWarningInspection" level="WARNING" enabled="false" /> <inspection_tool class="PointlessBitwiseExpressionJS" level="WARNING" enabled="false"> <option name="m_ignoreExpressionsContainingConstants" value="false" /> </inspection_tool> @@ -335,9 +368,17 @@ <inspection_tool class="BooleanConstructor" level="WARNING" enabled="false" /> <inspection_tool class="ExtendsObject" level="WARNING" enabled="false" /> <inspection_tool class="RedundantArrayCreation" level="WARNING" enabled="false" /> + <inspection_tool class="PersistenceQlInspection" level="ERROR" enabled="false" /> <inspection_tool class="UnnecessaryLabelOnContinueStatementJS" level="WARNING" enabled="false" /> <inspection_tool class="CheckImageSize" level="WARNING" enabled="false" /> - <inspection_tool class="EmptyMethod" level="WARNING" enabled="false" /> + <inspection_tool class="EmptyMethod" level="WARNING" enabled="false"> + <option name="EXCLUDE_ANNOS"> + <value> + <list size="0" /> + </value> + </option> + </inspection_tool> + <inspection_tool class="PersistenceDomInspection" level="ERROR" enabled="false" /> <inspection_tool class="EmptyTryBlock" level="WARNING" enabled="false" /> <inspection_tool class="MalformedFormatString" level="WARNING" enabled="false" /> <inspection_tool class="ComponentRegistrationProblems" level="ERROR" enabled="false"> @@ -377,21 +418,16 @@ <inspection_tool class="JBoss" level="ERROR" enabled="false" /> <inspection_tool class="UnusedDeclaration" level="WARNING" enabled="false"> <option name="ADD_MAINS_TO_ENTRIES" value="true" /> + <option name="ADD_JUNIT_TO_ENTRIES" value="true" /> + <option name="ADD_EJB_TO_ENTRIES" value="true" /> <option name="ADD_APPLET_TO_ENTRIES" value="true" /> <option name="ADD_SERVLET_TO_ENTRIES" value="true" /> <option name="ADD_NONJAVA_TO_ENTRIES" value="true" /> - <option name="ADDITIONAL_ANNOTATIONS"> - <value> - <list size="0" /> - </value> - </option> - <option name="ADD_EJB_TO_ENTRIES" value="true" /> - <option name="ADD_JUNIT_TO_ENTRIES" value="true" /> - <option name="ADD_TESTNG_TO_ENTRIES" value="true" /> </inspection_tool> <inspection_tool class="Deprecation" level="WARNING" enabled="false" /> <inspection_tool class="StrutsInspection" level="ERROR" enabled="false" /> - <inspection_tool class="JavaDoc" level="WARNING" enabled="false"> + <inspection_tool class="MissingDeprecatedAnnotation" level="WARNING" enabled="true" /> + <inspection_tool class="JavaDoc" level="WARNING" enabled="true"> <option name="TOP_LEVEL_CLASS_OPTIONS"> <value> <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="public" /> @@ -420,40 +456,55 @@ <option name="IGNORE_JAVADOC_PERIOD" value="false" /> <option name="myAdditionalJavadocTags" value="todo,note,todo,xxx,note,todo,fixme,fixme,warning,invariant,retval,pre" /> </inspection_tool> - <inspection_tool class="JavadocReference" level="ERROR" enabled="false" /> - <inspection_tool class="OnDemandImport" level="WARNING" enabled="true" /> - <inspection_tool class="SamePackageImport" level="WARNING" enabled="true" /> - <inspection_tool class="JavaLangImport" level="WARNING" enabled="true" /> - <inspection_tool class="RedundantImport" level="WARNING" enabled="true" /> - <inspection_tool class="UnusedImport" level="WARNING" enabled="true" /> - <inspection_tool class="UNUSED_IMPORT" level="WARNING" enabled="false" /> </profile> <profile version="1.0" is_locked="true"> <option name="myName" value="No errors allowed here" /> <option name="myLocal" value="false" /> + <used_levels> + <error> + <option name="myName" value="ERROR" /> + <option name="myVal" value="400" /> + </error> + <warning> + <option name="myName" value="WARNING" /> + <option name="myVal" value="300" /> + </warning> + <information> + <option name="myName" value="INFO" /> + <option name="myVal" value="200" /> + </information> + <server> + <option name="myName" value="SERVER PROBLEM" /> + <option name="myVal" value="100" /> + </server> + </used_levels> <inspection_tool class="CheckEmptyScriptTag" level="WARNING" enabled="false" /> <inspection_tool class="FunctionWithInconsistentReturnsJS" level="WARNING" enabled="false" /> - <inspection_tool class="InfiniteLoopStatement" level="WARNING" enabled="true" /> + <inspection_tool class="InfiniteLoopStatement" level="WARNING" enabled="false" /> <inspection_tool class="UnusedMessageFormatParameter" level="WARNING" enabled="true" /> <inspection_tool class="ConstantIfStatementJS" level="WARNING" enabled="false" /> <inspection_tool class="FacesModelInspection" level="ERROR" enabled="false" /> <inspection_tool class="UnhandledExceptionInJSP" level="WARNING" enabled="false" /> <inspection_tool class="SillyAssignmentJS" level="WARNING" enabled="false" /> - <inspection_tool class="UnnecessaryLabelOnBreakStatement" level="WARNING" enabled="true" /> + <inspection_tool class="UnnecessaryLabelOnBreakStatement" level="ERROR" enabled="true" /> <inspection_tool class="ShiftOutOfRangeJS" level="WARNING" enabled="false" /> <inspection_tool class="JSUnresolvedVariable" level="INFO" enabled="false" /> <inspection_tool class="DuplicateThrows" level="WARNING" enabled="false" /> <inspection_tool class="ELValidationInJSP" level="WARNING" enabled="false" /> <inspection_tool class="ConstantConditionalExpressionJS" level="WARNING" enabled="false" /> - <inspection_tool class="PointlessBooleanExpression" level="WARNING" enabled="true"> + <inspection_tool class="PointlessBooleanExpression" level="ERROR" enabled="true"> <option name="m_ignoreExpressionsContainingConstants" value="false" /> </inspection_tool> <inspection_tool class="GwtInconsistentI18nInterface" level="ERROR" enabled="false" /> - <inspection_tool class="StringToString" level="WARNING" enabled="true" /> + <inspection_tool class="StringToString" level="ERROR" enabled="true" /> + <inspection_tool class="AnalyzingStaticVariables" level="ERROR" enabled="true"> + <option name="CHECKED_TYPES" value="javax.servlet.http.HttpSession;com.ulcjava.base.application.ULCProxy" /> + </inspection_tool> <inspection_tool class="BoundFieldAssignment" level="WARNING" enabled="false" /> - <inspection_tool class="NullArgumentToVariableArgMethod" level="WARNING" enabled="true" /> + <inspection_tool class="NullArgumentToVariableArgMethod" level="ERROR" enabled="true" /> <inspection_tool class="JSUndeclaredVariable" level="INFO" enabled="false" /> - <inspection_tool class="LoopStatementsThatDontLoop" level="WARNING" enabled="true" /> + <inspection_tool class="PersistenceModelErrorInspection" level="ERROR" enabled="false" /> + <inspection_tool class="LoopStatementsThatDontLoop" level="ERROR" enabled="true" /> <inspection_tool class="RedundantThrows" level="WARNING" enabled="false" /> <inspection_tool class="StrutsValidatorFormInspection" level="ERROR" enabled="false" /> <inspection_tool class="UnnecessaryLabelOnBreakStatementJS" level="WARNING" enabled="false" /> @@ -469,10 +520,10 @@ <inspection_tool class="Glassfish" level="ERROR" enabled="false" /> <inspection_tool class="ConstantConditions" level="WARNING" enabled="true"> <option name="SUGGEST_NULLABLE_ANNOTATIONS" value="true" /> - <option name="DONT_REPORT_TRUE_ASSERT_STATEMENTS" value="false" /> </inspection_tool> <inspection_tool class="GwtServiceNotRegistered" level="ERROR" enabled="false" /> <inspection_tool class="EjbErrorInspection" level="ERROR" enabled="false" /> + <inspection_tool class="PersistenceDataSourceORMInspection" level="ERROR" enabled="false" /> <inspection_tool class="CanBeFinal" level="WARNING" enabled="true"> <option name="REPORT_CLASSES" value="false" /> <option name="REPORT_METHODS" value="false" /> @@ -480,17 +531,25 @@ </inspection_tool> <inspection_tool class="NoScrollPane" level="WARNING" enabled="true" /> <inspection_tool class="JSUnresolvedFunction" level="INFO" enabled="false" /> - <inspection_tool class="InstantiatingObjectToGetClassObject" level="WARNING" enabled="true" /> + <inspection_tool class="InstantiatingObjectToGetClassObject" level="ERROR" enabled="true" /> <inspection_tool class="ReturnFromFinallyBlockJS" level="WARNING" enabled="false" /> <inspection_tool class="UnusedAssignment" level="WARNING" enabled="true"> <option name="REPORT_PREFIX_EXPRESSIONS" value="true" /> <option name="REPORT_POSTFIX_EXPRESSIONS" value="true" /> <option name="REPORT_REDUNDANT_INITIALIZER" value="true" /> </inspection_tool> + <inspection_tool class="AnalyzingVariableNaming" level="WARNING" enabled="false"> + <option name="IGNORE_SERIAL_VERSION_UID" value="true" /> + <option name="CHECK_STATIC_FINAL_FIELDS" value="true" /> + <option name="CHECK_STATIC_FIELDS" value="true" /> + <option name="CHECK_FIELDS" value="true" /> + <option name="CHECK_PARAMETERS" value="true" /> + </inspection_tool> <inspection_tool class="WebProperties" level="ERROR" enabled="false" /> <inspection_tool class="PointlessArithmeticExpressionJS" level="WARNING" enabled="false" /> - <inspection_tool class="UnnecessaryConditionalExpression" level="WARNING" enabled="true" /> - <inspection_tool class="StringConcatenationInsideStringBufferAppend" level="WARNING" enabled="true" /> + <inspection_tool class="UnnecessaryConditionalExpression" level="ERROR" enabled="true" /> + <inspection_tool class="StringConcatenationInsideStringBufferAppend" level="ERROR" enabled="true" /> + <inspection_tool class="AnalyzingJLSModifierOrder" level="ERROR" enabled="true" /> <inspection_tool class="AntDuplicateImportedTargetsInspection" level="WARNING" enabled="true" /> <inspection_tool class="UNUSED_SYMBOL" level="WARNING" enabled="false"> <option name="LOCAL_VARIABLE" value="true" /> @@ -498,7 +557,6 @@ <option name="METHOD" value="true" /> <option name="CLASS" value="true" /> <option name="PARAMETER" value="true" /> - <option name="REPORT_PARAMETER_FOR_PUBLIC_METHODS" value="true" /> <option name="INJECTION_ANNOS"> <value> <list size="0" /> @@ -521,19 +579,20 @@ <inspection_tool class="PointlessArithmeticExpression" level="WARNING" enabled="false"> <option name="m_ignoreExpressionsContainingConstants" value="false" /> </inspection_tool> - <inspection_tool class="UnnecessaryTemporaryOnConversionToString" level="WARNING" enabled="true" /> - <inspection_tool class="UnnecessaryContinue" level="WARNING" enabled="true" /> + <inspection_tool class="UnnecessaryTemporaryOnConversionToString" level="ERROR" enabled="true" /> + <inspection_tool class="UnnecessaryContinue" level="ERROR" enabled="true" /> <inspection_tool class="SameReturnValue" level="WARNING" enabled="false" /> - <inspection_tool class="UnusedLabel" level="WARNING" enabled="true" /> + <inspection_tool class="UnusedLabel" level="ERROR" enabled="true" /> <inspection_tool class="NoButtonGroup" level="WARNING" enabled="true" /> <inspection_tool class="GWTStyleCheck" level="ERROR" enabled="false" /> <inspection_tool class="NonSerializableServiceParameters" level="ERROR" enabled="false" /> <inspection_tool class="CloneCallsSuperClone" level="INFO" enabled="true" /> - <inspection_tool class="ReturnFromFinallyBlock" level="WARNING" enabled="true" /> + <inspection_tool class="ReturnFromFinallyBlock" level="ERROR" enabled="true" /> <inspection_tool class="UnreachableCodeJS" level="WARNING" enabled="false" /> <inspection_tool class="CheckValidXmlInScriptTagBody" level="ERROR" enabled="false" /> - <inspection_tool class="ManualArrayCopy" level="WARNING" enabled="true" /> + <inspection_tool class="ManualArrayCopy" level="ERROR" enabled="true" /> <inspection_tool class="Weblogic" level="ERROR" enabled="false" /> + <inspection_tool class="PersistenceDataSourceORMDomInspection" level="ERROR" enabled="false" /> <inspection_tool class="FallthroughInSwitchStatementJS" level="WARNING" enabled="false" /> <inspection_tool class="IgnoreResultOfCall" level="WARNING" enabled="true"> <option name="m_reportAllNonLibraryCalls" value="true" /> @@ -541,38 +600,45 @@ </inspection_tool> <inspection_tool class="ThrowFromFinallyBlock" level="WARNING" enabled="false" /> <inspection_tool class="RedundantCast" level="WARNING" enabled="true" /> - <inspection_tool class="UnnecessaryReturn" level="WARNING" enabled="true" /> - <inspection_tool class="FinalStaticMethod" level="WARNING" enabled="true" /> - <inspection_tool class="SuspiciousMethodCalls" level="WARNING" enabled="true"> - <option name="REPORT_CONVERTIBLE_METHOD_CALLS" value="true" /> + <inspection_tool class="UnnecessaryReturn" level="ERROR" enabled="true" /> + <inspection_tool class="FinalStaticMethod" level="ERROR" enabled="true" /> + <inspection_tool class="SuspiciousMethodCalls" level="ERROR" enabled="true" /> + <inspection_tool class="HTML" level="WARNING" enabled="false"> + <option name="myAdditionalHtmlTags" value="embed,nobr,noembed,comment,script" /> + <option name="myAdditionalHtmlAttributes" value="type,wmode,src,width,height" /> + <option name="myCheckHtmlTags" value="true" /> + <option name="myCheckHtmlAttributes" value="true" /> </inspection_tool> <inspection_tool class="SameParameterValue" level="WARNING" enabled="false" /> + <inspection_tool class="AnalyzingRedundantFieldInitialization" level="WARNING" enabled="false" /> <inspection_tool class="ReservedWordUsedAsNameJS" level="WARNING" enabled="false" /> <inspection_tool class="UnnecessaryReturnJS" level="WARNING" enabled="false" /> - <inspection_tool class="ConstantIfStatement" level="WARNING" enabled="true" /> + <inspection_tool class="ConstantIfStatement" level="ERROR" enabled="true" /> <inspection_tool class="ComponentNotRegistered" level="WARNING" enabled="false"> <option name="CHECK_ACTIONS" value="true" /> <option name="IGNORE_NON_PUBLIC" value="true" /> </inspection_tool> - <inspection_tool class="UnnecessaryLabelOnContinueStatement" level="WARNING" enabled="true" /> + <inspection_tool class="UnnecessaryLabelOnContinueStatement" level="ERROR" enabled="true" /> <inspection_tool class="NoLabelFor" level="WARNING" enabled="true" /> <inspection_tool class="SynchronizeOnNonFinalField" level="WARNING" enabled="false" /> + <inspection_tool class="AnalyzingLoggingWithoutLogLevelCheck" level="WARNING" enabled="false"> + <option name="CHECK_DEBUG" value="true" /> + <option name="CHECK_INFO" value="true" /> + <option name="IGNORE_SIMPLE_STATEMENTS" value="true" /> + </inspection_tool> <inspection_tool class="AntDuplicateTargetsInspection" level="ERROR" enabled="true" /> - <inspection_tool class="NullableProblems" level="WARNING" enabled="true"> + <inspection_tool class="NullableProblems" level="ERROR" enabled="true"> <option name="REPORT_NULLABLE_METHOD_OVERRIDES_NOTNULL" value="true" /> <option name="REPORT_NOT_ANNOTATED_METHOD_OVERRIDES_NOTNULL" value="true" /> <option name="REPORT_NOTNULL_PARAMETER_OVERRIDES_NULLABLE" value="true" /> <option name="REPORT_NOT_ANNOTATED_PARAMETER_OVERRIDES_NOTNULL" value="true" /> - <option name="REPORT_NOT_ANNOTATED_GETTER" value="true" /> - <option name="REPORT_NOT_ANNOTATED_SETTER_PARAMETER" value="true" /> - <option name="REPORT_ANNOTATION_NOT_PROPAGATED_TO_OVERRIDERS" value="true" /> </inspection_tool> <inspection_tool class="ReferencesToClassesFromDefaultPackagesInJSPFile" level="ERROR" enabled="false" /> - <inspection_tool class="TrivialIf" level="WARNING" enabled="true" /> - <inspection_tool class="AntMissingPropertiesFileInspection" level="WARNING" enabled="true" /> - <inspection_tool class="ObjectEqualsNull" level="WARNING" enabled="true" /> + <inspection_tool class="TrivialIf" level="ERROR" enabled="true" /> + <inspection_tool class="AntMissingPropertiesFileInspection" level="ERROR" enabled="true" /> + <inspection_tool class="ObjectEqualsNull" level="ERROR" enabled="true" /> <inspection_tool class="GwtToHtmlReferences" level="ERROR" enabled="false" /> - <inspection_tool class="EmptyFinallyBlock" level="WARNING" enabled="true" /> + <inspection_tool class="EmptyFinallyBlock" level="ERROR" enabled="true" /> <inspection_tool class="MismatchedCollectionQueryUpdate" level="WARNING" enabled="true" /> <inspection_tool class="EmptyStatementBody" level="WARNING" enabled="true"> <option name="m_reportEmptyBlocks" value="false" /> @@ -584,11 +650,16 @@ <inspection_tool class="TrivialConditionalJS" level="WARNING" enabled="false" /> <inspection_tool class="OneButtonGroup" level="WARNING" enabled="true" /> <inspection_tool class="StrutsTilesInspection" level="ERROR" enabled="false" /> - <inspection_tool class="ReflectionForUnavailableAnnotation" level="WARNING" enabled="true" /> + <inspection_tool class="ReflectionForUnavailableAnnotation" level="ERROR" enabled="true" /> <inspection_tool class="IncompatibleMaskJS" level="WARNING" enabled="false" /> <inspection_tool class="NonJREEmulationClassesInClientCode" level="ERROR" enabled="false" /> <inspection_tool class="OctalLiteral" level="WARNING" enabled="false" /> - <inspection_tool class="InfiniteRecursion" level="WARNING" enabled="true" /> + <inspection_tool class="AnalyzingRedundantModifier" level="ERROR" enabled="true"> + <option name="CHECK_FINAL_METHODS" value="true" /> + <option name="CHECK_PUBLIC_INTERFACE_METHODS" value="true" /> + <option name="CHECK_TRANSIENT_STATIC_FIELDS" value="true" /> + </inspection_tool> + <inspection_tool class="InfiniteRecursion" level="ERROR" enabled="true" /> <inspection_tool class="Geronimo" level="ERROR" enabled="false" /> <inspection_tool class="InfiniteLoopJS" level="WARNING" enabled="false" /> <inspection_tool class="SelfIncludingJspFiles" level="ERROR" enabled="false" /> @@ -598,42 +669,51 @@ <inspection_tool class="EmptyCatchBlock" level="WARNING" enabled="false"> <option name="m_includeComments" value="true" /> <option name="m_ignoreTestCases" value="true" /> - <option name="m_ignoreIgnoreParameter" value="true" /> </inspection_tool> <inspection_tool class="UnnecessaryLocalVariable" level="WARNING" enabled="false"> <option name="m_ignoreImmediatelyReturnedVariables" value="false" /> <option name="m_ignoreAnnotatedVariables" value="false" /> </inspection_tool> - <inspection_tool class="UnnecessaryTemporaryOnConversionFromString" level="WARNING" enabled="true" /> + <inspection_tool class="UnnecessaryTemporaryOnConversionFromString" level="ERROR" enabled="true" /> <inspection_tool class="EmptyStatementBodyJS" level="WARNING" enabled="false"> <option name="m_reportEmptyBlocks" value="false" /> </inspection_tool> <inspection_tool class="ThrowFromFinallyBlockJS" level="WARNING" enabled="false" /> - <inspection_tool class="TypeParameterExtendsObject" level="WARNING" enabled="true" /> - <inspection_tool class="FieldCanBeLocal" level="WARNING" enabled="true" /> + <inspection_tool class="PersistenceORMDomInspection" level="ERROR" enabled="false" /> + <inspection_tool class="TypeParameterExtendsObject" level="ERROR" enabled="true" /> + <inspection_tool class="FieldCanBeLocal" level="ERROR" enabled="true" /> <inspection_tool class="UNCHECKED_WARNING" level="WARNING" enabled="false" /> <inspection_tool class="LoopStatementThatDoesntLoopJS" level="WARNING" enabled="false" /> - <inspection_tool class="SuspiciousNameCombination" level="WARNING" enabled="true"> + <inspection_tool class="SuspiciousNameCombination" level="ERROR" enabled="true"> <group names="x,width,left,right" /> <group names="y,height,top,bottom" /> </inspection_tool> - <inspection_tool class="MalformedRegex" level="WARNING" enabled="true" /> + <inspection_tool class="MalformedRegex" level="ERROR" enabled="true" /> <inspection_tool class="TrivialIfJS" level="WARNING" enabled="false" /> - <inspection_tool class="SimplifiableConditionalExpression" level="WARNING" enabled="true" /> - <inspection_tool class="UNUSED_IMPORT" level="WARNING" enabled="true" /> + <inspection_tool class="SimplifiableConditionalExpression" level="ERROR" enabled="true" /> + <inspection_tool class="UNUSED_IMPORT" level="ERROR" enabled="true" /> <inspection_tool class="DuplicateCaseLabelJS" level="WARNING" enabled="false" /> + <inspection_tool class="PersistenceModelWarningInspection" level="WARNING" enabled="false" /> <inspection_tool class="PointlessBitwiseExpressionJS" level="WARNING" enabled="false"> <option name="m_ignoreExpressionsContainingConstants" value="false" /> </inspection_tool> <inspection_tool class="SimplifiableIfStatement" level="WARNING" enabled="false" /> - <inspection_tool class="BooleanConstructor" level="WARNING" enabled="true" /> - <inspection_tool class="ExtendsObject" level="WARNING" enabled="true" /> + <inspection_tool class="BooleanConstructor" level="ERROR" enabled="true" /> + <inspection_tool class="ExtendsObject" level="ERROR" enabled="true" /> <inspection_tool class="RedundantArrayCreation" level="WARNING" enabled="true" /> + <inspection_tool class="PersistenceQlInspection" level="ERROR" enabled="false" /> <inspection_tool class="UnnecessaryLabelOnContinueStatementJS" level="WARNING" enabled="false" /> <inspection_tool class="CheckImageSize" level="WARNING" enabled="false" /> - <inspection_tool class="EmptyMethod" level="WARNING" enabled="false" /> + <inspection_tool class="EmptyMethod" level="WARNING" enabled="false"> + <option name="EXCLUDE_ANNOS"> + <value> + <list size="0" /> + </value> + </option> + </inspection_tool> + <inspection_tool class="PersistenceDomInspection" level="ERROR" enabled="false" /> <inspection_tool class="EmptyTryBlock" level="WARNING" enabled="false" /> - <inspection_tool class="MalformedFormatString" level="WARNING" enabled="true" /> + <inspection_tool class="MalformedFormatString" level="ERROR" enabled="true" /> <inspection_tool class="ComponentRegistrationProblems" level="ERROR" enabled="false"> <option name="CHECK_PLUGIN_XML" value="true" /> <option name="CHECK_JAVA_CODE" value="true" /> @@ -642,14 +722,14 @@ <inspection_tool class="PointlessBooleanExpressionJS" level="WARNING" enabled="false" /> <inspection_tool class="CssUnitlessNumber" level="WARNING" enabled="false" /> <inspection_tool class="ExceptionCaughtLocallyJS" level="WARNING" enabled="false" /> - <inspection_tool class="ConstantConditionalExpression" level="WARNING" enabled="true" /> + <inspection_tool class="ConstantConditionalExpression" level="ERROR" enabled="true" /> <inspection_tool class="MissingMnemonic" level="WARNING" enabled="true" /> <inspection_tool class="CloneDeclaresCloneNotSupported" level="INFO" enabled="true" /> - <inspection_tool class="MalformedXPath" level="WARNING" enabled="true" /> + <inspection_tool class="MalformedXPath" level="ERROR" enabled="true" /> <inspection_tool class="AccessStaticViaInstance" level="WARNING" enabled="true" /> <inspection_tool class="UnusedParameters" level="WARNING" enabled="false" /> <inspection_tool class="DuplicateMnemonic" level="WARNING" enabled="true" /> - <inspection_tool class="StringConstructor" level="WARNING" enabled="true"> + <inspection_tool class="StringConstructor" level="ERROR" enabled="true"> <option name="ignoreSubstringArguments" value="false" /> </inspection_tool> <inspection_tool class="GWTRemoteServiceAsyncCheck" level="ERROR" enabled="false" /> @@ -657,32 +737,26 @@ <inspection_tool class="MismatchedArrayReadWrite" level="WARNING" enabled="true" /> <inspection_tool class="UnusedReturnValue" level="WARNING" enabled="false" /> <inspection_tool class="UnnecessaryContinueJS" level="WARNING" enabled="false" /> - <inspection_tool class="FinallyBlockCannotCompleteNormally" level="WARNING" enabled="true" /> + <inspection_tool class="FinallyBlockCannotCompleteNormally" level="ERROR" enabled="true" /> <inspection_tool class="BadExpressionStatementJS" level="WARNING" enabled="false" /> - <inspection_tool class="PrimitiveArrayArgumentToVariableArgMethod" level="WARNING" enabled="true" /> + <inspection_tool class="PrimitiveArrayArgumentToVariableArgMethod" level="ERROR" enabled="true" /> <inspection_tool class="InfiniteRecursionJS" level="WARNING" enabled="false" /> <inspection_tool class="StrutsValidatorInspection" level="ERROR" enabled="false" /> - <inspection_tool class="ContinueOrBreakFromFinallyBlock" level="WARNING" enabled="true" /> + <inspection_tool class="ContinueOrBreakFromFinallyBlock" level="ERROR" enabled="true" /> <inspection_tool class="DuplicatePropertyOnObjectJS" level="WARNING" enabled="false" /> <inspection_tool class="JBoss" level="ERROR" enabled="false" /> <inspection_tool class="UnusedDeclaration" level="WARNING" enabled="false"> <option name="ADD_MAINS_TO_ENTRIES" value="true" /> + <option name="ADD_JUNIT_TO_ENTRIES" value="true" /> + <option name="ADD_EJB_TO_ENTRIES" value="true" /> <option name="ADD_APPLET_TO_ENTRIES" value="true" /> <option name="ADD_SERVLET_TO_ENTRIES" value="true" /> <option name="ADD_NONJAVA_TO_ENTRIES" value="true" /> - <option name="ADDITIONAL_ANNOTATIONS"> - <value> - <list size="0" /> - </value> - </option> - <option name="ADD_EJB_TO_ENTRIES" value="true" /> - <option name="ADD_JUNIT_TO_ENTRIES" value="true" /> - <option name="ADD_TESTNG_TO_ENTRIES" value="true" /> </inspection_tool> <inspection_tool class="Deprecation" level="WARNING" enabled="false" /> <inspection_tool class="StrutsInspection" level="ERROR" enabled="false" /> - <inspection_tool class="MissingDeprecatedAnnotation" level="WARNING" enabled="true" /> - <inspection_tool class="JavaDoc" level="WARNING" enabled="true"> + <inspection_tool class="MissingDeprecatedAnnotation" level="ERROR" enabled="true" /> + <inspection_tool class="JavaDoc" level="ERROR" enabled="true"> <option name="TOP_LEVEL_CLASS_OPTIONS"> <value> <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" /> @@ -711,178 +785,174 @@ <option name="IGNORE_JAVADOC_PERIOD" value="false" /> <option name="myAdditionalJavadocTags" value="todo,note,todo,xxx,note,todo,fixme,fixme,warning,invariant,retval,pre" /> </inspection_tool> - <inspection_tool class="MissingOverrideAnnotation" level="WARNING" enabled="true"> - <option name="useJdk6Rules" value="false" /> - </inspection_tool> - <inspection_to... [truncated message content] |
From: <aki...@us...> - 2008-05-22 09:02:08
|
Revision: 4047 http://gridarta.svn.sourceforge.net/gridarta/?rev=4047&view=rev Author: akirschbaum Date: 2008-05-22 02:02:14 -0700 (Thu, 22 May 2008) Log Message: ----------- Move code to StringUtils. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/utils/ trunk/src/app/net/sf/gridarta/utils/utils/ trunk/src/app/net/sf/gridarta/utils/utils/StringUtils.java Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2008-05-22 08:48:59 UTC (rev 4046) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2008-05-22 09:02:14 UTC (rev 4047) @@ -25,6 +25,7 @@ import java.io.Serializable; import javax.swing.JList; import net.sf.gridarta.gui.GameObjectAttributesPanel; +import net.sf.gridarta.utils.utils.StringUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -96,7 +97,7 @@ } public void setLoreText(@NotNull final String loreText) { - final String trimmedLoreText = patternTrailingWhitespace.matcher(loreText).replaceAll(""); + final String trimmedLoreText = StringUtils.removeTrailingWhitespace(loreText); if (this.loreText.equals(trimmedLoreText)) { return; } Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-05-22 08:48:59 UTC (rev 4046) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-05-22 09:02:14 UTC (rev 4047) @@ -30,6 +30,7 @@ import net.sf.gridarta.gui.GameObjectAttributesPanel; import net.sf.gridarta.map.MapArchObject; import net.sf.gridarta.map.MapSquare; +import net.sf.gridarta.utils.utils.StringUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -143,11 +144,6 @@ private static final Pattern patternEndOfLine = Pattern.compile("\\s*\n"); /** - * Pattern to match trailing whitespace. - */ - protected static final Pattern patternTrailingWhitespace = Pattern.compile("(?m)[\\x00-\\x09\\x0b\\x20]+$"); - - /** * The name of the face. * Object face name <code>face <var>name</var></code>. */ @@ -843,7 +839,7 @@ } if (text != null) { - final String trimmedText = patternTrailingWhitespace.matcher(text).replaceAll(""); + final String trimmedText = StringUtils.removeTrailingWhitespace(text); if (trimmedText.length() > 0) { myMsgText.append(trimmedText); isChanged = true; Added: trunk/src/app/net/sf/gridarta/utils/utils/StringUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/utils/utils/StringUtils.java (rev 0) +++ trunk/src/app/net/sf/gridarta/utils/utils/StringUtils.java 2008-05-22 09:02:14 UTC (rev 4047) @@ -0,0 +1,50 @@ +/* + * 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.utils.utils; + +import java.util.regex.Pattern; + +/** + * Utility class for string manipulation. + * @author Andreas Kirschbaum + */ +public class StringUtils { + + /** + * Pattern to match trailing whitespace. + */ + private static final Pattern patternTrailingWhitespace = Pattern.compile("(?m)[\\x00-\\x09\\x0b\\x20]+$"); + + /** + * Private constructor to prevent instantiation. + */ + private StringUtils() { + } + + /** + * Removes trailing whitespace from a string. + * @param str the string + * @return the trimmed string + */ + public static String removeTrailingWhitespace(final String str) { + return patternTrailingWhitespace.matcher(str).replaceAll(""); + } + +} // class StringUtils Property changes on: trunk/src/app/net/sf/gridarta/utils/utils/StringUtils.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-05-22 10:07:45
|
Revision: 4048 http://gridarta.svn.sourceforge.net/gridarta/?rev=4048&view=rev Author: akirschbaum Date: 2008-05-22 03:07:51 -0700 (Thu, 22 May 2008) Log Message: ----------- Fix package name. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/utils/StringUtils.java Removed Paths: ------------- trunk/src/app/net/sf/gridarta/utils/utils/ Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2008-05-22 09:02:14 UTC (rev 4047) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2008-05-22 10:07:51 UTC (rev 4048) @@ -25,7 +25,7 @@ import java.io.Serializable; import javax.swing.JList; import net.sf.gridarta.gui.GameObjectAttributesPanel; -import net.sf.gridarta.utils.utils.StringUtils; +import net.sf.gridarta.utils.StringUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-05-22 09:02:14 UTC (rev 4047) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-05-22 10:07:51 UTC (rev 4048) @@ -30,7 +30,7 @@ import net.sf.gridarta.gui.GameObjectAttributesPanel; import net.sf.gridarta.map.MapArchObject; import net.sf.gridarta.map.MapSquare; -import net.sf.gridarta.utils.utils.StringUtils; +import net.sf.gridarta.utils.StringUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Copied: trunk/src/app/net/sf/gridarta/utils/StringUtils.java (from rev 4047, trunk/src/app/net/sf/gridarta/utils/utils/StringUtils.java) =================================================================== --- trunk/src/app/net/sf/gridarta/utils/StringUtils.java (rev 0) +++ trunk/src/app/net/sf/gridarta/utils/StringUtils.java 2008-05-22 10:07:51 UTC (rev 4048) @@ -0,0 +1,50 @@ +/* + * 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.utils; + +import java.util.regex.Pattern; + +/** + * Utility class for string manipulation. + * @author Andreas Kirschbaum + */ +public class StringUtils { + + /** + * Pattern to match trailing whitespace. + */ + private static final Pattern patternTrailingWhitespace = Pattern.compile("(?m)[\\x00-\\x09\\x0b\\x20]+$"); + + /** + * Private constructor to prevent instantiation. + */ + private StringUtils() { + } + + /** + * Removes trailing whitespace from a string. + * @param str the string + * @return the trimmed string + */ + public static String removeTrailingWhitespace(final String str) { + return patternTrailingWhitespace.matcher(str).replaceAll(""); + } + +} // class StringUtils Property changes on: trunk/src/app/net/sf/gridarta/utils/StringUtils.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-05-22 11:02:24
|
Revision: 4050 http://gridarta.svn.sourceforge.net/gridarta/?rev=4050&view=rev Author: akirschbaum Date: 2008-05-22 04:00:57 -0700 (Thu, 22 May 2008) Log Message: ----------- Make sure all lines in GameObject.objectText have a trailing newline character. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/io/GameObjectParser.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2008-05-22 10:39:14 UTC (rev 4049) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2008-05-22 11:00:57 UTC (rev 4050) @@ -354,9 +354,6 @@ } out.append(arch.getObjectText()); - if (arch.getObjectText().lastIndexOf('\n') != arch.getObjectText().length() - 1) { - out.append('\n'); - } out.append("end\n"); } else { @@ -381,9 +378,6 @@ } out.append(arch.getObjectText()); - if (arch.getObjectText().lastIndexOf('\n') != arch.getObjectText().length() - 1) { - out.append('\n'); - } out.append("end\n"); @@ -404,9 +398,6 @@ } out.append(tail.getObjectText()); - if (tail.getObjectText().lastIndexOf('\n') != tail.getObjectText().length() - 1) { - out.append('\n'); - } // position of multi relative to head if (tail.getMultiX() != 0) { Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2008-05-22 10:39:14 UTC (rev 4049) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2008-05-22 11:00:57 UTC (rev 4050) @@ -509,9 +509,6 @@ } out.append(arch.getObjectText()); - if (arch.getObjectText().lastIndexOf('\n') != arch.getObjectText().length() - 1) { - out.append('\n'); - } out.append("end\n"); } else { @@ -548,9 +545,6 @@ out.append("editor_folder ").append(arch.getEditorFolder()).append('\n'); out.append(arch.getObjectText()); - if (arch.getObjectText().lastIndexOf('\n') != arch.getObjectText().length() - 1) { - out.append('\n'); - } out.append("end\n"); @@ -593,9 +587,6 @@ } out.append(tail.getObjectText()); - if (tail.getObjectText().lastIndexOf('\n') != tail.getObjectText().length() - 1) { - out.append('\n'); - } // position of multi relative to head if (tail.getMultiX() != 0) { Modified: trunk/daimonin/src/daieditor/io/GameObjectParser.java =================================================================== --- trunk/daimonin/src/daieditor/io/GameObjectParser.java 2008-05-22 10:39:14 UTC (rev 4049) +++ trunk/daimonin/src/daieditor/io/GameObjectParser.java 2008-05-22 11:00:57 UTC (rev 4050) @@ -92,7 +92,7 @@ final String objText = gameObject.getObjectText(); if (objText.length() > 0) { - format.format("%s%s", objText, objText.endsWith("\n") ? "" : "\n"); + format.format("%s", objText); } // map coordinates only belong into map arches (not inventory arches) Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-05-22 10:39:14 UTC (rev 4049) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-05-22 11:00:57 UTC (rev 4050) @@ -1112,7 +1112,7 @@ return; } - objectText.delete(0, objectText.length()); + objectText.setLength(0); clearAttributeCache(); gameObjectChanged(); } @@ -1128,6 +1128,9 @@ resetObjectText(); this.objectText.append(objectText); + if (!objectText.endsWith("\n")) { + this.objectText.append('\n'); + } clearAttributeCache(); gameObjectChanged(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-05-22 13:31:35
|
Revision: 4051 http://gridarta.svn.sourceforge.net/gridarta/?rev=4051&view=rev Author: akirschbaum Date: 2008-05-22 06:31:40 -0700 (Thu, 22 May 2008) Log Message: ----------- Move ArchetypeParser.postParseGameObject() to GameObject.postParseGameObject(). Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gui/GameObjectAttributesPanel.java trunk/src/app/net/sf/gridarta/io/AbstractGameObjectParser.java trunk/src/app/net/sf/gridarta/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2008-05-22 11:00:57 UTC (rev 4050) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2008-05-22 13:31:40 UTC (rev 4051) @@ -325,51 +325,4 @@ } // while loop ends here } - /** {@inheritDoc} */ - public void postParseGameObject(final GameObject gameObject, final int editType) { - final String text = gameObject.getObjectText(); - final Archetype archetype = gameObject.getArchetype(); - - gameObject.resetObjectText(); - for (final String line : lineSeparatorPattern.split(text)) { - if (line.length() > 0) { - if (line.startsWith("name ")) { - gameObject.setObjName(line.substring(5)); - } else if (line.startsWith("animation ")) { - gameObject.setAnimName(line.substring(10)); - gameObject.addObjectText(line); - } else { - // this is an unparsed arch attribute, it has to stay in the archtext - gameObject.addObjectText(line); - } - } - } - - if (gameObject.getDirection() == -1) { // still the invalid direction! - gameObject.setDirection(archetype.getDirection()); - } - gameObject.setRealFace(gameObject.getFaceName()); - // if the type is still unset, then we take the default one - if (gameObject.getArchTypNr() == net.sf.gridarta.gameobject.GameObject.TYPE_UNSET) { - gameObject.setArchTypNr(archetype.getArchTypNr()); - } - - gameObject.setMultiX(archetype.getMultiX()); - gameObject.setMultiY(archetype.getMultiY()); - - // gameObject.setEditType(archetype.getEditType()); - - // validate the ScriptedEvents - gameObject.validateAllEvents(); - - // we don't handle anim yet, so attach then back to archtext - if (gameObject.getAnimText() != null) { - gameObject.addObjectText("anim"); - gameObject.addObjectText(gameObject.getAnimText()); - gameObject.addObjectText("mina"); - } - - gameObject.updateEditType(editType); - } - } // class ArchetypeParser Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2008-05-22 11:00:57 UTC (rev 4050) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2008-05-22 13:31:40 UTC (rev 4051) @@ -254,4 +254,51 @@ && gameObject.archType == archType; } + /** {@inheritDoc} */ + @Override public void postParseGameObject(final int editType) { + final String text = getObjectText(); + final Archetype archetype = getArchetype(); + + resetObjectText(); + for (final String line : lineSeparatorPattern.split(text)) { + if (line.length() > 0) { + if (line.startsWith("name ")) { + setObjName(line.substring(5)); + } else if (line.startsWith("animation ")) { + setAnimName(line.substring(10)); + addObjectText(line); + } else { + // this is an unparsed arch attribute, it has to stay in the archtext + addObjectText(line); + } + } + } + + if (getDirection() == -1) { // still the invalid direction! + setDirection(archetype.getDirection()); + } + setRealFace(getFaceName()); + // if the type is still unset, then we take the default one + if (getArchTypNr() == TYPE_UNSET) { + setArchTypNr(archetype.getArchTypNr()); + } + + setMultiX(archetype.getMultiX()); + setMultiY(archetype.getMultiY()); + + // gameObject.setEditType(archetype.getEditType()); + + // validate the ScriptedEvents + validateAllEvents(); + + // we don't handle anim yet, so attach then back to archtext + if (getAnimText() != null) { + addObjectText("anim"); + addObjectText(getAnimText()); + addObjectText("mina"); + } + + updateEditType(editType); + } + } // class GameObject Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2008-05-22 11:00:57 UTC (rev 4050) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2008-05-22 13:31:40 UTC (rev 4051) @@ -182,7 +182,7 @@ throw new UndefinedEventArchetypeNameException(eventArchetypeName); } final GameObject event = eventArchetype.createGameObject(); - CMainControl.getInstance().getArchetypeParser().postParseGameObject(event, 0); + event.postParseGameObject(0); return event; } Modified: trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java 2008-05-22 11:00:57 UTC (rev 4050) +++ trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java 2008-05-22 13:31:40 UTC (rev 4051) @@ -452,7 +452,7 @@ gameObject.removeAll(); if (index < mainControl.getGameObjectSpells().size()) { final GameObject spellObject = mainControl.getGameObjectSpells().getSpell(index).createGameObject(); - mainControl.getArchetypeParser().postParseGameObject(spellObject, 0); + spellObject.postParseGameObject(0); gameObject.addLast(spellObject); } Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2008-05-22 11:00:57 UTC (rev 4050) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2008-05-22 13:31:40 UTC (rev 4051) @@ -350,59 +350,6 @@ } } - /** {@inheritDoc} */ - public void postParseGameObject(final GameObject gameObject, final int editType) { - if (!gameObject.hasArchetype()) { - return; - } - - final String text = gameObject.getObjectText(); - final Archetype archetype = gameObject.getArchetype(); - - gameObject.resetObjectText(); - for (final String line : lineSeparatorPattern.split(text)) { - if (line.length() > 0) { - if (line.startsWith("name ")) { - gameObject.setObjName(line.substring(5)); - } else if (line.startsWith("animation ")) { - gameObject.setAnimName(line.substring(10)); - gameObject.addObjectText(line); - } else { - // this is an unparsed arch attribute, it has to stay in the archtext - gameObject.addObjectText(line); - } - } - } - - if (gameObject.getDirection() == -1) { // still the invalid direction! - gameObject.setDirection(archetype.getDirection()); - } - gameObject.setRealFace(gameObject.getFaceName()); - // if the type is still unset, then we take the default one - if (gameObject.getArchTypNr() == net.sf.gridarta.gameobject.GameObject.TYPE_UNSET) { - gameObject.setArchTypNr(archetype.getArchTypNr()); - } - - // if the type is still unset, then we take the default one - if (archetype.getMultiShapeID() > 0 && gameObject.getMultiShapeID() == 0) { - gameObject.setMultiShapeID(archetype.getMultiShapeID()); - } - if (archetype.getMultiPartNr() > 0 && gameObject.getMultiPartNr() == 0) { - gameObject.setMultiPartNr(archetype.getMultiPartNr()); - } - gameObject.setLowestPart(archetype.isLowestPart()); - - gameObject.setMultiX(archetype.getMultiX()); - gameObject.setMultiY(archetype.getMultiY()); - - // gameObject.setEditType(archetype.getEditType()); - - // validate the ScriptedEvents - gameObject.validateAllEvents(); - - gameObject.updateEditType(editType); - } - /** * Calculate the lowest part of this multi-arch. This lowest part is needed * because in ISO view, the big image is drawn for it's lowest part, in Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2008-05-22 11:00:57 UTC (rev 4050) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2008-05-22 13:31:40 UTC (rev 4051) @@ -418,6 +418,59 @@ && gameObject.transFace == transFace; } + /** {@inheritDoc} */ + @Override public void postParseGameObject(final int editType) { + if (!hasArchetype()) { + return; + } + + final String text = getObjectText(); + final Archetype archetype = getArchetype(); + + resetObjectText(); + for (final String line : lineSeparatorPattern.split(text)) { + if (line.length() > 0) { + if (line.startsWith("name ")) { + setObjName(line.substring(5)); + } else if (line.startsWith("animation ")) { + setAnimName(line.substring(10)); + addObjectText(line); + } else { + // this is an unparsed arch attribute, it has to stay in the archtext + addObjectText(line); + } + } + } + + if (getDirection() == -1) { // still the invalid direction! + setDirection(archetype.getDirection()); + } + setRealFace(getFaceName()); + // if the type is still unset, then we take the default one + if (getArchTypNr() == TYPE_UNSET) { + setArchTypNr(archetype.getArchTypNr()); + } + + // if the type is still unset, then we take the default one + if (archetype.getMultiShapeID() > 0 && getMultiShapeID() == 0) { + setMultiShapeID(archetype.getMultiShapeID()); + } + if (archetype.getMultiPartNr() > 0 && getMultiPartNr() == 0) { + setMultiPartNr(archetype.getMultiPartNr()); + } + setLowestPart(archetype.isLowestPart()); + + setMultiX(archetype.getMultiX()); + setMultiY(archetype.getMultiY()); + + // setEditType(archetype.getEditType()); + + // validate the ScriptedEvents + validateAllEvents(); + + updateEditType(editType); + } + /** Enumeration describing the state of the face. */ public enum FaceSource { Modified: trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java 2008-05-22 11:00:57 UTC (rev 4050) +++ trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java 2008-05-22 13:31:40 UTC (rev 4051) @@ -179,7 +179,7 @@ } final GameObject event = eventArchetype.createGameObject(); event.addObjectText("sub_type " + eventType); - CMainControl.getInstance().getArchetypeParser().postParseGameObject(event, 0); + event.postParseGameObject(0); return event; } Modified: trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java 2008-05-22 11:00:57 UTC (rev 4050) +++ trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java 2008-05-22 13:31:40 UTC (rev 4051) @@ -106,7 +106,7 @@ // now attach the default arch and stuff // (don't need edit type as we copy from head) - postParseGameObject(newarch, 0); + newarch.postParseGameObject(0); } } Modified: trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java 2008-05-22 11:00:57 UTC (rev 4050) +++ trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java 2008-05-22 13:31:40 UTC (rev 4051) @@ -86,26 +86,4 @@ */ void parseArchetypeFromStream(BufferedReader in, @NotNull String panelName, @NotNull String folderName, String fname, @NotNull List<G> invObjects) throws IOException; - /** - * Here we go... thats the hard one - * we copy the needed values from archetype to the gameObject. - * we setup the panels to show the right values - * <p/> - * first: the anim list... we want handle this later so we ignore this yet - * and let it in the gameObject text windows for handwork - * <p/> - * 2nd: msg/msgend - * we had in the map a msg/msgend cmd or not - * because we init our msg buffer only when one cmd come in - * we have a null-ptr or a text - * if text, this will overrule ALWAYS the default text - * if null, copy the default text in the gameObject, so the user can see and edit it - * if at save time msg-maparch == msg-default, we ignore it - * in every other case (even "" text) we save - * @param gameObject gameObject to be parsed - * @param editType edit type(s) to be calculated for the gameObject - * @todo improve this stupid comment - */ - void postParseGameObject(G gameObject, int editType); - } // interface ArchetypeParser Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-05-22 11:00:57 UTC (rev 4050) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-05-22 13:31:40 UTC (rev 4051) @@ -49,7 +49,7 @@ * The pattern to match end of line characters separating lines in the arch * text. */ - private static final Pattern lineSeparatorPattern = Pattern.compile("\n"); + protected static final Pattern lineSeparatorPattern = Pattern.compile("\n"); /** Static reference to the typeList (find syntax errors). */ protected static CFArchTypeList typeList; @@ -1492,4 +1492,25 @@ setObjectFace(); } + /** + * Here we go... thats the hard one + * we copy the needed values from archetype to the gameObject. + * we setup the panels to show the right values + * <p/> + * first: the anim list... we want handle this later so we ignore this yet + * and let it in the gameObject text windows for handwork + * <p/> + * 2nd: msg/msgend + * we had in the map a msg/msgend cmd or not + * because we init our msg buffer only when one cmd come in + * we have a null-ptr or a text + * if text, this will overrule ALWAYS the default text + * if null, copy the default text in the gameObject, so the user can see and edit it + * if at save time msg-maparch == msg-default, we ignore it + * in every other case (even "" text) we save + * @param editType edit type(s) to be calculated for the gameObject + * @todo improve this stupid comment + */ + public abstract void postParseGameObject(int editType); + } // interface GameObject Modified: trunk/src/app/net/sf/gridarta/gui/GameObjectAttributesPanel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/GameObjectAttributesPanel.java 2008-05-22 11:00:57 UTC (rev 4050) +++ trunk/src/app/net/sf/gridarta/gui/GameObjectAttributesPanel.java 2008-05-22 13:31:40 UTC (rev 4051) @@ -695,7 +695,7 @@ } invnew.setDirection(invnew.getArchetype().getDirection()); - mainControl.getArchetypeParser().postParseGameObject(invnew, 0); + invnew.postParseGameObject(0); final MapSquare<G, A, R> mapSquare = inv.getMapSquare(); assert mapSquare != null; final MapModel mapModel = mapSquare.getModel(); Modified: trunk/src/app/net/sf/gridarta/io/AbstractGameObjectParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/io/AbstractGameObjectParser.java 2008-05-22 11:00:57 UTC (rev 4050) +++ trunk/src/app/net/sf/gridarta/io/AbstractGameObjectParser.java 2008-05-22 13:31:40 UTC (rev 4051) @@ -189,7 +189,7 @@ // Ok, now is attached to default arch and loaded png // NOW we post parse the object... // (We calculate only edit types that are active, to save time) - mainControl.getArchetypeParser().postParseGameObject(gameObject, mainControl.getEditType()); + gameObject.postParseGameObject(mainControl.getEditType()); gameObject.setObjectFace(); if (!gameObject.isInContainer()) { Modified: trunk/src/app/net/sf/gridarta/map/DefaultMapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/DefaultMapModel.java 2008-05-22 11:00:57 UTC (rev 4050) +++ trunk/src/app/net/sf/gridarta/map/DefaultMapModel.java 2008-05-22 13:31:40 UTC (rev 4051) @@ -656,7 +656,7 @@ next.getContainer().addLast(newGameObject); newGameObject.setObjectFace(); - mainControl.getArchetypeParser().postParseGameObject(newGameObject, getMapControl().getActiveEditType()); + newGameObject.postParseGameObject(getMapControl().getActiveEditType()); } return newGameObject; @@ -713,7 +713,7 @@ part.setDirection(direction); part.setAttributeString("direction", Integer.toString(direction)); } - mainControl.getArchetypeParser().postParseGameObject(part, getMapControl().getActiveEditType()); + part.postParseGameObject(getMapControl().getActiveEditType()); part.setObjectFace(); } @@ -838,7 +838,7 @@ addGameObjectToMap(newGameObject, fillBelow); for (G tmp = newGameObject.getMultiNext(); tmp != null; tmp = tmp.getMultiNext()) { addGameObjectToMap(tmp, fillBelow); - mainControl.getArchetypeParser().postParseGameObject(tmp, mapControl.getActiveEditType()); + tmp.postParseGameObject(mapControl.getActiveEditType()); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-05-22 15:03:17
|
Revision: 4055 http://gridarta.svn.sourceforge.net/gridarta/?rev=4055&view=rev Author: akirschbaum Date: 2008-05-22 08:03:22 -0700 (Thu, 22 May 2008) Log Message: ----------- Merge duplicated code Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2008-05-22 14:55:24 UTC (rev 4054) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2008-05-22 15:03:22 UTC (rev 4055) @@ -257,8 +257,10 @@ * @param square The square to paint. */ private void paintSquare(@NotNull final MapSquare<GameObject, MapArchObject, Archetype> square) { - updateTile(new Point(square.getMapX(), square.getMapY())); - repaint(0, borderOffset.x + square.getMapX() * 32, borderOffset.y + square.getMapY() * 32, 32, 32); + final int x = square.getMapX(); + final int y = square.getMapY(); + updateTile(new Point(x, y)); + repaint(0, borderOffset.x + x * 32, borderOffset.y + y * 32, 32, 32); } /** @@ -362,19 +364,24 @@ */ private void paintMapGrid(final Graphics grfx) { if (gridVisible) { - for (int x = 0; x <= mapGrid.getSize().getWidth(); x++) { - grfx.drawLine(borderOffset.x + x * 32, borderOffset.y, borderOffset.x + x * 32, borderOffset.y + mapGrid.getSize().getHeight() * 32); + final Size2D mapSize = mapGrid.getSize(); + final int mapWidth = mapSize.getWidth(); + final int mapHeight = mapSize.getHeight(); + for (int x = 0; x <= mapWidth; x++) { + grfx.drawLine(borderOffset.x + x * 32, borderOffset.y, borderOffset.x + x * 32, borderOffset.y + mapHeight * 32); } - for (int y = 0; y <= mapGrid.getSize().getHeight(); y++) { - grfx.drawLine(borderOffset.x, borderOffset.y + y * 32, borderOffset.x + mapGrid.getSize().getWidth() * 32, borderOffset.y + y * 32); + for (int y = 0; y <= mapHeight; y++) { + grfx.drawLine(borderOffset.x, borderOffset.y + y * 32, borderOffset.x + mapWidth * 32, borderOffset.y + y * 32); } } } /** {@inheritDoc} */ @Nullable public Point getTileLocationAt(@NotNull final Point point, @Nullable final Point retPoint) { + final int mapWidth = mapSize.getWidth(); + final int mapHeight = mapSize.getHeight(); final int xm, ym; - if (point.x >= borderOffset.x && point.x < mapSize.getWidth() * 32 + borderOffset.x && point.y >= borderOffset.y && point.y < mapSize.getHeight() * 32 + borderOffset.y) { + if (point.x >= borderOffset.x && point.x < mapWidth * 32 + borderOffset.x && point.y >= borderOffset.y && point.y < mapHeight * 32 + borderOffset.y) { xm = (point.x - borderOffset.x) / 32; ym = (point.y - borderOffset.y) / 32; } else { @@ -382,7 +389,7 @@ ym = -1; } - if (xm < 0 || xm >= mapSize.getWidth() || ym < 0 || ym >= mapSize.getHeight()) { + if (xm < 0 || xm >= mapWidth || ym < 0 || ym >= mapHeight) { return null; } if (retPoint != null) { Modified: trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2008-05-22 14:55:24 UTC (rev 4054) +++ trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2008-05-22 15:03:22 UTC (rev 4055) @@ -222,7 +222,9 @@ /** {@inheritDoc} */ @NotNull public BufferedImage getFullImage() { // set map dimensions for iso view - final int sum = mapSize.getWidth() + mapSize.getHeight(); + final int mapWidth = mapSize.getWidth(); + final int mapHeight = mapSize.getHeight(); + final int sum = mapWidth + mapHeight; final int viewWidth = sum * IGUIConstants.TILE_ISO_XLEN2; final int viewHeight = sum * IGUIConstants.TILE_ISO_YLEN2; @@ -239,10 +241,10 @@ drawDoubleFaces = mainControl.isDrawDouble(); clearBackground(bufGrfx); final Point pos = new Point(); - for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { + for (pos.y = 0; pos.y < mapHeight; pos.y++) { int xstart = origin.x - (pos.y + 1) * IGUIConstants.TILE_ISO_XLEN2; int ystart = origin.y + pos.y * IGUIConstants.TILE_ISO_YLEN2; - for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { + for (pos.x = 0; pos.x < mapWidth; pos.x++) { paintSquare(bufGrfx, xstart, ystart, mapModel.getMapSquare(pos)); xstart += IGUIConstants.TILE_ISO_XLEN2; ystart += IGUIConstants.TILE_ISO_YLEN2; @@ -483,18 +485,20 @@ // draw iso grid grfx.setColor(Color.black); - for (int x = 0; x <= mapSize.getWidth(); x++) { + final int mapWidth = mapSize.getWidth(); + final int mapHeight = mapSize.getHeight(); + for (int x = 0; x <= mapWidth; x++) { grfx.drawLine(origin.x + x * IGUIConstants.TILE_ISO_XLEN2 - 1, origin.y + x * IGUIConstants.TILE_ISO_YLEN2 - 1, - origin.x - (mapSize.getHeight() - x) * IGUIConstants.TILE_ISO_XLEN2 - 1, - origin.y + (mapSize.getHeight() + x) * IGUIConstants.TILE_ISO_YLEN2 - 1); + origin.x - (mapHeight - x) * IGUIConstants.TILE_ISO_XLEN2 - 1, + origin.y + (mapHeight + x) * IGUIConstants.TILE_ISO_YLEN2 - 1); } - for (int y = 0; y <= mapSize.getHeight(); y++) { + for (int y = 0; y <= mapHeight; y++) { grfx.drawLine(origin.x - y * IGUIConstants.TILE_ISO_XLEN2 - 1, origin.y + y * IGUIConstants.TILE_ISO_YLEN2 - 1, - origin.x + (mapSize.getWidth() - y) * IGUIConstants.TILE_ISO_XLEN2 - 1, - origin.y + (mapSize.getWidth() + y) * IGUIConstants.TILE_ISO_YLEN2 - 1); + origin.x + (mapWidth - y) * IGUIConstants.TILE_ISO_XLEN2 - 1, + origin.y + (mapWidth + y) * IGUIConstants.TILE_ISO_YLEN2 - 1); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-05-22 15:27:10
|
Revision: 4060 http://gridarta.svn.sourceforge.net/gridarta/?rev=4060&view=rev Author: akirschbaum Date: 2008-05-22 08:26:57 -0700 (Thu, 22 May 2008) Log Message: ----------- Remove MainView.setStatusText(). Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java trunk/src/app/net/sf/gridarta/DefaultMapManager.java trunk/src/app/net/sf/gridarta/MapImageCache.java trunk/src/app/net/sf/gridarta/gui/MainView.java trunk/src/app/net/sf/gridarta/map/DefaultMapControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-05-22 15:15:48 UTC (rev 4059) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-05-22 15:26:57 UTC (rev 4060) @@ -318,7 +318,7 @@ if (log.isInfoEnabled()) { log.info("Start to load archetypes..."); } - mainView.setStatusText("Loading Archetypes..."); + mainView.getStatusBar().setStatusText("Loading Archetypes..."); // browse arch archive // load object from a arch file you found @@ -331,14 +331,14 @@ } scriptControl.loadScripts(new File(globalSettings.getMapDir(), IGUIConstants.SCRIPTS_DIR)); - mainView.setStatusText("Sorting..."); + mainView.getStatusBar().setStatusText("Sorting..."); objectChooser.getArchetypeChooserControl().finishBuildProcess(); // load the autojoin lists - mainView.setStatusText("Loading Autojoin Tables..."); + mainView.getStatusBar().setStatusText("Loading Autojoin Tables..."); getAutojoinLists().loadList(archetypeSet, getConfigurationDirectory()); - mainView.setStatusText("Ready."); + mainView.getStatusBar().setStatusText("Ready."); if (archetypeSet.getLoadStatus() == ArchetypeSet.LoadStatus.EMPTY) { ACTION_FACTORY.showMessageDialog(mainView, "loadArchesNoArchfiles"); @@ -465,7 +465,7 @@ @ActionMethod public void gc() { System.gc(); System.runFinalization(); - mainView.setStatusText("Garbage collection - done."); + mainView.getStatusBar().setStatusText("Garbage collection - done."); } /** View Treasure Lists. */ Modified: trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2008-05-22 15:15:48 UTC (rev 4059) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2008-05-22 15:26:57 UTC (rev 4060) @@ -226,7 +226,7 @@ DataOutputStream binFile = null; try { final File dfile = new File(dir, IGUIConstants.PNG_FILE); - mainControl.getMainView().setStatusText("Collect Archfile: write images"); + mainControl.getMainView().getStatusBar().setStatusText("Collect Archfile: write images"); binFile = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(dfile))); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-05-22 15:15:48 UTC (rev 4059) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-05-22 15:26:57 UTC (rev 4060) @@ -396,19 +396,19 @@ if (log.isInfoEnabled()) { log.info("Start to load archetypes..."); } - mainView.setStatusText("Loading Archetypes..."); + mainView.getStatusBar().setStatusText("Loading Archetypes..."); // browse arch archive // load object from a arch file you found - mainView.setStatusText("Sorting..."); + mainView.getStatusBar().setStatusText("Sorting..."); objectChooser.getArchetypeChooserControl().finishBuildProcess(); // load the autojoin lists - mainView.setStatusText("Loading Autojoin Tables..."); + mainView.getStatusBar().setStatusText("Loading Autojoin Tables..."); getAutojoinLists().loadList(archetypeSet, getConfigurationDirectory()); - mainView.setStatusText("Ready."); + mainView.getStatusBar().setStatusText("Ready."); if (archetypeSet.getLoadStatus() == ArchetypeSet.LoadStatus.EMPTY) { ACTION_FACTORY.showMessageDialog(mainView, "loadArchesNoArchfiles"); @@ -583,7 +583,7 @@ @ActionMethod public void gc() { System.gc(); System.runFinalization(); - mainView.setStatusText("Garbage collection - done."); + mainView.getStatusBar().setStatusText("Garbage collection - done."); } /** Control the client. */ Modified: trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2008-05-22 15:15:48 UTC (rev 4059) +++ trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2008-05-22 15:26:57 UTC (rev 4060) @@ -264,7 +264,7 @@ final long start = System.currentTimeMillis(); paintComponent2((Graphics2D) g); final long lastPaint = System.currentTimeMillis() - start; - mainControl.getMainView().setStatusText("Sel: " + lastSelectionPaint + " Core: " + lastCorePaint + " All: " + lastPaint); + mainControl.getMainView().getStatusBar().setStatusText("Sel: " + lastSelectionPaint + " Core: " + lastCorePaint + " All: " + lastPaint); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/DefaultMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/DefaultMapManager.java 2008-05-22 15:15:48 UTC (rev 4059) +++ trunk/src/app/net/sf/gridarta/DefaultMapManager.java 2008-05-22 15:26:57 UTC (rev 4060) @@ -90,7 +90,7 @@ /** {@inheritDoc} */ public MapView<G, A, R, V> newMapWithView(@Nullable final List<G> objects, @NotNull final A mapArchObject, @Nullable final Point viewPosition, @Nullable final File file, @NotNull final String mapFileName) { - mainControl.getMainView().setStatusText("Creating new map " + mapArchObject.getMapDisplayName()); + mainControl.getMainView().getStatusBar().setStatusText("Creating new map " + mapArchObject.getMapDisplayName()); final MapControl<G, A, R, V> mapControl = newMap(objects, mapArchObject, file, mapFileName); levels.add(mapControl); Modified: trunk/src/app/net/sf/gridarta/MapImageCache.java =================================================================== --- trunk/src/app/net/sf/gridarta/MapImageCache.java 2008-05-22 15:15:48 UTC (rev 4059) +++ trunk/src/app/net/sf/gridarta/MapImageCache.java 2008-05-22 15:26:57 UTC (rev 4060) @@ -320,7 +320,7 @@ result[0] = new ImageIcon(image.getScaledInstance(48, 23, Image.SCALE_SMOOTH)); result[1] = new ImageIcon(image.getScaledInstance(image.getWidth(null)/8, image.getHeight(null)/8, Image.SCALE_SMOOTH)); } catch (final OutOfMemoryError e) { - mainControl.getMainView().setStatusText(ACTION_FACTORY.getString("mapImagesOutOfMemory")); + mainControl.getMainView().getStatusBar().setStatusText(ACTION_FACTORY.getString("mapImagesOutOfMemory")); result[0] = defaultImages.get(Type.ICON); result[1] = defaultImages.get(Type.PREVIEW); } Modified: trunk/src/app/net/sf/gridarta/gui/MainView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/MainView.java 2008-05-22 15:15:48 UTC (rev 4059) +++ trunk/src/app/net/sf/gridarta/gui/MainView.java 2008-05-22 15:26:57 UTC (rev 4060) @@ -265,14 +265,6 @@ } /** - * Set the status message to be displayed in the status bar. - * @param statusText status message to be displayed - */ - public void setStatusText(final String statusText) { - statusBar.setStatusText(statusText); - } - - /** * Returns the StatusBar. * @return The StatusBar. */ Modified: trunk/src/app/net/sf/gridarta/map/DefaultMapControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/DefaultMapControl.java 2008-05-22 15:15:48 UTC (rev 4059) +++ trunk/src/app/net/sf/gridarta/map/DefaultMapControl.java 2008-05-22 15:26:57 UTC (rev 4060) @@ -434,9 +434,9 @@ /** {@inheritDoc} */ public void save() { if (isPickmap()) { - mainControl.getMainView().setStatusText("Saving pickmap '" + getMapFileName() + "'..."); + mainControl.getMainView().getStatusBar().setStatusText("Saving pickmap '" + getMapFileName() + "'..."); } else { - mainControl.getMainView().setStatusText("Saving map '" + getMapFileName() + "'..."); + mainControl.getMainView().getStatusBar().setStatusText("Saving map '" + getMapFileName() + "'..."); } assert mapFile != null; if (isModified()) { @@ -456,7 +456,7 @@ /** {@inheritDoc} */ public void saveAs(@NotNull final File file) { - mainControl.getMainView().setStatusText("Saving the map to a file..."); + mainControl.getMainView().getStatusBar().setStatusText("Saving the map to a file..."); if (!encodeMapFile(file)) { return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-05-28 21:13:05
|
Revision: 4063 http://gridarta.svn.sourceforge.net/gridarta/?rev=4063&view=rev Author: akirschbaum Date: 2008-05-28 14:13:00 -0700 (Wed, 28 May 2008) Log Message: ----------- Enable "Enter Exit" for non-head parts of multi-part exits. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/MapActions.java trunk/daimonin/ChangeLog trunk/daimonin/src/daieditor/MapActions.java trunk/src/app/net/sf/gridarta/map/DefaultMapModel.java trunk/src/app/net/sf/gridarta/map/MapModel.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2008-05-25 21:18:05 UTC (rev 4062) +++ trunk/crossfire/ChangeLog 2008-05-28 21:13:00 UTC (rev 4063) @@ -1,3 +1,7 @@ +2008-05-28 Andreas Kirschbaum + + * Enable "Enter Exit" for non-head parts of multi-part exits. + 2008-05-22 Andreas Kirschbaum * Fix crash while collecting archetypes. From now on the collected Modified: trunk/crossfire/src/cfeditor/MapActions.java =================================================================== --- trunk/crossfire/src/cfeditor/MapActions.java 2008-05-25 21:18:05 UTC (rev 4062) +++ trunk/crossfire/src/cfeditor/MapActions.java 2008-05-28 21:13:00 UTC (rev 4063) @@ -455,8 +455,8 @@ } final GameObject cursorExit = mapView.getMapControl().getMapModel().getExit(mapView.getView().getMapCursor().getLocation()); - if (cursorExit != null && exitMatcher.isMatching(cursorExit.getHead()) && cursorExit.getHead().getAttributeString("slaying").length() > 0) { - return cursorExit.getHead(); + if (cursorExit != null && exitMatcher.isMatching(cursorExit) && cursorExit.getAttributeString("slaying").length() > 0) { + return cursorExit; } return null; Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2008-05-25 21:18:05 UTC (rev 4062) +++ trunk/daimonin/ChangeLog 2008-05-28 21:13:00 UTC (rev 4063) @@ -1,3 +1,7 @@ +2008-05-28 Andreas Kirschbaum + + * Enable "Enter Exit" for non-head parts of multi-part exits. + 2008-05-22 Andreas Kirschbaum * Do not cut off left and right sides of pickmaps. Modified: trunk/daimonin/src/daieditor/MapActions.java =================================================================== --- trunk/daimonin/src/daieditor/MapActions.java 2008-05-25 21:18:05 UTC (rev 4062) +++ trunk/daimonin/src/daieditor/MapActions.java 2008-05-28 21:13:00 UTC (rev 4063) @@ -433,7 +433,7 @@ } final GameObject cursorExit = mapView.getMapControl().getMapModel().getExit(mapView.getView().getMapCursor().getLocation()); - if (cursorExit != null && exitMatcher.isMatching(cursorExit.getHead()) && cursorExit.getHead().getAttributeString("slaying").length() > 0) { + if (cursorExit != null && exitMatcher.isMatching(cursorExit) && cursorExit.getAttributeString("slaying").length() > 0) { return cursorExit.getHead(); } Modified: trunk/src/app/net/sf/gridarta/map/DefaultMapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/DefaultMapModel.java 2008-05-25 21:18:05 UTC (rev 4062) +++ trunk/src/app/net/sf/gridarta/map/DefaultMapModel.java 2008-05-28 21:13:00 UTC (rev 4063) @@ -531,13 +531,14 @@ } /** {@inheritDoc} */ - @Nullable public G getExit(@Nullable final Point hspot) { - if (exitTypeGameObjectMatcher == null || hspot == null || !isPointValid(hspot)) { + @Nullable public G getExit(@Nullable final Point point) { + if (exitTypeGameObjectMatcher == null || point == null || !isPointValid(point)) { return null; } - for (final G arch : mapGrid[hspot.x][hspot.y]) { - if (exitTypeGameObjectMatcher.isMatching(arch) && arch.getAttributeString("slaying").length() > 0) { - return arch; + for (final G part : mapGrid[point.x][point.y]) { + final G head = part.getHead(); + if (exitTypeGameObjectMatcher.isMatching(head) && head.getAttributeString("slaying").length() > 0) { + return head; } } return null; Modified: trunk/src/app/net/sf/gridarta/map/MapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapModel.java 2008-05-25 21:18:05 UTC (rev 4062) +++ trunk/src/app/net/sf/gridarta/map/MapModel.java 2008-05-28 21:13:00 UTC (rev 4063) @@ -357,13 +357,13 @@ @Nullable G insertArchToMap(G newObject, G next, Point pos, boolean join); /** - * Get the first exit on the MapSquare described by <var>hspot</var>. + * Get the first exit on the MapSquare described by <var>point</var>. * Possible exits include teleporters, exits and pits. - * @param hspot Point to get exit at + * @param point Point to get exit at * @return first exit found or <code>null</code> if no exit was found * @todo move this method somewhere else because the model should not know about arch types */ - @Nullable G getExit(@Nullable Point hspot); + @Nullable G getExit(@Nullable Point point); /** * Delete an existing arch from the map. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-05-29 22:45:44
|
Revision: 4066 http://gridarta.svn.sourceforge.net/gridarta/?rev=4066&view=rev Author: akirschbaum Date: 2008-05-29 15:45:50 -0700 (Thu, 29 May 2008) Log Message: ----------- Implement Map|Shrink Map Size: remove empty tiles from a map's border. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/MapActions.java trunk/crossfire/src/cfeditor/action.properties 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/ChangeLog trunk/daimonin/src/daieditor/MapActions.java trunk/daimonin/src/daieditor/action.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/map/DefaultMapModel.java trunk/src/app/net/sf/gridarta/map/MapModel.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/map/ShrinkMapSizeDialog.java trunk/src/app/net/sf/gridarta/gui/map/ShrinkMapSizeDialogManager.java trunk/src/app/net/sf/gridarta/map/ShrinkMapSizeUtils.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/crossfire/ChangeLog 2008-05-29 22:45:50 UTC (rev 4066) @@ -1,3 +1,8 @@ +2008-05-30 Andreas Kirschbaum + + * Implement Map|Shrink Map Size: remove empty tiles from a map's + border. + 2008-05-28 Andreas Kirschbaum * Enable "Enter Exit" for non-head parts of multi-part exits. Modified: trunk/crossfire/src/cfeditor/MapActions.java =================================================================== --- trunk/crossfire/src/cfeditor/MapActions.java 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/crossfire/src/cfeditor/MapActions.java 2008-05-29 22:45:50 UTC (rev 4066) @@ -38,6 +38,7 @@ import net.sf.gridarta.gameobject.match.GameObjectMatcher; import net.sf.gridarta.gui.map.MapCursorEvent; import net.sf.gridarta.gui.map.MapView; +import net.sf.gridarta.gui.map.ShrinkMapSizeDialogManager; import net.sf.gridarta.map.MapControl; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.ToggleAction; @@ -90,6 +91,9 @@ /** Action for "autojoin". */ private final ToggleAction aAutoJoin = (ToggleAction) ACTION_FACTORY.createToggle(true, "autoJoin", this); + /** Action for "shrink map size". */ + private final Action aShrinkMapSize = ACTION_FACTORY.createAction(true, "shrinkMapSize", this); + /** Action for "enter exit". */ private final Action aEnterExit = ACTION_FACTORY.createAction(true, "enterExit", this); @@ -116,6 +120,11 @@ private final CurrentMapListener<GameObject, MapArchObject, Archetype, CMapViewBasic> currentMapListener; /** + * The {@link ShrinkMapSizeDialogManager} instance. + */ + private final ShrinkMapSizeDialogManager shrinkMapSizeDialogManager; + + /** * Create a new instance. * * @param mainControl the main control to use @@ -128,6 +137,7 @@ this.mainControl = mainControl; this.mapManager = mapManager; this.exitMatcher = exitMatcher; + shrinkMapSizeDialogManager = new ShrinkMapSizeDialogManager(mapManager); autoJoin = prefs.getBoolean(AUTOJOIN_KEY, false); @@ -221,6 +231,14 @@ } } + /** Action method for "shrink map size". */ + public void shrinkMapSize() { + final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView = getShrinkMapSizeEnabled(); + if (mapView != null) { + shrinkMapSizeDialogManager.showDialog(mapView); + } + } + /** * Action method for "autojoin". * @return <code>true</code> if autojoining is enabled, or @@ -438,6 +456,16 @@ } /** + * Determine whether "shrink map size" is enabled. + * + * @return the current map view, or <code>null</code> if "shrink map size" + * is disabled + */ + private MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> getShrinkMapSizeEnabled() { + return currentMapListener.getCurrentMapView(); + } + + /** * Determine whether "enter exit" is enabled. * * @return the exit to enter, or <code>null</code> if "enter exit" is @@ -498,6 +526,7 @@ for (int i = 0; i < directionsDir.length; i++) { aDirections[i].setEnabled(getEnterMapEnabled(directionsDir[i]) != null); } + aShrinkMapSize.setEnabled(getShrinkMapSizeEnabled() != null); } /** Modified: trunk/crossfire/src/cfeditor/action.properties =================================================================== --- trunk/crossfire/src/cfeditor/action.properties 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/crossfire/src/cfeditor/action.properties 2008-05-29 22:45:50 UTC (rev 4066) @@ -29,7 +29,7 @@ main.menubar=file edit map archetypes pickmaps resources tools analyze view plugins window help file.menu=createNew open recent close - save saveAs saveAll revert createImage - options - exit edit.menu=undo redo - clear cut copy paste - shift - replace fillAbove fillBelow randFillAbove randFillBelow floodfill - selectAll -map.menu=autoJoin - enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap tileShow - mapCreateView mapProperties +map.menu=autoJoin - enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap tileShow - mapCreateView mapProperties shrinkMapSize archetypes.menu=displayObjectNames findArchetypes #pickmaps.menu: See gridarta resources.menu=collectArches - viewTreasurelists @@ -44,7 +44,7 @@ mapwindowFile.menu=save saveAs createImage - revert - close mapwindowEdit.menu=undo redo - clear cut copy paste - shift - replace fillAbove fillBelow randFillAbove randFillBelow floodfill - selectAll -mapwindowMap.menu=gridVisible enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap tileShow - mapCreateView mapProperties +mapwindowMap.menu=gridVisible enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap tileShow - mapCreateView mapProperties shrinkMapSize mapwindowCursor.menu=moveCursor - selectTile startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes ########## Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/crossfire/src/cfeditor/messages.properties 2008-05-29 22:45:50 UTC (rev 4066) @@ -199,7 +199,10 @@ mapProperties.mnemonic=M mapProperties.accel=ctrl pressed M +shrinkMapSize.text=Shrink Map Size... +shrinkMapSize.shortdescription=Remove empty tiles at right or bottom map border + ####### # Cursor Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2008-05-29 22:45:50 UTC (rev 4066) @@ -186,7 +186,10 @@ mapProperties.text=Karteneigenschaften mapProperties.mnemonic=K +shrinkMapSize.text=Kartengr\xF6\xDFe reduzieren... +shrinkMapSize.shortdescription=Freien Bereich am rechten bzw. unteren Kartenrand entfernen + ####### # Cursor Modified: trunk/crossfire/src/cfeditor/messages_fr.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_fr.properties 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/crossfire/src/cfeditor/messages_fr.properties 2008-05-29 22:45:50 UTC (rev 4066) @@ -187,7 +187,10 @@ mapProperties.text=Propri\xE9t\xE9s de la carte mapProperties.mnemonic=P +#shrinkMapSize.text= +#shrinkMapSize.shortdescription= + ####### # Cursor Modified: trunk/crossfire/src/cfeditor/messages_sv.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_sv.properties 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/crossfire/src/cfeditor/messages_sv.properties 2008-05-29 22:45:50 UTC (rev 4066) @@ -185,7 +185,10 @@ mapProperties.text=Egenskaper... mapProperties.mnemonic=E +#shrinkMapSize.text= +#shrinkMapSize.shortdescription= + ####### # Cursor Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/daimonin/ChangeLog 2008-05-29 22:45:50 UTC (rev 4066) @@ -1,3 +1,8 @@ +2008-05-30 Andreas Kirschbaum + + * Implement Map|Shrink Map Size: remove empty tiles from a map's + border. + 2008-05-28 Andreas Kirschbaum * Enable "Enter Exit" for non-head parts of multi-part exits. Modified: trunk/daimonin/src/daieditor/MapActions.java =================================================================== --- trunk/daimonin/src/daieditor/MapActions.java 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/daimonin/src/daieditor/MapActions.java 2008-05-29 22:45:50 UTC (rev 4066) @@ -37,6 +37,7 @@ import net.sf.gridarta.gameobject.match.GameObjectMatcher; import net.sf.gridarta.gui.map.MapCursorEvent; import net.sf.gridarta.gui.map.MapView; +import net.sf.gridarta.gui.map.ShrinkMapSizeDialogManager; import net.sf.gridarta.map.MapControl; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.ToggleAction; @@ -86,6 +87,9 @@ /** Action for "autojoin". */ private final ToggleAction aAutoJoin = (ToggleAction) ACTION_FACTORY.createToggle(true, "autoJoin", this); + /** Action for "shrink map size". */ + private final Action aShrinkMapSize = ACTION_FACTORY.createAction(true, "shrinkMapSize", this); + /** Action for "enter exit". */ private final Action aEnterExit = ACTION_FACTORY.createAction(true, "enterExit", this); @@ -112,6 +116,11 @@ private final CurrentMapListener<GameObject, MapArchObject, Archetype, CMapViewBasic> currentMapListener; /** + * The {@link ShrinkMapSizeDialogManager} instance. + */ + private final ShrinkMapSizeDialogManager shrinkMapSizeDialogManager; + + /** * Create a new instance. * * @param mainControl the main control to use @@ -124,6 +133,7 @@ this.mainControl = mainControl; this.mapManager = mapManager; this.exitMatcher = exitMatcher; + shrinkMapSizeDialogManager = new ShrinkMapSizeDialogManager(mapManager); autoJoin = prefs.getBoolean(AUTOJOIN_KEY, false); @@ -217,6 +227,14 @@ } } + /** Action method for "shrink map size". */ + public void shrinkMapSize() { + final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView = getShrinkMapSizeEnabled(); + if (mapView != null) { + shrinkMapSizeDialogManager.showDialog(mapView); + } + } + /** * Action method for "autojoin". * @return <code>true</code> if autojoining is enabled, or @@ -416,6 +434,16 @@ } /** + * Determine whether "shrink map size" is enabled. + * + * @return the current map view, or <code>null</code> if "shrink map size" + * is disabled + */ + private MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> getShrinkMapSizeEnabled() { + return currentMapListener.getCurrentMapView(); + } + + /** * Determine whether "enter exit" is enabled. * * @return the exit to enter, or <code>null</code> if "enter exit" is @@ -476,6 +504,7 @@ for (int i = 0; i < directionsDir.length; i++) { aDirections[i].setEnabled(getEnterMapEnabled(directionsDir[i]) != null); } + aShrinkMapSize.setEnabled(getShrinkMapSizeEnabled() != null); } /** Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/daimonin/src/daieditor/action.properties 2008-05-29 22:45:50 UTC (rev 4066) @@ -29,7 +29,7 @@ main.menubar=file edit map archetypes pickmaps resources tools view window help file.menu=createNew open recent close - save saveAs saveAll revert createImage - options - exit edit.menu=undo redo - clear cut copy paste - shift - replace fillAbove fillBelow randFillAbove randFillBelow floodfill - selectAll -map.menu=autoJoin - enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties +map.menu=autoJoin - enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize archetypes.menu=displayObjectNames findArchetypes #pickmaps.menu: See gridarta resources.menu=collectArches collectSpells - reloadFaces - viewTreasurelists @@ -47,7 +47,7 @@ mapwindowFile.menu=save saveAs createImage - revert - close mapwindowEdit.menu=undo redo - clear cut copy paste - shift - replace fillAbove fillBelow randFillAbove randFillBelow floodfill - selectAll -mapwindowMap.menu=gridVisible enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties +mapwindowMap.menu=gridVisible enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize mapwindowCursor.menu=moveCursor - selectTile startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes # Zoom Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/daimonin/src/daieditor/messages.properties 2008-05-29 22:45:50 UTC (rev 4066) @@ -280,7 +280,10 @@ mapProperties.mnemonic=M mapProperties.accel=ctrl pressed M +shrinkMapSize.text=Shrink Map Size... +shrinkMapSize.shortdescription=Remove empty tiles at right or bottom map border + ####### # Cursor Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/daimonin/src/daieditor/messages_de.properties 2008-05-29 22:45:50 UTC (rev 4066) @@ -263,7 +263,10 @@ mapProperties.text=Karteneigenschaften mapProperties.mnemonic=K +shrinkMapSize.text=Kartengr\xF6\xDFe reduzieren... +shrinkMapSize.shortdescription=Freien Bereich am rechten bzw. unteren Kartenrand entfernen + ####### # Cursor Modified: trunk/daimonin/src/daieditor/messages_fr.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_fr.properties 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/daimonin/src/daieditor/messages_fr.properties 2008-05-29 22:45:50 UTC (rev 4066) @@ -261,7 +261,10 @@ mapProperties.text=Propri\xE9t\xE9s de la carte mapProperties.mnemonic=P +#shrinkMapSize.text= +#shrinkMapSize.shortdescription= + ####### # Cursor Modified: trunk/daimonin/src/daieditor/messages_sv.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_sv.properties 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/daimonin/src/daieditor/messages_sv.properties 2008-05-29 22:45:50 UTC (rev 4066) @@ -265,7 +265,10 @@ mapProperties.text=Egenskaper... mapProperties.mnemonic=E +#shrinkMapSize.text= +#shrinkMapSize.shortdescription= + ####### # Cursor Added: trunk/src/app/net/sf/gridarta/gui/map/ShrinkMapSizeDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/ShrinkMapSizeDialog.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/map/ShrinkMapSizeDialog.java 2008-05-29 22:45:50 UTC (rev 4066) @@ -0,0 +1,229 @@ +/* + * 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.gui.map; + +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.WindowConstants; +import net.sf.gridarta.CommonConstants; +import net.sf.gridarta.gui.GUIConstants; +import net.sf.gridarta.map.MapArchObject; +import net.sf.gridarta.map.ShrinkMapSizeUtils; +import net.sf.japi.swing.ActionFactory; + +/** + * Dialog to ask which empty borders to remove from a map. + * @author Andreas Kirschbaum + */ +public final class ShrinkMapSizeDialog extends JOptionPane { + + /** Serial Version UID. */ + private static final long serialVersionUID = 1L; + + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.gridarta"); + + /** The manager for this dialog. */ + private final ShrinkMapSizeDialogManager shinkMapSizeDialogManager; + + /** The affected map view of this dialog. */ + private final MapView<?, ?, ?, ?> mapView; + + /** Checkbox to remove empty tiles at the east edge. */ + private final JCheckBox eastCheckBox = new JCheckBox(ACTION_FACTORY.createToggle(false, "shrinkMapSizeDialogEast", this)); + + /** Checkbox to remove empty tiles at the south edge. */ + private final JCheckBox southCheckBox = new JCheckBox(ACTION_FACTORY.createToggle(false, "shrinkMapSizeDialogSouth", this)); + + /** Text area for displaying warning messages. */ + private final JLabel warnings = new JLabel(); + + /** JButton for ok. */ + private final JButton okButton = new JButton(ACTION_FACTORY.createAction(false, "shrinkMapSizeDialogOk", this)); + + /** JButton for cancel. */ + private final JButton cancelButton = new JButton(ACTION_FACTORY.createAction(false, "shrinkMapSizeDialogCancel", this)); + + /** The associated {@link JDialog} instance. */ + private JDialog dialog = null; + + /** + * Creates a new instance. + * @param shinkMapSizeDialogManager the manager for this dialog + * @param mapView the map view to affect + */ + public ShrinkMapSizeDialog(final ShrinkMapSizeDialogManager shinkMapSizeDialogManager, final MapView<?, ?, ?, ?> mapView) { + this.shinkMapSizeDialogManager = shinkMapSizeDialogManager; + + okButton.setDefaultCapable(true); + setOptions(new Object[]{okButton, cancelButton}); + + this.mapView = mapView; + setMessage(createPanel()); + + dialog = createDialog(mapView.getComponent(), ACTION_FACTORY.getString("shrinkMapSizeDialogTitle")); + dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + dialog.getRootPane().setDefaultButton(okButton); + dialog.setModal(false); + + dialog.pack(); + dialog.setVisible(true); + } + + /** + * Creates the GUI. + * @return the panel containing the GUI + */ + private JPanel createPanel() { + final JLabel label = new JLabel(ACTION_FACTORY.getString("shrinkMapSizeDialogLabel")); + label.setAlignmentX(0); + eastCheckBox.setAlignmentX(0); + southCheckBox.setAlignmentX(0); + warnings.setAlignmentX(0); + final JPanel mainPanel = new JPanel(); + mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); + mainPanel.setBorder(GUIConstants.DIALOG_BORDER); + mainPanel.add(label); + mainPanel.add(Box.createVerticalStrut(5)); + mainPanel.add(eastCheckBox); + mainPanel.add(southCheckBox); + mainPanel.add(Box.createVerticalStrut(5)); + mainPanel.add(warnings); + mainPanel.add(Box.createVerticalStrut(5)); + final int shrinkFlags = ShrinkMapSizeUtils.getShrinkFlags(mapView.getMapControl().getMapModel()); + eastCheckBox.setEnabled((shrinkFlags&ShrinkMapSizeUtils.SHRINK_EAST) != 0); + eastCheckBox.setSelected((shrinkFlags&ShrinkMapSizeUtils.SHRINK_EAST) != 0); + southCheckBox.setEnabled((shrinkFlags&ShrinkMapSizeUtils.SHRINK_SOUTH) != 0); + southCheckBox.setSelected((shrinkFlags&ShrinkMapSizeUtils.SHRINK_SOUTH) != 0); + updateWarnings(); + return mainPanel; + } + + /** + * Updates the {@link #warnings} label. + */ + private void updateWarnings() { + final StringBuilder sb = new StringBuilder(100); + if (!eastCheckBox.isEnabled() && !southCheckBox.isEnabled()) { + sb.append("<p>"); + sb.append(ACTION_FACTORY.getString("shrinkMapSizeDialogNoEmptySpace")); + } else { + final MapArchObject<?> mapArchObject = mapView.getMapControl().getMapModel().getMapArchObject(); + if (eastCheckBox.isEnabled() && eastCheckBox.isSelected()) { + if (!mapArchObject.getTilePath(CommonConstants.NORTH).isEmpty()) { + sb.append("<p>"); + sb.append(ACTION_FACTORY.getString("shrinkMapSizeDialogEastBreaksNorthTiling")); + } + if (!mapArchObject.getTilePath(CommonConstants.SOUTH).isEmpty()) { + sb.append("<p>"); + sb.append(ACTION_FACTORY.getString("shrinkMapSizeDialogEastBreaksSouthTiling")); + } + } + if (southCheckBox.isEnabled() && southCheckBox.isSelected()) { + if (!mapArchObject.getTilePath(CommonConstants.EAST).isEmpty()) { + sb.append("<p>"); + sb.append(ACTION_FACTORY.getString("shrinkMapSizeDialogSouthBreaksEastTiling")); + } + if (!mapArchObject.getTilePath(CommonConstants.WEST).isEmpty()) { + sb.append("<p>"); + sb.append(ACTION_FACTORY.getString("shrinkMapSizeDialogSouthBreaksWestTiling")); + } + } + } + okButton.setEnabled(eastCheckBox.isSelected() || southCheckBox.isSelected()); + if(sb.length() > 0) { + sb.insert(0, ACTION_FACTORY.getString("shrinkMapSizeDialogWarning")); + sb.insert(0, "<html>"); + warnings.setText(sb.toString()); + } else { + warnings.setText(""); + } + } + + /** Action method for ok. */ + public void shrinkMapSizeDialogOk() { + shrinkMapSize(); + setValue(okButton); + } + + /** Action method for cancel. */ + public void shrinkMapSizeDialogCancel() { + setValue(cancelButton); + } + + /** + * Shrinks the map model. + */ + private void shrinkMapSize() { + int shrinkFlags = 0; + if (eastCheckBox.isSelected()) { + shrinkFlags |= ShrinkMapSizeUtils.SHRINK_EAST; + } + if (southCheckBox.isSelected()) { + shrinkFlags |= ShrinkMapSizeUtils.SHRINK_SOUTH; + } + ShrinkMapSizeUtils.shrinkMap(mapView.getMapControl().getMapModel(), shrinkFlags); + } + + /** {@inheritDoc} */ + @Override public void setValue(final Object newValue) { + super.setValue(newValue); + if (newValue != UNINITIALIZED_VALUE) { + shinkMapSizeDialogManager.disposeDialog(mapView); + } + } + + /** + * Returns the {@link JDialog} for this instance. + * @return the dialog + */ + public JDialog getDialog() { + return dialog; + } + + /** Action method for "shrinkMapSizeDialogEast". */ + public boolean isShrinkMapSizeDialogEast() { + return eastCheckBox.isSelected(); + } + + /** Action method for "shrinkMapSizeDialogEast". */ + public void setShrinkMapSizeDialogEast(final boolean flag) { + eastCheckBox.setSelected(!flag); + updateWarnings(); + } + + /** Action method for "shrinkMapSizeDialogSouth". */ + public boolean isShrinkMapSizeDialogSouth() { + return southCheckBox.isSelected(); + } + + /** Action method for "shrinkMapSizeDialogSouth". */ + public void setShrinkMapSizeDialogSouth(final boolean flag) { + southCheckBox.setSelected(!flag); + updateWarnings(); + } + +} // class ShrinkMapSizeDialog Property changes on: trunk/src/app/net/sf/gridarta/gui/map/ShrinkMapSizeDialog.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gui/map/ShrinkMapSizeDialogManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/ShrinkMapSizeDialogManager.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/map/ShrinkMapSizeDialogManager.java 2008-05-29 22:45:50 UTC (rev 4066) @@ -0,0 +1,122 @@ +/* + * 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.gui.map; + +import java.util.HashMap; +import java.util.Map; +import net.sf.gridarta.MapManager; +import net.sf.gridarta.MapManagerListener; +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; + +/** + * Manager for {@link ShrinkMapSizeDialog} instances. This class makes sure + * that for each map view no more than one shink map size dialog exists. + * @author Andreas Kirschbaum + */ +public final class ShrinkMapSizeDialogManager<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>, V extends MapViewBasic<G, A, R>> { + + /** Dialog for each map view. */ + private final Map<MapView<G, A, R, V>, ShrinkMapSizeDialog> dialogs = new HashMap<MapView<G, A, R, V>, ShrinkMapSizeDialog>(); + + /** + * The map manager listener to detect closed map views. + */ + private final MapManagerListener<G, A, R, V> mapManagerListener = new MapManagerListener<G, A, R, V>() { + + /** {@inheritDoc} */ + public void currentMapChanged(@Nullable final MapControl<G, A, R, V> mapControl) { + // ignore + } + + /** {@inheritDoc} */ + public void currentMapViewChanged(@Nullable final MapView<G, A, R, V> mapView) { + // ignore + } + + /** {@inheritDoc} */ + public void mapCreated(@NotNull final MapControl<G, A, R, V> mapControl) { + // ignore + } + + /** {@inheritDoc} */ + public void mapViewCreated(@NotNull final MapView<G, A, R, V> mapView) { + // ignore + } + + /** {@inheritDoc} */ + public void mapClosing(@NotNull final MapControl<G, A, R, V> mapControl) { + // ignore + } + + /** {@inheritDoc} */ + public void mapViewClosing(@NotNull final MapView<G, A, R, V> mapView) { + disposeDialog(mapView); + } + + }; + + /** + * Creates a new instance. + * @param mapManager the map manager + */ + public ShrinkMapSizeDialogManager(@NotNull final MapManager<G, A, R, V> mapManager) { + mapManager.addMapManagerListener(mapManagerListener); + } + + /** + * Shows a dialog to shink the map size. + * @param mapView the view map + */ + public void showDialog(final MapView<G, A, R, V> mapView) { + synchronized (dialogs) { + final ShrinkMapSizeDialog oldDialog = dialogs.get(mapView); + if (oldDialog != null) { + oldDialog.getDialog().toFront(); + return; + } + + final ShrinkMapSizeDialog pane = new ShrinkMapSizeDialog(this, mapView); + dialogs.put(mapView, pane); + } + } + + /** + * Disposes a dialog. + * @param mapView the map view to dispose the dialog of; does nothing if no + * dialog exists + */ + public void disposeDialog(final MapView<G, A, R, V> mapView) { + final ShrinkMapSizeDialog dialog; + synchronized (dialogs) { + dialog = dialogs.remove(mapView); + if (dialog == null) { + return; + } + } + + dialog.getDialog().dispose(); + } + +} // class ShrinkMapSizeDialogManager Property changes on: trunk/src/app/net/sf/gridarta/gui/map/ShrinkMapSizeDialogManager.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/map/DefaultMapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/DefaultMapModel.java 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/src/app/net/sf/gridarta/map/DefaultMapModel.java 2008-05-29 22:45:50 UTC (rev 4066) @@ -785,6 +785,21 @@ gameObject.updateEditType(getMapControl().getActiveEditType()); } + /** {@inheritDoc} */ + public boolean isAreaEmpty(final int left, final int top, final int width, final int height) { + final Point point = new Point(); + for (int x = left; x < left + width; x++) { + point.x = x; + for (int y = top; y < top + height; y++) { + point.y = y; + if (!getMapSquare(point).isEmpty()) { + return false; + } + } + } + return true; + } + /** Iterator for iterating over all squares of a model. */ private class MapSquareIterator implements Iterator<MapSquare<G, A, R>> { Modified: trunk/src/app/net/sf/gridarta/map/MapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapModel.java 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/src/app/net/sf/gridarta/map/MapModel.java 2008-05-29 22:45:50 UTC (rev 4066) @@ -412,4 +412,14 @@ */ void insertMapArchToPickmap(@NotNull Point pos, @NotNull final G newarch); + /** + * Checks whether an area of a map is completely empty. + * @param left the left border of the area + * @param top the top border of the area + * @param width the with of the area + * @param height the height of the area + * @return whether the area is completely empty + */ + boolean isAreaEmpty(int left, int top, int width, int height); + } // interface MapModel Added: trunk/src/app/net/sf/gridarta/map/ShrinkMapSizeUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/ShrinkMapSizeUtils.java (rev 0) +++ trunk/src/app/net/sf/gridarta/map/ShrinkMapSizeUtils.java 2008-05-29 22:45:50 UTC (rev 4066) @@ -0,0 +1,100 @@ +/* + * 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.map; + +import java.awt.Point; +import net.sf.gridarta.Size2D; + +/** + * Utility class to remove empty tiles from a map's border. + * @author Andreas Kirschbaum + */ +public class ShrinkMapSizeUtils { + + /** Flag value: remove empty space from east border. */ + public static final int SHRINK_EAST = 2; + + /** Flag value: remove empty space from south border. */ + public static final int SHRINK_SOUTH = 4; + + /** + * Private constructor to prevent instantiation. + */ + private ShrinkMapSizeUtils() { + } + + /** + * Removes empty tiles from a map's border. + * @param mapModel the map to modify + * @param shrinkFlags the borders to modify + */ + public static void shrinkMap(final MapModel<?, ?, ?> mapModel, final int shrinkFlags) { + final Size2D mapSize = mapModel.getMapSize(); + final Point point = new Point(); + int filledWidth = mapSize.getWidth(); + int filledHeight = mapSize.getHeight(); + if ((shrinkFlags&SHRINK_EAST) != 0) { + while (filledWidth > 1 && mapModel.isAreaEmpty(filledWidth - 1, 0, 1, filledHeight)) { + filledWidth--; + } + } + if ((shrinkFlags&SHRINK_SOUTH) != 0) { + while (filledHeight > 1 && mapModel.isAreaEmpty(0, filledHeight - 1, filledWidth, 1)) { + filledHeight--; + } + } + mapModel.beginTransaction("Shrink Map Size"); + try { + mapModel.resizeMap(new Size2D(filledWidth, filledHeight)); + } finally { + mapModel.endTransaction(); + } + } + + /** + * Returns which borders contain empty tiles. + * @param mapModel the map to check + * @return the borders having empty tiles + */ + public static int getShrinkFlags(final MapModel<?, ?, ?> mapModel) { + final Size2D mapSize = mapModel.getMapSize(); + final int mapWidth = mapSize.getWidth(); + final int mapHeight = mapSize.getHeight(); + int shrinkFlags = 0; +/* + if (mapModel.isAreaEmpty(0, 0, mapWidth, 1)) { + shrinkFlags |= SHRINK_NORTH; + } +*/ + if (mapModel.isAreaEmpty(mapWidth - 1, 0, 1, mapHeight)) { + shrinkFlags |= SHRINK_EAST; + } + if (mapModel.isAreaEmpty(0, mapHeight - 1, mapWidth, 1)) { + shrinkFlags |= SHRINK_SOUTH; + } +/* + if (mapModel.isAreaEmpty(0, 0, 1, mapHeight)) { + shrinkFlags |= SHRINK_WEST; + } +*/ + return shrinkFlags; + } + +} // class ShrinkMapSizeUtils Property changes on: trunk/src/app/net/sf/gridarta/map/ShrinkMapSizeUtils.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/src/app/net/sf/gridarta/messages.properties 2008-05-29 22:45:50 UTC (rev 4066) @@ -194,6 +194,19 @@ goLocationCoordinateOutOfRange.title=Illegal Value goLocationCoordinateOutOfRange.message=Coordinate value is invalid. +shrinkMapSizeDialogTitle=Shink Map Size {0} +shrinkMapSizeDialogLabel=Remove empty tiles from: +shrinkMapSizeDialogEast.text=east border +shrinkMapSizeDialogSouth.text=south border +shrinkMapSizeDialogOk.text=Ok +shrinkMapSizeDialogCancel.text=Cancel +shrinkMapSizeDialogWarning=Warning: +shrinkMapSizeDialogNoEmptySpace=no empty space at map border +shrinkMapSizeDialogEastBreaksNorthTiling=removing empty tiles from the east border breaks north tiling +shrinkMapSizeDialogEastBreaksSouthTiling=removing empty tiles from the east border breaks south tiling +shrinkMapSizeDialogSouthBreaksWestTiling=removing empty tiles from the south border breaks west tiling +shrinkMapSizeDialogSouthBreaksEastTiling=removing empty tiles from the south border breaks east tiling + loadDuplicateArch.title=Error: Duplicate arch loadDuplicateArch.message.1=<html><h1>Warning!</h1>Duplicate arches: loadDuplicateArch.message.2.title.1=Archetype Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2008-05-29 22:45:50 UTC (rev 4066) @@ -182,6 +182,19 @@ goLocationCoordinateOutOfRange.title=Ung\xFCltiger Wert goLocationCoordinateOutOfRange.message=Die Koordinate ist ung\xFCltig. +shrinkMapSizeDialogTitle=Kartengr\xF6\xDFe reduzieren {0} +shrinkMapSizeDialogLabel=Freien Bereich entfernen von: +shrinkMapSizeDialogEast.text=Ost-Rand +shrinkMapSizeDialogSouth.text=S\xFCd-Rand +shrinkMapSizeDialogOk.text=OK +shrinkMapSizeDialogCancel.text=Abbrechen +shrinkMapSizeDialogWarning=Warnung: +shrinkMapSizeDialogNoEmptySpace=kein freier Bereich am Kartenrand +shrinkMapSizeDialogEastBreaksNorthTiling=l\xF6schen von leeren Feldern am \xF6stlichen Kartenrand st\xF6rt Verbindung zu n\xF6rdlicher Karte +shrinkMapSizeDialogEastBreaksSouthTiling=l\xF6schen von leeren Feldern am \xF6stlichen Kartenrand st\xF6rt Verbindung zu s\xFCdlicher Karte +shrinkMapSizeDialogSouthBreaksWestTiling=l\xF6schen von leeren Feldern am s\xFCdlichen Kartenrand st\xF6rt Verbindung zu westlicher Karte +shrinkMapSizeDialogSouthBreaksEastTiling=l\xF6schen von leeren Feldern am s\xFCdlichen Kartenrand st\xF6rt Verbindung zu \xF6stlicher Karte + loadDuplicateArch.title=Fehler: Mehrfach definierte Archetypen loadDuplicateArch.message.1=<html><h1>Warnung</h1>Mehrfach definierte Archetypen: loadDuplicateArch.message.2.title.1=Archetyp Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2008-05-29 22:45:50 UTC (rev 4066) @@ -181,6 +181,19 @@ #goLocationCoordinateOutOfRange.title= #goLocationCoordinateOutOfRange.message= +#shrinkMapSizeDialogTitle= +#shrinkMapSizeDialogLabel= +#shrinkMapSizeDialogEast.text= +#shrinkMapSizeDialogSouth.text= +#shrinkMapSizeDialogOk.text= +#shrinkMapSizeDialogCancel.text= +#shrinkMapSizeDialogWarning= +#shrinkMapSizeDialogNoEmptySpace= +#shrinkMapSizeDialogEastBreaksNorthTiling= +#shrinkMapSizeDialogEastBreaksSouthTiling= +#shrinkMapSizeDialogSouthBreaksWestTiling= +#shrinkMapSizeDialogSouthBreaksEastTiling= + #loadDuplicateArch.title= #loadDuplicateArch.message.1= #loadDuplicateArch.message.2.title.1= Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2008-05-29 22:31:13 UTC (rev 4065) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2008-05-29 22:45:50 UTC (rev 4066) @@ -181,6 +181,19 @@ #goLocationCoordinateOutOfRange.title= #goLocationCoordinateOutOfRange.message= +#shrinkMapSizeDialogTitle= +#shrinkMapSizeDialogLabel= +#shrinkMapSizeDialogEast.text= +#shrinkMapSizeDialogSouth.text= +#shrinkMapSizeDialogOk.text= +#shrinkMapSizeDialogCancel.text= +#shrinkMapSizeDialogWarning= +#shrinkMapSizeDialogNoEmptySpace= +#shrinkMapSizeDialogEastBreaksNorthTiling= +#shrinkMapSizeDialogEastBreaksSouthTiling= +#shrinkMapSizeDialogSouthBreaksWestTiling= +#shrinkMapSizeDialogSouthBreaksEastTiling= + loadDuplicateArch.title=Fel: duplicerad arketyp loadDuplicateArch.message.1=<html><h1>Varning!</h1>Duplicerad arketyp: #loadDuplicateArch.message.2.title.1= This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-05-31 21:48:34
|
Revision: 4067 http://gridarta.svn.sourceforge.net/gridarta/?rev=4067&view=rev Author: akirschbaum Date: 2008-05-31 14:48:40 -0700 (Sat, 31 May 2008) Log Message: ----------- Fix typos. Modified Paths: -------------- trunk/AUTHORS trunk/README trunk/crossfire/ChangeLog trunk/crossfire/Developer_README.txt trunk/crossfire/INSTALL.txt trunk/crossfire/build.xml trunk/crossfire/resource/HelpFiles/guide.html trunk/crossfire/resource/HelpFiles/map_quests.html trunk/crossfire/resource/HelpFiles/map_start.html trunk/crossfire/resource/HelpFiles/treasure_multi.html trunk/crossfire/resource/HelpFiles/treasure_special.html trunk/crossfire/resource/HelpFiles/tut_copypaste.html trunk/crossfire/resource/HelpFiles/tut_loading.html trunk/crossfire/resource/HelpFiles/tut_mapattr.html trunk/crossfire/resource/HelpFiles/tut_pickmaps.html trunk/crossfire/resource/conf/types.xml trunk/crossfire/src/cfeditor/messages.properties trunk/daimonin/ChangeLog trunk/daimonin/INSTALL.txt trunk/daimonin/KNOWN_BUGS.txt trunk/daimonin/build.xml trunk/daimonin/resource/HelpFiles/faq.html trunk/daimonin/resource/HelpFiles/guide.html trunk/daimonin/resource/HelpFiles/treasure_multi.html trunk/daimonin/resource/HelpFiles/treasure_special.html trunk/daimonin/resource/HelpFiles/tut_DScript.html trunk/daimonin/resource/HelpFiles/tut_copypaste.html trunk/daimonin/resource/HelpFiles/tut_loading.html trunk/daimonin/resource/HelpFiles/tut_mapattr.html trunk/daimonin/resource/HelpFiles/tut_objects.html trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/overview.html trunk/resource/system/dtd/spells.dtd trunk/src/app/net/sf/gridarta/messages.properties trunk/src/doc/dev/codeStyle.xhtml trunk/src/doc/dev/howToHelp.xhtml trunk/src/doc/dev/todo.xhtml trunk/src/doc/dev/transactions.xhtml trunk/src/doc/dev/typeParameters.xhtml trunk/src/doc/hist/MergingEditors.xhtml trunk/src/doc/history.xhtml trunk/src/doc/news/2006-05-27_1.xhtml trunk/src/doc/subversion.xhtml trunk/src/screenshots/README Modified: trunk/AUTHORS =================================================================== --- trunk/AUTHORS 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/AUTHORS 2008-05-31 21:48:40 UTC (rev 4067) @@ -1,9 +1,9 @@ The following people have contributed to Gridarta: * Pasi Keränen - He created Gridder, out of which Michhael Tönnis created CFJavaEditor. + He created Gridder, out of which Michael Tönnies created CFJavaEditor. -* Michael Tönnis <in...@da...> +* Michael Tönnies <in...@da...> He created CFJavaEditor and DaimoninEditor. * Andreas Vogel <av...@us...> Modified: trunk/README =================================================================== --- trunk/README 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/README 2008-05-31 21:48:40 UTC (rev 4067) @@ -76,7 +76,7 @@ dest/ (generated) The directory containing generated files. -developer.proprties (optional) +developer.properties (optional) Optional file for changing default settings of the Ant build. You won't need to tweak this file for normal building. But if you want to set or override properties for build.xml, this is the place to put them. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/crossfire/ChangeLog 2008-05-31 21:48:40 UTC (rev 4067) @@ -10,7 +10,7 @@ 2008-05-22 Andreas Kirschbaum * Fix crash while collecting archetypes. From now on the collected - files are slighly smaller than the files produced by Crossfire's + files are slightly smaller than the files produced by Crossfire's collect script. 2008-05-17 Andreas Kirschbaum Modified: trunk/crossfire/Developer_README.txt =================================================================== --- trunk/crossfire/Developer_README.txt 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/crossfire/Developer_README.txt 2008-05-31 21:48:40 UTC (rev 4067) @@ -7,7 +7,7 @@ 1. The basic setup of the editor was done by Michael Toennies, derived from a basic editor-application called "Gridder" by Pasi Ker\x84nen. Then, I (Andreas Vogl) have added the countless features - neccessary to turn this application into a real useful CF map-editor. + necessary to turn this application into a real useful CF map-editor. We have both spent a lot of time on the editor (take a glimpse at the CHANGES.txt file), so please communicate with us, best through the cf-devel-mailing list, before considering any fundamental changes. @@ -55,11 +55,11 @@ I've spent a lot of extra-work to keep everything as fast and memory-efficient as possible. So, when you add new datafields or calculations in the archobject area, please make sure they are as - effiecient as possible and worth both the time and space they consume. + efficient as possible and worth both the time and space they consume. Now don't be afraid too much. No development would be possible without adding calculations and data at all. Just bear in mind - that, unlike for many other opensource projects, performance + that, unlike for many other open source projects, performance does make a difference for the CrossfireEditor. 4. The source package name is not java standard (being just "cfeditor"). @@ -92,7 +92,7 @@ "View"-classes should only manage the graphical layout and appearance of an object. "Controller"-classes should manage events and dataflow, concering that object. In a perfect world, - these three things would be totally seperated and you could + these three things would be totally separated and you could replace any of these parts without changing the others. I have yet never seen it realized perfectly, so feel proud when you just tried your best. Modified: trunk/crossfire/INSTALL.txt =================================================================== --- trunk/crossfire/INSTALL.txt 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/crossfire/INSTALL.txt 2008-05-31 21:48:40 UTC (rev 4067) @@ -18,12 +18,12 @@ How to build the CrossfireEditor from sources: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you have checked out the Gridarta sources from SVN, or -downloaded a "developer version", then you've got the java sources. -Now you can modify the java code, you can add classes, but please +downloaded a "developer version", then you've got the Java sources. +Now you can modify the Java code, you can add classes, but please don't move or rename any directories. When you find yourself in the position that you want to compile the -java sources for the editor, you need Apache Ant. Visit +Java sources for the editor, you need Apache Ant. Visit <http://ant.apache.org/> for more information about Ant. Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/crossfire/build.xml 2008-05-31 21:48:40 UTC (rev 4067) @@ -177,7 +177,7 @@ doctitle = "${targetName} Editor<br />API Documentation" header = "${targetName} Editor<br />API Documentation" footer = "${targetName} Editor<br />API Documentation" - bottom = "<div style="text-align:center;">© 2003 Andreas Vogl, Michael Toennis, 2004-2006 The ${targetName} Developers, 2006 The Gridarta Developers. All rights reserved.</div>" + bottom = "<div style="text-align:center;">© 2003 Andreas Vogl, Michael Toennies, 2004-2006 The ${targetName} Developers, 2006 The Gridarta Developers. All rights reserved.</div>" serialwarn = "yes" charset = "utf-8" docencoding = "utf-8" Modified: trunk/crossfire/resource/HelpFiles/guide.html =================================================================== --- trunk/crossfire/resource/HelpFiles/guide.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/crossfire/resource/HelpFiles/guide.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -54,7 +54,7 @@ <H2 align=center>Guidlines for creating artifacts:</H2> <UL> <LI><B>Don't rely on artifacts to make your maps interesting for players.</B> - <LI>When you create a new artifact (weapon, armour, etc), <B>always keep an eye + <LI>When you create a new artifact (weapon, armor, etc), <B>always keep an eye on playbalance.</B> Powerful items must not be reachable without hard fighting AND questing. Look at other maps. Try to adopt the average taste of "difficulty". Make sure the artifact is always hard to get, not only for the first time. Modified: trunk/crossfire/resource/HelpFiles/map_quests.html =================================================================== --- trunk/crossfire/resource/HelpFiles/map_quests.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/crossfire/resource/HelpFiles/map_quests.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -12,7 +12,7 @@ gain experience and collect the loot. After a while though, this tends to get boring.</P> <P>Quests are like the "salt in the soup". When a player gets involved in a task -or plot which is more than just monster killing, that is a quest. Obvisouly +or plot which is more than just monster killing, that is a quest. Obviously quests are a must-have for any set of really good maps.</P> <P>So how does one create a good quest? - There's no easy answer to this Modified: trunk/crossfire/resource/HelpFiles/map_start.html =================================================================== --- trunk/crossfire/resource/HelpFiles/map_start.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/crossfire/resource/HelpFiles/map_start.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -52,7 +52,7 @@ can let your inspirations run free. Create a small quest, involving like two or three maps. It could be a small tower, a castle or a little island.</p> -<p>This time you can decide wether to create all-new maps or again replace +<p>This time you can decide whether to create all-new maps or again replace existing maps which are crappy. If you choose to add all-new maps, spend some time looking for a suitable place in the existing Crossfire world to link your maps in. Try to resist the temptation to link it to Scorn, unless it is a very @@ -62,7 +62,7 @@ an award-winning bestseller fantasy story (Save that one for later, hehe). You can choose a simple type of quest like: "fetch item A from monster B and bring it to place C in order to get a reward". Just try to create something with a -little bit of flavour. Maybe sprinkle a small bit of story with magic_mouths, +little bit of flavor. Maybe sprinkle a small bit of story with magic_mouths, books or NPCs.</p> <p>It is likely that already here you'll get to a point where you want to do @@ -73,7 +73,7 @@ <h2>Embarking on the big mapset</h2> <p>I recommend you work on a lot more small maps before you start working on a -big set. Don't start unless you feel you have already aquired a good deal of +big set. Don't start unless you feel you have already acquired a good deal of map-making experience. Then, think about the amount of work you can and want to tackle. If it's too much, ask a friend to help you, or simply cut down on your goals.</p> Modified: trunk/crossfire/resource/HelpFiles/treasure_multi.html =================================================================== --- trunk/crossfire/resource/HelpFiles/treasure_multi.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/crossfire/resource/HelpFiles/treasure_multi.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -10,7 +10,7 @@ <p>You can recognize this type of treasurelist by the icon: <img src="treasure_list.png" width="32" height="20" align="bottom" alt="[multi]">. -Such a treasurelist can produce muliple items from the list. Items with no +Such a treasurelist can produce multiple items from the list. Items with no chance set are always generated - others are only generated when they succeed a random-roll at the given chance.</p> @@ -18,12 +18,12 @@ <p>Look at the example below, the "giant" treasurelist:</p> -<p>Club, throwing skill and boulders will always be generated. Goldcoins have a +<p>Club, throwing skill and boulders will always be generated. Gold coins have a chance of 65% to be generated, and there is only a 10% chance that one item out of the giant_parts list is generated.</p> <p>Numbers like in "<b>80</b> goldcoin" indicate that if chance succeeds, a -stack of 1-80 goldcoins can appear.</p> +stack of 1-80 gold coins can appear.</p> <p><img src="treasure3.jpg" width="242" height="202" align="center" alt="Treasurelist 'giant'"></p> Modified: trunk/crossfire/resource/HelpFiles/treasure_special.html =================================================================== --- trunk/crossfire/resource/HelpFiles/treasure_special.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/crossfire/resource/HelpFiles/treasure_special.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -9,12 +9,12 @@ <h1>Special treasurelists</h1> <p>Some treasurelists are used for special purposes. These can be found in the -subfolders "God Intervention", "Dragon Player Evolution" and "Player Creation". +sub-folders "God Intervention", "Dragon Player Evolution" and "Player Creation". They cannot be used in maps.</p> <p>The "God Intervention" lists are of special importance. They define which bonuses the Crossfire gods donate to their worshippers. These lists are -traveresed from top to bottom and the grace_limit objects are only passed when +traversed from top to bottom and the grace_limit objects are only passed when the worshipping player has a certain amount of grace.</p> <p>Below you see the treasurelist of the god Gnarg (as of 24.10.2002, the list Modified: trunk/crossfire/resource/HelpFiles/tut_copypaste.html =================================================================== --- trunk/crossfire/resource/HelpFiles/tut_copypaste.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/crossfire/resource/HelpFiles/tut_copypaste.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -40,17 +40,17 @@ </p> <p> -(Note that multipart game objects will usually be copied only when their +(Note that multi-part game objects will usually be copied only when their "head"-tile is located within the selected area. Since the position of this -"head"-tile differs, expect some strange behaviour there.) +"head"-tile differs, expect some strange behavior there.) </p> <h2>Paste</h2> <p> The Paste command allows to dump the contents of the copy buffer onto the map. -First, select a square on the map to be the topleft corner of the pasted area. +First, select a square on the map to be the top-left corner of the pasted area. Anything which doesn't fit within the borders of the map will not get pasted. -Multipart game objects which would reach outside of the map borders, and be it +Multi-part game objects which would reach outside of the map borders, and be it only with their small toe, don't get pasted either. </P> Modified: trunk/crossfire/resource/HelpFiles/tut_loading.html =================================================================== --- trunk/crossfire/resource/HelpFiles/tut_loading.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/crossfire/resource/HelpFiles/tut_loading.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -41,7 +41,7 @@ package only to find out it takes three times longer to load?". Well, at some point during mapmaking you will probably want to modify an archetype, create new archetypes or new images. And for that task, you need to have the -individual archtypee files in extracted form. However, don't worry too much +individual archtype files in extracted form. However, don't worry too much about the loading time. You can collect the arches after modifying/adding what you want (see menu: "Resources->Collect Arches"). This will create new collected archives so you can both have your changes and load in short @@ -49,7 +49,7 @@ <H2>Maps</H2> -<P>Concerning maps: You don't neccessarily need to have the Crossfire maps. You +<P>Concerning maps: You don't necessarily need to have the Crossfire maps. You can just head off creating your own maps. Though, most likely you will notice that Crossfire mapmaking isn't all that easy, and you'll want to have working examples to look at. Besides, you will want to link your maps into the existing Modified: trunk/crossfire/resource/HelpFiles/tut_mapattr.html =================================================================== --- trunk/crossfire/resource/HelpFiles/tut_mapattr.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/crossfire/resource/HelpFiles/tut_mapattr.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -61,7 +61,7 @@ <p><b>Enter X, Y:</b> These values represent the location where players get inserted if entering through an exit that has no destination coordinates set. -Usage of this functionality is <b>not adviseable</b>. It might even happen that +Usage of this functionality is <b>not advisable</b>. It might even happen that these attributes get removed in future.</p> <p><b>Difficulty:</b> This value stores the map difficulty. If set to zero, the Modified: trunk/crossfire/resource/HelpFiles/tut_pickmaps.html =================================================================== --- trunk/crossfire/resource/HelpFiles/tut_pickmaps.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/crossfire/resource/HelpFiles/tut_pickmaps.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -48,7 +48,7 @@ for the active pickmap. When you save this map, the changes are reflected back into the pickmap.</p> -<p>It might be helpful to shape and modify your pickmaps, neverthless you might +<p>It might be helpful to shape and modify your pickmaps, nevertheless you might come to a point where you are quite satisfied with their look. In that case you might find it useful to "lock" them with menu command "Pickmaps->Lock All Pickmaps". This will disable any further changes to the pickmaps unless they Modified: trunk/crossfire/resource/conf/types.xml =================================================================== --- trunk/crossfire/resource/conf/types.xml 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/crossfire/resource/conf/types.xml 2008-05-31 21:48:40 UTC (rev 4067) @@ -378,7 +378,7 @@ <attribute arch="weight" editor="weight" type="int"> This value defines the object's weight in grams (1000g is 1kg). Objects with zero weight are not pickable for players. Still, set the "non-pickable"-flag - for explicitly non-pickable objects (hey, this is opensource.. you + for explicitly non-pickable objects (hey, this is open source.. you never know ;) ). </attribute> <attribute arch="value" editor="value" type="int"> @@ -1360,8 +1360,8 @@ detectors do not check the inventory of players/monsters. ]]> </description> <use><![CDATA[ - There is one major speciality about detectors: You can detect spells - blown over a detector! To deetect a lighting bolt for example, set + There is one major specialty about detectors: You can detect spells + blown over a detector! To detect a lighting bolt for example, set "slaying lighting" and "speed 1.0". In combination with spellcasting walls, this can be very useful for map-mechanisms. ]]> </use> @@ -3389,7 +3389,7 @@ monsters can be "frozen" while on top of movers so that they MUST move along a chain of them. <br><br> - Multisquare monsters can be moved as well, given + Multi-square monsters can be moved as well, given enough space. Movers are usually invisible. ]]> </description> <use><![CDATA[ @@ -3508,12 +3508,12 @@ </ignore> <description><![CDATA[ Pits are holes, transporting the player when he walks (and falls) into them. - A speciality about pits is that they don't transport the player to + A specialty about pits is that they don't transport the player to the exact destination, but within a two-square radius of the destination (never on blocked squares).<br> Optionally, pits can get closed and opened, similar to gates.<br><br> Monsters and items are affected by pits just as well as players. - Even multipart monsters can fall through them, given enough space. ]]> + Even multi-part monsters can fall through them, given enough space. ]]> </description> <use><![CDATA[ Pits can add interesting effects to your map. When using them, make @@ -4810,7 +4810,7 @@ they don't have, etc. A simple example of this would a horse. It doesn't let the player move anyplace he normally couldn't go, but lets him get there faster. Ships would be another case - the player normally can't move - accross water, but with a ship, he can.]]> + across water, but with a ship, he can.]]> </description> <attribute arch="move_type" editor="move type" type="bitmask_movement"> The move type the transport uses. @@ -4858,7 +4858,7 @@ </attribute> <attribute arch="anim_full" editor="animation full" type="string"> It may be desirable to have different animations to denote what the - transsport looks like if someone is on it vs. not (mounted horse vs. just a + transport looks like if someone is on it vs. not (mounted horse vs. just a horse). This is used to denote what it will look like when loaded. If the transport becomes empty, it will fall back to the archetype animation. </attribute> Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/crossfire/src/cfeditor/messages.properties 2008-05-31 21:48:40 UTC (rev 4067) @@ -33,7 +33,7 @@ overwriteOtherFile.message=A file named "{0}" already exists.\n\nReally overwrite it? mapOutOfMemory.title=Out of memory -mapOutOfMemory.message=<html>Not enough memory available to open the map {0}!<br>You can increase the memory limit by using the <code>-Xmx</code> runtime flag.<br>For example: <code>java -Xmx128m -jar DaimoninEditor.jar</code></html> +mapOutOfMemory.message=<html>Not enough memory available to open the map {0}!<br>You can increase the memory limit by using the <code>-Xmx</code> runtime flag.<br>For example: <code>java -Xmx128m -jar CrossfireEditor.jar</code></html> mapDirDoesntExist.title=Invalid map directory mapDirDoesntExist.message=The map directory "{0}" doesn''t exist.\nPlease select menu ''File->Options...'' and correct that. @@ -42,7 +42,7 @@ 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. +openFileWantedNoArches.message=There are currently no arches available!\nYou need to have arches loaded before opening a map. openFileLoadMap.title=Cannot open map openFileLoadMap.message=An I/O error occurred while loading {0}:\n{1} openFileOutOfMapBoundsDeleted.title=Loading mapfile {0} Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/daimonin/ChangeLog 2008-05-31 21:48:40 UTC (rev 4067) @@ -182,7 +182,7 @@ 2007-10-28 Andreas Kirschbaum - * Suppress spurious error message "Multipart expansion for a + * Suppress spurious error message "Multi-part expansion for a GameObject inside a container requested." when loading maps with multi-parts in inventories. Modified: trunk/daimonin/INSTALL.txt =================================================================== --- trunk/daimonin/INSTALL.txt 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/daimonin/INSTALL.txt 2008-05-31 21:48:40 UTC (rev 4067) @@ -33,26 +33,26 @@ How to build the DaimoninEditor from sources: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you have checked out the DaimoninEditor sources from SVN, or -downloaded a "developer version", then you've got the java sources. -Now you can modify the java code, you can add classes, but please +downloaded a "developer version", then you've got the Java sources. +Now you can modify the Java code, you can add classes, but please don't move or rename any directories. When you find yourself in the position that you want to compile -the java sources for the editor, you have mainly these options: +the Java sources for the editor, you have mainly these options: 1. Compile using Apache Ant. 2. Compile & Debug using NetBeans IDE. 3. Compile using one of the OS-specific build scripts. (There is no guarantee any of these works correctly.) (Keep in mind that the sources are UTF-8) -4. Compile "by hand" via commandline. +4. Compile "by hand" via command line. (Do not forget to add -encoding utf-8 for the Java compiler) KEEP IN MIND THAT DAIMONIN JAVA EDITOR SOURCES ARE ENCODED IN UTF-8! -I strongly recommed using Ant for compile and NetBeans for coding & compile. +I strongly recommend using Ant for compile and NetBeans for coding & compile. It works on any reasonable platform and comes even pre-installed on most -Linux/Unix systems today. NetBeans IDE is free avaible for personal use from +Linux/Unix systems today. NetBeans IDE is free available for personal use from Sun. (Michtoen) I strongly recommend the supplied buildfile and running Ant directly, either Modified: trunk/daimonin/KNOWN_BUGS.txt =================================================================== --- trunk/daimonin/KNOWN_BUGS.txt 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/daimonin/KNOWN_BUGS.txt 2008-05-31 21:48:40 UTC (rev 4067) @@ -6,7 +6,7 @@ Known Bugs ---------- -* Mantis 0000144: Add a check wether the Editor is correctly started (with daimonin/editor as current directory) +* Mantis 0000144: Add a check whether the Editor is correctly started (with daimonin/editor as current directory) * Mantis 0000137: Some new types in typenumbers.xml lack descriptions in types.xml * Mantis 0000135: Fill does not work on non-empty tiles * Mantis 0000122: Zoom feature should be integrated in normal map view Modified: trunk/daimonin/build.xml =================================================================== --- trunk/daimonin/build.xml 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/daimonin/build.xml 2008-05-31 21:48:40 UTC (rev 4067) @@ -185,7 +185,7 @@ doctitle = "${targetName} Editor<br />API Documentation" header = "${targetName} Editor<br />API Documentation" footer = "${targetName} Editor<br />API Documentation" - bottom = "<div style="text-align:center;">© 2003 Andreas Vogl, Michael Toennis, 2004-2006 The ${targetName} Developers, 2006 The Gridarta Developers. All rights reserved.</div>" + bottom = "<div style="text-align:center;">© 2003 Andreas Vogl, Michael Toennies, 2004-2006 The ${targetName} Developers, 2006 The Gridarta Developers. All rights reserved.</div>" serialwarn = "yes" charset = "utf-8" docencoding = "utf-8" Modified: trunk/daimonin/resource/HelpFiles/faq.html =================================================================== --- trunk/daimonin/resource/HelpFiles/faq.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/daimonin/resource/HelpFiles/faq.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -42,7 +42,7 @@ I'm only a student. I don't always have time, nor do I own that domain. So it certainly could happen that it is down sometimes or not perfectly up-to-date. </P> -<P>Another good (and the most relyable) source is Daimonin's CVS repository. Go to +<P>Another good (and the most reliable) source is Daimonin's CVS repository. Go to <http://sourceforge.net/projects/daimonin/> and try to figure out how to do an anonymous checkout. The package is called "CFJavaEditor". </P> @@ -68,7 +68,7 @@ <P><B>Whenever I start the JavaEditor, I get a bunch of errormessages concerning some missing font. What does that mean?</B></P> -<P>That appears to happen with several linux distributions. +<P>That appears to happen with several Linux distributions. The messages might be annoying, but it's completely harmless. Simply ignore it. If using Java SDK version 1.3, upgrading to 1.4 might resolve the problem and maybe even get you a better-looking default font. @@ -80,7 +80,7 @@ Now seriously, I'm sorry that this program requires a certain level of system performance - But I can't help it. I have invested big amounts of time to make everything run as fast as possible and with least -Memory consumtion. +Memory consumption. <br> </P> </BODY> Modified: trunk/daimonin/resource/HelpFiles/guide.html =================================================================== --- trunk/daimonin/resource/HelpFiles/guide.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/daimonin/resource/HelpFiles/guide.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -72,7 +72,7 @@ <H2 align=center>Guidlines for creating Artifacts:</H2> <UL> <LI><B>Don't rely on artifacts to make your maps interesting for players.</B> - <LI>When you create a new artifact (weapon, armour, etc), <B>always keep an eye + <LI>When you create a new artifact (weapon, armor, etc), <B>always keep an eye on playbalance.</B> Powerful items must NOT be reachable without hard fighting AND questing. Look at other maps. Try to adopt the average taste of "difficulty". Make sure the artifact is always hard to get, not only for the first time. Modified: trunk/daimonin/resource/HelpFiles/treasure_multi.html =================================================================== --- trunk/daimonin/resource/HelpFiles/treasure_multi.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/daimonin/resource/HelpFiles/treasure_multi.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -1,4 +1,4 @@ -<!-- +daimonin/<!-- ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. ~ Copyright (C) 2000-2007 The Gridarta Developers. ~ @@ -28,17 +28,17 @@ <H1 align=center>Treasurelists producing multiple items</H1> <P>You can recognize this type of treasurelist by the icon: <IMG SRC="treasure_list.png" WIDTH="32" HEIGHT="20" ALIGN="BOTTOM">. -Such a treasurelist can produce muliple items from the list. Objects with no chance set +Such a treasurelist can produce multiple items from the list. Objects with no chance set are always generated - Others are only generated when they succeed a random-roll at the given chance.</P> <P> Look at the example below, the "giant" treasurelist:<br> Club, throwing skill and boulders will always be generated. -Goldcoins have a chance of 65% to be generated, and there +Gold coins have a chance of 65% to be generated, and there is only a 10% chance that one item out of the giant_parts list is generated. Numbers like in "<b>80</b> goldcoin" indicate that if chance succeeds, -a stack of 1-80 goldcoins can appear.<br> +a stack of 1-80 gold coins can appear.<br> </P> <IMG SRC="treasure3.jpg" WIDTH="242" HEIGHT="202" ALIGN="CENTER"> <P> Modified: trunk/daimonin/resource/HelpFiles/treasure_special.html =================================================================== --- trunk/daimonin/resource/HelpFiles/treasure_special.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/daimonin/resource/HelpFiles/treasure_special.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -28,13 +28,13 @@ <H1 align=center>Special Treasurelists</H1> <P>Some treasurelists are used for special purposes. These can be found in -the subfolders "God Intervention", "Dragon Player Evolution" and "Player Creation". +the sub-folders "God Intervention", "Dragon Player Evolution" and "Player Creation". They cannot be used in maps. </P> <P> The "God Intervention" lists are of special importance. They define which bonuses the Daimonin gods donate to their worshippers. These lists are -traveresed from top to bottom and the grace_limit objects are only passed +traversed from top to bottom and the grace_limit objects are only passed when the worshipping player has a certain amount of grace. </P> <P> Modified: trunk/daimonin/resource/HelpFiles/tut_DScript.html =================================================================== --- trunk/daimonin/resource/HelpFiles/tut_DScript.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/daimonin/resource/HelpFiles/tut_DScript.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -48,9 +48,9 @@ <p>MatchString<br> ------------------------------------------------------------<br> Daimonin.MatchString(firststr,secondstr)<br> - Case insensitive string comparision. Returns 1 if the two<br> + Case insensitive string comparison. Returns 1 if the two<br> strings are the same, or 0 if they differ.<br> - secondstring can contain regular expressions.<br> + second string can contain regular expressions.<br> Parameter types:<br> string firststr<br> string secondstr<br> @@ -211,7 +211,7 @@ Status:<br> untested<br> TODO:<br> - do someting about the new modified coordinates too?</p> + do something about the new modified coordinates too?</p> <p>PlaySound<br> ------------------------------------------------------------<br> map.PlaySound(x, y, soundnumber, soundtype)<br> @@ -239,7 +239,7 @@ Status:<br> Tested<br> TODO:<br> - Add constants for colours</p> + Add constants for colors</p> <p>CreateObject<br> ------------------------------------------------------------<br> map.CreateObject(arch_name, x, y)<br> @@ -258,10 +258,10 @@ <p>GetSkill<br> ------------------------------------------------------------<br> object.GetSkill(type, id) <br> - This fucntion will fetch a skill or the exp of the skill<br> + This function will fetch a skill or the exp of the skill<br> Parameter types:<br> integer skill<br> - interger type<br> + integer type<br> Possible return types:<br> integer<br> Status:<br> @@ -269,7 +269,7 @@ <p>SetSkill<br> ------------------------------------------------------------<br> object.SetSkill(skillid,value) <br> - Sets objects's experience in the skill skillid as close to value<br> + Sets object's experience in the skill skillid as close to value<br> as permitted. There is currently a limit of 1/4 of a level.<br> There's no limit on exp reduction<br> FIXME overall experience is not changed (should it be?) <br> @@ -470,7 +470,7 @@ <p>GetAlignmentForce<br> ------------------------------------------------------------<br> object.GetAlignmentForce()<br> - This gets the aligment_force from a inventory (should be player?)<br> + This gets the alignment_force from a inventory (should be player?)<br> Parameter types:<br> Possible return types:<br> object<br> @@ -773,7 +773,7 @@ marked must be None for IDENTIFY_NORMAL and IDENTIFY_ALL<br> Parameter types:<br> object target<br> - speciall marked<br> + special marked<br> integer mode<br> Possible return types:<br> None<br> Modified: trunk/daimonin/resource/HelpFiles/tut_copypaste.html =================================================================== --- trunk/daimonin/resource/HelpFiles/tut_copypaste.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/daimonin/resource/HelpFiles/tut_copypaste.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -46,16 +46,16 @@ <P><B>Copy:</B><br> By activating the Copy-command, everything in the currently selected area is stored into the copy buffer. The map itself remains unchanged. <br> -(Note that multipart objects will usually be copied only when their +(Note that multi-part objects will usually be copied only when their "head"-tile is located within the selected area. Since the position of this -"head"-tile differs, expect some strange behaviour there.) +"head"-tile differs, expect some strange behavior there.) </P> <P><B>Paste:</B><br> The paste command allows to dump the contents of the copy buffer onto the map. -First, select a square on the map to be the topleft corner of the +First, select a square on the map to be the top-left corner of the pasted area. Anything which doesn't fit within the borders of the map -will not get pasted. Multipart objects which would reach outside of the map +will not get pasted. Multi-part objects which would reach outside of the map borders, and be it only with their small toe, don't get pasted either. </P> @@ -70,7 +70,7 @@ <LI> Select *one* empty square and hit fill: All empty squares adjacent to the selected one will get floodfilled. <LI> Select an area or a non-empty square: The currently selected - default arch will be inserted ontop of (or below) every square within the + default arch will be inserted on top of (or below) every square within the selected area. </ol> </P> Modified: trunk/daimonin/resource/HelpFiles/tut_loading.html =================================================================== --- trunk/daimonin/resource/HelpFiles/tut_loading.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/daimonin/resource/HelpFiles/tut_loading.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -52,12 +52,12 @@ only to find out it takes three times longer to load?". Well, at some point during mapmaking you will probably want to modify an arch, create new arches or new images. And for that task, you need to have the individual -arche files in extracted form. However, don't worry too much about the loading time. +arch files in extracted form. However, don't worry too much about the loading time. You can collect the arches after modifying/adding what you want (see menu: "Resources->Collect CF Arches"). This will create new collected archives so you can both have your changes and load in short time. </P><br> -<P>Concerning maps: You don't neccessarily need to have the Daimonin maps. +<P>Concerning maps: You don't necessarily need to have the Daimonin maps. You can just head off creating your own maps. Though, most likely you will notice that Daimonin mapmaking isn't all that easy, and you'll want to have working examples to look at. Besides, you will want to link your Modified: trunk/daimonin/resource/HelpFiles/tut_mapattr.html =================================================================== --- trunk/daimonin/resource/HelpFiles/tut_mapattr.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/daimonin/resource/HelpFiles/tut_mapattr.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -34,10 +34,10 @@ </P> <P><B>Map Text</B>: -This textfield is meant to contain the map creator's name (, evtl. email), +This text field is meant to contain the map creator's name (and email), and the date when the map was created or last modified. If you are planning to publish your maps on the net or get them into the official Daimonin -distribution then <B>please write your name into that textfield for +distribution then <B>please write your name into that text field for every map you create</B>. </P> @@ -88,7 +88,7 @@ </P> <P><B>Darkness</B>: -Light/darnkess of the map (overall). A value of -1 is default and the server will +Light/darkness of the map (overall). A value of -1 is default and the server will set this map to daylight (will be overruled by outdoor flag). A value of 0 means "no light" - absolute darkness. 1 means a bit light, 2 a bit more. Good values for dark caves are 2 or 3. 4 is a good "ambient" value. @@ -134,7 +134,7 @@ This flag is very special and important: Normally, when a player logs in to the game, he gets inserted at the place where he left. However, in many cases this is troublesome. Players can get -stuck and starve, or they could keep sitting in big treasurerooms. +stuck and starve, or they could keep sitting in big treasure rooms. Therefore, on maps with "Fixed Login", players always get inserted to the "Enter X/Y" coordinates if they log in AND the map has been reset since they last left. @@ -152,7 +152,7 @@ corpse of his body remains on the ground though. When another character manages to reach this corpse and revive it, the dead player comes back to life.</LI> <LI><B>Ultra Death</B>: This is like Permanent Death, with the small difference - that corpses decay and dissapear after a certain amount of time. That means the + that corpses decay and disappear after a certain amount of time. That means the time to revive a player is limited. If it doesn't happen in time, this unlucky player is deleted and there is no way to get him back to life EVER.</LI> <LI><B>Instant Death</B>: The ultimate challenge - When a player dies on this Modified: trunk/daimonin/resource/HelpFiles/tut_objects.html =================================================================== --- trunk/daimonin/resource/HelpFiles/tut_objects.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/daimonin/resource/HelpFiles/tut_objects.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -47,7 +47,7 @@ graphical user interface.<br> Keep in mind that the syntax definitions for this entire thing are written in well-readable XML. So if you notice that some attribute is wrong, - or missing, I strongly recommed you trying to edit the definitions file: "types.xml".<br><br> + or missing, I strongly recommend you trying to edit the definitions file: "types.xml".<br><br> <LI><b>Modify the archtext directly</b><br> <br> @@ -56,7 +56,7 @@ bottom-right corner).<br> But beware! You need to know exactly what you are doing there. If you do typos or set wrong values, you won't receive a warning. - Modifying the archtext directly is adviseable for more experienced + Modifying the archtext directly is advisable for more experienced map makers only. </ol> <br> Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/daimonin/src/daieditor/messages.properties 2008-05-31 21:48:40 UTC (rev 4067) @@ -113,7 +113,7 @@ 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. +openFileWantedNoArches.message=There are currently no arches available!\nYou need to have arches loaded before opening a map.\nLook into the online help on how to get Daimonin archfiles. openFileLoadMap.title=Cannot open map openFileLoadMap.message=An I/O error occurred while loading {0}:\n{1} openFileOutOfMapBoundsDeleted.title=Loading mapfile {0} Modified: trunk/daimonin/src/daieditor/overview.html =================================================================== --- trunk/daimonin/src/daieditor/overview.html 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/daimonin/src/daieditor/overview.html 2008-05-31 21:48:40 UTC (rev 4067) @@ -26,7 +26,7 @@ </head> <body> <p> - You are reading the Damonin Java Map Editor (short Daimonin Editor) API Documentation. + You are reading the Daimonin Java Map Editor (short Daimonin Editor) API Documentation. The Daimonin Editor is a Java program to create and modify maps for the MMORPG <a href="http://www.daimonin.net/">Daimonin MMORPG</a>. </p> <h3>UI Classes</h3> @@ -36,7 +36,7 @@ Most actions are delegated to {@link daieditor.CMainControl} upon performation. </p> <p> - Map Visualisation is done by {@link daieditor.CMapViewBasic}, which renders the map, and {@link daieditor.CMapViewIFrame}, which is + Map visualization is done by {@link daieditor.CMapViewBasic}, which renders the map, and {@link daieditor.CMapViewIFrame}, which is a JInternalFrame wrapping CMapViewBasic. </p> <h3>Data Model</h3> @@ -48,8 +48,8 @@ <dt id="Animation">Animation</dt> <dd> An Animation is a list of faces that defines the appearance of an Archetype in cases the appearance can change. - The number of Facings in an Animation defines how many different subanimations the animation contains. - Such a subanimation is for instance used to show the Archetype from different perspectives, depending on the direction (facing) of the + The number of Facings in an Animation defines how many different sub-animations the animation contains. + Such a sub-animation is for instance used to show the Archetype from different perspectives, depending on the direction (facing) of the Archetype. The number of Frames in an Animation defines the number of different faces used to display the Archetypes' appearance for a Facing. The Animations are not played by the Editor, @@ -76,7 +76,7 @@ Real Archetypes are objects in maps and each of them refers to a Default Archetype it is derived from. Each Real Archetype only stores the information that differs from its Default Archetype. <p /> - Additionally, an Archetype can be a socalled Artifact. + Additionally, an Archetype can be a so called Artifact. Artifacts are always read from a file named <code>arch/artifacts</code>. Currently, Artifacts are under migration. After the migration is finished, Artifacts are special "appliable" Archetypes. Modified: trunk/resource/system/dtd/spells.dtd =================================================================== --- trunk/resource/system/dtd/spells.dtd 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/resource/system/dtd/spells.dtd 2008-05-31 21:48:40 UTC (rev 4067) @@ -4,7 +4,7 @@ --> <!-- spells -- Containts: spell elements (any number) +- Contains: spell elements (any number) --> <!ELEMENT spells (spell*)> Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/src/app/net/sf/gridarta/messages.properties 2008-05-31 21:48:40 UTC (rev 4067) @@ -834,7 +834,7 @@ autoValidate.text=Automatically run validation after each change optionsValidators=Validators optionsCheckMaps.text=Analyse map files in file chooser -optionsCheckMaps.shortdescription=<html>When opening or attaching maps, there are 2 ways of filtering map files:<ul><li>Analysing maps takes longer but reliably filters out all non-map files.<li>Not analysing maps is extremely fast but tries to guess map files<br>as files that do not have a file ending, which can be wrong.</ul></html> +optionsCheckMaps.shortdescription=<html>When opening or attaching maps, there are 2 ways of filtering map files:<ul><li>Analyzing maps takes longer but reliably filters out all non-map files.<li>Not analyzing maps is extremely fast but tries to guess map files<br>as files that do not have a file ending, which can be wrong.</ul></html> optionsUser=Artist name for new maps Modified: trunk/src/doc/dev/codeStyle.xhtml =================================================================== --- trunk/src/doc/dev/codeStyle.xhtml 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/src/doc/dev/codeStyle.xhtml 2008-05-31 21:48:40 UTC (rev 4067) @@ -93,7 +93,7 @@ <dd> Operator assignments should be used wherever applicable because they are easier to read: It's faster to see and understand that the new variable value is based on a modification of the original value, not a completely new value. <br /> - Conditional operators are currently ignored because <code>foo |= bar();</code> is not the same as <code>foo = foo || bar();</code> because the behaviour regarding side-effects in <code>bar()</code> is changed. + Conditional operators are currently ignored because <code>foo |= bar();</code> is not the same as <code>foo = foo || bar();</code> because the behavior regarding side-effects in <code>bar()</code> is changed. </dd> <dt>Assignment to catch block parameter</dt> <dd> @@ -114,7 +114,7 @@ Pointless expressions that and with zero, or with zero or shift with zero most likely are logical errors. </dd> <dt>Shift operation by inappropriate constant</dt> - <dd> +evtl. <dd> Shifts with shift values out of range (0..31 for int, 0..63 for long) most likely are logical errors. </dd> </dl> @@ -124,17 +124,17 @@ <dl> <dt>'final' method in 'final' class</dt> <dd> - This is unneccessary and may be confusing. - Methods in final classes are always implicitely final. - A method should only be explicitely declared final if the context is "the class might be subclasses, but this method is not designed to be overridden". - Thus if a method in a final class is explicitely declared final, it may lead to the conclusion that the class was declared final by mistake. + This is unnecessary and may be confusing. + Methods in final classes are always implicitly final. + A method should only be explicitly declared final if the context is "the class might be subclasses, but this method is not designed to be overridden". + Thus if a method in a final class is explicitly declared final, it may lead to the conclusion that the class was declared final by mistake. </dd> <dt>Missing @Deprecated annotation</dt> <dd> - Makes sure that deprecated members that are documented as deprecated in Javadoc (<code>@deprecated</code> javadoc tag) are also annotated as <code>@Deprecated</code> in the source code. + Makes sure that deprecated members that are documented as deprecated in Javadoc (<code>@deprecated</code> Javadoc tag) are also annotated as <code>@Deprecated</code> in the source code. <br /> Background: - Future compiler versions (jdk 1.6 or jdk 1.7) might stop to parse javadoc comments. + Future compiler versions (JDK 1.6 or JDK 1.7) might stop to parse Javadoc comments. To get the deprecation information into the class file, the annotation must be used then. Also, deprecation information might only be fully reflective on 1.5 or later if it was declared with the annotation. </dd> @@ -151,13 +151,13 @@ </dd> <dt>'private' method declared 'final'</dt> <dd> - Private methods are implicitely final. - Explicitely declaring them final looks like the method should be public or protected instead. + Private methods are implicitly final. + Explicitly declaring them final looks like the method should be public or protected instead. </dd> <dt>'protected' member in 'final' class</dt> <dd> - Final classes cannot be subclassed. - Protected members are explicitely visible for subclasses. + Final classes cannot be sub-classed. + Protected members are explicitly visible for subclasses. Because of that, protected members in final classes are an oxymoron that indicates an error. </dd> <dt>'public' constructor in non-public class</dt> @@ -178,7 +178,7 @@ <li> Finalization issues <dl> - <dt>'finalize()' called explicitely</dt> + <dt>'finalize()' called explicitly</dt> <dd>finalize() must only be called by the garbage collector, but not application software.</dd> <dt>'finalize()' does not call 'super.finalize()'</dt> <dd>This always is an error as this prevents the superclass from performing its own finalization code.</dd> @@ -189,19 +189,19 @@ <li> General <dl> - <dt>Declaration has javadoc problems</dt> + <dt>Declaration has Javadoc problems</dt> <dd> - Makes sure that a javadoc comment that is present also has a certain level of technical quality. + Makes sure that a Javadoc comment that is present also has a certain level of technical quality. Currently the following omissions are treated as errors: <code>@author</code> for top level classes, periods in briefs, <code>@return</code> for methods, <code>@param</code> and <code>ŧrhwos</code> or <code>@exception</code> for methods and constructors. - Unknown javadoc tags are also reported (<code>@note</code> and similar extension tags are known to this inspection and won't cause false positives). + Unknown Javadoc tags are also reported (<code>@note</code> and similar extension tags are known to this inspection and won't cause false positives). <br /> Though it would be possible to ignore deprecated elements, they're not. Even if an element is deprecated, it must still be documented properly and without errors. </dd> - <dt>Declaration has problems in javadoc references</dt> + <dt>Declaration has problems in Javadoc references</dt> <dd> - Makes sure that references in javadoc comments (<code>{@link ...}</code> and eventually <code>@see ...</code>) can be resolved. + Makes sure that references in Javadoc comments (<code>{@link ...}</code> and eventually <code>@see ...</code>) can be resolved. </dd> <dt>equals() and hashCode() not paired</dt> <dd> Modified: trunk/src/doc/dev/howToHelp.xhtml =================================================================== --- trunk/src/doc/dev/howToHelp.xhtml 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/src/doc/dev/howToHelp.xhtml 2008-05-31 21:48:40 UTC (rev 4067) @@ -43,7 +43,7 @@ </ul> <h3>Useful information for developers</h3> <ul> - <li><a href="http://www.daimonin.net/modules.php?op=modload&name=phpWiki&file=index&pagename=Guide%20to%20the%20Editor%20Code">Daimonin Wiki: Guide to the Editor Code</a> (not neccessarily up to date)</li> + <li><a href="http://www.daimonin.net/modules.php?op=modload&name=phpWiki&file=index&pagename=Guide%20to%20the%20Editor%20Code">Daimonin Wiki: Guide to the Editor Code</a> (not necessarily up to date)</li> <li><a href="http://gridarta.sourceforge.net/">Gridarta Homepage</a></li> <li><a href="http://sourceforge.net/projects/gridarta/">Gridarta SF Project Homepage</a></li> <li><a href="http://gridarta.sourceforge.net/dev/">Gridarta Development Documentation</a> (part of Gridarta Homepage)</li> @@ -56,7 +56,7 @@ <li>Submit your first development steps as patches to the gridarta-devel list.</li> </ul> <p> - Once the existing Gridarta team sees that you're doing a good job and would be a valueable member of the Gridarta development team, you should give them your SF account information and they will add you as a member to the Gridarta SF team and get a Mantis developer account. + Once the existing Gridarta team sees that you're doing a good job and would be a valuable member of the Gridarta development team, you should give them your SF account information and they will add you as a member to the Gridarta SF team and get a Mantis developer account. You will then also receive an Open Source License key for IntelliJ IDEA, the IDE used by the Gridarta developers. </p> <h3>What you should know</h3> Modified: trunk/src/doc/dev/todo.xhtml =================================================================== --- trunk/src/doc/dev/todo.xhtml 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/src/doc/dev/todo.xhtml 2008-05-31 21:48:40 UTC (rev 4067) @@ -77,10 +77,10 @@ <li><a href="http://www.daimonin.net/mantis/view.php?id=256">Daimonin Mantis #0000256: Add preferences module for proxy configuration</a></li> <li><a href="http://www.daimonin.net/mantis/view.php?id=313">Daimonin Mantis #0000313: feature request: improving map editing ergonomy</a></li> <li><a href="http://www.daimonin.net/mantis/view.php?id=259">Daimonin Mantis #0000259: a small preview map for navigation</a></li> - <li><a href="http://www.daimonin.net/mantis/view.php?id=260">Daimonin Mantis #0000260: a hotkey for reloadig all graphics</a></li> + <li><a href="http://www.daimonin.net/mantis/view.php?id=260">Daimonin Mantis #0000260: a hotkey for reloading all graphics</a></li> <li><a href="http://www.daimonin.net/mantis/view.php?id=270">Daimonin Mantis #0000270: Show linked map tiles in edit window</a></li> <li><a href="http://www.daimonin.net/mantis/view.php?id=74">Daimonin Mantis #0000074: Unislash: Add paint below feature</a></li> - <li><a href="http://www.daimonin.net/mantis/view.php?id=178">Daimonin Mantis #0000178: Allow setting the background colour for created images (screenshots)</a></li> + <li><a href="http://www.daimonin.net/mantis/view.php?id=178">Daimonin Mantis #0000178: Allow setting the background color for created images (screenshots)</a></li> <li><a href="http://www.daimonin.net/mantis/view.php?id=70">Daimonin Mantis #0000070: Allow locking of tiles</a></li> </ul> </dd> Modified: trunk/src/doc/dev/transactions.xhtml =================================================================== --- trunk/src/doc/dev/transactions.xhtml 2008-05-29 22:45:50 UTC (rev 4066) +++ trunk/src/doc/dev/transactions.xhtml 2008-05-31 21:48:40 UTC (rev 4067) @@ -20,7 +20,7 @@ This was missing. </p> <p> - When adding the event listeners to the map MVC, the system might have run into the problem that for instance when deleting a whole selected region, an event would be fired for every single deleted object, resulting in bulky slow behaviour. + When adding the event listeners to the map MVC, the system might have run into the problem that for instance when deleting a ... [truncated message content] |
From: <aki...@us...> - 2008-06-03 21:09:42
|
Revision: 4068 http://gridarta.svn.sourceforge.net/gridarta/?rev=4068&view=rev Author: akirschbaum Date: 2008-06-03 14:09:33 -0700 (Tue, 03 Jun 2008) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/MapActions.java trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java trunk/daimonin/src/daieditor/io/MapArchObjectParser.java trunk/daimonin/src/daieditor/map/MapArchObject.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 Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-05-31 21:48:40 UTC (rev 4067) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-06-03 21:09:33 UTC (rev 4068) @@ -291,7 +291,7 @@ throw new MissingResourceException("GameObjectMatcher 'monster' does not exist", null, null); } final LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic> lockedItemsControl = new LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(getMapManager(), Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER); - final GameObjectAttributesPanel gameObjectAttributesPanel = new GameObjectAttributesPanel(this, getMapManager(), mainView, lockedItemsControl, monsterMatcher); + final GameObjectAttributesPanel gameObjectAttributesPanel = new GameObjectAttributesPanel(this, getMapManager(), mainView, lockedItemsControl, monsterMatcher); mainView.init(gameObjectAttributesPanel, selectedSquareControl.getSelectedSquareView(), typeList, mapTileListBottom, gameObjectMatchers); mapActions.updateMenuState(); scriptControl.getView().setMenu((JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "plugins")); @@ -498,6 +498,7 @@ /** Swing FileFilter for Python scripts. */ public static final FileFilter pythonFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.python"), ".py")); + /** {@inheritDoc} */ public GlobalSettingsImpl getGlobalSettings() { return globalSettings; } Modified: trunk/crossfire/src/cfeditor/MapActions.java =================================================================== --- trunk/crossfire/src/cfeditor/MapActions.java 2008-05-31 21:48:40 UTC (rev 4067) +++ trunk/crossfire/src/cfeditor/MapActions.java 2008-06-03 21:09:33 UTC (rev 4068) @@ -484,7 +484,7 @@ final GameObject cursorExit = mapView.getMapControl().getMapModel().getExit(mapView.getView().getMapCursor().getLocation()); if (cursorExit != null && exitMatcher.isMatching(cursorExit) && cursorExit.getAttributeString("slaying").length() > 0) { - return cursorExit; + return cursorExit.getHead(); } return null; Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2008-05-31 21:48:40 UTC (rev 4067) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2008-06-03 21:09:33 UTC (rev 4068) @@ -171,7 +171,6 @@ setToolTipText("dummy"); setFocusable(true); - borderOffset.setLocation(borderSize, borderSize); } Modified: trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2008-05-31 21:48:40 UTC (rev 4067) +++ trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2008-06-03 21:09:33 UTC (rev 4068) @@ -147,6 +147,7 @@ mapModel = mapControl.getMapModel(); mapSize = mapModel.getMapSize(); this.mapGrid = mapGrid; + setToolTipText("dummy"); setFocusable(true); resizeFromModel(); @@ -493,7 +494,6 @@ origin.x - (mapHeight - x) * IGUIConstants.TILE_ISO_XLEN2 - 1, origin.y + (mapHeight + x) * IGUIConstants.TILE_ISO_YLEN2 - 1); } - for (int y = 0; y <= mapHeight; y++) { grfx.drawLine(origin.x - y * IGUIConstants.TILE_ISO_XLEN2 - 1, origin.y + y * IGUIConstants.TILE_ISO_YLEN2 - 1, Modified: trunk/daimonin/src/daieditor/io/MapArchObjectParser.java =================================================================== --- trunk/daimonin/src/daieditor/io/MapArchObjectParser.java 2008-05-31 21:48:40 UTC (rev 4067) +++ trunk/daimonin/src/daieditor/io/MapArchObjectParser.java 2008-06-03 21:09:33 UTC (rev 4068) @@ -44,9 +44,7 @@ if (mapArchObject.getMapName().length() > 0) { format.format("name %s\n", mapArchObject.getMapName()); } - format.format("msg\n%s%sendmsg\n", mapArchObject.getText().trim(), "\n"); - format.format("width %d\n", mapArchObject.getMapSize().getWidth()); format.format("height %d\n", mapArchObject.getMapSize().getHeight()); if (mapArchObject.getEnterX() > 0) { @@ -73,7 +71,6 @@ if (mapArchObject.isOutdoor()) { appendable.append("outdoor 1\n"); } - if (mapArchObject.isNoSave()) { appendable.append("no_save 1\n"); } @@ -104,19 +101,16 @@ if (mapArchObject.isPvp()) { appendable.append("pvp 1\n"); } - for (int i = 0; i < MapArchObject.MAX_TILE; i++) { if (mapArchObject.getTilePath(i).length() > 0) { format.format("tile_path_%d %s\n", i + 1, mapArchObject.getTilePath(i)); } } - if (mapArchObject.getTilesetId() > 0) { format.format("tileset_id %d\n", mapArchObject.getTilesetId()); format.format("tileset_x %d\n", mapArchObject.getTilesetX()); format.format("tileset_y %d\n", mapArchObject.getTilesetY()); } - appendable.append("end\n"); } Modified: trunk/daimonin/src/daieditor/map/MapArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapArchObject.java 2008-05-31 21:48:40 UTC (rev 4067) +++ trunk/daimonin/src/daieditor/map/MapArchObject.java 2008-06-03 21:09:33 UTC (rev 4068) @@ -26,7 +26,7 @@ /** * MapArchObject contains the specific meta data about a map that is stored in - * the map-arch, at the very beginning of the map file. The map metadata is + * the map-arch, at the very beginning of the map file. The map meta data is * information like mapSize, difficulty level, darkness etc.). * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2008-05-31 21:48:40 UTC (rev 4067) +++ trunk/daimonin/src/daieditor/messages.properties 2008-06-03 21:09:33 UTC (rev 4068) @@ -476,6 +476,7 @@ aboutRuntimeProperties.title=Runtime properties aboutBuildProperties.title=Build properties + ############ # Map window @@ -536,7 +537,7 @@ faceObjectWithoutOriginalName=No originalName for {0}! logDuplicateAnimation=Duplicate Animation: {0} logInventoryInDefArch=Found inventory Object in def arch: {0} -logFoundCoordInDefArchSingleTileOrHead=Found {0} cmd in single tile or head (add it to arch text): {0} +logFoundCoordInDefArchSingleTileOrHead=Found {0} cmd in single tile or head (add it to arch text): {1} logDefArchWithZeroType=Archetype type number is zero: {0}. logDefArchWithInvalidTypeNr=Arch {0} has an invalid type nr: {1} logDefArchWithInvalidDirection=Arch {0} has an invalid direction: {1} Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2008-05-31 21:48:40 UTC (rev 4067) +++ trunk/daimonin/src/daieditor/messages_de.properties 2008-06-03 21:09:33 UTC (rev 4068) @@ -435,6 +435,7 @@ aboutRuntimeProperties.title=Laufzeitparameter #aboutBuildProperties.title= + ############ # Map window Modified: trunk/daimonin/src/daieditor/messages_fr.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_fr.properties 2008-05-31 21:48:40 UTC (rev 4067) +++ trunk/daimonin/src/daieditor/messages_fr.properties 2008-06-03 21:09:33 UTC (rev 4068) @@ -429,6 +429,7 @@ #aboutRuntimeProperties.title= #aboutBuildProperties.title= + ############ # Map window Modified: trunk/daimonin/src/daieditor/messages_sv.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_sv.properties 2008-05-31 21:48:40 UTC (rev 4067) +++ trunk/daimonin/src/daieditor/messages_sv.properties 2008-06-03 21:09:33 UTC (rev 4068) @@ -433,6 +433,7 @@ aboutRuntimeProperties.title=Runtime properties aboutBuildProperties.title=Build properties + ############ # Map window This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-06-03 21:15:25
|
Revision: 4070 http://gridarta.svn.sourceforge.net/gridarta/?rev=4070&view=rev Author: akirschbaum Date: 2008-06-03 14:15:30 -0700 (Tue, 03 Jun 2008) Log Message: ----------- Move fields to top of class. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java Modified: trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2008-06-03 21:12:29 UTC (rev 4069) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2008-06-03 21:15:30 UTC (rev 4070) @@ -52,6 +52,12 @@ /** Size of the image buffer. */ private static final int IMAGE_BUFFER_SIZE = 50 * 1024; + /** The Logger for printing log messages. */ + private static final Logger log = Logger.getLogger(FaceObjects.class); + + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); + /** The main control. */ @NotNull private final MainControl<?, ?, ?, ?> mainControl; @@ -73,12 +79,6 @@ // TODO } - /** The Logger for printing log messages. */ - private static final Logger log = Logger.getLogger(FaceObjects.class); - - /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); - /** * Adds a new face object. * @param faceName name of face, e.g. <samp>"robe.101"</samp> Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2008-06-03 21:12:29 UTC (rev 4069) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2008-06-03 21:15:30 UTC (rev 4070) @@ -53,6 +53,12 @@ */ public final class FaceObjects extends AbstractFaceObjects<FaceObject> { + /** The Logger for printing log messages. */ + private static final Logger log = Logger.getLogger(FaceObjects.class); + + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); + /** Grayscale filter to make grayscaled images. */ private static final ImageFilter GRAY_FILTER = new GrayFilter(false, 50); @@ -190,12 +196,6 @@ ((FilterFaceProvider) GRID).setParent(normal); } - /** The Logger for printing log messages. */ - private static final Logger log = Logger.getLogger(FaceObjects.class); - - /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); - /** * Adds a new face object. * @param faceName name of face, e.g. <samp>"robe.101"</samp> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-06-03 21:43:55
|
Revision: 4076 http://gridarta.svn.sourceforge.net/gridarta/?rev=4076&view=rev Author: akirschbaum Date: 2008-06-03 14:43:32 -0700 (Tue, 03 Jun 2008) Log Message: ----------- Move FaceObjects.contains() to ArrayUtils.contains(). Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/utils/ArrayUtils.java Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2008-06-03 21:34:42 UTC (rev 4075) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2008-06-03 21:43:32 UTC (rev 4076) @@ -42,6 +42,7 @@ import net.sf.gridarta.gameobject.face.DuplicateFaceException; import net.sf.gridarta.gameobject.face.FaceProvider; import net.sf.gridarta.gameobject.face.FilterFaceProvider; +import net.sf.gridarta.utils.ArrayUtils; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.misc.Progress; import org.apache.log4j.Logger; @@ -269,7 +270,7 @@ for (int offset = 0, length = data.length; offset < length;) { // File: Structure* // Structure: "IMAGE " seqnr ' ' size ' ' facename '\n' PNGBinary - if (!contains(data, offset, tag)) { // check for IMAGE + if (!ArrayUtils.contains(data, offset, tag)) { // check for IMAGE throw new IOException("Error in file daimonin.0"); } offset += 6; // skip "IMAGE "; @@ -305,28 +306,6 @@ } } - /** - * Helper method that checks whether a region in a byte array at a given offset contains the same as another byte array. - * It's used by loadAllDaimoninPNGFromCollect as a replacement for the C-function strncmp() (but invocation args are a bit different). - * @param src source byte array - * @param offset offset to start comparison - * @param search byte array containing the bytes to search - * @return <code>true</code> if the bytes in <code><var>src</var></code> starting at <code><var>offset</var></code> are the same as those in - * <code><var>search</var></code>, otherwise <code>false</code> - */ - private static boolean contains(final byte[] src, final int offset, final byte[] search) { - try { - for (int i = 0; i < search.length; i++) { - if (src[offset + i] != search[i]) { - return false; - } - } - return true; - } catch (final ArrayIndexOutOfBoundsException e) { - return false; - } - } - /** {@inheritDoc} */ @Override protected void collectImageFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException { final File dfile = new File(dir, IGUIConstants.PNG_FILE); Added: trunk/src/app/net/sf/gridarta/utils/ArrayUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/utils/ArrayUtils.java (rev 0) +++ trunk/src/app/net/sf/gridarta/utils/ArrayUtils.java 2008-06-03 21:43:32 UTC (rev 4076) @@ -0,0 +1,36 @@ +package net.sf.gridarta.utils; + +/** + * Utility class for array related functions. + * @author Andreas Kirschbaum + */ +public class ArrayUtils { + + /** + * Private constructor to prevent instantiation. + */ + private ArrayUtils() { + } + + /** + * Helper method that checks whether a region in a byte array at a given offset contains the same as another byte array. + * It's used by loadAllDaimoninPNGFromCollect as a replacement for the C-function strncmp() (but invocation args are a bit different). + * @param src source byte array + * @param offset offset to start comparison + * @param search byte array containing the bytes to search + * @return <code>true</code> if the bytes in <code><var>src</var></code> starting at <code><var>offset</var></code> are the same as those in + * <code><var>search</var></code>, otherwise <code>false</code> + */ + public static boolean contains(final byte[] src, final int offset, final byte[] search) { + try { + for (int i = 0; i < search.length; i++) { + if (src[offset + i] != search[i]) { + return false; + } + } + return true; + } catch (final ArrayIndexOutOfBoundsException e) { + return false; + } + } +} // class ArrayUtils Property changes on: trunk/src/app/net/sf/gridarta/utils/ArrayUtils.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-06-03 21:59:37
|
Revision: 4080 http://gridarta.svn.sourceforge.net/gridarta/?rev=4080&view=rev Author: akirschbaum Date: 2008-06-03 14:59:44 -0700 (Tue, 03 Jun 2008) Log Message: ----------- Whitespace changes. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java Modified: trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2008-06-03 21:58:01 UTC (rev 4079) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2008-06-03 21:59:44 UTC (rev 4080) @@ -244,7 +244,6 @@ int i = 0; for (final FaceObject faceObject : this) { final String path = faceObject.getActualFilename(); - try { final FileInputStream fin = new FileInputStream(path); try { Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2008-06-03 21:58:01 UTC (rev 4079) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2008-06-03 21:59:44 UTC (rev 4080) @@ -314,7 +314,6 @@ //noinspection ChannelOpenedButNotSafelyClosed final FileChannel outChannel = fout.getChannel(); final PrintStream binFile = new PrintStream(fout); - try { int i = 0; for (final FaceObject faceObject : this) { @@ -339,6 +338,7 @@ ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectErrorIOException", path, e); return; } + if (i++ % 100 == 0) { progress.setValue(i); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-06-04 06:30:43
|
Revision: 4087 http://gridarta.svn.sourceforge.net/gridarta/?rev=4087&view=rev Author: akirschbaum Date: 2008-06-03 23:30:51 -0700 (Tue, 03 Jun 2008) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java Modified: trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2008-06-04 06:24:49 UTC (rev 4086) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2008-06-04 06:30:51 UTC (rev 4087) @@ -110,7 +110,7 @@ final String baseDir = mainControl.getCollectedDirectory(); final byte[] data; final InputStream inputStream = IOUtils.createStream(baseDir, IGUIConstants.PNG_FILE); - final ByteArrayOutputStream bufOut = new ByteArrayOutputStream(); + final ByteArrayOutputStream bufOut = new ByteArrayOutputStream((int) faceFile.length()); try { final byte[] buf = new byte[65536]; for (;;) { Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2008-06-04 06:24:49 UTC (rev 4086) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2008-06-04 06:30:51 UTC (rev 4087) @@ -236,11 +236,10 @@ public void loadFacesCollection(final File faceFile, final File treeFile) throws IOException, FileNotFoundException, DuplicateFaceException { setNormal(new CollectedFaceProvider(faceFile)); final String actualFilename = faceFile.toString(); - byte[] data; - // open a bytestream to the resource file + final byte[] data; final FileInputStream inputStream = new FileInputStream(faceFile); + final ByteArrayOutputStream bufOut = new ByteArrayOutputStream((int) faceFile.length()); try { - final ByteArrayOutputStream bufOut = new ByteArrayOutputStream((int) faceFile.length()); final byte[] buf = new byte[4096]; for (;;) { final int len = inputStream.read(buf); @@ -249,10 +248,10 @@ } bufOut.write(buf, 0, len); } - data = bufOut.toByteArray(); } finally { inputStream.close(); } + data = bufOut.toByteArray(); // Note: treeIn might stay null, this is optional data. BufferedReader treeIn = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-06-04 18:16:16
|
Revision: 4094 http://gridarta.svn.sourceforge.net/gridarta/?rev=4094&view=rev Author: akirschbaum Date: 2008-06-04 11:15:14 -0700 (Wed, 04 Jun 2008) Log Message: ----------- Move ColourFilter to top-level class/to common code base. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gameobject/face/ColourFilter.java Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2008-06-04 10:53:07 UTC (rev 4093) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2008-06-04 18:15:14 UTC (rev 4094) @@ -40,6 +40,7 @@ import net.sf.gridarta.gameobject.face.AbstractFaceObjects; import net.sf.gridarta.gameobject.face.ArchFaceProvider; import net.sf.gridarta.gameobject.face.CollectedFaceProvider; +import net.sf.gridarta.gameobject.face.ColourFilter; import net.sf.gridarta.gameobject.face.DuplicateFaceException; import net.sf.gridarta.gameobject.face.FaceProvider; import net.sf.gridarta.gameobject.face.FilterFaceProvider; @@ -86,60 +87,6 @@ }; // GRID_FILTER - /** Class to filter images by simply applying a boolean OR operation. */ - private static final class ColourFilter extends RGBImageFilter { - - /** The positive mask to apply. */ - private final int positiveMask; - - /** The negative mask to apply. */ - private final int negativeMask; - - /** - * Create an ColourFilter. - * @param mask Mask to apply - */ - private ColourFilter(final int mask) { - positiveMask = mask & 0xFFFFFF; - negativeMask = ~mask & 0xFFFFFF; - } - - /** - * Converts a pixel by applying an or operation. - * {@inheritDoc} - */ - @Override public int filterRGB(final int x, final int y, final int rgb) { - final int alpha = rgb & 0xFF000000; - final float r = rgb >> 16 & 0xFF; - final float g = rgb >> 8 & 0xFF; - final float b = rgb & 0xFF; - int gray1 = (int) (0.66 * r + 0.66 * g + 0.66 * b); - int gray2 = gray1 - 256; - if (gray1 < 0) { - gray1 = 0; - } - if (gray1 > 255) { - gray1 = 255; - } - if (gray2 < 0) { - gray2 = 0; - } - if (gray2 > 255) { - gray2 = 255; - } - gray1 = gray1 | gray1 << 8 | gray1 << 16; - gray2 = gray2 | gray2 << 8 | gray2 << 16; - - return alpha | gray1 & positiveMask | gray2 & negativeMask; - } - - /** {@inheritDoc} */ - @Override public Object clone() { - return super.clone(); - } - - } // class OrFilter - /** * The FaceProvider for normal faces. * Only read this, do not write this! Added: trunk/src/app/net/sf/gridarta/gameobject/face/ColourFilter.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/face/ColourFilter.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/face/ColourFilter.java 2008-06-04 18:15:14 UTC (rev 4094) @@ -0,0 +1,79 @@ +/* + * 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; + +import java.awt.image.RGBImageFilter; + +/** + * Class to filter images by simply applying a boolean OR operation. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public final class ColourFilter extends RGBImageFilter { + + /** The positive mask to apply. */ + private final int positiveMask; + + /** The negative mask to apply. */ + private final int negativeMask; + + /** + * Create an ColourFilter. + * @param mask Mask to apply + */ + public ColourFilter(final int mask) { + positiveMask = mask & 0xFFFFFF; + negativeMask = ~mask & 0xFFFFFF; + } + + /** + * Converts a pixel by applying an or operation. + * {@inheritDoc} + */ + @Override public int filterRGB(final int x, final int y, final int rgb) { + final int alpha = rgb & 0xFF000000; + final float r = rgb >> 16 & 0xFF; + final float g = rgb >> 8 & 0xFF; + final float b = rgb & 0xFF; + int gray1 = (int) (0.66 * r + 0.66 * g + 0.66 * b); + int gray2 = gray1 - 256; + if (gray1 < 0) { + gray1 = 0; + } + if (gray1 > 255) { + gray1 = 255; + } + if (gray2 < 0) { + gray2 = 0; + } + if (gray2 > 255) { + gray2 = 255; + } + gray1 = gray1 | gray1 << 8 | gray1 << 16; + gray2 = gray2 | gray2 << 8 | gray2 << 16; + + return alpha | gray1 & positiveMask | gray2 & negativeMask; + } + + /** {@inheritDoc} */ + @Override public Object clone() { + return super.clone(); + } + +} // class ColourFilter Property changes on: trunk/src/app/net/sf/gridarta/gameobject/face/ColourFilter.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-06-04 18:29:10
|
Revision: 4095 http://gridarta.svn.sourceforge.net/gridarta/?rev=4095&view=rev Author: akirschbaum Date: 2008-06-04 11:29:08 -0700 (Wed, 04 Jun 2008) Log Message: ----------- Extract code from FaceObjects into FaceObjectProviders. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gameobject/face/FaceObjectProviders.java Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-06-04 18:15:14 UTC (rev 4094) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-06-04 18:29:08 UTC (rev 4095) @@ -62,6 +62,7 @@ import net.sf.gridarta.CommonConstants; import net.sf.gridarta.MainControl; import net.sf.gridarta.XmlHelper; +import net.sf.gridarta.gameobject.face.FaceObjectProviders; import net.sf.gridarta.gameobject.match.GameObjectMatcher; import net.sf.gridarta.gameobject.match.GameObjectMatchers; import net.sf.gridarta.gameobject.match.MutableOrGameObjectMatcher; @@ -942,7 +943,7 @@ /** {@inheritDoc} */ public void reloadFaces() { - FaceObjects.reloadAll(); + FaceObjectProviders.reloadAll(); } /** Invoked when user wants to exit from the program. */ Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2008-06-04 18:15:14 UTC (rev 4094) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2008-06-04 18:29:08 UTC (rev 4095) @@ -22,7 +22,6 @@ import daieditor.CMainControl; import daieditor.IGUIConstants; import daieditor.gameobject.anim.AnimationObjects; -import daieditor.gameobject.face.FaceObjects; import daieditor.map.MapArchObject; import java.io.BufferedReader; import java.io.BufferedWriter; @@ -44,6 +43,7 @@ import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import net.sf.gridarta.gameobject.face.ArchFaceProvider; import net.sf.gridarta.gameobject.face.DuplicateFaceException; +import net.sf.gridarta.gameobject.face.FaceObjectProviders; import net.sf.gridarta.gui.SystemIcons; import net.sf.gridarta.io.IOUtils; import net.sf.japi.swing.ActionFactory; @@ -103,7 +103,7 @@ return SystemIcons.getNofaceTileIcon(); } - final ImageIcon face = FaceObjects.normal.getImageIconForFacename(faceName); + final ImageIcon face = FaceObjectProviders.normal.getImageIconForFacename(faceName); if (face == null) { return SystemIcons.getUnknownTileIcon(); } @@ -142,7 +142,7 @@ return SystemIcons.getNofaceTileIcon(); } - final ImageIcon face = FaceObjects.ALPHA.getImageIconForFacename(faceName); + final ImageIcon face = FaceObjectProviders.ALPHA.getImageIconForFacename(faceName); if (face == null) { return SystemIcons.getUnknownTileIcon(); } @@ -161,7 +161,7 @@ loadArchFromCollected(archetypeParser, invObjects); // load arches & images from collection fname = IGUIConstants.ARCH_FILE; } else { - FaceObjects.setNormal(new ArchFaceProvider()); + FaceObjectProviders.setNormal(new ArchFaceProvider()); setLoadedFromArchive(false); // don't load from the collected files animFiles = new ArrayList<File>(); addPNGFace(new File(mainControl.getGlobalSettings().getArchDefaultFolder(), "dev/editor/bug.101.png").getAbsolutePath(), "bug.101.png"); @@ -442,7 +442,7 @@ */ private void addPNGFace(final String filename, final String name) { final String facename = generateFaceName(name); - ((ArchFaceProvider) FaceObjects.normal).addInfo(facename, filename); + ((ArchFaceProvider) FaceObjectProviders.normal).addInfo(facename, filename); final int stripPath = new File(mainControl.getCollectedDirectory()).getAbsolutePath().length(); try { mainControl.getFaceObjects().addFaceObject(facename, filename.substring(stripPath, filename.length() - 4).replace('\\', '/')); Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java 2008-06-04 18:15:14 UTC (rev 4094) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java 2008-06-04 18:29:08 UTC (rev 4095) @@ -19,12 +19,12 @@ package daieditor.gameobject.anim; -import daieditor.gameobject.face.FaceObjects; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.swing.ImageIcon; import net.sf.gridarta.gameobject.anim.AbstractAnimationObject; +import net.sf.gridarta.gameobject.face.FaceObjectProviders; import org.apache.log4j.Logger; /** @@ -86,7 +86,7 @@ /** {@inheritDoc} */ public ImageIcon getDisplayIcon() { - return FaceObjects.normal.getImageIconForFacename(getFirstFrame(getFacings() > 1 ? 1 : 0)); + return FaceObjectProviders.normal.getImageIconForFacename(getFirstFrame(getFacings() > 1 ? 1 : 0)); } /** Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java 2008-06-04 18:15:14 UTC (rev 4094) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java 2008-06-04 18:29:08 UTC (rev 4095) @@ -21,6 +21,7 @@ import javax.swing.ImageIcon; import net.sf.gridarta.gameobject.face.AbstractFaceObject; +import net.sf.gridarta.gameobject.face.FaceObjectProviders; import org.jetbrains.annotations.Nullable; /** @@ -90,7 +91,7 @@ /** {@inheritDoc} */ @Nullable public ImageIcon getDisplayIcon() { - return FaceObjects.normal.getImageIconForFacename(getFaceName()); + return FaceObjectProviders.normal.getImageIconForFacename(getFaceName()); } /** Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2008-06-04 18:15:14 UTC (rev 4094) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2008-06-04 18:29:08 UTC (rev 4095) @@ -21,8 +21,6 @@ import daieditor.IGUIConstants; import java.awt.Component; -import java.awt.image.ImageFilter; -import java.awt.image.RGBImageFilter; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; @@ -36,14 +34,11 @@ import java.io.OutputStreamWriter; import java.io.PrintStream; import java.nio.channels.FileChannel; -import javax.swing.GrayFilter; import net.sf.gridarta.gameobject.face.AbstractFaceObjects; import net.sf.gridarta.gameobject.face.ArchFaceProvider; import net.sf.gridarta.gameobject.face.CollectedFaceProvider; -import net.sf.gridarta.gameobject.face.ColourFilter; import net.sf.gridarta.gameobject.face.DuplicateFaceException; -import net.sf.gridarta.gameobject.face.FaceProvider; -import net.sf.gridarta.gameobject.face.FilterFaceProvider; +import net.sf.gridarta.gameobject.face.FaceObjectProviders; import net.sf.gridarta.utils.ArrayUtils; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.misc.Progress; @@ -62,56 +57,6 @@ /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); - /** Grayscale filter to make grayscaled images. */ - private static final ImageFilter GRAY_FILTER = new GrayFilter(false, 50); - - /** Red filter to make images red. */ - private static final ImageFilter RED_FILTER = new ColourFilter(0x00FF0000); - - /** Green filter to make images green. */ - private static final ImageFilter GREEN_FILTER = new ColourFilter(0x0000FF00); - - /** Blue filter to make images blue. */ - private static final ImageFilter BLUE_FILTER = new ColourFilter(0x000000FF); - - /** Transparency filter using a full alpha grid instead of alpha blending. */ - private static final ImageFilter GRID_FILTER = new RGBImageFilter() { - - /** - * Converts every second pixel by making it transparent. - * {@inheritDoc} - */ - @Override public int filterRGB(final int x, final int y, final int rgb) { - return (x + y) % 2 != 0 ? rgb : rgb & 0x00FFFFFF; - } - - }; // GRID_FILTER - - /** - * The FaceProvider for normal faces. - * Only read this, do not write this! - * Setting this provider must be done with setNormalProvider, otherwise all other providers will not work! - */ - public static FaceProvider normal; - - /** The FaceProvider for GRAY faces. */ - private static final FaceProvider GRAY = new FilterFaceProvider(GRAY_FILTER); - - /** The FaceProvider for red faces. */ - private static final FaceProvider RED = new FilterFaceProvider(RED_FILTER); - - /** The FaceProvider for green faces. */ - private static final FaceProvider GREEN = new FilterFaceProvider(GREEN_FILTER); - - /** The FaceProvider for blue faces. */ - private static final FaceProvider BLUE = new FilterFaceProvider(BLUE_FILTER); - - /** The FaceProvider for alpha faces. */ - public static final FaceProvider ALPHA = new FilterFaceProvider(ALPHA_FILTER); - - /** The FaceProvider for grid faces. */ - private static final FaceProvider GRID = new FilterFaceProvider(GRID_FILTER); - /** The parent component for error messages. */ @NotNull private final Component parent; @@ -123,29 +68,7 @@ this.parent = parent; } - /** Reloads all providers provided by this FaceObjects. */ - public static void reloadAll() { - for (final FaceProvider faceProvider : new FaceProvider[]{normal, GRAY, RED, GREEN, BLUE, ALPHA, GRID}) { - faceProvider.reload(); - } - } - /** - * Set the normal FaceProvider. - * The normal FaceProvider also serves as parent for all other FaceProviders. - * @param normal FaceProvider that provides normal images - */ - public static void setNormal(@NotNull final FaceProvider normal) { - FaceObjects.normal = normal; - ((FilterFaceProvider) GRAY).setParent(normal); - ((FilterFaceProvider) RED).setParent(normal); - ((FilterFaceProvider) GREEN).setParent(normal); - ((FilterFaceProvider) BLUE).setParent(normal); - ((FilterFaceProvider) ALPHA).setParent(normal); - ((FilterFaceProvider) GRID).setParent(normal); - } - - /** * Adds a new face object. * @param faceName name of face, e.g. <samp>"robe.101"</samp> * @param originalFilename original filename, e.g. <samp>"arch/objects/misc/robe.101.png"</samp> @@ -182,7 +105,7 @@ * @throws DuplicateFaceException in case a face was not unique */ public void loadFacesCollection(final File faceFile, final File treeFile) throws IOException, FileNotFoundException, DuplicateFaceException { - setNormal(new CollectedFaceProvider(faceFile)); + FaceObjectProviders.setNormal(new CollectedFaceProvider(faceFile)); final String actualFilename = faceFile.toString(); final byte[] data; final InputStream inputStream = new FileInputStream(faceFile); @@ -248,7 +171,7 @@ addFaceObject(faceName, originalFilename, actualFilename, offset, size); } } - ((CollectedFaceProvider) normal).addInfo(faceName, offset, size); // TODO Remove me + ((CollectedFaceProvider) FaceObjectProviders.normal).addInfo(faceName, offset, size); // TODO Remove me offset += size; } } finally { @@ -270,7 +193,7 @@ int i = 0; for (final FaceObject faceObject : this) { final String face = faceObject.getFaceName(); - final String path = ((ArchFaceProvider) normal).getFilename(face); + final String path = ((ArchFaceProvider) FaceObjectProviders.normal).getFilename(face); try { final FileInputStream fin = new FileInputStream(path); try { @@ -308,7 +231,7 @@ int i = 0; for (final FaceObject faceObject : this) { final String face = faceObject.getFaceName(); - final String path = ((ArchFaceProvider) normal).getFilename(face); + final String path = ((ArchFaceProvider) FaceObjectProviders.normal).getFilename(face); treeFile.append(path.substring(stripPath, path.length() - 4).replace('\\', '/')).append('\n'); if (i++ % 100 == 0) { progress.setValue(i); Added: trunk/src/app/net/sf/gridarta/gameobject/face/FaceObjectProviders.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/face/FaceObjectProviders.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/face/FaceObjectProviders.java 2008-06-04 18:29:08 UTC (rev 4095) @@ -0,0 +1,109 @@ +/* + * 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; + +import java.awt.image.ImageFilter; +import java.awt.image.RGBImageFilter; +import javax.swing.GrayFilter; +import org.jetbrains.annotations.NotNull; + +/** + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class FaceObjectProviders { + + /** Grayscale filter to make grayscaled images. */ + private static final ImageFilter GRAY_FILTER = new GrayFilter(false, 50); + + /** The FaceProvider for GRAY faces. */ + private static final FaceProvider GRAY = new FilterFaceProvider(GRAY_FILTER); + + /** Red filter to make images red. */ + private static final ImageFilter RED_FILTER = new ColourFilter(0x00FF0000); + + /** The FaceProvider for red faces. */ + private static final FaceProvider RED = new FilterFaceProvider(RED_FILTER); + + /** Green filter to make images green. */ + private static final ImageFilter GREEN_FILTER = new ColourFilter(0x0000FF00); + + /** The FaceProvider for green faces. */ + private static final FaceProvider GREEN = new FilterFaceProvider(GREEN_FILTER); + + /** Blue filter to make images blue. */ + private static final ImageFilter BLUE_FILTER = new ColourFilter(0x000000FF); + + /** The FaceProvider for blue faces. */ + private static final FaceProvider BLUE = new FilterFaceProvider(BLUE_FILTER); + + /** Transparency filter using a full alpha grid instead of alpha blending. */ + private static final ImageFilter GRID_FILTER = new RGBImageFilter() { + + /** + * Converts every second pixel by making it transparent. + * {@inheritDoc} + */ + @Override public int filterRGB(final int x, final int y, final int rgb) { + return (x + y) % 2 != 0 ? rgb : rgb & 0x00FFFFFF; + } + + }; // GRID_FILTER + + /** The FaceProvider for grid faces. */ + private static final FaceProvider GRID = new FilterFaceProvider(GRID_FILTER); + + /** + * The FaceProvider for normal faces. + * Only read this, do not write this! + * Setting this provider must be done with setNormalProvider, otherwise all other providers will not work! + */ + public static FaceProvider normal; + + /** The FaceProvider for alpha faces. */ + public static final FaceProvider ALPHA = new FilterFaceProvider(AbstractFaceObjects.ALPHA_FILTER); + + /** + * Private constructor to prevent instantiation. + */ + private FaceObjectProviders() { + } + + /** Reloads all providers provided by this FaceObjects. */ + public static void reloadAll() { + for (final FaceProvider faceProvider : new FaceProvider[]{normal, GRAY, RED, GREEN, BLUE, ALPHA, GRID}) { + faceProvider.reload(); + } + } + + /** + * Set the normal FaceProvider. + * The normal FaceProvider also serves as parent for all other FaceProviders. + * @param normal FaceProvider that provides normal images + */ + public static void setNormal(@NotNull final FaceProvider normal) { + FaceObjectProviders.normal = normal; + ((FilterFaceProvider) GRAY).setParent(normal); + ((FilterFaceProvider) RED).setParent(normal); + ((FilterFaceProvider) GREEN).setParent(normal); + ((FilterFaceProvider) BLUE).setParent(normal); + ((FilterFaceProvider) ALPHA).setParent(normal); + ((FilterFaceProvider) GRID).setParent(normal); + } +} // class FaceObjectProviders Property changes on: trunk/src/app/net/sf/gridarta/gameobject/face/FaceObjectProviders.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-06-04 20:49:39
|
Revision: 4099 http://gridarta.svn.sourceforge.net/gridarta/?rev=4099&view=rev Author: akirschbaum Date: 2008-06-04 13:48:57 -0700 (Wed, 04 Jun 2008) Log Message: ----------- Move CPreview as MapPreview to common code base. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/action.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/action.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 Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/MapPreview.java Removed Paths: ------------- trunk/daimonin/src/daieditor/CPreview.java Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-06-04 20:35:37 UTC (rev 4098) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-06-04 20:48:57 UTC (rev 4099) @@ -73,6 +73,7 @@ import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.MapFileFilter; import net.sf.gridarta.gui.MapManagerActions; +import net.sf.gridarta.gui.MapPreview; import net.sf.gridarta.gui.RecentManager; import net.sf.gridarta.gui.SystemIcons; import net.sf.gridarta.gui.connectionview.LockedItemsControl; @@ -1024,7 +1025,7 @@ JOptionPane.showMessageDialog(mainView, "No map loaded! Please load a map!!", "Error", JOptionPane.ERROR_MESSAGE); return; } - new CPreview(getGridartaObjectsFactory().newSimpleLevelRenderer(currentMap.getMapModel(), archetypeSet).getFullImage()); + new MapPreview(getGridartaObjectsFactory().newSimpleLevelRenderer(currentMap.getMapModel(), archetypeSet).getFullImage()); } /** {@inheritDoc} */ Deleted: trunk/daimonin/src/daieditor/CPreview.java =================================================================== --- trunk/daimonin/src/daieditor/CPreview.java 2008-06-04 20:35:37 UTC (rev 4098) +++ trunk/daimonin/src/daieditor/CPreview.java 2008-06-04 20:48:57 UTC (rev 4099) @@ -1,315 +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; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.image.BufferedImage; -import java.awt.image.RenderedImage; -import java.io.File; -import java.io.IOException; -import javax.imageio.ImageIO; -import javax.swing.JComponent; -import javax.swing.JFileChooser; -import javax.swing.JFrame; -import javax.swing.JScrollPane; -import javax.swing.WindowConstants; -import net.sf.gridarta.AbstractMainControl; -import net.sf.japi.swing.ActionFactory; -import net.sf.japi.swing.ActionMethod; - -/** - * The map preview of the level editor. - * This allows the user to zoom in and out of the map. - * @author <a href="mailto:pli...@ho...">Peter Plischewsky</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo add user definable previews - * @todo add zoom increase, zoom decrease - */ -public final class CPreview extends JComponent { - - /** Serial Version UID. */ - private static final long serialVersionUID = 1L; - - /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); - - /** Original image. */ - private final Image original; - - /** Currently used algorithm. */ - private int algorithm = Image.SCALE_DEFAULT; - - /** Currently used width. */ - private int width; - - /** Currently used height. */ - private int height; - - /** Currently displayed image. */ - private Image image; - - /** Preview frame. */ - private final JFrame frame; - - /** - * Constructs the CPreview user interface. - * When image is not null - * it either increases or decreases the zoom. If m_Image is null - * the the program will wait for a zoom factor to be chosen. - * @param original Image to be displayed - */ - public CPreview(final Image original) { - this.original = original; - image = original; - width = image.getWidth(this); - height = image.getHeight(this); - rescale(); - setBackground(new Color(255, 255, 255, 0)); - frame = new JFrame("Daimonin Map Previewer"); - // WARNING: Do not set the icon. There's a bug that will prevent the frame from getting properly disposed. - // This code will be put back in as soon as sun fixes the setIconImage() bug in their java.awt.peer.FramePeer impl. - //ImageIcon icon = GUIUtils.getIcon(GUIConstants.APP_ICON); - //if (icon != null) { - // frame.setIconImage(icon.getImage()); - //} - frame.setJMenuBar(ACTION_FACTORY.createMenuBar(false, "zoomBar", this)); - final JScrollPane scroll = new JScrollPane(this); - scroll.setFocusable(true); - frame.add(scroll); - frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); - frame.pack(); - frame.setVisible(true); - } - - /** - * Zoom to 24x24. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - @ActionMethod public void zoom0() throws OutOfMemoryError { - setScale(48, 23); - } - - /** - * Zoom to 12.5%. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - @ActionMethod public void zoom12() throws OutOfMemoryError { - setScale(0.125); - } - - /** - * Zoom to 25%. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - @ActionMethod public void zoom25() throws OutOfMemoryError { - setScale(0.25); - } - - /** - * Zoom to 50%. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - @ActionMethod public void zoom50() throws OutOfMemoryError { - setScale(0.5); - } - - /** - * Zoom to 100%. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - @ActionMethod public void zoom100() throws OutOfMemoryError { - setScale(1.0); - } - - /** - * Zoom to 150%. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - @ActionMethod public void zoom150() throws OutOfMemoryError { - setScale(1.5); - } - - /** - * Zoom to 200%. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - @ActionMethod public void zoom200() throws OutOfMemoryError { - setScale(2.0); - } - - /** - * Zoom to 250%. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - @ActionMethod public void zoom250() throws OutOfMemoryError { - setScale(2.5); - } - - /** - * Zoom to 300%. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - @ActionMethod public void zoom300() throws OutOfMemoryError { - setScale(3.0); - } - - /** - * Zoom to 400%. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - @ActionMethod public void zoom400() throws OutOfMemoryError { - setScale(4.0); - } - - /** - * Zoom save. - * @throws IOException In case of I/O problems. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - @ActionMethod public void zoomSave() throws IOException, OutOfMemoryError { - final JFileChooser chooser = new JFileChooser(); - 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)) { - final RenderedImage img; - if (image instanceof RenderedImage) { - img = (RenderedImage) image; - } else { - final BufferedImage img2 = new BufferedImage(image.getWidth(this), image.getHeight(this), BufferedImage.TYPE_INT_ARGB); - paintComponent(img2.getGraphics()); - img = img2; - } - ImageIO.write(img, "png", file); - } - } - } - - /** - * Close the preview. - */ - @ActionMethod public void zoomClose() { - frame.dispose(); - } - - /** - * Zoom Algorithm: Default. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - @ActionMethod public void zoomAlgDefault() throws OutOfMemoryError { - setAlgorithm(Image.SCALE_DEFAULT); - } - - /** - * Zoom Algorithm: Fast. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - @ActionMethod public void zoomAlgFast() throws OutOfMemoryError { - setAlgorithm(Image.SCALE_FAST); - } - - /** - * Zoom Algorithm: Smooth. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - @ActionMethod public void zoomAlgSmooth() throws OutOfMemoryError { - setAlgorithm(Image.SCALE_SMOOTH); - } - - /** - * Zoom Algorithm: Replicate. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - @ActionMethod public void zoomAlgReplicate() throws OutOfMemoryError { - setAlgorithm(Image.SCALE_REPLICATE); - } - - /** - * Zoom Algorithm: Area Averaging. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - @ActionMethod public void zoomAlgAreaAveraging() throws OutOfMemoryError { - setAlgorithm(Image.SCALE_AREA_AVERAGING); - } - - /** - * Set the scale factor to be used for displaying the image. - * The viewport size is automatically updated. - * @param scale scale factor to be used - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - private void setScale(final double scale) throws OutOfMemoryError { - width = (int) (original.getWidth(this) * scale); - height = (int) (original.getHeight(this) * scale); - rescale(); - } - - /** - * Set the scale factor to a specific size. - * @param width width for scale - * @param height height for scale - */ - private void setScale(final int width, final int height) { - this.width = width; - this.height = height; - rescale(); - } - - /** - * Set the algorithm. - * @param algorithm algorithm for scale - */ - private void setAlgorithm(final int algorithm) { - this.algorithm = algorithm; - rescale(); - } - - /** - * Recalculate the image. - * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. - */ - private void rescale() throws OutOfMemoryError { - try { - image = original.getScaledInstance(width, height, algorithm); - } catch (final OutOfMemoryError e) { - image = original; - width = image.getWidth(this); - height = image.getHeight(this); - throw e; - } finally { - setPreferredSize(new Dimension(width, height)); - revalidate(); - if (image == original) { - // XXX somehow in this case no repainting is done, so we tell to do it. - repaint(); - } - } - } - - /** {@inheritDoc} */ - @Override public void paintComponent(final Graphics g) { - super.paintComponent(g); - g.drawImage(image, 0, 0, this); - } - -} // class CPreview Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2008-06-04 20:35:37 UTC (rev 4098) +++ trunk/daimonin/src/daieditor/action.properties 2008-06-04 20:48:57 UTC (rev 4099) @@ -50,12 +50,6 @@ mapwindowMap.menu=gridVisible enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize mapwindowCursor.menu=moveCursor - selectTile startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes -# Zoom -zoomBar.menubar=zoomMen zoomAlg -zoomMen.menu=zoom0 zoom12 zoom25 zoom50 - zoom100 - zoom150 zoom200 zoom250 zoom300 zoom400 - zoomSave - zoomClose - -zoomAlg.menu=zoomAlgDefault zoomAlgFast zoomAlgSmooth zoomAlgReplicate zoomAlgAreaAveraging - ########## # ToolBars main.toolbar=createNew open save saveAs - prevWindow nextWindow Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2008-06-04 20:35:37 UTC (rev 4098) +++ trunk/daimonin/src/daieditor/messages.properties 2008-06-04 20:48:57 UTC (rev 4099) @@ -24,82 +24,9 @@ mainWindow.title=Gridarta for Daimonin {0} -# Zoom -zoomMen.text=Zoom -zoomMen.mnemonic=Z -zoom0.text=special -zoom12.text=12.5% -zoom25.text=25% -zoom50.text=50% -zoom100.text=100% -zoom100.mnemonic=1 -zoom100.accel=ctrl pressed 1 -zoom150.text=150% -zoom200.text=200% -zoom250.text=250% -zoom300.text=300% -zoom400.text=400% -zoomSave.text=Save preview... -zoomSave.mnemonic=S -zoomSave.accel=ctrl pressed S -zoomClose.text=Close -zoomClose.mnemonic=C -zoomClose.accel=ctrl pressed W -zoomSaveException.title=Save zoom -zoomSave.exception.java.io.IOException.title=I/O Exception -zoomSave.exception.java.io.IOException.message=Error while saving:\n{0} -zoomSave.exception.java.lang.OutOfMemoryError.title=Out of Memory -zoomSave.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} -zoom0.exception.java.lang.OutOfMemoryError.title=Out of Memory -zoom0.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} -zoom12.exception.java.lang.OutOfMemoryError.title=Out of Memory -zoom12.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} -zoom25.exception.java.lang.OutOfMemoryError.title=Out of Memory -zoom25.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} -zoom50.exception.java.lang.OutOfMemoryError.title=Out of Memory -zoom50.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} -zoom100.exception.java.lang.OutOfMemoryError.title=Out of Memory -zoom100.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} -zoom150.exception.java.lang.OutOfMemoryError.title=Out of Memory -zoom150.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} -zoom200.exception.java.lang.OutOfMemoryError.title=Out of Memory -zoom200.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} -zoom250.exception.java.lang.OutOfMemoryError.title=Out of Memory -zoom250.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} -zoom300.exception.java.lang.OutOfMemoryError.title=Out of Memory -zoom300.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} -zoom400.exception.java.lang.OutOfMemoryError.title=Out of Memory -zoom400.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} - -zoomAlg.text=Zoom Algorithm -zoomAlg.mnemonic=A -zoomAlgDefault.text=Default -zoomAlgDefault.mnemonic=D -zoomAlgDefault.exception.java.lang.OutOfMemoryError.title=Out of Memory -zoomAlgDefault.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} -zoomAlgFast.text=Fast -zoomAlgFast.mnemonic=F -zoomAlgFast.exception.java.lang.OutOfMemoryError.title=Out of Memory -zoomAlgFast.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} -zoomAlgSmooth.text=Smooth -zoomAlgSmooth.mnemonic=S -zoomAlgSmooth.exception.java.lang.OutOfMemoryError.title=Out of Memory -zoomAlgSmooth.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} -zoomAlgReplicate.text=Replicate -zoomAlgReplicate.mnemonic=R -zoomAlgReplicate.exception.java.lang.OutOfMemoryError.title=Out of Memory -zoomAlgReplicate.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} -zoomAlgAreaAveraging.text=Area Averaging -zoomAlgAreaAveraging.mnemonic=A -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! -overwriteOtherFile.title=Overwrite file? -overwriteOtherFile.message=A file named "{0}" already exists.\n\nReally overwrite it? mapOutOfMemory.title=Out of memory mapOutOfMemory.message=<html>Not enough memory available to open the map {0}!<br>You can increase the memory limit by using the <code>-Xmx</code> runtime flag.<br>For example: <code>java -Xmx128m -jar DaimoninEditor.jar</code></html> Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2008-06-04 20:35:37 UTC (rev 4098) +++ trunk/daimonin/src/daieditor/messages_de.properties 2008-06-04 20:48:57 UTC (rev 4099) @@ -24,79 +24,9 @@ mainWindow.title=Gridarta f\xFCr Daimonin {0} -# Zoom -zoomMen.text=Vergr\xF6\xDFerung -zoomMen.mnemonic=V -zoom0.text=spezial -zoom12.text=12.5% -zoom25.text=25% -zoom50.text=50% -zoom100.text=100% -zoom100.mnemonic=1 -zoom150.text=150% -zoom200.text=200% -zoom250.text=250% -zoom300.text=300% -zoom400.text=400% -zoomSave.text=Vorschau speichern... -zoomSave.mnemonic=S -zoomClose.text=Schlie\xDFen -zoomClose.mnemonic=C -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? mapOutOfMemory.title=Kann Karte nicht \xF6ffnen mapOutOfMemory.message=Es ist nicht gen\xFCgend freier Speicher vorhanden, um die\nKarte {0} zu laden. Modified: trunk/daimonin/src/daieditor/messages_fr.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_fr.properties 2008-06-04 20:35:37 UTC (rev 4098) +++ trunk/daimonin/src/daieditor/messages_fr.properties 2008-06-04 20:48:57 UTC (rev 4099) @@ -24,79 +24,9 @@ application.name=Gridarta for Daimonin mainWindow.title=Gridarta for Daimonin {0} -# Zoom -#zoomMen.text= -#zoomMen.mnemonic= -#zoom0.text= -#zoom12.text= -#zoom25.text= -#zoom50.text= -#zoom100.text= -#zoom100.mnemonic= -#zoom150.text= -#zoom200.text= -#zoom250.text= -#zoom300.text= -#zoom400.text= -#zoomSave.text= -#zoomSave.mnemonic= -#zoomClose.text= -#zoomClose.mnemonic= -#zoomSaveException.title= -#zoomSave.exception.java.io.IOException.title= -#zoomSave.exception.java.io.IOException.message= -#zoomSave.exception.java.lang.OutOfMemoryError.title= -#zoomSave.exception.java.lang.OutOfMemoryError.message= -#zoom0.exception.java.lang.OutOfMemoryError.title= -#zoom0.exception.java.lang.OutOfMemoryError.message= -#zoom12.exception.java.lang.OutOfMemoryError.title= -#zoom12.exception.java.lang.OutOfMemoryError.message= -#zoom25.exception.java.lang.OutOfMemoryError.title= -#zoom25.exception.java.lang.OutOfMemoryError.message= -#zoom50.exception.java.lang.OutOfMemoryError.title= -#zoom50.exception.java.lang.OutOfMemoryError.message= -#zoom100.exception.java.lang.OutOfMemoryError.title= -#zoom100.exception.java.lang.OutOfMemoryError.message= -#zoom150.exception.java.lang.OutOfMemoryError.title= -#zoom150.exception.java.lang.OutOfMemoryError.message= -#zoom200.exception.java.lang.OutOfMemoryError.title= -#zoom200.exception.java.lang.OutOfMemoryError.message= -#zoom250.exception.java.lang.OutOfMemoryError.title= -#zoom250.exception.java.lang.OutOfMemoryError.message= -#zoom300.exception.java.lang.OutOfMemoryError.title= -#zoom300.exception.java.lang.OutOfMemoryError.message= -#zoom400.exception.java.lang.OutOfMemoryError.title= -#zoom400.exception.java.lang.OutOfMemoryError.message= - -#zoomAlg.text= -#zoomAlg.mnemonic= -#zoomAlgDefault.text= -#zoomAlgDefault.mnemonic= -#zoomAlgDefault.exception.java.lang.OutOfMemoryError.title= -#zoomAlgDefault.exception.java.lang.OutOfMemoryError.message= -#zoomAlgFast.text= -#zoomAlgFast.mnemonic= -#zoomAlgFast.exception.java.lang.OutOfMemoryError.title= -#zoomAlgFast.exception.java.lang.OutOfMemoryError.message= -#zoomAlgSmooth.text= -#zoomAlgSmooth.mnemonic= -#zoomAlgSmooth.exception.java.lang.OutOfMemoryError.title= -#zoomAlgSmooth.exception.java.lang.OutOfMemoryError.message= -#zoomAlgReplicate.text= -#zoomAlgReplicate.mnemonic= -#zoomAlgReplicate.exception.java.lang.OutOfMemoryError.title= -#zoomAlgReplicate.exception.java.lang.OutOfMemoryError.message= -#zoomAlgAreaAveraging.text= -#zoomAlgAreaAveraging.mnemonic= -#zoomAlgAreaAveraging.exception.java.lang.OutOfMemoryError.title= -#zoomAlgAreaAveraging.exception.java.lang.OutOfMemoryError.message= - - ########## # Dialogs warning=Attention! -#overwriteOtherFile.title= -overwriteOtherFile.message=Un fichier nomm\xE9 "{0}" existe d\xE9j\xE0.\n\nVoulez vous vraiment le remplacer? #mapOutOfMemory.title= #mapOutOfMemory.message= Modified: trunk/daimonin/src/daieditor/messages_sv.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_sv.properties 2008-06-04 20:35:37 UTC (rev 4098) +++ trunk/daimonin/src/daieditor/messages_sv.properties 2008-06-04 20:48:57 UTC (rev 4099) @@ -24,82 +24,9 @@ mainWindow.title=Gridarta for Daimonin {0} -# Zoom -zoomMen.text=Zoom -zoomMen.mnemonic=Z -zoom0.text=special -zoom12.text=12.5% -zoom25.text=25% -zoom50.text=50% -zoom100.text=100% -zoom100.mnemonic=1 -zoom150.text=150% -zoom200.text=200% -zoom250.text=250% -zoom300.text=300% -zoom400.text=400% -zoomSave.text=Spara f\xF6rhandsvisning... -zoomSave.mnemonic=S -zoomClose.text=Close -zoomClose.mnemonic=C -zoomSaveException.title=Spara zoom -#zoomSaveException.message=Kunde inte spara zoom. -#zoomSaveOutOfMem.title=Slut p\xE5 minne -#zoomSaveOutOfMem.message=Otillr\xE4ckligt minne f\xF6r att spara f\xF6rhandsvisning.\nF\xF6rs\xF6k att starta om med -Xmx128m eller -Xmx256m. -#zoomSave.exception.java.io.IOException.title= -#zoomSave.exception.java.io.IOException.message= -#zoomSave.exception.java.lang.OutOfMemoryError.title= -#zoomSave.exception.java.lang.OutOfMemoryError.message= -#zoom0.exception.java.lang.OutOfMemoryError.title= -#zoom0.exception.java.lang.OutOfMemoryError.message= -#zoom12.exception.java.lang.OutOfMemoryError.title= -#zoom12.exception.java.lang.OutOfMemoryError.message= -#zoom25.exception.java.lang.OutOfMemoryError.title= -#zoom25.exception.java.lang.OutOfMemoryError.message= -#zoom50.exception.java.lang.OutOfMemoryError.title= -#zoom50.exception.java.lang.OutOfMemoryError.message= -#zoom100.exception.java.lang.OutOfMemoryError.title= -#zoom100.exception.java.lang.OutOfMemoryError.message= -#zoom150.exception.java.lang.OutOfMemoryError.title= -#zoom150.exception.java.lang.OutOfMemoryError.message= -#zoom200.exception.java.lang.OutOfMemoryError.title= -#zoom200.exception.java.lang.OutOfMemoryError.message= -#zoom250.exception.java.lang.OutOfMemoryError.title= -#zoom250.exception.java.lang.OutOfMemoryError.message= -#zoom300.exception.java.lang.OutOfMemoryError.title= -#zoom300.exception.java.lang.OutOfMemoryError.message= -#zoom400.exception.java.lang.OutOfMemoryError.title= -#zoom400.exception.java.lang.OutOfMemoryError.message= - -zoomAlg.text=Zoomalgoritm -zoomAlg.mnemonic=A -zoomAlgDefault.text=Standard -zoomAlgDefault.mnemonic=D -#zoomAlgDefault.exception.java.lang.OutOfMemoryError.title= -#zoomAlgDefault.exception.java.lang.OutOfMemoryError.message= -zoomAlgFast.text=Snabb -zoomAlgFast.mnemonic=S -#zoomAlgFast.exception.java.lang.OutOfMemoryError.title= -#zoomAlgFast.exception.java.lang.OutOfMemoryError.message= -zoomAlgSmooth.text=J\xE4mn -zoomAlgSmooth.mnemonic=J -#zoomAlgSmooth.exception.java.lang.OutOfMemoryError.title= -#zoomAlgSmooth.exception.java.lang.OutOfMemoryError.message= -zoomAlgReplicate.text=Replikera -zoomAlgReplicate.mnemonic=R -#zoomAlgReplicate.exception.java.lang.OutOfMemoryError.title= -#zoomAlgReplicate.exception.java.lang.OutOfMemoryError.message= -zoomAlgAreaAveraging.text=Area Averaging -zoomAlgAreaAveraging.mnemonic=A -#zoomAlgAreaAveraging.exception.java.lang.OutOfMemoryError.title= -#zoomAlgAreaAveraging.exception.java.lang.OutOfMemoryError.message= - - ########## # Dialogs warning=Varning! -overwriteOtherFile.title=Skriv \xF6ver existerande fil? -overwriteOtherFile.message=En fil med namnet "{0}" existerar redan.\n\nVill du verkligen skriva \xF6ver den? mapOutOfMemory.title=Slut p\xE5 minne mapOutOfMemory.message=<html>Det finns inte tillr\xE4ckligt med minne f\xF6r att \xF6ppna kartan {0}!<br>Du kan h\xF6ja minnesgr\xE4nsen med <code>-Xmx</code> -flaggan.<br>Till exempel: <code>java -Xmx128m -jar DaimoninEditor.jar</code></html> Modified: trunk/src/app/net/sf/gridarta/action.properties =================================================================== --- trunk/src/app/net/sf/gridarta/action.properties 2008-06-04 20:35:37 UTC (rev 4098) +++ trunk/src/app/net/sf/gridarta/action.properties 2008-06-04 20:48:57 UTC (rev 4099) @@ -26,7 +26,6 @@ #this is empty but yet must be here. recent.menu= - save.icon=general/Save16 saveAs.icon=general/SaveAs16 @@ -50,7 +49,13 @@ revertPickmap.icon=general/Refresh16 pickmapFolders.menu= +# Zoom +zoomBar.menubar=zoomMen zoomAlg +zoomMen.menu=zoom0 zoom12 zoom25 zoom50 - zoom100 - zoom150 zoom200 zoom250 zoom300 zoom400 - zoomSave - zoomClose +zoomAlg.menu=zoomAlgDefault zoomAlgFast zoomAlgSmooth zoomAlgReplicate zoomAlgAreaAveraging + + ##################### # Script Editor Menu scriptEditMenu.menubar=scriptEditFile scriptEditEdit Copied: trunk/src/app/net/sf/gridarta/gui/MapPreview.java (from rev 4098, trunk/daimonin/src/daieditor/CPreview.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gui/MapPreview.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/MapPreview.java 2008-06-04 20:48:57 UTC (rev 4099) @@ -0,0 +1,315 @@ +/* + * 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.gui; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.awt.image.RenderedImage; +import java.io.File; +import java.io.IOException; +import javax.imageio.ImageIO; +import javax.swing.JComponent; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JScrollPane; +import javax.swing.WindowConstants; +import net.sf.gridarta.AbstractMainControl; +import net.sf.japi.swing.ActionFactory; +import net.sf.japi.swing.ActionMethod; + +/** + * The map preview of the level editor. + * This allows the user to zoom in and out of the map. + * @author <a href="mailto:pli...@ho...">Peter Plischewsky</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @todo add user definable previews + * @todo add zoom increase, zoom decrease + */ +public final class MapPreview extends JComponent { + + /** Serial Version UID. */ + private static final long serialVersionUID = 1L; + + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.gridarta"); + + /** Original image. */ + private final Image original; + + /** Currently used algorithm. */ + private int algorithm = Image.SCALE_DEFAULT; + + /** Currently used width. */ + private int width; + + /** Currently used height. */ + private int height; + + /** Currently displayed image. */ + private Image image; + + /** Preview frame. */ + private final JFrame frame; + + /** + * Constructs the CPreview user interface. + * When image is not null + * it either increases or decreases the zoom. If m_Image is null + * the the program will wait for a zoom factor to be chosen. + * @param original Image to be displayed + */ + public MapPreview(final Image original) { + this.original = original; + image = original; + width = image.getWidth(this); + height = image.getHeight(this); + rescale(); + setBackground(new Color(255, 255, 255, 0)); + frame = new JFrame("Map Previewer"); + // WARNING: Do not set the icon. There's a bug that will prevent the frame from getting properly disposed. + // This code will be put back in as soon as sun fixes the setIconImage() bug in their java.awt.peer.FramePeer impl. + //ImageIcon icon = GUIUtils.getIcon(GUIConstants.APP_ICON); + //if (icon != null) { + // frame.setIconImage(icon.getImage()); + //} + frame.setJMenuBar(ACTION_FACTORY.createMenuBar(false, "zoomBar", this)); + final JScrollPane scroll = new JScrollPane(this); + scroll.setFocusable(true); + frame.add(scroll); + frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + frame.pack(); + frame.setVisible(true); + } + + /** + * Zoom to 24x24. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + @ActionMethod public void zoom0() throws OutOfMemoryError { + setScale(48, 23); + } + + /** + * Zoom to 12.5%. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + @ActionMethod public void zoom12() throws OutOfMemoryError { + setScale(0.125); + } + + /** + * Zoom to 25%. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + @ActionMethod public void zoom25() throws OutOfMemoryError { + setScale(0.25); + } + + /** + * Zoom to 50%. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + @ActionMethod public void zoom50() throws OutOfMemoryError { + setScale(0.5); + } + + /** + * Zoom to 100%. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + @ActionMethod public void zoom100() throws OutOfMemoryError { + setScale(1.0); + } + + /** + * Zoom to 150%. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + @ActionMethod public void zoom150() throws OutOfMemoryError { + setScale(1.5); + } + + /** + * Zoom to 200%. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + @ActionMethod public void zoom200() throws OutOfMemoryError { + setScale(2.0); + } + + /** + * Zoom to 250%. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + @ActionMethod public void zoom250() throws OutOfMemoryError { + setScale(2.5); + } + + /** + * Zoom to 300%. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + @ActionMethod public void zoom300() throws OutOfMemoryError { + setScale(3.0); + } + + /** + * Zoom to 400%. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + @ActionMethod public void zoom400() throws OutOfMemoryError { + setScale(4.0); + } + + /** + * Zoom save. + * @throws IOException In case of I/O problems. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + @ActionMethod public void zoomSave() throws IOException, OutOfMemoryError { + final JFileChooser chooser = new JFileChooser(); + 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)) { + final RenderedImage img; + if (image instanceof RenderedImage) { + img = (RenderedImage) image; + } else { + final BufferedImage img2 = new BufferedImage(image.getWidth(this), image.getHeight(this), BufferedImage.TYPE_INT_ARGB); + paintComponent(img2.getGraphics()); + img = img2; + } + ImageIO.write(img, "png", file); + } + } + } + + /** + * Close the preview. + */ + @ActionMethod public void zoomClose() { + frame.dispose(); + } + + /** + * Zoom Algorithm: Default. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + @ActionMethod public void zoomAlgDefault() throws OutOfMemoryError { + setAlgorithm(Image.SCALE_DEFAULT); + } + + /** + * Zoom Algorithm: Fast. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + @ActionMethod public void zoomAlgFast() throws OutOfMemoryError { + setAlgorithm(Image.SCALE_FAST); + } + + /** + * Zoom Algorithm: Smooth. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + @ActionMethod public void zoomAlgSmooth() throws OutOfMemoryError { + setAlgorithm(Image.SCALE_SMOOTH); + } + + /** + * Zoom Algorithm: Replicate. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + @ActionMethod public void zoomAlgReplicate() throws OutOfMemoryError { + setAlgorithm(Image.SCALE_REPLICATE); + } + + /** + * Zoom Algorithm: Area Averaging. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + @ActionMethod public void zoomAlgAreaAveraging() throws OutOfMemoryError { + setAlgorithm(Image.SCALE_AREA_AVERAGING); + } + + /** + * Set the scale factor to be used for displaying the image. + * The viewport size is automatically updated. + * @param scale scale factor to be used + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + private void setScale(final double scale) throws OutOfMemoryError { + width = (int) (original.getWidth(this) * scale); + height = (int) (original.getHeight(this) * scale); + rescale(); + } + + /** + * Set the scale factor to a specific size. + * @param width width for scale + * @param height height for scale + */ + private void setScale(final int width, final int height) { + this.width = width; + this.height = height; + rescale(); + } + + /** + * Set the algorithm. + * @param algorithm algorithm for scale + */ + private void setAlgorithm(final int algorithm) { + this.algorithm = algorithm; + rescale(); + } + + /** + * Recalculate the image. + * @throws OutOfMemoryError In case this method runs out of memory, which really might happen, so callers are expected to handle this. + */ + private void rescale() throws OutOfMemoryError { + try { + image = original.getScaledInstance(width, height, algorithm); + } catch (final OutOfMemoryError e) { + image = original; + width = image.getWidth(this); + height = image.getHeight(this); + throw e; + } finally { + setPreferredSize(new Dimension(width, height)); + revalidate(); + if (image == original) { + // XXX somehow in this case no repainting is done, so we tell to do it. + repaint(); + } + } + } + + /** {@inheritDoc} */ + @Override public void paintComponent(final Graphics g) { + super.paintComponent(g); + g.drawImage(image, 0, 0, this); + } + +} // class MapPreview Property changes on: trunk/src/app/net/sf/gridarta/gui/MapPreview.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2008-06-04 20:35:37 UTC (rev 4098) +++ trunk/src/app/net/sf/gridarta/messages.properties 2008-06-04 20:48:57 UTC (rev 4099) @@ -98,7 +98,81 @@ saveAll.longdescription=Saves all opened maps +# Zoom +zoomMen.text=Zoom +zoomMen.mnemonic=Z +zoom0.text=special +zoom12.text=12.5% +zoom25.text=25% +zoom50.text=50% +zoom100.text=100% +zoom100.mnemonic=1 +zoom100.accel=ctrl pressed 1 +zoom150.text=150% +zoom200.text=200% +zoom250.text=250% +zoom300.text=300% +zoom400.text=400% +zoomSave.text=Save preview... +zoomSave.mnemonic=S +zoomSave.accel=ctrl pressed S +zoomClose.text=Close +zoomClose.mnemonic=C +zoomClose.accel=ctrl pressed W +zoomSaveException.title=Save zoom +zoomSave.exception.java.io.IOException.title=I/O Exception +zoomSave.exception.java.io.IOException.message=Error while saving:\n{0} +zoomSave.exception.java.lang.OutOfMemoryError.title=Out of Memory +zoomSave.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} +zoom0.exception.java.lang.OutOfMemoryError.title=Out of Memory +zoom0.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} +zoom12.exception.java.lang.OutOfMemoryError.title=Out of Memory +zoom12.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} +zoom25.exception.java.lang.OutOfMemoryError.title=Out of Memory +zoom25.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} +zoom50.exception.java.lang.OutOfMemoryError.title=Out of Memory +zoom50.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} +zoom100.exception.java.lang.OutOfMemoryError.title=Out of Memory +zoom100.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} +zoom150.exception.java.lang.OutOfMemoryError.title=Out of Memory +zoom150.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} +zoom200.exception.java.lang.OutOfMemoryError.title=Out of Memory +zoom200.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} +zoom250.exception.java.lang.OutOfMemoryError.title=Out of Memory +zoom250.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} +zoom300.exception.java.lang.OutOfMemoryError.title=Out of Memory +zoom300.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} +zoom400.exception.java.lang.OutOfMemoryError.title=Out of Memory +zoom400.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} + +zoomAlg.text=Zoom Algorithm +zoomAlg.mnemonic=A +zoomAlgDefault.text=Default +zoomAlgDefault.mnemonic=D +zoomAlgDefault.exception.java.lang.OutOfMemoryError.title=Out of Memory +zoomAlgDefault.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} +zoomAlgFast.text=Fast +zoomAlgFast.mnemonic=F +zoomAlgFast.exception.java.lang.OutOfMemoryError.title=Out of Memory +zoomAlgFast.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} +zoomAlgSmooth.text=Smooth +zoomAlgSmooth.mnemonic=S +zoomAlgSmooth.exception.java.lang.OutOfMemoryError.title=Out of Memory +zoomAlgSmooth.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} +zoomAlgReplicate.text=Replicate +zoomAlgReplicate.mnemonic=R +zoomAlgReplicate.exception.java.lang.OutOfMemoryError.title=Out of Memory +zoomAlgReplicate.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} +zoomAlgAreaAveraging.text=Area Averaging +zoomAlgAreaAveraging.mnemonic=A +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 +overwriteOtherFile.title=Overwrite file? +overwriteOtherFile.message=A file named "{0}" already exists.\n\nReally overwrite it? + mkdirIOError.title=Cannot Create Directory mkdirIOError.message=Cannot create the directory:\n{0} Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2008-06-04 20:35:37 UTC (rev 4098) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2008-06-04 20:48:57 UTC (rev 4099) @@ -86,7 +86,78 @@ saveAll.longdescription=Speichert alle ge\xF6ffneten Karten. +# Zoom +zoomMen.text=Vergr\xF6\xDFerung +zoomMen.mnemonic=V +zoom0.text=spezial +zoom12.text=12.5% +zoom25.text=25% +zoom50.text=50% +zoom100.text=100% +zoom100.mnemonic=1 +zoom150.text=150% +zoom200.text=200% +zoom250.text=250% +zoom300.text=300% +zoom400.text=400% +zoomSave.text=Vorschau speichern... +zoomSave.mnemonic=S +zoomClose.text=Schlie\xDFen +zoomClose.mnemonic=C +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 +overwriteOtherFile.title=Datei \xFCberschreiben? +overwriteOtherFile.message=Eine Datei mit Namen "{0}" existiert bereits.\n\nWirklich \xFCberschreiben? + mkdirIOError.title=Kann Verzeichnis nicht anlegen mkdirIOError.message=Kann Verzeichnis nicht anlegen:\n{0} Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2008-06-04 20:35:37 UTC (rev 4098) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2008-06-04 20:48:57 UTC (rev 4099) @@ -85,7 +85,78 @@ #saveAll.longdescription= +# Zoom +#zoomMen.text= +#zoomMen.mnemonic= +#zoom0.text= +#zoom12.text= +#zoom25.text= +#zoom50.text= +#zoom100.text= +#zoom100.mnemonic= +#zoom150.text= +#zoom200.text= +#zoom250.text= +#zoom300.text= +#zoom400.text= +#zoomSave.text= +#zoomSave.mnemonic= +#zoomClose.text= +#zoomClose.mnemonic= +#zoomSaveException.title= +#zoomSave.exception.java.io.IOException.title= +#zoomSave.exception.java.io.IOException.message= +#zoomSave.exception.java.lang.OutOfMemoryError.title= +#zoomSave.exception.java.lang.OutOfMemoryError.message= +#zoom0.exception.java.lang.OutOfMemoryError.title= +#zoom0.exception.java.lang.OutOfMemoryError.message= +#zoom12.exception.java.lang.OutOfMemoryError.title= +#zoom12.exception.java.lang.OutOfMemoryError.message= +#zoom25.exception.java.lang.OutOfMemoryError.title= +#zoom25.exception.java.lang.OutOfMemoryError.message= +#zoom50.exception.java.lang.OutOfMemoryError.title= +#zoom50.exception.java.lang.OutOfMemoryError.message= +#zoom100.exception.java.lang.OutOfMemoryError.title= +#zoom100.exception.java.lang.OutOfMemoryError.message= +#zoom150.exception.java.lang.OutOfMemoryError.title= +#zoom150.exception.java.lang.OutOfMemoryError.message= +#zoom200.exception.java.lang.OutOfMemoryError.title= +#zoom200.exception.java.lang.OutOfMemoryError.message= +#zoom250.exception.java.lang.OutOfMemoryError.title= +#zoom250.exception.java.lang.OutOfMemoryError.message= +#zoom300.exception.java.lang.OutOfMemoryError.title= +#zoom300.exception.java.lang.OutOfMemoryError.message= +#zoom400.exception.java.lang.OutOfMemoryError.title= +#zoom400.exception.java.lang.OutOfMemoryError.message= + +#zoomAlg.text= +#zoomAlg.mnemonic= +#zoomAlgDefault.text= +#zoomAlgDefault.mnemonic= +#zoomAlgDefault.exception.java.lang.OutOfMemoryError.title= +#zoomAlgDefault.exception.java.lang.OutOfMemoryError.message= +#zoomAlgFast.text= +#zoomAlgFast.mnemonic= +#zoomAlgFast.exception.java.lang.OutOfMemoryError.title= +#zoomAlgFast.exception.java.lang.OutOfMemoryError.message= +#zoomAlgSmooth.text= +#zoomAlgSmooth.mnemonic= +#zoomAlgSmooth.exception.java.lang.OutOfMemoryError.title= +#zoomAlgSmooth.exception.java.lang.OutOfMemoryError.message= +#zoomAlgReplicate.text= +#zoomAlgReplicate.mnemonic= +#zoomAlgReplicate.exception.java.lang.OutOfMemoryError.title= +#zoomAlgReplicate.exception.java.lang.OutOfMemoryError.message= +#zoomAlgAreaAveraging.text= +#zoomAlgAreaAveraging.mnemonic= +#zoomAlgAreaAveraging.exception.java.lang.OutOfMemoryError.title= +#zoomAlgAreaAveraging.exception.java.lang.OutOfMemoryError.message= + + # Dialogs +#overwriteOtherFile.title= +overwriteOtherFile.message=Un fichier nomm\xE9 "{0}" existe d\xE9j\xE0.\n\nVoulez vous vraiment le remplacer? + #mkdirIOError.title= #mkdirIOError.message= Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2008-06-04 20:35:37 UTC (rev 4098) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2008-06-04 20:48:57 UTC (rev 4099) @@ -85,7 +85,81 @@ #saveAll.longdescription= +# Zoom +zoomMen.text=Zoom +zoomMen.mnemonic=Z +zoom0.text=special +zoom12.text=12.5% +zoom25.text=25% +zoom50.text=50% +zoom100.text=100% +zoom100.mnemonic=1 +zoom150.text=150% +zoom200.text=200% +zoom250.text=250% +zoom300.text=300% +zoom400.text=400% +zoomSave.text=Spara f\xF6rhandsvisning... +zoomSave.mnemonic=S +zoomClose.text=Close +zoomClose.mnemonic=C +zoomSaveException.title=Spara zoom +#zoomSaveException.message=Kunde inte spara zoom. +#zoomSaveOutOfMem.title=Slut p\xE5 minne +#zoomSaveOutOfMem.message=Otillr\xE4ckligt minne f\xF6r att spara f\xF6rhandsvisning.\nF\xF6rs\xF6k att starta om med -Xmx128m eller -Xmx256m. +#zoomSave.exception.java.io.IOException.title= +#zoomSave.exception.java.io.IOException.message= +#zoomSave.exception.java.lang.OutOfMemoryError.title= +#zoomSave.exception.java.lang.OutOfMemoryError.message= +#zoom0.exception.java.lang.OutOfMemoryError.title= +#zoom0.exception.java.lang.OutOfMemoryError.message= +#zoom12.exception.java.lang.OutOfMemoryError.title= +#zoom12.exception.java.lang.OutOfMemoryError.message= +#zoom25.exception.java.lang.OutOfMemoryError.title= +#zoom25.exception.java.lang.OutOfMemoryError.message= +#zoom50.exception.java.lang.OutOfMemoryError.title= +#zoom50.exception.java.lang.OutOfMemoryError.message= +#zoom100.exception.java.lang.OutOfMemoryError.title= +#zoom100.exception.java.lang.OutOfMemoryError.message= +#zoom150.exception.java.lang.OutOfMemoryError.title= +#zoom150.exception.java.lang.OutOfMemoryError.message= +#zoom200.exception.java.lang.OutOfMemoryError.title= +#zoom200.exception.java.lang.OutOfMemoryError.message= +#zoom250.exception.java.lang.OutOfMemoryError.title= +#zoom250.exception.java.lang.OutOfMemoryError.message= +#zoom300.exception.java.lang.OutOfMemoryError.title= +#zoom300.exception.java.lang.OutOfMemoryError.message= +#zoom400.exception.java.lang.OutOfMemoryError.title= +#zoom400.exception.java.lang.OutOfMemoryError.message= + +zoomAlg.text=Zoomalgoritm +zoomAlg.mnemonic=A +zoomAlgDefault.text=Standard +zoomAlgDefault.mnemonic=D +#zoomAlgDefault.exception.java.lang.OutOfMemoryError.title= +#zoomAlgDefault.exception.java.lang.OutOfMemoryError.message= +zoomAlgFast.text=Snabb +zoomAlgFast.mnemonic=S +#zoomAlgFast.exception.java.lang.OutOfMemoryError.title= +#zoomAlgFast.exception.java.lang.OutOfMemoryError.message= +zoomAlgSmooth.text=J\xE4mn +zoomAlgSmooth.mnemonic=J +#zoomAlgSmooth.exception.java.lang.OutOfMemoryError.title= +#zoomAlgSmooth.exception.java.lang.OutOfMemoryError.message= +zoomAlgReplicate.text=Replikera +zoomAlgReplicate.mnemonic=R +#zoomAlgReplicate.exception.java.lang.OutOfMemoryError.title= +#zoomAlgReplicate.exception.java.lang.OutOfMemoryError.message= +zoomAlgAreaAveraging.text=Area Averaging +zoomAlgAreaAveraging.mnemonic=A +#zoomAlgAreaAveraging.exception.java.lang.OutOfMemoryError.ti... [truncated message content] |
From: <aki...@us...> - 2008-06-04 21:03:14
|
Revision: 4100 http://gridarta.svn.sourceforge.net/gridarta/?rev=4100&view=rev Author: akirschbaum Date: 2008-06-04 14:02:12 -0700 (Wed, 04 Jun 2008) Log Message: ----------- Add German translations to zoom tool. Modified Paths: -------------- trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/messages_de.properties Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2008-06-04 20:48:57 UTC (rev 4099) +++ trunk/daimonin/ChangeLog 2008-06-04 21:02:12 UTC (rev 4100) @@ -1,3 +1,7 @@ +2008-06-04 Andreas Kirschbaum + + * Add German translations to zoom tool. + 2008-05-30 Andreas Kirschbaum * Implement Map|Shrink Map Size: remove empty tiles from a map's Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2008-06-04 20:48:57 UTC (rev 4099) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2008-06-04 21:02:12 UTC (rev 4100) @@ -108,50 +108,50 @@ 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= +zoomSave.exception.java.lang.OutOfMemoryError.message=<html>Speichermangel beim Speichern des Bildes.<br>Probieren Sie es erneut mit <code>-Xmx128m</code> oder <code>-Xmx256m</code>.<br><br>{0} zoom0.exception.java.lang.OutOfMemoryError.title=Speichermangel -#zoom0.exception.java.lang.OutOfMemoryError.message= +zoom0.exception.java.lang.OutOfMemoryError.message=<html>Speichermangel beim Speichern des Bildes.<br>Probieren Sie es erneut mit <code>-Xmx128m</code> oder <code>-Xmx256m</code>.<br><br>{0} zoom12.exception.java.lang.OutOfMemoryError.title=Speichermangel -#zoom12.exception.java.lang.OutOfMemoryError.message= +zoom12.exception.java.lang.OutOfMemoryError.message=<html>Speichermangel beim Speichern des Bildes.<br>Probieren Sie es erneut mit <code>-Xmx128m</code> oder <code>-Xmx256m</code>.<br><br>{0} zoom25.exception.java.lang.OutOfMemoryError.title=Speichermangel -#zoom25.exception.java.lang.OutOfMemoryError.message= +zoom25.exception.java.lang.OutOfMemoryError.message=<html>Speichermangel beim Speichern des Bildes.<br>Probieren Sie es erneut mit <code>-Xmx128m</code> oder <code>-Xmx256m</code>.<br><br>{0} zoom50.exception.java.lang.OutOfMemoryError.title=Speichermangel -#zoom50.exception.java.lang.OutOfMemoryError.message= +zoom50.exception.java.lang.OutOfMemoryError.message=<html>Speichermangel beim Speichern des Bildes.<br>Probieren Sie es erneut mit <code>-Xmx128m</code> oder <code>-Xmx256m</code>.<br><br>{0} zoom100.exception.java.lang.OutOfMemoryError.title=Speichermangel -#zoom100.exception.java.lang.OutOfMemoryError.message= +zoom100.exception.java.lang.OutOfMemoryError.message=<html>Speichermangel beim Speichern des Bildes.<br>Probieren Sie es erneut mit <code>-Xmx128m</code> oder <code>-Xmx256m</code>.<br><br>{0} zoom150.exception.java.lang.OutOfMemoryError.title=Speichermangel -#zoom150.exception.java.lang.OutOfMemoryError.message= +zoom150.exception.java.lang.OutOfMemoryError.message=<html>Speichermangel beim Speichern des Bildes.<br>Probieren Sie es erneut mit <code>-Xmx128m</code> oder <code>-Xmx256m</code>.<br><br>{0} zoom200.exception.java.lang.OutOfMemoryError.title=Speichermangel -#zoom200.exception.java.lang.OutOfMemoryError.message= +zoom200.exception.java.lang.OutOfMemoryError.message=<html>Speichermangel beim Speichern des Bildes.<br>Probieren Sie es erneut mit <code>-Xmx128m</code> oder <code>-Xmx256m</code>.<br><br>{0} zoom250.exception.java.lang.OutOfMemoryError.title=Speichermangel -#zoom250.exception.java.lang.OutOfMemoryError.message= +zoom250.exception.java.lang.OutOfMemoryError.message=<html>Speichermangel beim Speichern des Bildes.<br>Probieren Sie es erneut mit <code>-Xmx128m</code> oder <code>-Xmx256m</code>.<br><br>{0} zoom300.exception.java.lang.OutOfMemoryError.title=Speichermangel -#zoom300.exception.java.lang.OutOfMemoryError.message= +zoom300.exception.java.lang.OutOfMemoryError.message=<html>Speichermangel beim Speichern des Bildes.<br>Probieren Sie es erneut mit <code>-Xmx128m</code> oder <code>-Xmx256m</code>.<br><br>{0} zoom400.exception.java.lang.OutOfMemoryError.title=Speichermangel -#zoom400.exception.java.lang.OutOfMemoryError.message= +zoom400.exception.java.lang.OutOfMemoryError.message=<html>Speichermangel beim Speichern des Bildes.<br>Probieren Sie es erneut mit <code>-Xmx128m</code> oder <code>-Xmx256m</code>.<br><br>{0} -#zoomAlg.text= -#zoomAlg.mnemonic= -#zoomAlgDefault.text= -#zoomAlgDefault.mnemonic= +zoomAlg.text=Skalierungsalgorithmen +zoomAlg.mnemonic=S +zoomAlgDefault.text=Standard +zoomAlgDefault.mnemonic=S zoomAlgDefault.exception.java.lang.OutOfMemoryError.title=Speichermangel -#zoomAlgDefault.exception.java.lang.OutOfMemoryError.message= -#zoomAlgFast.text= -#zoomAlgFast.mnemonic= +zoomAlgDefault.exception.java.lang.OutOfMemoryError.message=<html>Speichermangel beim Speichern des Bildes.<br>Probieren Sie es erneut mit <code>-Xmx128m</code> oder <code>-Xmx256m</code>.<br><br>{0} +zoomAlgFast.text=Schnell +zoomAlgFast.mnemonic=C zoomAlgFast.exception.java.lang.OutOfMemoryError.title=Speichermangel -#zoomAlgFast.exception.java.lang.OutOfMemoryError.message= -#zoomAlgSmooth.text= -#zoomAlgSmooth.mnemonic= +zoomAlgFast.exception.java.lang.OutOfMemoryError.message=<html>Speichermangel beim Speichern des Bildes.<br>Probieren Sie es erneut mit <code>-Xmx128m</code> oder <code>-Xmx256m</code>.<br><br>{0} +zoomAlgSmooth.text=Gl\xE4ttung +zoomAlgSmooth.mnemonic=G zoomAlgSmooth.exception.java.lang.OutOfMemoryError.title=Speichermangel -#zoomAlgSmooth.exception.java.lang.OutOfMemoryError.message= -#zoomAlgReplicate.text= -#zoomAlgReplicate.mnemonic= +zoomAlgSmooth.exception.java.lang.OutOfMemoryError.message=<html>Speichermangel beim Speichern des Bildes.<br>Probieren Sie es erneut mit <code>-Xmx128m</code> oder <code>-Xmx256m</code>.<br><br>{0} +zoomAlgReplicate.text=Replikation +zoomAlgReplicate.mnemonic=R zoomAlgReplicate.exception.java.lang.OutOfMemoryError.title=Speichermangel -#zoomAlgReplicate.exception.java.lang.OutOfMemoryError.message= -#zoomAlgAreaAveraging.text= -#zoomAlgAreaAveraging.mnemonic= +zoomAlgReplicate.exception.java.lang.OutOfMemoryError.message=<html>Speichermangel beim Speichern des Bildes.<br>Probieren Sie es erneut mit <code>-Xmx128m</code> oder <code>-Xmx256m</code>.<br><br>{0} +zoomAlgAreaAveraging.text=Fl\xE4chenmittelwert +zoomAlgAreaAveraging.mnemonic=F zoomAlgAreaAveraging.exception.java.lang.OutOfMemoryError.title=Speichermangel -#zoomAlgAreaAveraging.exception.java.lang.OutOfMemoryError.message= +zoomAlgAreaAveraging.exception.java.lang.OutOfMemoryError.message=<html>Speichermangel beim Speichern des Bildes.<br>Probieren Sie es erneut mit <code>-Xmx128m</code> oder <code>-Xmx256m</code>.<br><br>{0} # Dialogs This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |