From: <chr...@us...> - 2006-10-08 21:52:26
|
Revision: 503 http://svn.sourceforge.net/gridarta/?rev=503&view=rev Author: christianhujer Date: 2006-10-08 14:52:21 -0700 (Sun, 08 Oct 2006) Log Message: ----------- CMainControl extended JFrame for no good - changed. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-10-08 21:50:03 UTC (rev 502) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-10-08 21:52:21 UTC (rev 503) @@ -45,7 +45,6 @@ import java.util.Vector; import javax.swing.ImageIcon; import javax.swing.JFileChooser; -import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JViewport; import javax.swing.SwingUtilities; @@ -68,7 +67,7 @@ * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> */ -public final class CMainControl extends JFrame implements MainControl { +public final class CMainControl implements MainControl { /** ActionFactory. */ private static final ActionFactory ACTION_FACTORY = getFactory("cfeditor"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-01 23:35:51
|
Revision: 779 http://svn.sourceforge.net/gridarta/?rev=779&view=rev Author: akirschbaum Date: 2006-12-01 15:35:51 -0800 (Fri, 01 Dec 2006) Log Message: ----------- Replace Vector with List. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-01 23:27:43 UTC (rev 778) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-01 23:35:51 UTC (rev 779) @@ -41,10 +41,8 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; -import java.util.Enumeration; import java.util.Iterator; import java.util.List; -import java.util.Vector; import javax.swing.ImageIcon; import javax.swing.JFileChooser; import javax.swing.JOptionPane; @@ -139,7 +137,7 @@ private final ArchetypeSet archetypeSet; // the one and only arch list /** All open maps. */ - private final Vector<MapControl> levels = new Vector<MapControl>(1, 2); + private final List<MapControl> levels = new ArrayList<MapControl>(); /** The current top map we are working with */ private MapControl currentMap; @@ -348,9 +346,7 @@ */ void selectEditType(final int newType) { // calculate the new type for all opened maps: - for (Enumeration<MapControl> enu = levels.elements(); enu.hasMoreElements();) { - final MapControl level = enu.nextElement(); - + for (final MapControl level : levels) { level.addEditType(newType); // calculate new type } @@ -582,8 +578,7 @@ // update the look and feel for all open map views if (levels.size() > 0) { - for (final Enumeration<MapControl> enu = levels.elements(); enu.hasMoreElements();) { - final MapControl level = enu.nextElement(); + for (final MapControl level : levels) { level.getMapViewFrame().updateLookAndFeel(); if (log.isDebugEnabled()) { log.debug("map " + level.getMapName()); @@ -661,7 +656,7 @@ if (show) { mainView.addLevelView(map.getMapViewFrame()); // one view... map.getMapViewFrame().setAutoscrolls(true); - levels.addElement(map); + levels.add(map); setCurrentLevel(map); refreshMenusAndToolbars(); } @@ -753,14 +748,12 @@ mainView.setMapTileList(null, -1); level.levelCloseNotify(); mainView.removeLevelView(level.getMapViewFrame()); - levels.removeElement(level); + levels.remove(level); currentMap = null; if (levels.size() > 0) { // get next open map we can find and set it to currentMap - for (final Enumeration<MapControl> enu = levels.elements(); enu.hasMoreElements();) { - currentMap = enu.nextElement(); - } + currentMap = levels.get(levels.size() - 1); } } refreshMenusAndToolbars(); @@ -1218,8 +1211,7 @@ /** Invoked when user wants to exit from the program. */ void exitWanted() { if (levels.size() > 0) { - for (final Enumeration<MapControl> enu = levels.elements(); enu.hasMoreElements();) { - final MapControl level = enu.nextElement(); + for (final MapControl level : levels) { closeLevel(level, false); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-01 23:39:01
|
Revision: 780 http://svn.sourceforge.net/gridarta/?rev=780&view=rev Author: akirschbaum Date: 2006-12-01 15:39:02 -0800 (Fri, 01 Dec 2006) Log Message: ----------- Unify comment. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-01 23:35:51 UTC (rev 779) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-01 23:39:02 UTC (rev 780) @@ -340,7 +340,7 @@ /** * A new edit type was selected from the view menu. Now - * we activate the new type and calculate it for each arch on + * we activate the new type and calculate it for each GameObject on * each map where this type has not yet been used. * @param newType new selected edit type (should not be more than one) */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-02 11:35:36
|
Revision: 786 http://svn.sourceforge.net/gridarta/?rev=786&view=rev Author: akirschbaum Date: 2006-12-02 03:35:36 -0800 (Sat, 02 Dec 2006) Log Message: ----------- Make method private. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-02 11:33:24 UTC (rev 785) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-02 11:35:36 UTC (rev 786) @@ -1674,7 +1674,7 @@ * Load all system tile icons into temporare variables for more convenient * access. */ - public void loadDefTiles() { + private void loadDefTiles() { mapGridIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_IGRID_TILE); mapSelIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_ISEL_TILE); unknownTileIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_IUNKNOWN); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-02 11:47:47
|
Revision: 790 http://svn.sourceforge.net/gridarta/?rev=790&view=rev Author: akirschbaum Date: 2006-12-02 03:47:48 -0800 (Sat, 02 Dec 2006) Log Message: ----------- Remove bad comment. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-02 11:47:03 UTC (rev 789) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-02 11:47:48 UTC (rev 790) @@ -250,7 +250,7 @@ // now collect all arch you can find in the arch path!! System.gc(); - mainView.updateFocus(false); /*MTMT*/ + mainView.updateFocus(false); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-06 23:20:16
|
Revision: 934 http://svn.sourceforge.net/gridarta/?rev=934&view=rev Author: akirschbaum Date: 2006-12-06 15:19:59 -0800 (Wed, 06 Dec 2006) Log Message: ----------- Unify order of functions. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-06 23:17:15 UTC (rev 933) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-06 23:19:59 UTC (rev 934) @@ -444,6 +444,16 @@ return strArchDir; } + /** {@inheritDoc} */ + public FileFilter getScriptFileFilter() { + return pythonFileFilter; + } + + /** {@inheritDoc} */ + public String getScriptSuffix() { + return ".py"; + } + public String getScriptDefaultFolder() { return strScriptDir; } @@ -474,16 +484,6 @@ mainView.showArchPanelQuickObject(gameObject); } - /** {@inheritDoc} */ - public FileFilter getScriptFileFilter() { - return pythonFileFilter; - } - - /** {@inheritDoc} */ - public String getScriptSuffix() { - return ".py"; - } - boolean addArchToMap(final String archname, final Point pos, final boolean allowDouble, final boolean join) { return currentMap.addArchToMap(archname, pos, allowDouble, join); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-19 22:38:18
|
Revision: 1621 http://svn.sourceforge.net/gridarta/?rev=1621&view=rev Author: akirschbaum Date: 2007-01-19 14:38:19 -0800 (Fri, 19 Jan 2007) Log Message: ----------- Unify status bar update. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-19 21:22:28 UTC (rev 1620) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-19 22:38:19 UTC (rev 1621) @@ -706,13 +706,14 @@ */ public MapControl newLevel(final List<GameObject> objects, final MapArchObject maparch, final boolean view, final Point initial) { // Create a new level control and set the level view from that - + if (view) { + setStatusText("Creating new map " + maparch.getMapDisplayName()); + } final MapControl map = new MapControl(this, objects, maparch, false, initial); fireMapCreatedEvent(map); if (view) { map.addMapGridListener(mainActions); map.addMapCursorListener(mainActions); - setStatusText("Creating new map " + maparch.getMapDisplayName()); mainView.addLevelView(map.getMapViewFrame()); // one view... map.getMapViewFrame().setAutoscrolls(true); levels.add(map); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-04-07 21:09:14
|
Revision: 3845 http://gridarta.svn.sourceforge.net/gridarta/?rev=3845&view=rev Author: akirschbaum Date: 2008-04-07 14:09:18 -0700 (Mon, 07 Apr 2008) Log Message: ----------- Remove raw type. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-04-07 21:05:04 UTC (rev 3844) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-04-07 21:09:18 UTC (rev 3845) @@ -274,7 +274,7 @@ throw new MissingResourceException("Cannot create XML parser: " + ex.getMessage(), null, null); } typeList = new CFArchTypeList(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath()); - new ArchetypeSetSpellLoader().load(archetypeSet, Archetype.TYPE_SPELL, gameObjectSpells); + new ArchetypeSetSpellLoader<GameObject, MapArchObject, Archetype>().load(archetypeSet, Archetype.TYPE_SPELL, gameObjectSpells); try { final String filename = IOUtils.getResourceURLAsString(getConfigurationDirectory(), "GameObjectMatchers.xml"); typeList.readGameObjectMatchers(filename); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-06 23:33:07
|
Revision: 935 http://svn.sourceforge.net/gridarta/?rev=935&view=rev Author: akirschbaum Date: 2006-12-06 15:32:45 -0800 (Wed, 06 Dec 2006) Log Message: ----------- Remove unused function. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-06 23:19:59 UTC (rev 934) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-06 23:32:45 UTC (rev 935) @@ -484,10 +484,6 @@ mainView.showArchPanelQuickObject(gameObject); } - boolean addArchToMap(final String archname, final Point pos, final boolean allowDouble, final boolean join) { - return currentMap.addArchToMap(archname, pos, allowDouble, join); - } - boolean insertArchToMap(final GameObject newarch, final String archname, final GameObject next, final Point pos, final boolean join) { return currentMap.insertArchToMap(newarch, archname, next, pos, join); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-06 23:37:14
|
Revision: 936 http://svn.sourceforge.net/gridarta/?rev=936&view=rev Author: akirschbaum Date: 2006-12-06 15:37:13 -0800 (Wed, 06 Dec 2006) Log Message: ----------- Remove unused function. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-06 23:32:45 UTC (rev 935) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-06 23:37:13 UTC (rev 936) @@ -535,10 +535,6 @@ return archetypeSet.getFace(i); } - public String getFaceName(final int i) { - return archetypeSet.getFaceName(i); - } - public void setStatusText(final String string) { mainView.setStatusText(string); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 19:55:32
|
Revision: 991 http://svn.sourceforge.net/gridarta/?rev=991&view=rev Author: christianhujer Date: 2006-12-09 11:55:32 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Fixed ConcurrentModificationException. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-09 19:39:28 UTC (rev 990) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-09 19:55:32 UTC (rev 991) @@ -1136,16 +1136,9 @@ /** Invoked when user wants to exit from the program. */ public void exit() { - if (levels.size() > 0) { - for (final MapControl level : levels) { - closeLevel(level, false); - } + while (levels.size() > 0) { + closeLevel(levels.get(0), false); } - doExit(); - } - - /** Exits from the program. */ - void doExit() { appExitNotify(); System.exit(0); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-12 03:39:17
|
Revision: 1051 http://svn.sourceforge.net/gridarta/?rev=1051&view=rev Author: akirschbaum Date: 2006-12-11 12:06:48 -0800 (Mon, 11 Dec 2006) Log Message: ----------- Fix typo. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-10 23:18:18 UTC (rev 1050) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-11 20:06:48 UTC (rev 1051) @@ -1126,7 +1126,7 @@ public void options() { if (prefsGroup == null) { prefsGroup = new PreferencesGroup( - "Gridarta for Daimonin", + "Gridarta for Crossfire", new ResPrefs(this), new GUIPrefs(this) ); // prefsGroup This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-12 03:39:22
|
Revision: 1007 http://svn.sourceforge.net/gridarta/?rev=1007&view=rev Author: akirschbaum Date: 2006-12-10 05:45:18 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Remove unused constant. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-10 13:44:20 UTC (rev 1006) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-10 13:45:18 UTC (rev 1007) @@ -90,8 +90,6 @@ public static final String USE_IMAGESET = "useImageSet"; - private static final String USE_FONT = "useFont"; - public static final String LOAD_ARCH_COLL = "loadArchFromCollection"; public static final String PICKMAPS_LOCKED = "pickmapsLocked"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-14 22:08:07
|
Revision: 1069 http://svn.sourceforge.net/gridarta/?rev=1069&view=rev Author: akirschbaum Date: 2006-12-14 14:08:07 -0800 (Thu, 14 Dec 2006) Log Message: ----------- Remove redundant catch clause. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-14 22:06:24 UTC (rev 1068) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-14 22:08:07 UTC (rev 1069) @@ -40,7 +40,6 @@ import java.awt.Point; import java.awt.Rectangle; import java.io.File; -import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -959,8 +958,6 @@ } finally { mapFileEncoder.close(); } - } catch (final FileNotFoundException e) { - ACTION_FACTORY.showMessageDialog(mainView, "encodeMapFile", file, e.getMessage()); } catch (final IOException e) { ACTION_FACTORY.showMessageDialog(mainView, "encodeMapFile", file, e.getMessage()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-24 00:08:28
|
Revision: 1257 http://svn.sourceforge.net/gridarta/?rev=1257&view=rev Author: akirschbaum Date: 2006-12-23 16:08:27 -0800 (Sat, 23 Dec 2006) Log Message: ----------- Turn NullPointerException into AssertionError. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-24 00:07:05 UTC (rev 1256) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-24 00:08:27 UTC (rev 1257) @@ -1457,7 +1457,7 @@ } else if (direction == IGUIConstants.WEST) { scrollto = new Rectangle(newViewPort.getViewSize().width - oldViewPort.getViewRect().width, oldViewPort.getViewRect().y, oldViewPort.getViewRect().width, oldViewPort.getViewRect().height); } else { - scrollto = null; + throw new AssertionError(); } if (scrollto.x + scrollto.width > newViewPort.getViewSize().width) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-24 00:22:26
|
Revision: 1259 http://svn.sourceforge.net/gridarta/?rev=1259&view=rev Author: akirschbaum Date: 2006-12-23 16:22:27 -0800 (Sat, 23 Dec 2006) Log Message: ----------- Whitespace change. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-24 00:20:30 UTC (rev 1258) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-24 00:22:27 UTC (rev 1259) @@ -1204,7 +1204,7 @@ } final File file = new File(filename); if (!file.exists() || ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, "overwriteOtherFile", filename) == JOptionPane.YES_OPTION) { - mapControl.getMapViewFrame().printFullImage(new File(filename)); + mapControl.getMapViewFrame().printFullImage(new File(filename)); } } } catch (final IOException e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-23 23:15:08
|
Revision: 1692 http://svn.sourceforge.net/gridarta/?rev=1692&view=rev Author: akirschbaum Date: 2007-01-23 15:15:08 -0800 (Tue, 23 Jan 2007) Log Message: ----------- Rename variable name. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-23 23:03:58 UTC (rev 1691) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-23 23:15:08 UTC (rev 1692) @@ -874,11 +874,11 @@ /** * Load a mapfile. * @param file mapfile - * @param show set to true to show the map in main view + * @param view set to true to show the map in main view * @param initial the view position to show initially * @return the map controller to manipulate this map */ - @Nullable public MapControl openFile(final File file, final boolean show, final Point initial) { + @Nullable public MapControl openFile(final File file, final boolean view, final Point initial) { final List<GameObject> objects; final MapArchObject maparch; try { @@ -903,11 +903,11 @@ } archetypeParser.sortTempList(objects); // sort the list (put multiparts at the end) - final MapControl mapControl = newLevel(objects, maparch, show, initial); // init the map + final MapControl mapControl = newLevel(objects, maparch, view, initial); // init the map mapControl.setMapFile(file); mapControl.setMapFileName(file.getPath()); - if (show) { + if (view) { // finally, show the map and refresh toolbars mapControl.setActiveEditType(tileEdit); // map is loaded with current view settings mapControl.resetModified(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-26 17:25:28
|
Revision: 1720 http://svn.sourceforge.net/gridarta/?rev=1720&view=rev Author: christianhujer Date: 2007-01-26 09:25:26 -0800 (Fri, 26 Jan 2007) Log Message: ----------- Minor change to createImage() so it creates less objects. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-26 17:03:33 UTC (rev 1719) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-26 17:25:26 UTC (rev 1720) @@ -1047,39 +1047,39 @@ strImageDir = mapDir.getAbsolutePath(); } - String filename = strImageDir + "/" + mapControl.getMapFileName() + ".png"; - try { - final JFileChooser fileChooser = new JFileChooser(strImageDir); - fileChooser.setDialogTitle("Save Image As"); - fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); - fileChooser.setMultiSelectionEnabled(false); - fileChooser.setSelectedFile(new File(filename)); - // set a file filter for "*.png" files - fileChooser.setFileFilter(new FileFilter() { - @Override public String getDescription() { - return "*.png"; - } + String startFilename = strImageDir + "/" + mapControl.getMapFileName() + ".png"; + final JFileChooser fileChooser = new JFileChooser(strImageDir); + fileChooser.setDialogTitle("Save Image As"); + fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); + fileChooser.setMultiSelectionEnabled(false); + fileChooser.setSelectedFile(new File(startFilename)); + // set a file filter for "*.png" files + fileChooser.setFileFilter(new FileFilter() { + @Override public String getDescription() { + return "*.png"; + } - @Override public boolean accept(final File f) { - return f.isDirectory() || f.getName().endsWith(".png"); - } - }); + @Override public boolean accept(final File f) { + return f.isDirectory() || f.getName().endsWith(".png"); + } + }); - final int returnVal = fileChooser.showSaveDialog(mainView); - if (returnVal == JFileChooser.APPROVE_OPTION) { - // got the filepath, now create image - filename = fileChooser.getSelectedFile().getAbsolutePath(); - strImageDir = fileChooser.getSelectedFile().getParentFile().getAbsolutePath(); - if (!filename.endsWith(".png")) { - filename += ".png"; + final int returnVal = fileChooser.showSaveDialog(mainView); + if (returnVal == JFileChooser.APPROVE_OPTION) { + // got the filepath, now create image + File imageFile = fileChooser.getSelectedFile(); + final String filename = imageFile.getAbsolutePath(); + if (!filename.endsWith(".png")) { + imageFile = new File(filename + ".png"); + } + strImageDir = imageFile.getParentFile().getAbsolutePath(); + if (!imageFile.exists() || ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, "overwriteOtherFile", imageFile) == JOptionPane.YES_OPTION) { + try { + mapControl.getMapViewFrame().printFullImage(imageFile); + } catch (final IOException e) { + ACTION_FACTORY.showMessageDialog(mainView, "createImageIOException", imageFile, e.getMessage()); } - final File file = new File(filename); - if (!file.exists() || ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, "overwriteOtherFile", filename) == JOptionPane.YES_OPTION) { - mapControl.getMapViewFrame().printFullImage(new File(filename)); - } } - } catch (final IOException e) { - ACTION_FACTORY.showMessageDialog(mainView, "createImageIOException", filename, e.getMessage()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-02-23 07:44:10
|
Revision: 1916 http://svn.sourceforge.net/gridarta/?rev=1916&view=rev Author: akirschbaum Date: 2007-02-22 23:44:11 -0800 (Thu, 22 Feb 2007) Log Message: ----------- Whitespace change. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-02-22 22:18:00 UTC (rev 1915) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-02-23 07:44:11 UTC (rev 1916) @@ -648,7 +648,6 @@ // Set grid of level, if there is a level public boolean isGridVisible() { return currentMap != null && currentMap.getMapViewFrame().isGridVisible(); - } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-03-22 19:57:34
|
Revision: 1956 http://svn.sourceforge.net/gridarta/?rev=1956&view=rev Author: akirschbaum Date: 2007-03-22 12:52:54 -0700 (Thu, 22 Mar 2007) Log Message: ----------- Unify method order. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-03-22 19:46:54 UTC (rev 1955) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-03-22 19:52:54 UTC (rev 1956) @@ -1605,11 +1605,6 @@ aSelectAll.setEnabled(isSelectAllEnabled()); } - /* {@inheritDoc} */ - public void currentMapChanged(@Nullable final MapControl mapControl) { - refreshMenus(); - } - /** {@inheritDoc} */ public void mapCreated(@NotNull final MapControl mapControl) { // ignore: a current map changed event will be generated @@ -1620,6 +1615,11 @@ // ignore: a current map changed event will be generated } + /* {@inheritDoc} */ + public void currentMapChanged(@Nullable final MapControl mapControl) { + refreshMenus(); + } + /** {@inheritDoc} */ public void mapGridChanged(@NotNull final MapGridEvent e) { refreshMenus(); // selection state may have changed This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-03-31 19:55:47
|
Revision: 2050 http://svn.sourceforge.net/gridarta/?rev=2050&view=rev Author: akirschbaum Date: 2007-03-31 12:55:48 -0700 (Sat, 31 Mar 2007) Log Message: ----------- Simplify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-03-31 19:50:15 UTC (rev 2049) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-03-31 19:55:48 UTC (rev 2050) @@ -587,8 +587,8 @@ final MapControl mapControl = new MapControl(this, objects, maparch, false, initial); fireMapCreatedEvent(mapControl); if (view) { - mainView.addLevelView(mapControl.getMapViewFrame()); // one view... final MapViewIFrame mapViewIFrame = mapControl.getMapViewFrame(); + mainView.addLevelView(mapViewIFrame); mapViewIFrame.setAutoscrolls(true); fireMapViewCreatedEvent(mapViewIFrame); levels.add(mapControl); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-03-31 20:44:48
|
Revision: 2057 http://svn.sourceforge.net/gridarta/?rev=2057&view=rev Author: akirschbaum Date: 2007-03-31 13:44:49 -0700 (Sat, 31 Mar 2007) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-03-31 20:43:16 UTC (rev 2056) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-03-31 20:44:49 UTC (rev 2057) @@ -1152,14 +1152,6 @@ mainView.refreshMenusAndToolbars(); } - /** - * Returns the grid icon. - * @return The grid icon. - */ - public ImageIcon getGridIcon() { - return mapGridIcon; - } - public static ImageIcon getMapCursorIcon() { return mapCursorIcon; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-04-01 00:27:27
|
Revision: 2067 http://svn.sourceforge.net/gridarta/?rev=2067&view=rev Author: akirschbaum Date: 2007-03-31 17:23:31 -0700 (Sat, 31 Mar 2007) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-04-01 00:21:26 UTC (rev 2066) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-04-01 00:23:31 UTC (rev 2067) @@ -777,8 +777,8 @@ } catch (final IOException e) { ACTION_FACTORY.showMessageDialog(mainView, "openFileWantedIOException", file, e.getMessage()); return null; - } catch (final OutOfMemoryError e) { - ACTION_FACTORY.showMessageDialog(mainView, "openFileWantedOutOfMemory", file, e.getMessage()); + } catch (final OutOfMemoryError ignore) { + ACTION_FACTORY.showMessageDialog(mainView, "openFileWantedOutOfMemory", file); return null; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-04-01 16:30:18
|
Revision: 2077 http://svn.sourceforge.net/gridarta/?rev=2077&view=rev Author: akirschbaum Date: 2007-04-01 09:30:15 -0700 (Sun, 01 Apr 2007) Log Message: ----------- Rename variable name. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-04-01 16:28:46 UTC (rev 2076) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-04-01 16:30:15 UTC (rev 2077) @@ -915,9 +915,9 @@ * Browse first through the default arch list and attach map arches to it * then browse through the face list and try to find the pictures. * @param objects List of GameObjects to collect - * @param file File (for error messages). + * @param uri URI they were read from (for error messages). */ - public void collectTempList(final List<GameObject> objects, final String file) { + public void collectTempList(final List<GameObject> objects, final String uri) { final List<GameObject> tailList = new ArrayList<GameObject>(); final SortedSet<String> undefinedArchetypeNames = new TreeSet<String>(); @@ -949,7 +949,7 @@ for (final String archetypeName : undefinedArchetypeNames) { noarch.append(archetypeName).append('\n'); } - if (ACTION_FACTORY.showQuestionDialog(mainView, "collectTemplistAutodelete", file, gameObjectsWithoutArchetype.size(), noarch)) { + if (ACTION_FACTORY.showQuestionDialog(mainView, "collectTemplistAutodelete", uri, gameObjectsWithoutArchetype.size(), noarch)) { objects.removeAll(gameObjectsWithoutArchetype); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-04-03 07:16:23
|
Revision: 2101 http://svn.sourceforge.net/gridarta/?rev=2101&view=rev Author: akirschbaum Date: 2007-04-03 00:16:24 -0700 (Tue, 03 Apr 2007) Log Message: ----------- Remove useless final modifier. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-04-03 07:15:10 UTC (rev 2100) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-04-03 07:16:24 UTC (rev 2101) @@ -998,7 +998,7 @@ } /** Invoked when user wants to create a new view of the current level. */ - public final MapViewIFrame mapCreateView(@NotNull final MapControl mapControl, @Nullable final Point viewPosition) { + public MapViewIFrame mapCreateView(@NotNull final MapControl mapControl, @Nullable final Point viewPosition) { final MapViewIFrame mapViewIFrame = mapControl.createView(viewPosition); mainView.addLevelView(mapViewIFrame); fireMapViewCreatedEvent(mapViewIFrame); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |