You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(103) |
Jun
(121) |
Jul
(16) |
Aug
(67) |
Sep
(126) |
Oct
(161) |
Nov
(164) |
Dec
(588) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(394) |
Feb
(181) |
Mar
(131) |
Apr
(180) |
May
(255) |
Jun
(11) |
Jul
(79) |
Aug
(70) |
Sep
(274) |
Oct
(138) |
Nov
(195) |
Dec
(8) |
2008 |
Jan
(3) |
Feb
(142) |
Mar
(162) |
Apr
(124) |
May
(148) |
Jun
(157) |
Jul
(425) |
Aug
(373) |
Sep
(264) |
Oct
(315) |
Nov
(225) |
Dec
(6) |
2009 |
Jan
(67) |
Feb
(78) |
Mar
(279) |
Apr
(294) |
May
(92) |
Jun
(65) |
Jul
(134) |
Aug
(41) |
Sep
(138) |
Oct
(125) |
Nov
(126) |
Dec
(122) |
2010 |
Jan
(15) |
Feb
(48) |
Mar
(9) |
Apr
(195) |
May
(373) |
Jun
(507) |
Jul
(42) |
Aug
(16) |
Sep
(38) |
Oct
(81) |
Nov
(64) |
Dec
(18) |
2011 |
Jan
(13) |
Feb
(12) |
Mar
(39) |
Apr
(1) |
May
(2) |
Jun
(27) |
Jul
(27) |
Aug
(31) |
Sep
(14) |
Oct
(102) |
Nov
(20) |
Dec
(37) |
2012 |
Jan
(22) |
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
(18) |
Jul
(6) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(47) |
Jun
(7) |
Jul
(107) |
Aug
|
Sep
|
Oct
(112) |
Nov
(31) |
Dec
(17) |
2014 |
Jan
(29) |
Feb
(111) |
Mar
(34) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(18) |
Dec
(10) |
From: <aki...@us...> - 2006-12-13 19:19:38
|
Revision: 1059 http://svn.sourceforge.net/gridarta/?rev=1059&view=rev Author: akirschbaum Date: 2006-12-13 11:19:24 -0800 (Wed, 13 Dec 2006) Log Message: ----------- Make Analyze menu work. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-12-13 18:34:55 UTC (rev 1058) +++ trunk/crossfire/ChangeLog 2006-12-13 19:19:24 UTC (rev 1059) @@ -1,3 +1,7 @@ +2006-12-13 Andreas Kirschbaum + + * Make Analyze menu work. + 2006-12-12 Andreas Kirschbaum * Make View|Reset View work. Modified: trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java 2006-12-13 18:34:55 UTC (rev 1058) +++ trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java 2006-12-13 19:19:24 UTC (rev 1059) @@ -24,12 +24,12 @@ private final EventListenerList listenerList = new EventListenerList(); public void setEnabled(final boolean enabled) { - this.enabled = enabled; if (enabled) { if (log.isDebugEnabled()) { log.debug("enabling filter " + this); } - if (!enabled) { + if (!this.enabled) { + this.enabled = true; final ConfigEvent e = new ConfigEvent(ConfigEventType.ENABLE, this); fireEvent(e); } @@ -37,7 +37,8 @@ if (log.isDebugEnabled()) { log.debug("disabling filter " + this); } - if (enabled) { + if (this.enabled) { + this.enabled = false; final ConfigEvent e = new ConfigEvent(ConfigEventType.DISABLE, this); fireEvent(e); } Modified: trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java 2006-12-13 18:34:55 UTC (rev 1058) +++ trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java 2006-12-13 19:19:24 UTC (rev 1059) @@ -34,7 +34,11 @@ } public void setInverted(final boolean inverted) { + if (this.inverted == inverted) { + return; + } this.inverted = inverted; + fireEvent(new ConfigEvent(ConfigEventType.CHANGE, this)); } public FilterConfig getConfig(final String name) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-13 18:34:57
|
Revision: 1058 http://svn.sourceforge.net/gridarta/?rev=1058&view=rev Author: christianhujer Date: 2006-12-13 10:34:55 -0800 (Wed, 13 Dec 2006) Log Message: ----------- Rationalized static member access. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainMenu.java Modified: trunk/crossfire/src/cfeditor/CMainMenu.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainMenu.java 2006-12-12 19:33:03 UTC (rev 1057) +++ trunk/crossfire/src/cfeditor/CMainMenu.java 2006-12-13 18:34:55 UTC (rev 1058) @@ -33,6 +33,7 @@ import cfeditor.menu.MenuManager; import cfeditor.menu.SimpleMenuEntry; import cfeditor.menu.SimpleMenuLocation; +import cfeditor.menu.MenuEntry; import java.awt.Event; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -244,7 +245,7 @@ }); menuManager.addMenuEntry("main.file", close); - menuManager.addMenuEntry("main.file", SimpleMenuEntry.getSeparator()); + menuManager.addMenuEntry("main.file", MenuEntry.getSeparator()); save = new SimpleMenuEntry("Save"); save.setIcon(CGUIUtils.getIcon(IGUIConstants.SAVE_LEVEL_SMALLICON)); @@ -379,7 +380,7 @@ }); menuManager.addMenuEntry("main.edit", paste); - menuManager.addMenuEntry("main.edit", SimpleMenuEntry.getSeparator()); + menuManager.addMenuEntry("main.edit", MenuEntry.getSeparator()); // Replace: replace = new SimpleMenuEntry("Replace"); @@ -480,9 +481,9 @@ group.add(menuItem); } - menuManager.addMenuEntry("main.view", SimpleMenuEntry.getSeparator()); + menuManager.addMenuEntry("main.view", MenuEntry.getSeparator()); - menuManager.addMenuEntry("main.view", SimpleMenuEntry.getSeparator()); + menuManager.addMenuEntry("main.view", MenuEntry.getSeparator()); monster = new CheckBoxMenuEntry("Show Monsters"); monster.setChecked(mainControl.isTileEdit(IGUIConstants.TILE_EDIT_MONSTER)); @@ -599,7 +600,7 @@ } }); menuManager.addMenuEntry("main.view", connected); - menuManager.addMenuEntry("main.view", SimpleMenuEntry.getSeparator()); + menuManager.addMenuEntry("main.view", MenuEntry.getSeparator()); final SimpleMenuEntry showAll = new SimpleMenuEntry("Reset View"); showAll.addActionListener( new ActionListener() { @@ -644,7 +645,7 @@ }); menuManager.addMenuEntry("main.map", autojoin); - menuManager.addMenuEntry("main.map", SimpleMenuEntry.getSeparator()); + menuManager.addMenuEntry("main.map", MenuEntry.getSeparator()); gridToggle = new CheckBoxMenuEntry("Show Grid"); gridToggle.setMnemonic('G'); @@ -668,7 +669,7 @@ } }); menuManager.addMenuEntry("main.map", enterExit); - menuManager.addMenuEntry("main.map", SimpleMenuEntry.getSeparator()); + menuManager.addMenuEntry("main.map", MenuEntry.getSeparator()); enterNorth = new SimpleMenuEntry("Enter North Map"); enterNorth.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_UP, Event.CTRL_MASK)); @@ -730,7 +731,7 @@ }); menuManager.addMenuEntry("main.map", enterLower); - menuManager.addMenuEntry("main.map", SimpleMenuEntry.getSeparator()); + menuManager.addMenuEntry("main.map", MenuEntry.getSeparator()); showTiles = new CheckBoxMenuEntry("Show Tiles around"); showTiles.addActionListener( @@ -741,7 +742,7 @@ }); menuManager.addMenuEntry("main.map", showTiles); - menuManager.addMenuEntry("main.map", SimpleMenuEntry.getSeparator()); + menuManager.addMenuEntry("main.map", MenuEntry.getSeparator()); properties = new SimpleMenuEntry("Map Properties"); properties.setMnemonic('P'); properties.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, Event.CTRL_MASK)); @@ -794,7 +795,7 @@ }); menuManager.addMenuEntry("main.pickmaps", lockPickmaps); - menuManager.addMenuEntry("main.pickmaps", SimpleMenuEntry.getSeparator()); + menuManager.addMenuEntry("main.pickmaps", MenuEntry.getSeparator()); newPickmap = new SimpleMenuEntry("Add New Pickmap"); newPickmap.setMnemonic('N'); @@ -819,7 +820,7 @@ } }); menuManager.addMenuEntry("main.pickmaps", deletePickmap); - menuManager.addMenuEntry("main.pickmaps", SimpleMenuEntry.getSeparator()); + menuManager.addMenuEntry("main.pickmaps", MenuEntry.getSeparator()); loadPickmap = new SimpleMenuEntry("Open Active Pickmap as Map"); loadPickmap.setMnemonic('O'); @@ -891,7 +892,7 @@ } }); menuManager.addMenuEntry("main.resources", spellC); - menuManager.addMenuEntry("main.resources", SimpleMenuEntry.getSeparator()); + menuManager.addMenuEntry("main.resources", MenuEntry.getSeparator()); viewTreasure = new SimpleMenuEntry("View Treasurelists"); viewTreasure.setMnemonic('T'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-12 19:33:07
|
Revision: 1057 http://svn.sourceforge.net/gridarta/?rev=1057&view=rev Author: akirschbaum Date: 2006-12-12 11:33:03 -0800 (Tue, 12 Dec 2006) Log Message: ----------- Make View|Reset View work. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CMainMenu.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-12-12 19:26:42 UTC (rev 1056) +++ trunk/crossfire/ChangeLog 2006-12-12 19:33:03 UTC (rev 1057) @@ -1,3 +1,7 @@ +2006-12-12 Andreas Kirschbaum + + * Make View|Reset View work. + 2006-12-10 Andreas Kirschbaum * Make WorldMaker script more robust: Modified: trunk/crossfire/src/cfeditor/CMainMenu.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainMenu.java 2006-12-12 19:26:42 UTC (rev 1056) +++ trunk/crossfire/src/cfeditor/CMainMenu.java 2006-12-12 19:33:03 UTC (rev 1057) @@ -605,7 +605,7 @@ new ActionListener() { public void actionPerformed(final ActionEvent event) { // set tileEdit to zero (-> show all) - mainControl.setTileEdit(0); + mainControl.unsetTileEdit(~0); monster.setChecked(false); exit.setChecked(false); background.setChecked(false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-12 19:26:42
|
Revision: 1056 http://svn.sourceforge.net/gridarta/?rev=1056&view=rev Author: akirschbaum Date: 2006-12-12 11:26:42 -0800 (Tue, 12 Dec 2006) Log Message: ----------- Do not run WorldMaker script in a loop. Modified Paths: -------------- trunk/crossfire/resource/conf/scripts.xml Modified: trunk/crossfire/resource/conf/scripts.xml =================================================================== --- trunk/crossfire/resource/conf/scripts.xml 2006-12-11 21:21:07 UTC (rev 1055) +++ trunk/crossfire/resource/conf/scripts.xml 2006-12-12 19:26:42 UTC (rev 1056) @@ -106,13 +106,7 @@ runCommand("mv /tmp/tmp.png " + Location + PictureDirectory + WorldPicture + ".png"); } -// Max run is mandatory because we are not yet able to kill batch scripts -int maxRun = 20; -while (maxRun > 0 && !scriptThread.isInterrupted()) { - checkDaList(); - Thread.sleep(CheckDelay.intValue()); - maxRun--; -} +checkDaList(); print("Done!");]]></code> <mode> <autoboot>false</autoboot> 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:32
|
Revision: 1037 http://svn.sourceforge.net/gridarta/?rev=1037&view=rev Author: akirschbaum Date: 2006-12-10 11:59:50 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Simplify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainView.java Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-12-10 19:58:30 UTC (rev 1036) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-12-10 19:59:50 UTC (rev 1037) @@ -691,8 +691,7 @@ /** {@inheritDoc} */ public void internalFrameClosing(final InternalFrameEvent event) { - final MapViewIFrame view = (MapViewIFrame) event.getSource(); - removeLevelView(view); + removeLevelView((MapViewIFrame) event.getSource()); } /** {@inheritDoc} */ 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:31
|
Revision: 1034 http://svn.sourceforge.net/gridarta/?rev=1034&view=rev Author: akirschbaum Date: 2006-12-10 11:47:45 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Whitespace changes. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFArchAttrib.java trunk/crossfire/src/cfeditor/CGUIUtils.java trunk/crossfire/src/cfeditor/CMainToolbar.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CFArchAttrib.java trunk/daimonin/src/daieditor/CMainView.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-10 19:39:20 UTC (rev 1033) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-10 19:47:45 UTC (rev 1034) @@ -433,7 +433,6 @@ gbc.gridy++; header.add(new JLabel("Archetype: ", SwingConstants.TRAILING), gbc); // create label - gbc.gridx = 3; gbc.gridy = 1; gbc.weightx = 1.0; @@ -1441,7 +1440,6 @@ public void focusLost(final FocusEvent e) { } - /** A single Attribute, combining the CFArchAttrib with its input component(s). */ private static class DialogAttrib<T> { @@ -1461,7 +1459,6 @@ } // class DialogAttrib - /** DialogAttrib for types with bitmasks to choose from. */ static final class BitmaskAttrib extends DialogAttrib<JTextComponent> { @@ -1502,7 +1499,6 @@ } // class BitmaskAttrib - /** ActionListener for help-buttons. */ private final class HelpActionListener implements ActionListener { @@ -1532,7 +1528,6 @@ } // class HelpActionListener - /** ActionListener for the change buttons of bitmasks. */ private static final class MaskChangeAL extends AbstractAction { @@ -1565,7 +1560,6 @@ } // class MaskChangeAL - /** * ActionListener for the buttons on treasurelists. When such a button is * pressed, the dialog with treasurelists pops up. @@ -1601,7 +1595,6 @@ } // class ViewTreasurelistAL - /** * ActionListener for the buttons in the ConfirmErrors popup dialog and * also WindowListener for the closebox of the dialog (which would equal a @@ -1661,7 +1654,6 @@ } // class ConfirmErrorsAL - /** ItemListener for the type-selection box on the attribute-dialog. */ private final class TypesBoxAL implements ItemListener { @@ -1737,7 +1729,6 @@ } // class TypesBoxAL - /** * KeySelectionManager to manage the select-per-keystroke in a JComboBox * (The default KeySelectionManager fails because all strings start with Modified: trunk/crossfire/src/cfeditor/CFArchAttrib.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchAttrib.java 2006-12-10 19:39:20 UTC (rev 1033) +++ trunk/crossfire/src/cfeditor/CFArchAttrib.java 2006-12-10 19:47:45 UTC (rev 1034) @@ -233,7 +233,6 @@ return false; } - final String listName1 = listNames.substring(0, seppos); final String listName2 = listNames.substring(seppos + 1); Modified: trunk/crossfire/src/cfeditor/CGUIUtils.java =================================================================== --- trunk/crossfire/src/cfeditor/CGUIUtils.java 2006-12-10 19:39:20 UTC (rev 1033) +++ trunk/crossfire/src/cfeditor/CGUIUtils.java 2006-12-10 19:47:45 UTC (rev 1034) @@ -160,7 +160,6 @@ return new ImageIcon(grayIcon); } - /** Grayscale filter to make grayscaled images. */ private final class CGrayScaleFilter extends RGBImageFilter { Modified: trunk/crossfire/src/cfeditor/CMainToolbar.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainToolbar.java 2006-12-10 19:39:20 UTC (rev 1033) +++ trunk/crossfire/src/cfeditor/CMainToolbar.java 2006-12-10 19:47:45 UTC (rev 1034) @@ -181,7 +181,6 @@ addSeparator(); - final JButton prevWindow = new CFancyButton( filterLabel("Prev"), "Show Previous Window", Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-12-10 19:39:20 UTC (rev 1033) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-12-10 19:47:45 UTC (rev 1034) @@ -213,7 +213,6 @@ // Build the placeholder for tile palette archPanel = new CArchPanel(mainControl); mapTileList = new CMapTileList(mainControl, this); - mapDesktop = new JDesktopPane(); if (!mapTileListBottom) { @@ -553,7 +552,6 @@ return null; } - /* * {@inheritDoc} * This implementation displays the exception in a modal message dialog. @@ -594,9 +592,8 @@ * all windows iconified by the user. */ void updateFocus(final boolean fCareAboutIconification) { - // Show the next level (if such exists) - for ( final MapViewIFrame view : mapViews) { + for (final MapViewIFrame view : mapViews) { if (view.isIcon()) { if (!fCareAboutIconification) { Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-10 19:39:20 UTC (rev 1033) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-10 19:47:45 UTC (rev 1034) @@ -296,8 +296,6 @@ // Highlight the selected area paintHighlightArea(grfx); } - - } /** @@ -388,7 +386,6 @@ paintHighlightTile(grfx, point); } - @Override public void setHighlightTile(final Point point) { if (isPickmap) { paintHighlightTile(getGraphics(), point); Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-12-10 19:39:20 UTC (rev 1033) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-12-10 19:47:45 UTC (rev 1034) @@ -429,7 +429,6 @@ gbc.gridy++; header.add(new JLabel("Archetype: ", SwingConstants.TRAILING), gbc); // create label - gbc.gridx = 3; gbc.gridy = 1; gbc.weightx = 1.0; @@ -1418,7 +1417,6 @@ public void focusLost(final FocusEvent e) { } - /** A single Attribute, combining the CFArchAttrib with its input component(s). */ private static class DialogAttrib<T> { @@ -1438,7 +1436,6 @@ } // class DialogAttrib - /** DialogAttrib for types with bitmasks to choose from. */ static final class BitmaskAttrib extends DialogAttrib<JTextComponent> { @@ -1479,7 +1476,6 @@ } // class BitmaskAttrib - /** ActionListener for help-buttons. */ private final class HelpActionListener implements ActionListener { @@ -1509,7 +1505,6 @@ } // class HelpActionListener - /** ActionListener for the change buttons of bitmasks. */ private static final class MaskChangeAL extends AbstractAction { @@ -1542,7 +1537,6 @@ } // class MaskChangeAL - /** * ActionListener for the buttons on treasurelists. When such a button is * pressed, the dialog with treasurelists pops up. @@ -1578,7 +1572,6 @@ } // class ViewTreasurelistAL - /** * ActionListener for the buttons in the ConfirmErrors popup dialog and * also WindowListener for the closebox of the dialog (which would equal a @@ -1638,7 +1631,6 @@ } // class ConfirmErrorsAL - /** ItemListener for the type-selection box on the attribute-dialog. */ private final class TypesBoxAL implements ItemListener { @@ -1712,7 +1704,6 @@ } // class TypesBoxAL - /** * KeySelectionManager to manage the select-per-keystroke in a JComboBox * (The default KeySelectionManager fails because all strings start with @@ -1750,7 +1741,6 @@ } // class StringKeyManager - /** Action for choosing a face or animation. */ private static final class TreeChooseAction extends AbstractAction { Modified: trunk/daimonin/src/daieditor/CFArchAttrib.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchAttrib.java 2006-12-10 19:39:20 UTC (rev 1033) +++ trunk/daimonin/src/daieditor/CFArchAttrib.java 2006-12-10 19:47:45 UTC (rev 1034) @@ -230,7 +230,6 @@ return false; } - final String listName1 = listNames.substring(0, seppos); final String listName2 = listNames.substring(seppos + 1); Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-12-10 19:39:20 UTC (rev 1033) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-12-10 19:47:45 UTC (rev 1034) @@ -518,7 +518,6 @@ * all windows iconified by the user. */ void updateFocus(final boolean fCareAboutIconification) { - // Show the next level (if such exists) for (final MapViewIFrame view : mapViews) { 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:31
|
Revision: 1036 http://svn.sourceforge.net/gridarta/?rev=1036&view=rev Author: akirschbaum Date: 2006-12-10 11:58:30 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Remove duplicate function. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/MapViewIFrame.java Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-12-10 19:54:24 UTC (rev 1035) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-12-10 19:58:30 UTC (rev 1036) @@ -680,7 +680,7 @@ public void levelViewFocusGainedNotify(final MapViewIFrame view) { mapViews.remove(view); mapViews.add(0, view); - final MapControl level = view.getLevel(); + final MapControl level = view.getMapControl(); mainControl.setCurrentLevel(level); //statusBar.setLevelInfo(level); } Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-12-10 19:54:24 UTC (rev 1035) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-12-10 19:58:30 UTC (rev 1036) @@ -105,14 +105,6 @@ setTitle(strTitle); // display new title } - /** - * Returns the controller of this view. - * @return The controller of this view. - */ - public MapControl getLevel() { - return mapControl; - } - // following a bunch of wrapper methods which just pass access // to the basic mapview object 'view': public Point getMapMouseRightPos() { 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:30
|
Revision: 1033 http://svn.sourceforge.net/gridarta/?rev=1033&view=rev Author: akirschbaum Date: 2006-12-10 11:39:20 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Unify variable names. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainView.java trunk/daimonin/src/daieditor/CMainView.java Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-12-10 19:14:38 UTC (rev 1032) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-12-10 19:39:20 UTC (rev 1033) @@ -329,8 +329,8 @@ return archPanel.getArchPanelSelection(); } - public void showArchPanelQuickObject(final GameObject arch) { - archPanel.showArchPanelQuickObject(arch); + public void showArchPanelQuickObject(final GameObject gameObject) { + archPanel.showArchPanelQuickObject(gameObject); } /** @@ -411,11 +411,11 @@ /** * Sets <code>true</code> when archpanel is merged into the bottom panel. - * @param state <code>true</code> when archpanel is merged into the bottom - * panel + * @param mapTileListBottom <code>true</code> when archpanel is merged into + * the bottom panel */ - public void setMapTileListBottom(final boolean state) { - mapTileListBottom = state; + public void setMapTileListBottom(final boolean mapTileListBottom) { + this.mapTileListBottom = mapTileListBottom; } /** Notifies that the application is about to exit. */ @@ -690,57 +690,57 @@ /** * Invoked when the internal frame view is opened. - * @param e the occurred <code>InternalFrameEvent</code> + * @param event the occurred <code>InternalFrameEvent</code> */ - public void internalFrameOpened(final InternalFrameEvent e) { + public void internalFrameOpened(final InternalFrameEvent event) { } /** * Invoked when the internal frame view is closing. - * @param e the occurred <code>InternalFrameEvent</code> + * @param event the occurred <code>InternalFrameEvent</code> */ - public void internalFrameClosing(final InternalFrameEvent e) { - final MapViewIFrame view = (MapViewIFrame) e.getSource(); + public void internalFrameClosing(final InternalFrameEvent event) { + final MapViewIFrame view = (MapViewIFrame) event.getSource(); removeLevelView(view); } /** * Invoked when the internal frame view is closed. - * @param e the occurred <code>InternalFrameEvent</code> + * @param event the occurred <code>InternalFrameEvent</code> */ - public void internalFrameClosed(final InternalFrameEvent e) { + public void internalFrameClosed(final InternalFrameEvent event) { } /** * Invoked when the internal frame view is iconified. - * @param e the occurred <code>InternalFrameEvent</code> + * @param event the occurred <code>InternalFrameEvent</code> */ - public void internalFrameIconified(final InternalFrameEvent e) { - final MapViewIFrame view = (MapViewIFrame) e.getSource(); + public void internalFrameIconified(final InternalFrameEvent event) { + final MapViewIFrame view = (MapViewIFrame) event.getSource(); levelViewFocusLostNotify(view); } /** * Invoked when the internal frame view is deiconified. - * @param e the occurred <code>InternalFrameEvent</code> + * @param event the occurred <code>InternalFrameEvent</code> */ - public void internalFrameDeiconified(final InternalFrameEvent e) { + public void internalFrameDeiconified(final InternalFrameEvent event) { } /** * Invoked when the internal frame view is activated. - * @param e the occurred <code>InternalFrameEvent</code> + * @param event the occurred <code>InternalFrameEvent</code> */ - public void internalFrameActivated(final InternalFrameEvent e) { - final MapViewIFrame view = (MapViewIFrame) e.getSource(); + public void internalFrameActivated(final InternalFrameEvent event) { + final MapViewIFrame view = (MapViewIFrame) event.getSource(); levelViewFocusGainedNotify(view); } /** * Invoked when the internal frame view is deactivated. - * @param e the occurred <code>InternalFrameEvent</code> + * @param event the occurred <code>InternalFrameEvent</code> */ - public void internalFrameDeactivated(final InternalFrameEvent e) { + public void internalFrameDeactivated(final InternalFrameEvent event) { } public CMainStatusbar getStatusBar() { Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-12-10 19:14:38 UTC (rev 1032) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-12-10 19:39:20 UTC (rev 1033) @@ -351,8 +351,8 @@ } // access mape tile list ... - public void setMapTileList(final MapControl map, final GameObject selArch) { - mapTileList.setMapTileList(map, selArch); + public void setMapTileList(final MapControl map, final GameObject gameObject) { + mapTileList.setMapTileList(map, gameObject); } public void refreshMapTileList() { 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:30
|
Revision: 1031 http://svn.sourceforge.net/gridarta/?rev=1031&view=rev Author: akirschbaum Date: 2006-12-10 11:10:17 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Unify (remove) functions in MapModel. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/crossfire/src/cfeditor/map/MapModel.java trunk/crossfire/src/cfeditor/parameter/MapParameter.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-10 19:07:55 UTC (rev 1030) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-10 19:10:17 UTC (rev 1031) @@ -542,7 +542,7 @@ for (final MapControl level : levels) { level.getMapViewFrame().updateLookAndFeel(); if (log.isDebugEnabled()) { - log.debug("map " + level.getMapName()); + log.debug("map " + level.getMapArch().getMapName()); } } } Modified: trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java 2006-12-10 19:07:55 UTC (rev 1030) +++ trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java 2006-12-10 19:10:17 UTC (rev 1031) @@ -189,7 +189,7 @@ private JPanel createMapPanel(final MapArchObject map) { final JPanel panel = new JPanel(new GridLayout(0, 1)); - panel.add(createPanelLine(mapName, 16, mapControl.getMapName(), "mapName")); + panel.add(createPanelLine(mapName, 16, map.getMapName(), "mapName")); panel.add(createPanelLine(mapRegion, 16, map.getMapRegion(), "mapRegion")); final Size2D mapSize = mapControl.getMapSize(); panel.add(createPanelLine(levelWidthField, 10, String.valueOf(mapSize.getWidth()), "mapWidth")); @@ -570,7 +570,7 @@ mapDescription.setText(map.getText()); mapLore.setText(map.getLore()); - mapName.setText(mapControl.getMapName()); + mapName.setText(map.getMapName()); mapRegion.setText("" + map.getMapRegion()); final Size2D mapSize = map.getMapSize(); levelWidthField.setText(String.valueOf(mapSize.getWidth())); Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-12-10 19:07:55 UTC (rev 1030) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-12-10 19:10:17 UTC (rev 1031) @@ -444,26 +444,6 @@ } /** {@inheritDoc} */ - public void setFileName(final String strFileName) { - getMapArchObject().setFileName(strFileName); - } - - /** {@inheritDoc} */ - public String getFileName() { - return getMapArchObject().getFileName(); - } - - /** {@inheritDoc} */ - public void setMapName(final String name) { - getMapArchObject().setMapName(name); - } - - /** {@inheritDoc} */ - public String getMapName() { - return getMapArchObject().getMapDisplayName(); - } - - /** {@inheritDoc} */ @Nullable public GameObject getExit(@Nullable final Point hspot) { if (hspot == null || !isPointValid(hspot)) { return null; // out of map Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-12-10 19:07:55 UTC (rev 1030) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-12-10 19:10:17 UTC (rev 1031) @@ -47,6 +47,8 @@ */ private final CMainControl mainControl; + private final MapArchObject mapArch; + /** * model (= map data of this level). */ @@ -101,6 +103,7 @@ */ public MapControl(final CMainControl mainControl, final List<GameObject> objects, final MapArchObject maparch, final boolean isPickmap, final Point initial) { this.mainControl = mainControl; + mapArch = maparch; activeEditType = 0; // start with no edit types (saves time) this.isPickmap = isPickmap; // is this a pickmap? // we create model (= data) @@ -230,6 +233,19 @@ return mapModel.getMapArchObject().getTilePath(direction); } + public String getMapFileName() { + return mapArch.getFileName(); + } + + public void setMapFileName(final String fname) { + if (mapViewFrame != null) { + final String title = fname + " [ " + mapArch.getMapName() + " ]"; + assert mapViewFrame != null; + mapViewFrame.setTitle(title); + } + mapArch.setFileName(fname); + } + public boolean containsArchObject(final Point pos) { return mapModel.containsArchObject(pos); } @@ -360,31 +376,6 @@ mapModel.resizeMap(size); } - /** - * Returns the name of this map. - * @return The name of this map. - */ - public String getMapName() { - return mapModel.getMapName(); - } - - /** - * Set the level name. - * @param strName the level name - */ - public void setMapName(final String strName) { - mapModel.setMapName(strName); - } - - public String getMapFileName() { - return mapModel.getFileName(); - } - - public void setMapFileName(final String fname) { - mapViewFrame.setTitle("Map [" + fname + "]"); - mapModel.setFileName(fname); - } - public void setLevelChangedFlag() { mapModel.setLevelChangedFlag(); } Modified: trunk/crossfire/src/cfeditor/map/MapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapModel.java 2006-12-10 19:07:55 UTC (rev 1030) +++ trunk/crossfire/src/cfeditor/map/MapModel.java 2006-12-10 19:10:17 UTC (rev 1031) @@ -119,30 +119,6 @@ boolean containsArchObject(Point pos); /** - * Get the map name as seen by the player. - * @return the map name - */ - String getMapName(); - - /** - * Update the map name as seen by the player. - * @param name the new map name - */ - void setMapName(String name); - - /** - * Get the map filename. - * @return the map filename - */ - String getFileName(); - - /** - * Update the map filename. - * @param strFileName the new map filename - */ - void setFileName(String strFileName); - - /** * Reset the level changed flag to false. * @todo this probably belongs to CMapControl instead */ Modified: trunk/crossfire/src/cfeditor/parameter/MapParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/MapParameter.java 2006-12-10 19:07:55 UTC (rev 1030) +++ trunk/crossfire/src/cfeditor/parameter/MapParameter.java 2006-12-10 19:10:17 UTC (rev 1031) @@ -65,7 +65,7 @@ super.setValue(null); } else { final MapControl map = (MapControl) value; - super.setValue(map.getMapName()); + super.setValue(map.getMapArch().getMapName()); } } 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:26
|
Revision: 1028 http://svn.sourceforge.net/gridarta/?rev=1028&view=rev Author: akirschbaum Date: 2006-12-10 10:29:56 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Move unified class ArchAttribType to gridarta source. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFArchAttrib.java trunk/crossfire/src/cfeditor/CFArchType.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CFArchAttrib.java trunk/daimonin/src/daieditor/CFArchType.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gameobject/ArchAttribType.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/gameobject/ArchAttribType.java trunk/daimonin/src/daieditor/gameobject/ArchAttribType.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-10 18:10:58 UTC (rev 1027) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-10 18:29:56 UTC (rev 1028) @@ -24,7 +24,6 @@ package cfeditor; -import cfeditor.gameobject.ArchAttribType; import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; import java.awt.BorderLayout; @@ -85,6 +84,7 @@ import javax.swing.text.Style; import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; +import net.sf.gridarta.gameobject.ArchAttribType; import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.NamedObject; import net.sf.gridarta.gameobject.NamedObjects; Modified: trunk/crossfire/src/cfeditor/CFArchAttrib.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchAttrib.java 2006-12-10 18:10:58 UTC (rev 1027) +++ trunk/crossfire/src/cfeditor/CFArchAttrib.java 2006-12-10 18:29:56 UTC (rev 1028) @@ -24,11 +24,11 @@ package cfeditor; -import cfeditor.gameobject.ArchAttribType; import java.io.BufferedReader; import java.io.EOFException; import java.io.IOException; import java.io.StringReader; +import net.sf.gridarta.gameobject.ArchAttribType; import org.apache.log4j.Logger; import org.jdom.Attribute; import org.jdom.DataConversionException; Modified: trunk/crossfire/src/cfeditor/CFArchType.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchType.java 2006-12-10 18:10:58 UTC (rev 1027) +++ trunk/crossfire/src/cfeditor/CFArchType.java 2006-12-10 18:29:56 UTC (rev 1028) @@ -24,11 +24,11 @@ package cfeditor; -import cfeditor.gameobject.ArchAttribType; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import net.sf.gridarta.gameobject.ArchAttribType; import org.apache.log4j.Logger; import org.jdom.Attribute; import org.jdom.Element; Deleted: trunk/crossfire/src/cfeditor/gameobject/ArchAttribType.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchAttribType.java 2006-12-10 18:10:58 UTC (rev 1027) +++ trunk/crossfire/src/cfeditor/gameobject/ArchAttribType.java 2006-12-10 18:29:56 UTC (rev 1028) @@ -1,78 +0,0 @@ -/* - * Daimonin Java Editor. - * Copyright (C) 2005 Christian Hujer - * - * 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., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package cfeditor.gameobject; - -/** - * Enumeration for Archetype Attribute Types. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public enum ArchAttribType { - - /** Boolean -> Checkbox. */ - BOOL, - - /** Boolean -> Checkbox, with customized true/false values. */ - BOOL_SPEC, - - /** Integer -> Textfield. */ - INT, - - /** Long -> Textfield. */ - LONG, - - /** Float -> Textfield. */ - FLOAT, - - /** String -> Textfield. */ - STRING, - - /** Text -> Textarea. */ - TEXT, - - /** Fixed String -> (No input). */ - FIXED, - - /** Spell -> Spell number (Combobox). */ - SPELL, - - /** ZSpell -> Spell number (except that 0 is always 0, not magic bullet). */ - ZSPELL, - - /** Bitmask -> Special input with popup frame. */ - BITMASK, - - /** List -> Combobox. */ - LIST, - - /** Treasure -> treasurelist (Textfield and Tree). */ - TREASURE, - - /** Double List -> 2 × Combobox. */ - DBLLIST, - - /** Face name -> Textfield and Tree. */ - FACENAME, - - /** Animation name -> Textfield and Tree. */ - ANIMNAME - -} // enum ArchAttribType Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-12-10 18:10:58 UTC (rev 1027) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-12-10 18:29:56 UTC (rev 1028) @@ -24,7 +24,6 @@ package daieditor; -import daieditor.gameobject.ArchAttribType; import daieditor.gameobject.GameObject; import java.awt.BorderLayout; import java.awt.CardLayout; @@ -84,6 +83,7 @@ import javax.swing.text.Style; import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; +import net.sf.gridarta.gameobject.ArchAttribType; import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.NamedObject; import net.sf.gridarta.gameobject.NamedObjects; Modified: trunk/daimonin/src/daieditor/CFArchAttrib.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchAttrib.java 2006-12-10 18:10:58 UTC (rev 1027) +++ trunk/daimonin/src/daieditor/CFArchAttrib.java 2006-12-10 18:29:56 UTC (rev 1028) @@ -24,7 +24,7 @@ package daieditor; -import daieditor.gameobject.ArchAttribType; +import net.sf.gridarta.gameobject.ArchAttribType; import org.apache.log4j.Logger; import org.w3c.dom.Attr; import org.w3c.dom.Element; Modified: trunk/daimonin/src/daieditor/CFArchType.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchType.java 2006-12-10 18:10:58 UTC (rev 1027) +++ trunk/daimonin/src/daieditor/CFArchType.java 2006-12-10 18:29:56 UTC (rev 1028) @@ -24,11 +24,11 @@ package daieditor; -import daieditor.gameobject.ArchAttribType; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import net.sf.gridarta.gameobject.ArchAttribType; import net.sf.japi.swing.ActionFactory; import net.sf.japi.xml.NodeListIterator; import static net.sf.japi.xml.NodeListIterator.getFirstChild; Deleted: trunk/daimonin/src/daieditor/gameobject/ArchAttribType.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchAttribType.java 2006-12-10 18:10:58 UTC (rev 1027) +++ trunk/daimonin/src/daieditor/gameobject/ArchAttribType.java 2006-12-10 18:29:56 UTC (rev 1028) @@ -1,78 +0,0 @@ -/* - * Daimonin Java Editor. - * Copyright (C) 2005 Christian Hujer - * - * 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., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package daieditor.gameobject; - -/** - * Enumeration for Archetype Attribute Types. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public enum ArchAttribType { - - /** Boolean -> Checkbox. */ - BOOL, - - /** Boolean -> Checkbox, with customized true/false values. */ - BOOL_SPEC, - - /** Integer -> Textfield. */ - INT, - - /** Long -> Textfield. */ - LONG, - - /** Float -> Textfield. */ - FLOAT, - - /** String -> Textfield. */ - STRING, - - /** Text -> Textarea. */ - TEXT, - - /** Fixed String -> (No input). */ - FIXED, - - /** Spell -> Spell number (Combobox). */ - SPELL, - - /** ZSpell -> Spell number (except that 0 is always 0, not magic bullet). */ - ZSPELL, - - /** Bitmask -> Special input with popup frame. */ - BITMASK, - - /** List -> Combobox. */ - LIST, - - /** Treasure -> treasurelist (Textfield and Tree). */ - TREASURE, - - /** Double List -> 2 × Combobox. */ - DBLLIST, - - /** Face name -> Textfield and Tree. */ - FACENAME, - - /** Animation name -> Textfield and Tree. */ - ANIMNAME - -} // enum ArchAttribType Added: trunk/src/app/net/sf/gridarta/gameobject/ArchAttribType.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/ArchAttribType.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/ArchAttribType.java 2006-12-10 18:29:56 UTC (rev 1028) @@ -0,0 +1,77 @@ +/* + * Gridarta Editor. + * Copyright (C) 2005 Christian Hujer + * + * 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +package net.sf.gridarta.gameobject; + +/** + * Enumeration for Archetype Attribute Types. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public enum ArchAttribType { + + /** Boolean -> Checkbox. */ + BOOL, + + /** Boolean -> Checkbox, with customized true/false values. */ + BOOL_SPEC, + + /** Integer -> Textfield. */ + INT, + + /** Long -> Textfield. */ + LONG, + + /** Float -> Textfield. */ + FLOAT, + + /** String -> Textfield. */ + STRING, + + /** Text -> Textarea. */ + TEXT, + + /** Fixed String -> (No input). */ + FIXED, + + /** Spell -> Spell number (Combobox). */ + SPELL, + + /** ZSpell -> Spell number (except that 0 is always 0, not magic bullet). */ + ZSPELL, + + /** Bitmask -> Special input with popup frame. */ + BITMASK, + + /** List -> Combobox. */ + LIST, + + /** Treasure -> treasurelist (Textfield and Tree). */ + TREASURE, + + /** Double List -> 2 × Combobox. */ + DBLLIST, + + /** Face name -> Textfield and Tree. */ + FACENAME, + + /** Animation name -> Textfield and Tree. */ + ANIMNAME + +} // enum ArchAttribType Property changes on: trunk/src/app/net/sf/gridarta/gameobject/ArchAttribType.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...> - 2006-12-12 03:39:26
|
Revision: 1018 http://svn.sourceforge.net/gridarta/?rev=1018&view=rev Author: akirschbaum Date: 2006-12-10 08:21:49 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Use File instead of String filenames. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFJavaEditor.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/MapViewIFrame.java trunk/daimonin/src/daieditor/CFJavaEditor.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/MapViewIFrame.java Modified: trunk/crossfire/src/cfeditor/CFJavaEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/CFJavaEditor.java 2006-12-10 15:59:12 UTC (rev 1017) +++ trunk/crossfire/src/cfeditor/CFJavaEditor.java 2006-12-10 16:21:49 UTC (rev 1018) @@ -137,7 +137,7 @@ } if (outfile != null) { - mainControl.createImageWanted(outfile); // create map image + mainControl.createImageWanted(new File(outfile)); // create map image System.exit(0); // exit } @@ -145,14 +145,13 @@ } - private static void makeImage(final CMainControl mainControl, final String in, final String out) { + private static void makeImage(final CMainControl mainControl, final File in, final File out) { if (log.isInfoEnabled()) { log.info("converting " + in + " to " + out); } - final File f = new File(in); - if (f.canRead()) { - mainControl.openFile(f); + if (in.canRead()) { + mainControl.openFile(in); mainControl.createImageWanted(out); mainControl.close(); } @@ -169,7 +168,7 @@ log.info("done."); System.exit(0); } - makeImage(mainControl, in, out); + makeImage(mainControl, new File(in), new File(out)); } } catch (final IOException e) { log.info("done."); Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-10 15:59:12 UTC (rev 1017) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-10 16:21:49 UTC (rev 1018) @@ -1050,7 +1050,7 @@ if (!filename.endsWith(".png")) { filename += ".png"; } - mapControl.getMapViewFrame().printFullImage(filename); + mapControl.getMapViewFrame().printFullImage(new File(filename)); } } catch (final IOException e) { ACTION_FACTORY.showMessageDialog(mainView, "createImgIOException", filename, e.getMessage()); @@ -1062,32 +1062,32 @@ * Create an image of the current map and save it as file. * In this method, the filename is already given, so the image * is created directly (if possible). - * @param filename Name of the png image file to create. + * @param file the png image file to create */ - public void createImageWanted(final String filename) { - createImageWanted(currentMap, filename); + public void createImageWanted(final File file) { + createImageWanted(currentMap, file); } /** * Create an image of the specified map and save it as file. * In this method, the filename is already given, so the image * is created directly (if possible). - * @param filename Name of the png image file to create. - * @param mapControl The controller of map to save. + * @param mapControl the controller of map to save + * @param file the png image file to create */ - public void createImageWanted(final MapControl mapControl, final String filename) { + public void createImageWanted(final MapControl mapControl, final File file) { if (mapControl == null) { // there is no map open (should not happen due to disabled menus) ACTION_FACTORY.showMessageDialog(mainView, "createImgNoMap"); } else { try { - mapControl.getMapViewFrame().printFullImage(filename); + mapControl.getMapViewFrame().printFullImage(file); if (log.isInfoEnabled()) { - log.info(ACTION_FACTORY.format("imageCreated", filename, mapControl.getMapFileName())); + log.info(ACTION_FACTORY.format("imageCreated", file, mapControl.getMapFileName())); } } catch (final IOException e) { - ACTION_FACTORY.showMessageDialog(mainView, "createImgIOException", filename); + ACTION_FACTORY.showMessageDialog(mainView, "createImgIOException", file); } } } Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-10 15:59:12 UTC (rev 1017) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-10 16:21:49 UTC (rev 1018) @@ -295,11 +295,11 @@ /** * Convert the map into a png file. - * @param filename the file to write to + * @param file the file to write to * @throws IOException in case of I/O problems writing the image. */ - public void printFullImage(final String filename) throws IOException { - ImageIO.write(renderer.getFullImage(), "png", new File(filename)); + public void printFullImage(final File file) throws IOException { + ImageIO.write(renderer.getFullImage(), "png", file); } /** Refreshes the data in the view from the model. */ Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-12-10 15:59:12 UTC (rev 1017) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-12-10 16:21:49 UTC (rev 1018) @@ -32,6 +32,7 @@ import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Point; +import java.io.File; import java.io.IOException; import javax.swing.JInternalFrame; import javax.swing.JViewport; @@ -174,8 +175,8 @@ view.setHotspot(point); } - public void printFullImage(final String filename) throws IOException { - view.printFullImage(filename); + public void printFullImage(final File file) throws IOException { + view.printFullImage(file); } public void refreshDataFromModel() { Modified: trunk/daimonin/src/daieditor/CFJavaEditor.java =================================================================== --- trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-12-10 15:59:12 UTC (rev 1017) +++ trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-12-10 16:21:49 UTC (rev 1018) @@ -25,6 +25,7 @@ package daieditor; import static daieditor.CMainControl.PREFS_LANGUAGE; +import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -112,7 +113,7 @@ if (infiles.size() > 1) { System.err.println("Warning: you specified more than 1 map for creating an image. I will create an image for only one of them."); } - mainControl.createImageWanted(outfile); // create map image + mainControl.createImageWanted(new File(outfile)); // create map image } mainControl.refreshMenusAndToolbars(); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-12-10 15:59:12 UTC (rev 1017) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-12-10 16:21:49 UTC (rev 1018) @@ -1408,8 +1408,9 @@ if (!filename.endsWith(".png")) { filename += ".png"; } - if (!new File(filename).exists() || ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, "overwriteOtherFile", filename) == JOptionPane.YES_OPTION) { - mapControl.getMapViewFrame().printFullImage(filename); + 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(file); } } } catch (final IOException e) { @@ -1422,9 +1423,9 @@ * Create an image of the current map and save it as file. * In this method, the filename is already given, so the image * is created directly (if possible). - * @param filename Name of the png image file to create. + * @param file the png image file to create */ - public void createImageWanted(final String filename) { + public void createImageWanted(final File file) { final MapControl mapc = currentMap; // control of current map if (mapc == null) { @@ -1432,12 +1433,12 @@ ACTION_FACTORY.showMessageDialog(mainView, "createImgNoMap"); } else { try { - mapc.getMapViewFrame().printFullImage(filename); + mapc.getMapViewFrame().printFullImage(file); if (log.isInfoEnabled()) { - log.info(ACTION_FACTORY.format("imageCreated", filename, mapc.getMapFileName())); + log.info(ACTION_FACTORY.format("imageCreated", file, mapc.getMapFileName())); } } catch (final IOException e) { - ACTION_FACTORY.showMessageDialog(mainView, "createImgIOException", filename); + ACTION_FACTORY.showMessageDialog(mainView, "createImgIOException", file); } } } Modified: trunk/daimonin/src/daieditor/CMapViewBasic.java =================================================================== --- trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-12-10 15:59:12 UTC (rev 1017) +++ trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-12-10 16:21:49 UTC (rev 1018) @@ -310,11 +310,11 @@ /** * Saves an image of the entire view to a file. - * @param filename filename to write image file to + * @param file file to write image file to * @throws IOException in case of I/O problems */ - public void printFullImage(final String filename) throws IOException { - ImageIO.write(getFullImage(), "png", new File(filename)); + public void printFullImage(final File file) throws IOException { + ImageIO.write(getFullImage(), "png", file); } /** Modified: trunk/daimonin/src/daieditor/MapViewIFrame.java =================================================================== --- trunk/daimonin/src/daieditor/MapViewIFrame.java 2006-12-10 15:59:12 UTC (rev 1017) +++ trunk/daimonin/src/daieditor/MapViewIFrame.java 2006-12-10 16:21:49 UTC (rev 1018) @@ -29,6 +29,7 @@ import java.awt.Image; import java.awt.Point; import java.awt.event.ActionEvent; +import java.io.File; import java.io.IOException; import javax.swing.AbstractAction; import static javax.swing.Action.SMALL_ICON; @@ -123,8 +124,8 @@ view.setHotspot(pos); } - public void printFullImage(final String filename) throws IOException { - view.printFullImage(filename); + public void printFullImage(final File file) throws IOException { + view.printFullImage(file); } /** The Action to select this Window. */ 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:25
|
Revision: 1017 http://svn.sourceforge.net/gridarta/?rev=1017&view=rev Author: akirschbaum Date: 2006-12-10 07:59:12 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Rename variable name. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-10 15:46:05 UTC (rev 1016) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-10 15:59:12 UTC (rev 1017) @@ -1013,9 +1013,9 @@ * an output file name/path for the png image. */ public void createImg() { - final MapControl mc = currentMap; // control of current map + final MapControl mapControl = currentMap; // control of current map - if (mc == null) { + if (mapControl == null) { // there is no map open (should not happen due to disabled menus) ACTION_FACTORY.showMessageDialog(mainView, "createImgNoMap"); } else { @@ -1025,7 +1025,7 @@ strImageDir = mapDir.getAbsolutePath(); } - filename = strImageDir + File.separator + mc.getMapFileName() + ".png"; + filename = strImageDir + File.separator + mapControl.getMapFileName() + ".png"; final JFileChooser fileChooser = new JFileChooser(strImageDir); fileChooser.setDialogTitle("Save Image As"); fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); @@ -1050,7 +1050,7 @@ if (!filename.endsWith(".png")) { filename += ".png"; } - mc.getMapViewFrame().printFullImage(filename); + mapControl.getMapViewFrame().printFullImage(filename); } } catch (final IOException e) { ACTION_FACTORY.showMessageDialog(mainView, "createImgIOException", filename, e.getMessage()); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-12-10 15:46:05 UTC (rev 1016) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-12-10 15:59:12 UTC (rev 1017) @@ -1379,9 +1379,9 @@ * an output file name/path for the png image. */ public void createImg() { - final MapControl mc = currentMap; // control of current map + final MapControl mapControl = currentMap; // control of current map - if (mc == null) { + if (mapControl == null) { // there is no map open (should not happen due to disabled menus) ACTION_FACTORY.showMessageDialog(mainView, "createImgNoMap"); } else { @@ -1391,7 +1391,7 @@ strImageDir = mapDir.getAbsolutePath(); } - filename = strImageDir + File.separator + mc.getMapFileName() + ".png"; + filename = strImageDir + File.separator + mapControl.getMapFileName() + ".png"; final JFileChooser fileChooser = new JFileChooser(strImageDir); fileChooser.setDialogTitle("Save Image As"); fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); @@ -1409,7 +1409,7 @@ filename += ".png"; } if (!new File(filename).exists() || ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, "overwriteOtherFile", filename) == JOptionPane.YES_OPTION) { - mc.getMapViewFrame().printFullImage(filename); + mapControl.getMapViewFrame().printFullImage(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...> - 2006-12-12 03:39:24
|
Revision: 1014 http://svn.sourceforge.net/gridarta/?rev=1014&view=rev Author: akirschbaum Date: 2006-12-10 07:28:08 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Make WorldMaker script more robust. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/resource/conf/scripts.xml Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-12-10 15:16:01 UTC (rev 1013) +++ trunk/crossfire/ChangeLog 2006-12-10 15:28:08 UTC (rev 1014) @@ -1,3 +1,9 @@ +2006-12-10 Andreas Kirschbaum + + * Make WorldMaker script more robust: + - create PictureDirectory if it does not exist + - do not require a trailing / for PictureDirectory + 2006-12-07 Andreas Kirschbaum * Make mouse position display work again. Modified: trunk/crossfire/resource/conf/scripts.xml =================================================================== --- trunk/crossfire/resource/conf/scripts.xml 2006-12-10 15:16:01 UTC (rev 1013) +++ trunk/crossfire/resource/conf/scripts.xml 2006-12-10 15:28:08 UTC (rev 1014) @@ -69,6 +69,11 @@ Location = Location + File.separator; } + if (!PictureDirectory.endsWith(File.separator)) { + PictureDirectory = PictureDirectory + File.separator; + } + new File(Location + PictureDirectory).mkdirs(); + HashSet mapList = new HashSet(); boolean firstRun = false; if (fileExists(Location + PictureDirectory + WorldPicture + ".ppm")) { @@ -179,7 +184,7 @@ <name>PictureDirectory</name> <description>The subdirectory where to put pictures</description> <type>java.lang.String</type> - <value>images/</value> + <value>images</value> </parameter> <parameter> <name>WorldPicture</name> 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:24
|
Revision: 1013 http://svn.sourceforge.net/gridarta/?rev=1013&view=rev Author: akirschbaum Date: 2006-12-10 07:16:01 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Whitespace change. Modified Paths: -------------- trunk/crossfire/resource/conf/scripts.xml Modified: trunk/crossfire/resource/conf/scripts.xml =================================================================== --- trunk/crossfire/resource/conf/scripts.xml 2006-12-10 15:15:27 UTC (rev 1012) +++ trunk/crossfire/resource/conf/scripts.xml 2006-12-10 15:16:01 UTC (rev 1013) @@ -60,7 +60,7 @@ DestHeight = TileHeight.intValue() * NumY.intValue(); if (Location == null || Location.length() < 1) { - Location=mainControl.getMapDefaultFolder(); + Location = mainControl.getMapDefaultFolder(); print("autodetected location " + Location); } 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:23
|
Revision: 1012 http://svn.sourceforge.net/gridarta/?rev=1012&view=rev Author: akirschbaum Date: 2006-12-10 07:15:27 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Whitespace changes; remove debugging print statements. Modified Paths: -------------- trunk/crossfire/resource/conf/scripts.xml Modified: trunk/crossfire/resource/conf/scripts.xml =================================================================== --- trunk/crossfire/resource/conf/scripts.xml 2006-12-10 14:23:47 UTC (rev 1011) +++ trunk/crossfire/resource/conf/scripts.xml 2006-12-10 15:15:27 UTC (rev 1012) @@ -2,101 +2,114 @@ <scripts> <script> <name>WorldMaker</name> - <code><![CDATA[//input your beanshell Code -import java.io.*; + <code><![CDATA[import java.io.*; import cfeditor.IGUIConstants; + /* * Functions declaration */ -String getSimpleFilename(String mapFilename){ - int i = mapFilename.lastIndexOf(File.separator); - if (i>0) - mapFilename=mapFilename.substring(i+1); - return mapFilename; +String getSimpleFilename(String mapFilename) { + int i = mapFilename.lastIndexOf(File.separator); + if (i > 0) { + mapFilename = mapFilename.substring(i + 1); + } + return mapFilename; } -String getPngImageFilename(String mapFilename){ - return Location+PictureDirectory+getSimpleFilename(mapFilename)+".png"; +String getPngImageFilename(String mapFilename) { + return Location + PictureDirectory + getSimpleFilename(mapFilename) + ".png"; } -boolean updateMap(String mapFile, String pictureFile){ - File image = new File(pictureFile); - File map = new File(mapFile); - if (!map.exists()) - return false; - if ( (image.exists()) && (image.lastModified() >= map.lastModified())) - return false; - print ("converting "+mapFile+" to "+pictureFile+"."); - mapControl = mainControl.openFile(map,false); - print ("map control is "+mapControl); - mainControl.createImageWanted(mapControl, pictureFile); - mainControl.closeLevel(mapControl,true); - return true; + +boolean updateMap(String mapFile, String pictureFile) { + File image = new File(pictureFile); + File map = new File(mapFile); + if (!map.exists()) { + return false; + } + if (image.exists() && image.lastModified() >= map.lastModified()) { + return false; + } + print("converting " + mapFile + " to " + pictureFile + "."); + mapControl = mainControl.openFile(map, false); + mainControl.createImageWanted(mapControl, pictureFile); + mainControl.closeLevel(mapControl, true); + return true; } -boolean fileExists(String name){return new File(name).exists();} -boolean runCommand(String cmd){ - f = File.createTempFile("WMaker",".sh"); - FileWriter out = new FileWriter(f); - out.write(cmd); - out.close(); - print ("running "+cmd); - Process p = Runtime.getRuntime().exec("sh "+f.getAbsolutePath()); - p.waitFor(); - f.delete(); - return (p.exitValue()==0); + +boolean fileExists(String name) { + return new File(name).exists(); } + +boolean runCommand(String cmd) { + f = File.createTempFile("WMaker", ".sh"); + FileWriter out = new FileWriter(f); + out.write(cmd); + out.close(); + print("running " + cmd); + Process p = Runtime.getRuntime().exec("sh " + f.getAbsolutePath()); + p.waitFor(); + f.delete(); + return p.exitValue() == 0; +} + /* * Running code */ -void checkDaList(){ - DestWidth=TileWidth.intValue()*NumX.intValue(); - DestHeight=TileHeight.intValue()*NumY.intValue(); - if ( (Location==null) || (Location.length()<1)){ - Location=mainControl.getMapDefaultFolder(); - print ("autodetected location "+Location); - } - print ("World map will be "+DestWidth+"x"+DestHeight+" in size"); - if (!Location.endsWith(File.separator)) - Location=Location+File.separator; - HashSet mapList = new HashSet(); - boolean firstRun = false; - if (fileExists(Location+PictureDirectory+WorldPicture+".ppm")){ - runCommand("cp "+Location+PictureDirectory+WorldPicture+".ppm /tmp/tmp.ppm"); - } else{ - runCommand("ppmmake \\#000 "+DestWidth+" "+DestHeight+" > /tmp/tmp.ppm"); - firstRun=true; - print ("Creating images for the first time."); - } - for (int x = 0;x< NumX.intValue();x++){ - for (int y = 0;y< NumY.intValue();y++){ - currentX = StartX.intValue()+x; - currentY = StartY.intValue()+y; - currentMap = Location+MapFilename+"_"+currentX+"_"+currentY; - currentPicture = getPngImageFilename(currentMap); - didUpdate = updateMap(currentMap,currentPicture); - if ( (didUpdate || firstRun) && fileExists(currentPicture)){ - print ("converting ...."); - runCommand("pngtopnm "+currentPicture+" | pnmscale -xysize "+TileWidth+" "+TileHeight+" > /tmp/ppm.tmp"); - sx = x * TileWidth.intValue(); - sy = y * TileHeight.intValue(); - runCommand("pnmpaste /tmp/ppm.tmp "+sx+" "+sy+" /tmp/tmp.ppm > /tmp/tmp.ppm1"); - runCommand("rm -f /tmp/tmp.ppm"); - runCommand("mv /tmp/tmp.ppm1 /tmp/tmp.ppm"); - } - } - } - runCommand("mv /tmp/tmp.ppm "+Location+PictureDirectory+WorldPicture+".ppm"); - print ("converting to png if possible.\n"); - runCommand("pnmtopng "+Location+PictureDirectory+WorldPicture+".ppm > /tmp/tmp.png"); - runCommand("mv /tmp/tmp.png "+Location+PictureDirectory+WorldPicture+".png"); +void checkDaList() { + DestWidth = TileWidth.intValue() * NumX.intValue(); + DestHeight = TileHeight.intValue() * NumY.intValue(); + + if (Location == null || Location.length() < 1) { + Location=mainControl.getMapDefaultFolder(); + print("autodetected location " + Location); + } + + print("World map will be " + DestWidth + "x" + DestHeight + " in size"); + if (!Location.endsWith(File.separator)) { + Location = Location + File.separator; + } + + HashSet mapList = new HashSet(); + boolean firstRun = false; + if (fileExists(Location + PictureDirectory + WorldPicture + ".ppm")) { + runCommand("cp " + Location + PictureDirectory + WorldPicture + ".ppm /tmp/tmp.ppm"); + } else { + runCommand("ppmmake \\#000 " + DestWidth + " " + DestHeight + " > /tmp/tmp.ppm"); + firstRun = true; + print("Creating images for the first time."); + } + + for (int x = 0; x < NumX.intValue(); x++) { + for (int y = 0;y < NumY.intValue(); y++) { + currentX = StartX.intValue() + x; + currentY = StartY.intValue() + y; + currentMap = Location + MapFilename + "_" + currentX + "_" + currentY; + currentPicture = getPngImageFilename(currentMap); + didUpdate = updateMap(currentMap, currentPicture); + if ((didUpdate || firstRun) && fileExists(currentPicture)) { + runCommand("pngtopnm " + currentPicture + " | pnmscale -xysize " + TileWidth + " " + TileHeight + " > /tmp/ppm.tmp"); + sx = x * TileWidth.intValue(); + sy = y * TileHeight.intValue(); + runCommand("pnmpaste /tmp/ppm.tmp " + sx + " " + sy + " /tmp/tmp.ppm > /tmp/tmp.ppm1"); + runCommand("rm -f /tmp/tmp.ppm"); + runCommand("mv /tmp/tmp.ppm1 /tmp/tmp.ppm"); + } + } + } + runCommand("mv /tmp/tmp.ppm " + Location + PictureDirectory + WorldPicture + ".ppm"); + print("converting to png if possible.\n"); + runCommand("pnmtopng " + Location + PictureDirectory + WorldPicture + ".ppm > /tmp/tmp.png"); + runCommand("mv /tmp/tmp.png " + Location + PictureDirectory + WorldPicture + ".png"); } + // Max run is mandatory because we are not yet able to kill batch scripts int maxRun = 20; -while ( (maxRun>0) && (!scriptThread.isInterrupted())){ - checkDaList(); - Thread.sleep(CheckDelay.intValue()); - maxRun--; +while (maxRun > 0 && !scriptThread.isInterrupted()) { + checkDaList(); + Thread.sleep(CheckDelay.intValue()); + maxRun--; } -print ("Done!");]]></code> +print("Done!");]]></code> <mode> <autoboot>false</autoboot> <bash>true</bash> @@ -184,4 +197,3 @@ </parameter> </script> </scripts> - 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:23
|
Revision: 1010 http://svn.sourceforge.net/gridarta/?rev=1010&view=rev Author: akirschbaum Date: 2006-12-10 06:16:46 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Remove IdGenerator class. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/ScriptEditor.java trunk/crossfire/src/cfeditor/gui/ScriptManager.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/IdGenerator.java Deleted: trunk/crossfire/src/cfeditor/IdGenerator.java =================================================================== --- trunk/crossfire/src/cfeditor/IdGenerator.java 2006-12-10 14:13:43 UTC (rev 1009) +++ trunk/crossfire/src/cfeditor/IdGenerator.java 2006-12-10 14:16:46 UTC (rev 1010) @@ -1,47 +0,0 @@ -/* - * Created on 03-nov.-2004 - * - * To change the template for this generated file go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ - -package cfeditor; - -import java.util.HashSet; -import java.util.Random; -import java.util.Set; - -/** - * Generator for ids. - * @author tchize - */ -public final class IdGenerator { - - private final Set<String> unsecureUid; - - private final Random unSecureRandom; - - private static final IdGenerator INSTANCE = new IdGenerator(); - - IdGenerator() { - unsecureUid = new HashSet<String>(); - //noinspection UnsecureRandomNumberGeneration - unSecureRandom = new Random(); - } - - public static IdGenerator getInstance() { - return INSTANCE; - } - - public String getUnsecureId() { - String id; - synchronized (unsecureUid) { - do { - id = Long.toHexString(unSecureRandom.nextLong()); - } while (unsecureUid.contains(id)); - unsecureUid.add(id); - } - return id; - } - -} // class IdGenerator Modified: trunk/crossfire/src/cfeditor/gui/ScriptEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2006-12-10 14:13:43 UTC (rev 1009) +++ trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2006-12-10 14:16:46 UTC (rev 1010) @@ -10,7 +10,6 @@ import cfeditor.CGUIUtils; import cfeditor.CScriptModel; import cfeditor.IGUIConstants; -import cfeditor.IdGenerator; import cfeditor.PluginParameter; import cfeditor.PluginParameterView; import cfeditor.parameter.ParameterDescriptionEditor; @@ -373,20 +372,6 @@ paramTable.add(getParameterView(param).getValueComponent(param.getValue(), param), gbc); } - public String getUid() { - if (uuid == null) { - generateUid(); - } - - return uuid; - } - - private synchronized void generateUid() { - if (uuid == null) { - uuid = IdGenerator.getInstance().getUnsecureId(); - } - } - private CScriptModel getScript() { return script; } Modified: trunk/crossfire/src/cfeditor/gui/ScriptManager.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptManager.java 2006-12-10 14:13:43 UTC (rev 1009) +++ trunk/crossfire/src/cfeditor/gui/ScriptManager.java 2006-12-10 14:16:46 UTC (rev 1010) @@ -159,9 +159,9 @@ if (c == null) { c = new ScriptEditor(model); components.put(model, c); - scriptPanel.add(c, c.getUid()); + scriptPanel.add(c, Integer.toString(c.hashCode())); } - scriptLayout.show(scriptPanel, c.getUid()); + scriptLayout.show(scriptPanel, Integer.toString(c.hashCode())); } private void removeScript(final CScriptModel model) { 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: 1008 http://svn.sourceforge.net/gridarta/?rev=1008&view=rev Author: akirschbaum Date: 2006-12-10 05:54:10 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-12-10 13:45:18 UTC (rev 1007) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-12-10 13:54:10 UTC (rev 1008) @@ -541,65 +541,6 @@ } } - /* - * Gets the level data from the level file. - * - * @param levelFile The level file that is used as the data source - */ - /* - void setLevelCellData(final int x, final int y, final int data) { - // Clear data bits - m_levelGrid[x][y] &= m_flagMask; - - // Set data bits - m_levelGrid[x][y] |= data&m_dataMask; - - // Level data has changed - levelChanged = true; - - mapControl.repaint(); - } - */ - - /* - * Returns the level raw 1D data. - * - * @return Raw 1D level data. - */ - /* - int[] getRawData() { - final int[] aData = new int[m_levelWidth*m_levelHeight]; - int idx = 0; - for (int y = 0; y < m_levelHeight; y++) { - for (int x = 0; x < m_levelWidth; x++) { - aData[idx] = m_levelGrid[x][y]; - idx++; - } - } - return aData; - } - */ - - /* - * Sets the level data. - */ - /* - void setRawData(final int[] aData) { - m_levelGrid = new int[m_levelWidth][m_levelHeight]; - int idx = 0; - for (int y = 0; y < m_levelHeight; y++) { - for (int x = 0; x < m_levelWidth; x++) { - if (idx > aData.length-1) { - break; - } - - m_levelGrid[x][y] = aData[idx]; - idx++; - } - } - } - */ - /** * Get an Archetype. * 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: 1005 http://svn.sourceforge.net/gridarta/?rev=1005&view=rev Author: akirschbaum Date: 2006-12-10 05:37:25 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Unify options dialog. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFJavaEditor.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CSettings.java trunk/crossfire/src/cfeditor/action.properties trunk/crossfire/src/cfeditor/messages.properties trunk/crossfire/src/cfeditor/messages_de.properties trunk/daimonin/src/daieditor/messages.properties trunk/src/app/net/sf/gridarta/messages.properties Added Paths: ----------- trunk/crossfire/resource/icons/development/ trunk/crossfire/resource/icons/development/Host24.gif trunk/crossfire/resource/icons/general/ trunk/crossfire/resource/icons/general/Open16.gif trunk/crossfire/resource/icons/general/Save24.gif trunk/crossfire/src/cfeditor/gui/prefs/ trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java trunk/crossfire/src/cfeditor/gui/prefs/ResPrefs.java trunk/crossfire/src/cfeditor/gui/prefs/package.html trunk/crossfire/src/cfeditor/io/PathManager.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/COptionDialog.java Added: trunk/crossfire/resource/icons/development/Host24.gif =================================================================== (Binary files differ) Property changes on: trunk/crossfire/resource/icons/development/Host24.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/crossfire/resource/icons/general/Open16.gif =================================================================== (Binary files differ) Property changes on: trunk/crossfire/resource/icons/general/Open16.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/crossfire/resource/icons/general/Save24.gif =================================================================== (Binary files differ) Property changes on: trunk/crossfire/resource/icons/general/Save24.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/crossfire/src/cfeditor/CFJavaEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/CFJavaEditor.java 2006-12-10 13:34:04 UTC (rev 1004) +++ trunk/crossfire/src/cfeditor/CFJavaEditor.java 2006-12-10 13:37:25 UTC (rev 1005) @@ -24,6 +24,7 @@ package cfeditor; +import static cfeditor.CMainControl.PREFS_LANGUAGE; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; @@ -31,6 +32,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; @@ -51,6 +53,12 @@ * @param args The command line parameters given to the level editor. */ public static void main(final String[] args) { + // Make sure the locale is set before any ActionFactory is used. + final String locName = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(PREFS_LANGUAGE, null); + if (locName != null) { + Locale.setDefault(new Locale(locName)); + } + // Now add prefs to the ActionFactory. final ActionFactory actionFactory = ActionFactory.getFactory("cfeditor"); actionFactory.addParent(ActionFactory.getFactory("net.sf.gridarta")); final List<String> infiles = new ArrayList<String>(); // map file names to open initially Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-10 13:34:04 UTC (rev 1004) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-10 13:37:25 UTC (rev 1005) @@ -30,6 +30,8 @@ import cfeditor.gameobject.anim.AnimationObjects; import cfeditor.gameobject.face.FaceObjects; import cfeditor.gui.map.MapPropertiesDialog; +import cfeditor.gui.prefs.GUIPrefs; +import cfeditor.gui.prefs.ResPrefs; import cfeditor.io.CMapReader; import cfeditor.io.CMapWriter; import cfeditor.map.MapArchObject; @@ -41,6 +43,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import javax.swing.ImageIcon; import javax.swing.JFileChooser; @@ -51,6 +54,7 @@ import javax.swing.UnsupportedLookAndFeelException; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.MainControl; +import net.sf.gridarta.Size2D; import net.sf.gridarta.gameobject.Collectable; import net.sf.gridarta.gameobject.Collector; import net.sf.gridarta.gui.HideFileFilterProxy; @@ -58,6 +62,8 @@ import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.ActionMethod; +import net.sf.japi.swing.prefs.PreferencesGroup; +import static net.sf.japi.swing.prefs.PreferencesPane.showPreferencesDialog; import net.sf.japi.util.ThrowableHandler; import net.sf.japi.util.filter.file.EndingFileFilter; import org.apache.log4j.Logger; @@ -82,14 +88,17 @@ private static final String DOCU_VERSION_KEY = "docuVersion"; - private static final String USE_IMAGESET = "useImageSet"; + public static final String USE_IMAGESET = "useImageSet"; private static final String USE_FONT = "useFont"; - private static final String LOAD_ARCH_COLL = "loadArchFromCollection"; + public static final String LOAD_ARCH_COLL = "loadArchFromCollection"; public static final String PICKMAPS_LOCKED = "pickmapsLocked"; + /** Preferences key for language. */ + public static final String PREFS_LANGUAGE = "language"; + /** The main view. */ private final CMainView mainView; @@ -348,11 +357,31 @@ currentMap.getMapViewFrame().setMapAndArchPosition(gameObject, pos); } - /** - * Set all global settings (mostly read from the - * 'CFJavaEditor.ini'-file) - */ - private void readGlobalSettings() { + /** Set all global settings from the preferences. */ + public void readGlobalSettings() { + imageSet = new String(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(USE_IMAGESET, "base")); + if (imageSet.equalsIgnoreCase("none")) { + imageSet = null; + } + initDirs(); + + loadFromArchive = new Boolean(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(LOAD_ARCH_COLL, "true")).booleanValue(); + + getMainView().setMapTileListBottom(new Boolean(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(CMainView.MAP_TILE_LIST_BOTTOM_KEY, Boolean.toString(CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT))).booleanValue()); + + setLockAllPickmaps(new Boolean(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(PICKMAPS_LOCKED, "false")).booleanValue()); + + // docu version + if (IGUIConstants.DOCU_VERSION > (new Integer(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(DOCU_VERSION_KEY, "0"))).intValue()) { + // remember to open docu + autoPopupDocu = true; + // update docu version right now, because we want the help popup only one time + CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(DOCU_VERSION_KEY, String.valueOf(IGUIConstants.DOCU_VERSION)); + } + } + + /** (Re-)initializes the directories. */ + public void initDirs() { // Get the directories strMapDir = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(ResourceFileManager.MAP_DIR_KEY, ResourceFileManager.DEFAULT_MAP_DIR); strArchDir = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(ResourceFileManager.ARCH_DIR_KEY, ResourceFileManager.DEFAULT_ARCH_DIR); @@ -373,25 +402,6 @@ !mapDir.isAbsolute() && !hasChangedDir) { mapDir = new File(currentDir.getAbsolutePath(), mapDir.getPath()); } - - imageSet = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(USE_IMAGESET, "base"); - if (imageSet.equalsIgnoreCase("none")) { - imageSet = null; - } - - loadFromArchive = Boolean.valueOf(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(LOAD_ARCH_COLL, "true")); - - getMainView().setMapTileListBottom(Boolean.valueOf(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(CMainView.MAPTILE_BOTTOM_KEY, "false"))); - - setLockAllPickmaps(Boolean.valueOf(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(PICKMAPS_LOCKED, "false"))); - - // docu version - if (IGUIConstants.DOCU_VERSION > new Integer(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(DOCU_VERSION_KEY, "0"))) { - // remember to open docu - autoPopupDocu = true; - // update docu version right now, because we want the help popup only one time - CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(DOCU_VERSION_KEY, String.valueOf(IGUIConstants.DOCU_VERSION)); - } } /** @@ -404,18 +414,7 @@ * @param mapTileBottom <code>true</code> if the map tile list should be displayed on the window bottom, otherwise (right border) <code>false</code>. */ void setGlobalSettings(final String arch, String map, final String script, final boolean baseImageSet, final boolean load, final boolean mapTileBottom) { - map = map.replace('\\', '/'); - if (map.endsWith("/")) { - map = map.substring(0, map.length() - 1); // path should not end with slash - } - - CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(ResourceFileManager.ARCH_DIR_KEY, arch); - CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(ResourceFileManager.MAP_DIR_KEY, map); - CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(ResourceFileManager.SCRIPT_DIR_KEY, script); - CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(USE_IMAGESET, baseImageSet ? "base" : "none"); - CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(LOAD_ARCH_COLL, load ? "true" : "false"); - CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(CMainView.MAPTILE_BOTTOM_KEY, mapTileBottom ? "true" : "false"); CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(PICKMAPS_LOCKED, pickmapsLocked ? "true" : "false"); readGlobalSettings(); @@ -1126,8 +1125,17 @@ void toggleShowTiles() { } + private PreferencesGroup prefsGroup; + public void options() { - new COptionDialog(this, mainView); + if (prefsGroup == null) { + prefsGroup = new PreferencesGroup( + "Gridarta for Daimonin", + new ResPrefs(this), + new GUIPrefs(this) + ); // prefsGroup + } + showPreferencesDialog(mainView, prefsGroup, false); } void setLockAllPickmaps(final boolean state) { Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-12-10 13:34:04 UTC (rev 1004) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-12-10 13:37:25 UTC (rev 1005) @@ -89,8 +89,11 @@ private static final String DIVIDER_LOCATION_KEY3 = "MainWindow.dividerLocation3"; /** Key for info whether map-tile panel is seperate or at bottom. */ - public static final String MAPTILE_BOTTOM_KEY = "MapTileBottom"; + public static final String MAP_TILE_LIST_BOTTOM_KEY = "MapTileBottom"; + /** Default value for {@link #MAP_TILE_LIST_BOTTOM_KEY}. */ + public static final boolean MAP_TILE_LIST_BOTTOM_DEFAULT = false; + /** Border size for the split panes. */ private static final int BORDER_SIZE = 5; Deleted: trunk/crossfire/src/cfeditor/COptionDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/COptionDialog.java 2006-12-10 13:34:04 UTC (rev 1004) +++ trunk/crossfire/src/cfeditor/COptionDialog.java 2006-12-10 13:37:25 UTC (rev 1005) @@ -1,270 +0,0 @@ -/* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) - * - * 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., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package cfeditor; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Frame; -import java.awt.GridLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import javax.swing.Box; -import javax.swing.BoxLayout; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JTextField; -import javax.swing.border.CompoundBorder; -import javax.swing.border.EmptyBorder; -import javax.swing.border.EtchedBorder; -import javax.swing.border.TitledBorder; - -/** - * Dialog used to ask the user the properties for the new level. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - */ -public final class COptionDialog extends CDialogBase { - - private final JTextField m_archField; - - private final JTextField m_mapField; - - private final JTextField m_scriptField; - - private final JCheckBox m_loadArches; // load arches from collected archives? - - private JComboBox m_ImageSet; // selection box for Image Set - - private final JCheckBox m_mapPanelBottom; // is map-tile panel in bottom panel? - - private static final long serialVersionUID = 1L; - - /** - * Constructs a new option dialog. - * @param mainControl The controller of this dialog. - * @param parentFrame The parent frame of this dialog. - */ - COptionDialog(final CMainControl mainControl, final Frame parentFrame) { - super(parentFrame, "Options"); - getContentPane().setLayout(new BorderLayout()); - - final JPanel mainPanel = new JPanel(); - mainPanel.setBorder(new EmptyBorder( - IGUIConstants.DIALOG_INSETS, - IGUIConstants.DIALOG_INSETS, - IGUIConstants.DIALOG_INSETS, - IGUIConstants.DIALOG_INSETS)); - mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); - - // --- Resource Path --- - final JPanel optionPathPanel = new JPanel(); - optionPathPanel.setLayout(new BoxLayout(optionPathPanel, BoxLayout.Y_AXIS)); - optionPathPanel.setBorder(new CompoundBorder( - new TitledBorder(new EtchedBorder(), "Resource Path"), - new EmptyBorder( - IGUIConstants.DIALOG_INSETS, - IGUIConstants.DIALOG_INSETS, - IGUIConstants.DIALOG_INSETS, - IGUIConstants.DIALOG_INSETS))); - - final JPanel archPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - archPanel.add(new JLabel("Archfiles: ")); - m_archField = new JTextField(16); - m_archField.setText(mainControl.getArchDefaultFolder()); - archPanel.add(m_archField); - optionPathPanel.add(archPanel); - - final JPanel mapPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - mapPanel.add(new JLabel("Maps: ")); - m_mapField = new JTextField(16); - m_mapField.setText(mainControl.getMapDefaultFolder()); - mapPanel.add(m_mapField); - optionPathPanel.add(mapPanel); - - final JPanel scriptPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - scriptPanel.add(new JLabel("Scripts: ")); - m_scriptField = new JTextField(16); - m_scriptField.setText(mainControl.getScriptDefaultFolder()); - scriptPanel.add(m_scriptField); - - mainPanel.add(optionPathPanel); - - // --- globals --- - final JPanel optionPartPanel = new JPanel(new GridLayout(2, 1)); - optionPartPanel.setBorder(new CompoundBorder( - new TitledBorder(new EtchedBorder(), "Globals"), - new EmptyBorder( - IGUIConstants.DIALOG_INSETS, - IGUIConstants.DIALOG_INSETS, - IGUIConstants.DIALOG_INSETS, - IGUIConstants.DIALOG_INSETS))); - - final JPanel cbox; - if (mainControl.getImageSet() != null) { - cbox = buildImageSetBox(mainControl.getImageSet().equalsIgnoreCase("base")); - } else { - cbox = buildImageSetBox(false); - } - optionPartPanel.add(cbox); - - m_loadArches = new JCheckBox(" Load Arches from Collection"); - m_loadArches.setSelected(mainControl.isArchLoadedFromCollection()); - m_loadArches.addActionListener(new SelectArchLoadAL(m_loadArches, this)); - optionPartPanel.add(m_loadArches); - if (mainControl.isArchLoadedFromCollection()) { - m_archField.setEnabled(false); - } - - mainPanel.add(optionPartPanel); - - // --- layout settings --- - final JPanel optionLayoutPanel = new JPanel(new GridLayout(2, 1)); - optionLayoutPanel.setBorder(new CompoundBorder( - new TitledBorder(new EtchedBorder(), "Layout Settings"), - new EmptyBorder( - IGUIConstants.DIALOG_INSETS, - IGUIConstants.DIALOG_INSETS, - IGUIConstants.DIALOG_INSETS, - IGUIConstants.DIALOG_INSETS))); - - m_mapPanelBottom = new JCheckBox(" Separate Map-Tile Panel"); - m_mapPanelBottom.setSelected(!mainControl.getMainView().isMapTileListBottom()); - optionLayoutPanel.add(m_mapPanelBottom); - optionLayoutPanel.add(new JLabel("(Takes effect on next application start)")); - mainPanel.add(optionLayoutPanel); - - // --- button line --- - final JPanel buttonPanel = new JPanel(); - buttonPanel.setBorder(new EmptyBorder( - IGUIConstants.SPACE_BETWEEN_BUTTON_AREA_AND_MAIN_DIALOG, - IGUIConstants.DIALOG_INSETS, - IGUIConstants.DIALOG_INSETS, - IGUIConstants.DIALOG_INSETS)); - buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS)); - buttonPanel.add(Box.createGlue()); - - /* - final JButton button = new JButton("Restore"); - button.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent event) { - } - }); - buttonPanel.add(button); - - buttonPanel.add(Box.createRigidArea( - new Dimension(IGUIConstants.SPACE_BETWEEN_BUTTON_GROUPS, 1))); - */ - final JButton okButton = new JButton("OK"); - okButton.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent event) { - mainControl.setGlobalSettings(m_archField.getText(), - m_mapField.getText(), m_scriptField.getText(), - m_ImageSet.getSelectedIndex() != 0, - m_loadArches.isSelected(), !m_mapPanelBottom.isSelected()); - dispose(); - } - }); - buttonPanel.add(okButton); - - buttonPanel.add(Box.createRigidArea( - new Dimension(IGUIConstants.SPACE_BETWEEN_BUTTONS, 1))); - - final JButton cancelButton = new JButton("Cancel"); - cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent event) { - dispose(); - } - }); - buttonPanel.add(cancelButton); - - getContentPane().add(mainPanel, BorderLayout.CENTER); - getContentPane().add(buttonPanel, BorderLayout.SOUTH); - pack(); - setVisible(true); - } - - /** - * Creates the ComboBox for the selection of Image Sets. - * @param baseSet <code>true</code> to select the base set, otherwise <code>false</code>. - * @return A Panel with the combobox plus label. - */ - /** Construct the Combo box for the selection of Image Sets. */ - private JPanel buildImageSetBox(final boolean baseSet) { - final JPanel lineLayout = new JPanel(new FlowLayout(FlowLayout.RIGHT)); // layout for this line - - // list of available Image Sets: - final String []list = new String[2]; - list[0] = " Disabled"; - list[1] = " Base"; - - lineLayout.add(new JLabel("Use Image Set: ")); // create label - - m_ImageSet = new JComboBox(list); // set "content" - m_ImageSet.setPreferredSize(new Dimension(150, 25)); - m_ImageSet.setSelectedIndex(baseSet ? 1 : 0); // set active selection - - m_ImageSet.setBackground(Color.white); // white background - m_ImageSet.setName("Image Set"); - - lineLayout.add(m_ImageSet); - return lineLayout; - } - - /** - * Action-listener for the checkbox "Load Arches from Collection". - * While it is selected, the arch path should be disabled. - * @todo Turn this into an Action. - */ - private final class SelectArchLoadAL implements ActionListener { - - final COptionDialog frame; // the frame (options dialog window) - - final JCheckBox cbox; // input checkbox - - public SelectArchLoadAL(final JCheckBox cbox, final COptionDialog frame) { - this.cbox = cbox; - this.frame = frame; - } - - /** {@inheritDoc} */ - public void actionPerformed(final ActionEvent event) { - // state has changed - if (cbox.isSelected()) { - m_archField.setEnabled(false); - frame.update(frame.getGraphics()); - } else { - m_archField.setEnabled(true); - frame.update(frame.getGraphics()); - } - } - - } // class SelectArchLoadAL - -} // class COptionDialog Modified: trunk/crossfire/src/cfeditor/CSettings.java =================================================================== --- trunk/crossfire/src/cfeditor/CSettings.java 2006-12-10 13:34:04 UTC (rev 1004) +++ trunk/crossfire/src/cfeditor/CSettings.java 2006-12-10 13:37:25 UTC (rev 1005) @@ -134,7 +134,9 @@ public synchronized String getProperty(final String strKey, final String strDefaultValue) { final String strValue = properties.getProperty(strKey); if (strValue == null) { - setProperty(strKey, strDefaultValue); + if (strDefaultValue != null) { + setProperty(strKey, strDefaultValue); + } return strDefaultValue; } return strValue; Modified: trunk/crossfire/src/cfeditor/action.properties =================================================================== --- trunk/crossfire/src/cfeditor/action.properties 2006-12-10 13:34:04 UTC (rev 1004) +++ trunk/crossfire/src/cfeditor/action.properties 2006-12-10 13:37:25 UTC (rev 1005) @@ -2,3 +2,8 @@ # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding ActionFactory.additionalBundles=cfeditor.messages +# Extend this if you add a new locale. The order is irrelevant. +availableLocales=en de fr sv + +prefsRes.icon=general/Save24 +prefsGUI.icon=development/Host24 Added: trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java (rev 0) +++ trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java 2006-12-10 13:37:25 UTC (rev 1005) @@ -0,0 +1,188 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2005 Christian Hujer + * + * 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package cfeditor.gui.prefs; + +import cfeditor.CMainControl; +import static cfeditor.CMainControl.PREFS_LANGUAGE; +import static cfeditor.CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT; +import static cfeditor.CMainView.MAP_TILE_LIST_BOTTOM_KEY; +import cfeditor.CSettings; +import cfeditor.IGUIConstants; +import static cfeditor.IGUIConstants.DIALOG_BORDER; +import java.awt.Component; +import static java.util.Arrays.binarySearch; +import static java.util.Arrays.sort; +import java.util.Locale; +import java.util.prefs.Preferences; +import javax.swing.Box; +import static javax.swing.Box.createHorizontalBox; +import static javax.swing.Box.createVerticalBox; +import static javax.swing.Box.createVerticalGlue; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.border.Border; +import javax.swing.border.CompoundBorder; +import javax.swing.border.TitledBorder; +import net.sf.japi.swing.ActionFactory; +import net.sf.japi.swing.LocaleComparator; +import net.sf.japi.swing.LocaleListCellRenderer; +import net.sf.japi.swing.prefs.AbstractPrefs; + +/** + * Preferences Module for user interface preferences. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @serial exclude + */ +public final class GUIPrefs extends AbstractPrefs { + + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); + + private final CMainControl mainControl; + + /** ComboBox for choosing the locale. */ + private JComboBox localeBox; + + /** Wether to place the map tile panel at the bottom or the right. */ + private JCheckBox mapPanelBottom; + + /** Locale[]. */ + private Locale[] locales; + + /** LocaleComparator. */ + private LocaleComparator comp = new LocaleComparator(); + + /** + * Create a GUIPrefs pane. + */ + public GUIPrefs(final CMainControl mainControl) { + this.mainControl = mainControl; + + setListLabelText(ACTION_FACTORY.getString("prefsGUI.title")); + setListLabelIcon(ACTION_FACTORY.getIcon("prefsGUI.icon")); + + add(createGlobalPanel()); + add(createLayoutPanel()); + add(createVerticalGlue()); + } + + /** + * Create a titled border. + * @param titleKey Action Key for border title + * @return titled border + */ + private static Border createTitledBorder(final String titleKey) { + return new CompoundBorder(new TitledBorder(ACTION_FACTORY.getString(titleKey)), DIALOG_BORDER); + } + + /** {@inheritDoc} */ + public void apply() { + final Locale loc = (Locale) localeBox.getSelectedItem(); + if (loc != null) { + CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(PREFS_LANGUAGE, loc.getLanguage()); + } else { + CSettings.getInstance(IGUIConstants.APP_NAME).clearProperty(PREFS_LANGUAGE); + } + CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(MAP_TILE_LIST_BOTTOM_KEY, mapPanelBottom.isSelected() ? "true" : "false"); + mainControl.readGlobalSettings(); + mainControl.refreshMenusAndToolbars(); + } + + /** {@inheritDoc} */ + public void revert() { + final String current = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(PREFS_LANGUAGE, null); + localeBox.setSelectedIndex(binarySearch(locales, current != null ? new Locale(current) : null, comp)); + mapPanelBottom.setSelected(new Boolean(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(MAP_TILE_LIST_BOTTOM_KEY, Boolean.toString(MAP_TILE_LIST_BOTTOM_DEFAULT))).booleanValue()); + } + + /** {@inheritDoc} */ + public void defaults() { + localeBox.setSelectedIndex(binarySearch(locales, null, comp)); + mapPanelBottom.setSelected(MAP_TILE_LIST_BOTTOM_DEFAULT); + } + + /** {@inheritDoc} */ + public boolean isChanged() { + final Locale loc = (Locale) localeBox.getSelectedItem(); + final String currentName = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(PREFS_LANGUAGE, null); + final Locale current = currentName != null ? new Locale(currentName) : null; + return !( + (loc == null ? loc == current : loc.equals(current)) + && mapPanelBottom.isSelected() == new Boolean(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(MAP_TILE_LIST_BOTTOM_KEY, Boolean.toString(MAP_TILE_LIST_BOTTOM_DEFAULT))).booleanValue()); + } + + /** + * Construct the Combo box for the selection of locales. + * @return combo box with locales to select + */ + private Component buildLocaleBox() { + final Box lineLayout = createHorizontalBox(); + + final String[] locNames = ACTION_FACTORY.getString("availableLocales").split("\\s+"); + locales = new Locale[locNames.length + 1]; + // locales[0] is intentionally null. It will be displayed as default and always get sorted to the top. + for (int i = 0; i < locNames.length; i++) { + locales[i + 1] = new Locale(locNames[i]); + } + sort(locales, comp); + + lineLayout.add(new JLabel(ACTION_FACTORY.getString("optionsLanguage"))); // create label + + localeBox = new JComboBox(locales); // set "content" + localeBox.setRenderer(new LocaleListCellRenderer()); + //localeBox.setPreferredSize(new Dimension(150, 25)); + final String current = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(PREFS_LANGUAGE, null); + localeBox.setSelectedIndex(binarySearch(locales, current != null ? new Locale(current) : null, comp)); + + lineLayout.add(localeBox); + return lineLayout; + } + + /** + * Creates the subpanel with the global settings. + * @return subpanel + */ + private Component createGlobalPanel() { + final Box globalPanel = createVerticalBox(); + globalPanel.setBorder(createTitledBorder("optionsGlobal")); + + globalPanel.add(buildLocaleBox()); + + return globalPanel; + } + + /** + * Creates the subpanel with the layout settings. + * @return subpanel + */ + private Component createLayoutPanel() { + final Box layoutPanel = createVerticalBox(); + layoutPanel.setBorder(createTitledBorder("optionsLayout")); + + mapPanelBottom = new JCheckBox(ACTION_FACTORY.createAction(false, "optionsSepMapTile")); + mapPanelBottom.setSelected(new Boolean(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(MAP_TILE_LIST_BOTTOM_KEY, Boolean.toString(MAP_TILE_LIST_BOTTOM_DEFAULT))).booleanValue()); + layoutPanel.add(mapPanelBottom); + return layoutPanel; + } + +} // class GUIPrefs Property changes on: trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/crossfire/src/cfeditor/gui/prefs/ResPrefs.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/prefs/ResPrefs.java (rev 0) +++ trunk/crossfire/src/cfeditor/gui/prefs/ResPrefs.java 2006-12-10 13:37:25 UTC (rev 1005) @@ -0,0 +1,314 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2005 Christian Hujer + * + * 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package cfeditor.gui.prefs; + +import cfeditor.CMainControl; +import cfeditor.CSettings; +import cfeditor.IGUIConstants; +import static cfeditor.IGUIConstants.DIALOG_BORDER; +import cfeditor.ResourceFileManager; +import cfeditor.io.PathManager; +import java.awt.Component; +import java.awt.Container; +import java.awt.FlowLayout; +import static java.util.Arrays.sort; +import java.util.prefs.Preferences; +import javax.swing.Box; +import static javax.swing.Box.createHorizontalBox; +import static javax.swing.Box.createVerticalBox; +import static javax.swing.Box.createVerticalGlue; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import static javax.swing.JFileChooser.DIRECTORIES_ONLY; +import javax.swing.JLabel; +import static javax.swing.JOptionPane.WARNING_MESSAGE; +import javax.swing.JTextField; +import javax.swing.border.Border; +import javax.swing.border.CompoundBorder; +import javax.swing.border.TitledBorder; +import net.sf.japi.swing.ActionFactory; +import net.sf.japi.swing.JFileChooserButton; +import net.sf.japi.swing.prefs.AbstractPrefs; + +/** + * Preferences Module for resource preferences. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @serial exclude + */ +public final class ResPrefs extends AbstractPrefs { + + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); + + /** Main Control. */ + private final CMainControl mainControl; + + /** TextField for arch directory path. */ + private FileField archField; + + /** TextField for map directory path. */ + private FileField mapField; + + /** TextField for script directory path. */ + private FileField scriptField; + + /** Checbox whether arches are to be loaded from collection. */ + private JCheckBox loadArches; + + /** ComboBox for choosing the image set. */ + private JComboBox imageSetBox; + + /** Contains all supported image sets. */ + private String[] imageSets; + + /** + * Create a ResPrefs pane. + * @param mainControl The controller of this dialog. + */ + public ResPrefs(final CMainControl mainControl) { + setListLabelText(ACTION_FACTORY.getString("prefsRes.title")); + setListLabelIcon(ACTION_FACTORY.getIcon("prefsRes.icon")); + this.mainControl = mainControl; + + add(createResourcePanel()); + add(createGlobalPanel()); + add(createVerticalGlue()); + } + + /** + * Create a titled border. + * @param titleKey Action Key for border title + * @return titled border + */ + private static Border createTitledBorder(final String titleKey) { + return new CompoundBorder(new TitledBorder(ACTION_FACTORY.getString(titleKey)), DIALOG_BORDER); + } + + /** {@inheritDoc} */ + public void apply() { + CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(ResourceFileManager.ARCH_DIR_KEY, PathManager.path(archField.getText())); + CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(ResourceFileManager.MAP_DIR_KEY, PathManager.path(mapField.getText())); + CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(ResourceFileManager.SCRIPT_DIR_KEY, PathManager.path(scriptField.getText())); + CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(CMainControl.LOAD_ARCH_COLL, loadArches.isSelected() ? "true" : "false"); + + final String imageSet = (String) imageSetBox.getSelectedItem(); + CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(CMainControl.USE_IMAGESET, imageSet == null || imageSet.equals("disabled") ? "none" : imageSet); + + mainControl.readGlobalSettings(); + mainControl.refreshMenusAndToolbars(); + ACTION_FACTORY.showOnetimeMessageDialog(this, WARNING_MESSAGE, "optionsRestart"); + } + + /** {@inheritDoc} */ + public void revert() { + archField.setText(mainControl.getArchDefaultFolder()); + mapField.setText(mainControl.getMapDefaultFolder()); + scriptField.setText(mainControl.getScriptDefaultFolder()); + loadArches.setSelected(mainControl.isArchLoadedFromCollection()); + imageSetBox.setSelectedIndex(linearSearch(imageSets, getCurrentImageSet())); + } + + /** {@inheritDoc} */ + public void defaults() { + archField.setText(ResourceFileManager.DEFAULT_ARCH_DIR); + mapField.setText(ResourceFileManager.DEFAULT_MAP_DIR); + scriptField.setText(ResourceFileManager.DEFAULT_SCRIPT_DIR); + loadArches.setSelected(true); + imageSetBox.setSelectedIndex(linearSearch(imageSets, "disabled")); + } + + /** {@inheritDoc} */ + public boolean isChanged() { + final String selectedimageSet = (String) imageSetBox.getSelectedItem(); + final String imageSet = selectedimageSet == null ? "disabled" : selectedimageSet; + return !( + archField.getText().equals(mainControl.getArchDefaultFolder()) + && mapField.getText().equals(mainControl.getMapDefaultFolder()) + && scriptField.getText().equals(mainControl.getScriptDefaultFolder()) + && loadArches.isSelected() == new Boolean(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(CMainControl.LOAD_ARCH_COLL, Boolean.toString(mainControl.isArchLoadedFromCollection()))).booleanValue() + && imageSet.equals(getCurrentImageSet())); + } + + /** + * Toggle action method for loading arches from collection. + * @param loadArchColl whether to load arches from collection + * @used + */ + public void setOptionsLoadArchColl(final boolean loadArchColl) { + archField.setEnabled(!loadArchColl); + } + + /** + * Toggle action method for loading arches from collection. + * @return whether arches are loaded from collection + * @used + */ + public boolean isOptionsLoadArchColl() { + return !archField.isEnabled(); + } + + /** + * Creates the subpanel with the resource paths. + * @return subpanel + */ + private Component createResourcePanel() { + final Box resourcePanel = createVerticalBox(); + resourcePanel.setBorder(createTitledBorder("optionsResPaths")); + archField = createFileField(resourcePanel, "optionsResArch", mainControl.getArchDefaultFolder(), DIRECTORIES_ONLY); + mapField = createFileField(resourcePanel, "optionsResMaps", mainControl.getMapDefaultFolder(), DIRECTORIES_ONLY); + scriptField = createFileField(resourcePanel, "optionsResScripts", mainControl.getScriptDefaultFolder(), DIRECTORIES_ONLY); + return resourcePanel; + } + + /** + * Creates the subpanel with the global settings. + * @return subpanel + */ + private Component createGlobalPanel() { + final Box globalPanel = createVerticalBox(); + globalPanel.setBorder(createTitledBorder("optionsGlobal")); + + loadArches = new JCheckBox(ACTION_FACTORY.createToggle(false, "optionsLoadArchColl", this)); + loadArches.setSelected(mainControl.isArchLoadedFromCollection()); + globalPanel.add(loadArches); + if (mainControl.isArchLoadedFromCollection()) { + archField.setEnabled(false); + } + + globalPanel.add(buildImageSetBox()); + + return globalPanel; + } + + /** + * Construct the Combo box for the selection of image sets. + * @return combo box with image sets to select + */ + private Component buildImageSetBox() { + final Box lineLayout = createHorizontalBox(); + + final String[] imageSetNames = ACTION_FACTORY.getString("availableImageSets").split("\\s+"); + sort(imageSetNames); + imageSets = new String[imageSetNames.length + 1]; + imageSets[0] = "disabled"; + System.arraycopy(imageSetNames, 0, imageSets, 1, imageSetNames.length); + + lineLayout.add(new JLabel(ACTION_FACTORY.getString("optionsImageSet"))); // create label + + imageSetBox = new JComboBox(imageSets); // set "content" + imageSetBox.setSelectedIndex(linearSearch(imageSets, getCurrentImageSet())); + + lineLayout.add(imageSetBox); + return lineLayout; + } + + /** + * Creats a textpanel for choosing a file and adds it to another panel. + * @param panel JPanel to add field to + * @param key Key for label + * @param initial Initial value for textfield + * @param fileSelectionMode file selection mode + * @return the created JTextField + */ + private static FileField createFileField(final Container panel, final String key, final String initial, final int fileSelectionMode) { + final FileField fileField = new FileField(ACTION_FACTORY.getString(key), initial, fileSelectionMode); + final String tooltip = ACTION_FACTORY.getString(key + ".shortdescription"); + if (tooltip != null) { + fileField.setToolTipText(tooltip); + } + panel.add(fileField); + return fileField; + } + + private static int linearSearch(final String[] a, final String key) { + for (int i = 0; i < a.length; i++) { + if (a[i].equals(key)) { + return i; + } + } + + return -1; + } + + private static String getCurrentImageSet() { + final String imageSet = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(CMainControl.USE_IMAGESET, "none"); + return imageSet.equals("none") ? "disabled" : imageSet; + } + + /** Class for selecting a file. + * @todo replace with JFileField from JAPI + */ + private static class FileField extends JComponent { + + /** The label. */ + private final JLabel label; + + /** The file field. */ + private final JTextField fileField; + + /** The button to start the JFileChooser. */ + private final JFileChooserButton chooserButton; + + /** + * Create a FileField. + * @param labelText the text for the label + * @param initial the initial path + * @param fileSelectionMode the mode for the file selection + */ + private FileField(final String labelText, final String initial, final int fileSelectionMode) { + setLayout(new FlowLayout(FlowLayout.RIGHT)); + fileField = new JTextField(initial, 16); + chooserButton = new JFileChooserButton(fileField, fileSelectionMode); + label = new JLabel(labelText); + add(label); + add(fileField); + add(chooserButton); + } + + /** {@inheritDoc} */ + @Override public void setEnabled(final boolean enabled) { + super.setEnabled(enabled); + fileField.setEnabled(enabled); + chooserButton.setEnabled(enabled); + label.setEnabled(enabled); + } + + /** + * Set the text, which is the filename. + * @param text filename + */ + public void setText(final String text) { + fileField.setText(text); + } + + /** + * Get the text, which is the filename. + * @return text (filename) + */ + public String getText() { + return fileField.getText(); + } + + } // class FileField + +} // class ResPrefs Property changes on: trunk/crossfire/src/cfeditor/gui/prefs/ResPrefs.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/crossfire/src/cfeditor/gui/prefs/package.html =================================================================== --- trunk/crossfire/src/cfeditor/gui/prefs/package.html (rev 0) +++ trunk/crossfire/src/cfeditor/gui/prefs/package.html 2006-12-10 13:37:25 UTC (rev 1005) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <title></title> + </head> + <body> + <p>This package contains the preferences ui modules.</p> + </body> +</html> Property changes on: trunk/crossfire/src/cfeditor/gui/prefs/package.html ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/crossfire/src/cfeditor/io/PathManager.java =================================================================== --- trunk/crossfire/src/cfeditor/io/PathManager.java (rev 0) +++ trunk/crossfire/src/cfeditor/io/PathManager.java 2006-12-10 13:37:25 UTC (rev 1005) @@ -0,0 +1,215 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2005 Christian Hujer + * + * 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package cfeditor.io; + +import cfeditor.CMainControl; +import java.io.File; +import java.io.IOException; + +/** + * This class contains methods for converting relative map paths to absolute map paths and vice versa. + * Serverside, paths to maps always are URIs with the maps directory being the root directory for the maps. + * Therefore it makes sense to treat them as URIs in the editor as well. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @todo make more use of URI + * @todo This class knows CMainControl. The dependency should be flipped: instead CMainControl should use this class. Then this class could be used by crossfire, too. + */ +public final class PathManager { + + // NOTE: There are certainly faster algorithms. But these methods are rarely used. + + /** + * Private constructor. + * There are only static methods, so prevent this class from being instanciated. + */ + private PathManager() { + } + + /** + * Create arch path. + * Replaces all occurences of '\' with '/' and removes the path to the arch directory (absolute, relative or canonical) from the path. + * @param path to create arch path from + * @return fixed path + */ + public static String getArchPath(final String path) { + final String archDirName = CMainControl.getInstance().getArchDefaultFolder(); + String archPath = path.replace('\\', '/'); + if (archPath.startsWith(archDirName)) { + archPath = archPath.substring(archDirName.length()); + } + if (archPath.startsWith(new File(archDirName).getAbsolutePath())) { + archPath = archPath.substring(new File(archDirName).getAbsolutePath().length()); + } + archPath = archPath.replace('\\', '/'); + return archPath; + } + + /** + * Create map path. + * Replaces all occurences of '\' with '/' and removes the path to the map directory (absolute, relative or canonical) from the path. + * @param path to create map path from + * @return fixed path + * @throws IOException In case of problems converting / creating the map path. + */ + public static String getMapPath(final String path) throws IOException { + final String mapDirName = CMainControl.getInstance().getMapDefaultFolder(); + String mapPath = path.replace('\\', '/'); + if (mapPath.startsWith(mapDirName)) { + mapPath = mapPath.substring(mapDirName.length()); + } + if (mapPath.startsWith(new File(mapDirName).getAbsolutePath())) { + mapPath = mapPath.substring(new File(mapDirName).getAbsolutePath().length()); + } + if (mapPath.startsWith(new File(mapDirName).getCanonicalPath())) { + mapPath = mapPath.substring(new File(mapDirName).getCanonicalPath().length()); + } + mapPath = mapPath.replace('\\', '/'); + return mapPath; + } + + /** + * Check whether a path is absolute. + * Paths starting with "/" are absolute, paths starting with other characters are relative. + * Empty paths are neither relative nor absolute. + * @param path Path to check + * @return <code>true</code> if <var>path</var> is absolute, <code>false</code> otherwise + * @see #isRelative(String) which nearly is the opposite of this method + */ + public static boolean isAbsolute(final String path) { + return path.startsWith("/") || new File(path).isAbsolute(); + } + + /** + * Check whether a path is relative. + * Paths not starting with "/" are relative, paths starting with are absolute. + * Empty paths are neither relative nor absolute. + * @param path Path to check + * @return <code>true</code> if <var>path</var> is relative, <code>false</code> otherwise + * @see #isAbsolute(String) which nearly is the opposite of this method + */ + public static boolean isRelative(final String path) { + return !path.startsWith("/") && !new File(path).isAbsolute(); + } + + /** + * Converts a relative path to an absolute path. + * If the path already is relative, this method simply returns the path. + * @param reference reference file the relative path works on (regular file, not directory) + * @param relative destination file with relative path + * @return absolute path from the base directory + */ + public static String relativeToAbsolute(final String reference, final String relative) { + if (reference.contains("\\") || relative.contains("\\")) { + return relativeToAbsolute(reference.replace('\\', '/'), relative.replace('\\', '/')); + } + if (isAbsolute(relative)) { + return relative; + } + String work = reference.substring(0, reference.lastIndexOf("/") + 1) + relative; // + 1 to include the "/" + String work2; + do { + work2 = work; + work = work2.replaceAll("[^/]+/\\.\\./", ""); + } while (!work2.equals(work)); + return work; + } + + /** + * Converts an absolute path to a relative path. + * If the path already is absolute, this method simply returns the path. + * @param reference reference file the relative path works on (regular file, not directory) + * @param absolute destination file with relative path + * @return absolute path from the base directory + */ + public static String absoluteToRelative(final String reference, final String absolute) { + if (reference.contains("\\") || absolute.contains("\\")) { + return absoluteToRelative(reference.replace('\\', '/'), absolute.replace('\\', '/')); + } + if (isRelative(absolute)) { + return absolute; + } + //String reference2 = + // First: Strip equal path parts + final int difference = findDifference(reference, absolute); + final StringBuilder relative = new StringBuilder(absolute.substring(difference)); + final String referencePath = reference.substring(difference); + for (int i = 0, l = findOccurrences(referencePath, '/'); i < l; i++) { + relative.insert(0, "../"); + } + return relative.toString(); + } + + /** + * Helper method that returns the first string index at which two strings denoting paths aren't identical. + * That is, the index always points at the beginning or a '/'-character. + * The return value of this method is in every case good for a String.substring() invocation start index. + * @param s1 first string to compare + * @param s2 second string to compare + * @return index of first / after which s1 and s2 aren't identical or 0 if they differ from start + */ + private static int findDifference(final String s1, final String s2) { + int s1slash = -1; + int s2slash = -1; + char c1 = (char) 0; // initialize for equality for first loop cycle + char c2 = (char) 0; + for (int index = 0, l1 = s1.length(), l2 = s2.length(); index < l1 && index < l2 && c1 == c2; index++) { + c1 = s1.charAt(index); + c2 = s2.charAt(index); + if (c1 == '/') { + s1slash = index; + } + if (c2 == '/') { + s2slash = index; + } + } + return Math.min(s1slash, s2slash) + 1; + } + + /** + * Counts the occurrences of a character within a string. + * @param s String to count in + * @param c character to count + * @return number of occurences of <var>c</var> in <var>s</var> + */ + private static int findOccurrences(final String s, final char c) { + int occurrences = 0; + for (int i = 0, l = s.length(); i < l; i++) { + if (s.charAt(i) == c) { + occurrences++; + } + } + return occurrences; + } + + /** + * Create a reasonable path. + * @param str String to create path from + * @return path + */ + public static String path(final String str) { + String path = str.replaceAll("\\\\", "/"); + path = path.endsWith("/") ? path.substring(0, path.length() - 1) : path; + path = path.startsWith("file:") ? path.substring("file:".length()) : path; + return path; + } + +} // class PathManager Property changes on: trunk/crossfire/src/cfeditor/io/PathManager.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2006-12-10 13:34:04 UTC (rev 1004) +++ trunk/crossfire/src/cfeditor/messages.properties 2006-12-10 13:37:25 UTC (rev 1005) @@ -1,6 +1,10 @@ # Warning: This file MUST be ISO-8859-1 # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding +# Supported image set. The values must match the image file names: +# <name>.<image set name>.111 +availableImageSets=base + # Dialogs collectArchesNotReady.title=Arches still loading @@ -46,3 +50,7 @@ mapSkySetting=Sky setting mapTop=Top mapBottom=Bottom + +# Options +optionsImageSet=Image Set +optionsImageSet.shortdescription=The image set to use Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2006-12-10 13:34:04 UTC (rev 1004) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2006-12-10 13:37:25 UTC (rev 1005) @@ -241,3 +241,29 @@ scriptEditData.text=Daten \xE4ndern scriptEdit.text=Script \xE4ndern scriptRemove.text=Script l\xF6schen + +##################### +# Preference Modules + +prefsRes.title=Pfade & Ressourcen +prefsGUI.title=Aussehen + +# Options + +optionsLanguage=Sprache +optionsLayout=Layout-Einstellungen +optionsSepMapTile.text=Map-Tile-Panel unten anzeigen +optionsSepMapTile.shortdescription=Map-Tile-Panel unten (anstatt rechts) anzeigen +optionsLoadArchColl.text=Vorbereitete Archetypen laden +optionsGlobal=Global +optionsResPaths=Pfade +optionsResArch=Archetypen +optionsResArch.shortdescription=Dateiname der Archetypen-Datei +optionsResMaps=Karten +optionsResMaps.shortdescription=Verzeichnis f\xFCr Karten +optionsResScripts=Skripte +optionsResScripts.shortdescription=Verzeichnis f\xFCr Scripte +optionsImageSet=Image Set +optionsImageSet.shortdescription=Verwendetes Image Set zur Darstellung von Karten +optionsRestart.title=Warnung +optionsRestart.message=Viele Optionen erfordern einen Programmneustart, um effektiv zu werden. Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2006-12-10 13:34:04 UTC (rev 1004) +++ trunk/daimonin/src/daieditor/messages.properties 2006-12-10 13:37:25 UTC (rev 1005) @@ -157,17 +157,8 @@ # Options optionsTitle=Options -optionsLanguage=Language -optionsLayout=Layout Settings optionsUpdate=Automatic Update -optionsSepMapTile.text=Display Map-Tile Panel at the bottom -optionsSepMapTile.shortdescription=Unchecking this moves the Map-Tile Panel to the right side of the screen instead of the bottom right corner. optionsLoadArchColl.text=Load Arches from Collection -optionsGlobal=Global -optionsResPaths=Resource Paths -optionsResArch=Archfiles -optionsResMaps=Maps -optionsResScripts=Scripts optionsResMedia=Media optionsResMedia.shortdescription=<html>The media directory is for choosing background sounds for maps.<br>Please know that you cannot simply choose any media directory you want.<br>The background sound will only work if the files exist on the client as well.<br>Therefore, choosing a standard daimonin media directory is crucial.</html> optionsMisc=Miscellaneous Options @@ -180,8 +171,6 @@ optionsAppServer=Server optionsAppClient=Client optionsAppEditor=Editor -optionsRestart.title=Warning -optionsRestart.message=Most options require restarting the editor to take effect. optionsValidation=Validation settings autoValidate.text=Automatically run validation after each change optionsValidators=Validators @@ -713,9 +702,7 @@ prefsApp.title=External applications prefsDev.title=Developers -prefsRes.title=Paths & resources prefsMisc.title=Miscellaneous -prefsGUI.title=Appearance prefsUpdate.title=Update prefsMapValidator.title=Map validation Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2006-12-10 13:34:04 UTC (rev 1004) +++ trunk/src/app/net/sf/gridarta/messages.properties 2006-12-10 13:37:25 UTC (rev 1005) @@ -223,3 +223,27 @@ scriptEditData.text=Edit Data scriptEdit.text=Edit Script scriptRemove.text=Remove Script + +##################### +# Preference Modules + +prefsRes.title=Paths & resources +prefsGUI.title=Appearance + +# Options + +optionsLanguage=Language +optionsGlobal=Global +optionsLayout=Layout Settings +optionsSepMapTile.text=Display Map-Tile Panel at ... [truncated message content] |
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-12 03:39:21
|
Revision: 1006 http://svn.sourceforge.net/gridarta/?rev=1006&view=rev Author: akirschbaum Date: 2006-12-10 05:44:20 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Fix executable property. Property Changed: ---------------- trunk/crossfire/build.xml trunk/daimonin/debug/LinuxDebug.sh trunk/daimonin/resource/icons/development/Application24.gif trunk/daimonin/resource/icons/development/Host16.gif trunk/daimonin/resource/icons/development/Host24.gif trunk/daimonin/resource/icons/development/Jar16.gif trunk/daimonin/resource/icons/development/Server16.gif trunk/daimonin/resource/icons/development/Server24.gif trunk/daimonin/resource/icons/general/About16.gif trunk/daimonin/resource/icons/general/Bookmarks16.gif trunk/daimonin/resource/icons/general/Copy16.gif trunk/daimonin/resource/icons/general/Cut16.gif trunk/daimonin/resource/icons/general/Delete16.gif trunk/daimonin/resource/icons/general/Edit16.gif trunk/daimonin/resource/icons/general/Find16.gif trunk/daimonin/resource/icons/general/Help16.gif trunk/daimonin/resource/icons/general/History16.gif trunk/daimonin/resource/icons/general/New16.gif trunk/daimonin/resource/icons/general/Open16.gif trunk/daimonin/resource/icons/general/Paste16.gif trunk/daimonin/resource/icons/general/Preferences16.gif trunk/daimonin/resource/icons/general/Preferences24.gif trunk/daimonin/resource/icons/general/Properties16.gif trunk/daimonin/resource/icons/general/Redo16.gif trunk/daimonin/resource/icons/general/Refresh16.gif trunk/daimonin/resource/icons/general/Remove16.gif trunk/daimonin/resource/icons/general/Replace16.gif trunk/daimonin/resource/icons/general/Save16.gif trunk/daimonin/resource/icons/general/Save24.gif trunk/daimonin/resource/icons/general/SaveAll16.gif trunk/daimonin/resource/icons/general/SaveAs16.gif trunk/daimonin/resource/icons/general/Search16.gif trunk/daimonin/resource/icons/general/Search24.gif trunk/daimonin/resource/icons/general/Stop16.gif trunk/daimonin/resource/icons/general/TipOfTheDay16.gif trunk/daimonin/resource/icons/general/TipOfTheDay24.gif trunk/daimonin/resource/icons/general/Undo16.gif trunk/daimonin/resource/icons/general/Zoom16.gif trunk/daimonin/resource/icons/general/ZoomIn16.gif trunk/daimonin/resource/icons/general/ZoomOut16.gif trunk/daimonin/resource/icons/media/Play16.gif trunk/daimonin/resource/icons/media/Stop16.gif trunk/daimonin/resource/icons/navigation/Back16.gif trunk/daimonin/resource/icons/navigation/Down16.gif trunk/daimonin/resource/icons/navigation/Forward16.gif trunk/daimonin/resource/icons/navigation/Up16.gif Property changes on: trunk/crossfire/build.xml ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/debug/LinuxDebug.sh ___________________________________________________________________ Name: svn:executable + * Property changes on: trunk/daimonin/resource/icons/development/Application24.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/development/Host16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/development/Host24.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/development/Jar16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/development/Server16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/development/Server24.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/About16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Bookmarks16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Copy16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Cut16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Delete16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Edit16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Find16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Help16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/History16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/New16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Open16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Paste16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Preferences16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Preferences24.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Properties16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Redo16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Refresh16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Remove16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Replace16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Save16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Save24.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/SaveAll16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/SaveAs16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Search16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Search24.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Stop16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/TipOfTheDay16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/TipOfTheDay24.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Undo16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/Zoom16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/ZoomIn16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/general/ZoomOut16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/media/Play16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/media/Stop16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/navigation/Back16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/navigation/Down16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/navigation/Forward16.gif ___________________________________________________________________ Name: svn:executable - * Property changes on: trunk/daimonin/resource/icons/navigation/Up16.gif ___________________________________________________________________ Name: svn:executable - * 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:21
|
Revision: 1023 http://svn.sourceforge.net/gridarta/?rev=1023&view=rev Author: akirschbaum Date: 2006-12-10 09:38:31 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Whitespace changes; add missing braces. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFArchAttrib.java trunk/crossfire/src/cfeditor/CFArchType.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainMenu.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/crossfire/src/cfeditor/CMapTileList.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/ScriptArchData.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/crossfire/src/cfeditor/gui/ScriptEditor.java trunk/crossfire/src/cfeditor/gui/ScriptManager.java trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/crossfire/src/cfeditor/menu/LocationMenuEntry.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CFArchAttrib.java trunk/daimonin/src/daieditor/CFArchType.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/CopyBuffer.java trunk/daimonin/src/daieditor/ReplaceDialog.java trunk/daimonin/src/daieditor/ScriptArchData.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gui/map/MapTilePane.java trunk/daimonin/src/daieditor/map/MapArchObject.java trunk/teststuff/perfTest/PerfTestMapDecode.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -577,8 +577,7 @@ newAttr = new DialogAttrib<JTextArea>(type.getAttr()[i]); String text = ""; if (nameOld.equalsIgnoreCase("msg")) { - if (archetype.getMsgText() != null && archetype.getMsgText().length() > 0 && (gameObject.getMsgText() == null || gameObject.getMsgText().trim().length() == 0)) - { + if (archetype.getMsgText() != null && archetype.getMsgText().length() > 0 && (gameObject.getMsgText() == null || gameObject.getMsgText().trim().length() == 0)) { text = archetype.getMsgText(); } else { text = gameObject.getMsgText(); Modified: trunk/crossfire/src/cfeditor/CFArchAttrib.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchAttrib.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/CFArchAttrib.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -169,8 +169,7 @@ endingOld = a1.getValue().trim(); } - if (nameOld == null || nameOld.length() == 0 || - endingOld == null || endingOld.length() == 0) { + if (nameOld == null || nameOld.length() == 0 || endingOld == null || endingOld.length() == 0) { log.warn("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has text attribute missing '" + XML_KEY_ARCH_BEGIN + "' or '" + XML_KEY_ARCH_END + "'."); return false; } Modified: trunk/crossfire/src/cfeditor/CFArchType.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchType.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/CFArchType.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -306,9 +306,7 @@ for (final CFArchAttrib attrib : impType.attr) { if (!attrib.getSecName().equalsIgnoreCase("general")) { // import this attrib: - if (!attrib.getSecName().equalsIgnoreCase("general") && - !attrib.getSecName().equalsIgnoreCase("special") && - !secNames.contains(attrib.getSecName())) { + if (!attrib.getSecName().equalsIgnoreCase("general") && !attrib.getSecName().equalsIgnoreCase("special") && !secNames.contains(attrib.getSecName())) { sectionNum++; // increment number of valid sections secNames.add(attrib.getSecName()); } @@ -436,8 +434,7 @@ // create table with attributes text += "<br><br><TABLE BORDER>"; for (int i = 0; i < attr.length; i++) { - if (attr[i].getDataType() != ArchAttribType.FIXED && - !attr[i].getSecName().equalsIgnoreCase("general")) { + if (attr[i].getDataType() != ArchAttribType.FIXED && !attr[i].getSecName().equalsIgnoreCase("general")) { text += "<TR><B>"+attr[i].getNameNew()+":</B><br>"+attr[i].getText()+"</TR>"; } } Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -337,8 +337,7 @@ private void sortVector(final List<TreasureTreeNode> v) { for (int j = 0; j < v.size() + 1; j++) { for (int i = 0; i < v.size() - 1; i++) { - if (v.get(i).getTreasureObj().getName().compareToIgnoreCase( - v.get(i + 1).getTreasureObj().getName()) > 0) { + if (v.get(i).getTreasureObj().getName().compareToIgnoreCase( v.get(i + 1).getTreasureObj().getName()) > 0) { final TreasureTreeNode node = v.get(i); v.set(i, v.get(i + 1)); v.set(i + 1, node); Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -394,8 +394,7 @@ mapDir = new File(currentDir.getAbsolutePath()); } // if mapdir has no absolute path, set it now - if (currentDir.exists() && mapDir.getParent() == null && - !mapDir.isAbsolute() && !hasChangedDir) { + if (currentDir.exists() && mapDir.getParent() == null && !mapDir.isAbsolute() && !hasChangedDir) { mapDir = new File(currentDir.getAbsolutePath(), mapDir.getPath()); } } @@ -1168,8 +1167,7 @@ exitPos.y = exit.getAttributeInt("sp"); final String path = exit.getAttributeString("slaying"); - if (path.length() == 0 || (currentMap.getMapFile() != null && - path.equals(currentMap.getMapFile().getName()))) { + if (path.length() == 0 || (currentMap.getMapFile() != null && path.equals(currentMap.getMapFile().getName()))) { // path points to the same map if (exitPos.x == 0 && exitPos.y == 0) { ACTION_FACTORY.showMessageDialog(mainView, "enterExitNowhere"); Modified: trunk/crossfire/src/cfeditor/CMainMenu.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainMenu.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/CMainMenu.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -1266,8 +1266,7 @@ tmenu = enterLower; break; } - if (mainControl.getCurrentMap().getMapTilePath(direction) != null && - mainControl.getCurrentMap().getMapTilePath(direction).length() > 0) { + if (mainControl.getCurrentMap().getMapTilePath(direction) != null && mainControl.getCurrentMap().getMapTilePath(direction).length() > 0) { tmenu.setEnabled(true); foundATile = true; } else { Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -307,9 +307,7 @@ */ public GameObject getArchPanelHighlight() { - if ((isPickmapActive() || archPanel.getArchPanelSelection() == null) - && CPickmapPanel.getInstance().isLoadComplete() && - CPickmapPanel.getInstance().getCurrentPickmap() != null) { + if ((isPickmapActive() || archPanel.getArchPanelSelection() == null) && CPickmapPanel.getInstance().isLoadComplete() && CPickmapPanel.getInstance().getCurrentPickmap() != null) { // get the active pickmap final MapControl pmap = CPickmapPanel.getInstance().getCurrentPickmap(); Modified: trunk/crossfire/src/cfeditor/CMapArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -347,8 +347,7 @@ facename = archetype.getFaceName(); } - if (archFaceField.getText() != null && - archFaceField.getText().compareTo(facename) != 0) { + if (archFaceField.getText() != null && archFaceField.getText().compareTo(facename) != 0) { needRedraw = true; } } Modified: trunk/crossfire/src/cfeditor/CMapTileList.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapTileList.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/CMapTileList.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -169,8 +169,7 @@ */ list.addMouseListener(new MouseAdapter() { @Override public void mousePressed(final MouseEvent e) { - if (e.getModifiers() == MouseEvent.BUTTON1_MASK && - !e.isShiftDown() && !e.isControlDown()) { + if (e.getModifiers() == MouseEvent.BUTTON1_MASK && !e.isShiftDown() && !e.isControlDown()) { // --- left mouse button: select arch --- // first, check if this is a doubleclick final long thisClick = (new Date()).getTime(); @@ -185,8 +184,7 @@ // save values for next click lastClick = thisClick; lastClickGameObject = getMapTileSelection(); - } else if ((e.getModifiers() & MouseEvent.BUTTON3_MASK) != 0 || - ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && e.isShiftDown())) { + } else if ((e.getModifiers() & MouseEvent.BUTTON3_MASK) != 0 || ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && e.isShiftDown())) { // --- right mouse button: insert arch --- if (currentSquare != null && mainControl.getArchPanelHighlight() != null) { Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -519,8 +519,7 @@ if (mapLoc != null) { // in "locked pickmaps" mode, pickmaps react only to leftclicks - if (mapControl.isPickmap() && mainControl.isLockAllPickmaps() - && !(e.getModifiers() == MouseEvent.BUTTON1_MASK && !e.isShiftDown() && !e.isControlDown())) { + if (mapControl.isPickmap() && mainControl.isLockAllPickmaps() && !(e.getModifiers() == MouseEvent.BUTTON1_MASK && !e.isShiftDown() && !e.isControlDown())) { return; } @@ -621,9 +620,7 @@ // Update offset (from starting-dragpoint) only when mouse moved // over new tile and mouse is still on the map - if (temp.x != -1 && temp.y != -1 && - (mapMouseRightOff.x != temp.x - mapMouseRightPos.x || - mapMouseRightOff.y != temp.y - mapMouseRightPos.y)) { + if (temp.x != -1 && temp.y != -1 && (mapMouseRightOff.x != temp.x - mapMouseRightPos.x || mapMouseRightOff.y != temp.y - mapMouseRightPos.y)) { // update offset and redraw mapview mapMouseRightOff.x = temp.x - mapMouseRightPos.x; mapMouseRightOff.y = temp.y - mapMouseRightPos.y; @@ -812,8 +809,7 @@ // be a default arch (when pickmap has no selection) GameObject newarch = mainControl.getArchPanelHighlight(); - if (!mainControl.getMainView().isPickmapActive() || mapControl.isPickmap() || - (newarch != null && newarch.isArchetype())) { + if (!mainControl.getMainView().isPickmapActive() || mapControl.isPickmap() || (newarch != null && newarch.isArchetype())) { // insert default arch from archlist: if (!mapControl.addArchToMap(mainControl.getPanelArchName(), pos, allowMany, MapModel.JOIN_ENABLE)) { // mainControl.getMainView().mapPanel.setMapArchList(null); @@ -833,8 +829,7 @@ if (!allowMany) { // check if there is already an arch of that kind for (final GameObject t : mapControl.getMapModel().getMapSquare(pos)) { - if (t.getArchetypeName().equals(newarch.getArchetypeName()) && - t.getArchTypNr() == newarch.getArchTypNr()) { + if (t.getArchetypeName().equals(newarch.getArchetypeName()) && t.getArchTypNr() == newarch.getArchTypNr()) { insertAllowed = false; // there's a match - don't insert a second one } } @@ -886,8 +881,7 @@ final MapControl currentMap = mainControl.getCurrentMap(); // insertion is only allowed for valid *empty* squares - if (currentMap != null && mapControl.isPickmap() && mapControl.isPointValid(pos) - && !mapControl.containsArchObject(pos)) { + if (currentMap != null && mapControl.isPickmap() && mapControl.isPointValid(pos) && !mapControl.containsArchObject(pos)) { // get the currently selected map arch GameObject newarch = mainControl.getMainView().getMapTileSelection(); if (newarch != null) { Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -188,9 +188,7 @@ // store a clone of the gameObject in the CopyBuffer // (for multiparts, only the heads get copied into the buffer) // arches that don't match the view settings are ignored! - if ((mode == Mode.DO_CUT || mode == Mode.DO_COPY) - && gameObject.isHead() && !gameObject.isInContainer() - && (mainControl.getTileEdit() == 0 || mainControl.isTileEdit(gameObject.getEditType()))) { + if ((mode == Mode.DO_CUT || mode == Mode.DO_COPY) && gameObject.isHead() && !gameObject.isInContainer() && (mainControl.getTileEdit() == 0 || mainControl.isTileEdit(gameObject.getEditType()))) { // copy this gameObject final GameObject clone = gameObject.createClone(pos.x - startp.x, pos.y - startp.y); assert copyMapCtrl != null; @@ -199,8 +197,7 @@ // delete the gameObject if we have a "cut" or "clear" command // again, arches that don't match the view settings are ignored - if ((mode == Mode.DO_CLEAR || mode == Mode.DO_CUT) && (mainControl.getTileEdit() == 0 || - mainControl.isTileEdit(gameObject.getEditType()))) { + if ((mode == Mode.DO_CLEAR || mode == Mode.DO_CUT) && (mainControl.getTileEdit() == 0 || mainControl.isTileEdit(gameObject.getEditType()))) { // store next arch in tmp // delete gameObject (without redrawing the map) @@ -301,8 +298,7 @@ // If offset is zero and map-spot empty, a floodfill is done final GameObject arch; - if (offset.x == 0 && offset.y == 0 && - !mapControl.containsArchObject(startp)) { + if (offset.x == 0 && offset.y == 0 && !mapControl.containsArchObject(startp)) { arch = mainControl.getArchPanelHighlight(); if (arch != null) { floodfill(mapControl, startp.x, startp.y, arch); Modified: trunk/crossfire/src/cfeditor/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -508,9 +508,7 @@ final int replaceIndex = getScriptedEvent(eventType); if (replaceIndex != -1) { // collision with existing event -> ask user: replace? - if (JOptionPane.showConfirmDialog(frame, "An event of type \"" + eventType + "\" already exists for this object.\n" + - "Do you want to replace the existing event?", "Event exists", - JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.NO_OPTION) { + if (JOptionPane.showConfirmDialog(frame, "An event of type \"" + eventType + "\" already exists for this object.\n" + "Do you want to replace the existing event?", "Event exists", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.NO_OPTION) { // bail out return; } @@ -563,8 +561,7 @@ } // file does not exist -> aks user: create new file? - if (JOptionPane.showConfirmDialog(frame, "Create new script '" + newScriptFile.getName() + "'?", "Confirm", - JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.YES_OPTION) { + if (JOptionPane.showConfirmDialog(frame, "Create new script '" + newScriptFile.getName() + "'?", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.YES_OPTION) { // okay, create new script file and open it boolean couldCreateFile = false; // true when file creation successful try { Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -484,8 +484,7 @@ if (ignoreValues) { // cut away everything after the first space in that line // because we want to ignore the "value part": - if (line.length() > 0 && line.indexOf(" ") > 0 && - diffTextString(getObjectText(), line.substring(0, line.indexOf(" ") + 1), ignoreValues) == null) { + if (line.length() > 0 && line.indexOf(" ") > 0 && diffTextString(getObjectText(), line.substring(0, line.indexOf(" ") + 1), ignoreValues) == null) { result = result.concat(line + "\n"); } } else { @@ -840,9 +839,7 @@ // now check if it is a negation of an entry in the default arch if (line.contains(" ")) { String attr_val = line.substring(line.indexOf(" ")).trim(); - if (!(archetype.getAttributeString(attr_key, null).length() > 0 && - (attr_val.equals("0") || attr_val.equals("null") || - attr_val.equals("none")))) { + if (!(archetype.getAttributeString(attr_key, null).length() > 0 && (attr_val.equals("0") || attr_val.equals("null") || attr_val.equals("none")))) { errors += line.trim()+"\n"; // append line to the errors } } else { Modified: trunk/crossfire/src/cfeditor/gui/ScriptEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -217,8 +217,7 @@ } final String name = getScript().getParamName(selectedRow); - if (JOptionPane.showConfirmDialog(removeParameter, "Delete " + name + "?", - "Delete?", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { + if (JOptionPane.showConfirmDialog(removeParameter, "Delete " + name + "?", "Delete?", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { getScript().removeParameter(selectedRow); } } Modified: trunk/crossfire/src/cfeditor/gui/ScriptManager.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptManager.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/gui/ScriptManager.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -118,8 +118,7 @@ return; } - if (JOptionPane.showConfirmDialog(scripts, "remove script name " + m.getName(), "remove", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) - { + if (JOptionPane.showConfirmDialog(scripts, "remove script name " + m.getName(), "remove", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { if (log.isDebugEnabled()) { log.debug("removing"); } Modified: trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -487,8 +487,7 @@ // update tilepaths for (int i = 0; i < IGUIConstants.DIRECTIONS; i++) { - if ((map.getTilePath(i) == null && (fieldTilePath[i].getText() == null || fieldTilePath[i].getText().length() == 0)) - || (map.getTilePath(i) != null && !map.getTilePath(i).equals(fieldTilePath[i].getText()))) { + if ((map.getTilePath(i) == null && (fieldTilePath[i].getText() == null || fieldTilePath[i].getText().length() == 0)) || (map.getTilePath(i) != null && !map.getTilePath(i).equals(fieldTilePath[i].getText()))) { modifyTilepaths = true; } map.setTilePath(i, fieldTilePath[i].getText()); Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -213,8 +213,7 @@ return false; } - if (mainControl.getAutojoin() && join == JOIN_ENABLE && mainControl.getJoinlist() != null - && archetype.getJoinList() != null && !archetype.isMulti()) { + if (mainControl.getAutojoin() && join == JOIN_ENABLE && mainControl.getJoinlist() != null && archetype.getJoinList() != null && !archetype.isMulti()) { // do autojoining if enabled archName = archetype.getJoinList().joinInsert(this, pos); if (archName == null) { @@ -412,8 +411,7 @@ // do autojoining final GameObject temp = getArchetype(node.getArchetypeName()); // get defarch - if (mainControl.getAutojoin() && join == JOIN_ENABLE && mainControl.getJoinlist() != null - && temp.getJoinList() != null && !temp.isMulti()) { + if (mainControl.getAutojoin() && join == JOIN_ENABLE && mainControl.getJoinlist() != null && temp.getJoinList() != null && !temp.isMulti()) { // remove connections to the deleted arch temp.getJoinList().joinDelete(this, pos); } Modified: trunk/crossfire/src/cfeditor/menu/LocationMenuEntry.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/LocationMenuEntry.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/crossfire/src/cfeditor/menu/LocationMenuEntry.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -79,8 +79,7 @@ } public void menuChanged(final MenuChangeEvent event) { - if (event.getLocation() != null - && (event.getLocation().getName().equals(location))) { + if (event.getLocation() != null && (event.getLocation().getName().equals(location))) { getMenuManager().fireMenuEntryChange(this, MenuChangeEvent.CHANGE_CONTENT); } } Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -576,8 +576,7 @@ newAttr = new DialogAttrib<JTextArea>(attrib); String text = ""; if (nameOld.equalsIgnoreCase("msg")) { - if (archetype.getMsgText() != null && archetype.getMsgText().length() > 0 && (gameObject.getMsgText() == null || gameObject.getMsgText().trim().length() == 0)) - { + if (archetype.getMsgText() != null && archetype.getMsgText().length() > 0 && (gameObject.getMsgText() == null || gameObject.getMsgText().trim().length() == 0)) { text = archetype.getMsgText(); } else { text = gameObject.getMsgText(); @@ -763,8 +762,7 @@ newAttr = new DialogAttrib<JComboBox[]>(attrib); // create ComboBox with parsed selection final JComboBox[] inputs = new JComboBox[2]; - if (attrib.getMisc() != null && typelist.getListTable().containsKey(attrib.getMisc()[0]) && typelist.getListTable().containsKey(attrib.getMisc()[1])) - { + if (attrib.getMisc() != null && typelist.getListTable().containsKey(attrib.getMisc()[0]) && typelist.getListTable().containsKey(attrib.getMisc()[1])) { // Hack to set preselected if available final int active = gameObject.getAttributeInt(nameOld); final int[] activepart = {active & 0x0F, active & 0xF0}; Modified: trunk/daimonin/src/daieditor/CFArchAttrib.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchAttrib.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/daimonin/src/daieditor/CFArchAttrib.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -166,8 +166,7 @@ endingOld = a1.getValue().trim(); } - if (nameOld == null || nameOld.length() == 0 - || endingOld == null || endingOld.length() == 0) { + if (nameOld == null || nameOld.length() == 0 || endingOld == null || endingOld.length() == 0) { log.warn("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has text attribute missing '" + XML_KEY_ARCH_BEGIN + "' or '" + XML_KEY_ARCH_END + "'."); return false; } Modified: trunk/daimonin/src/daieditor/CFArchType.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchType.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/daimonin/src/daieditor/CFArchType.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -295,9 +295,7 @@ for (final CFArchAttrib aAttr : impType.attr) { if (!"general".equalsIgnoreCase(aAttr.getSecName())) { // import this attrib: - if (!"general".equalsIgnoreCase(aAttr.getSecName()) - && !"special".equalsIgnoreCase(aAttr.getSecName()) - && !secNames.contains(aAttr.getSecName())) { + if (!"general".equalsIgnoreCase(aAttr.getSecName()) && !"special".equalsIgnoreCase(aAttr.getSecName()) && !secNames.contains(aAttr.getSecName())) { sectionNum++; // increment number of valid sections secNames.add(aAttr.getSecName()); } Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -278,9 +278,7 @@ */ @Nullable public GameObject getArchPanelHighlight() { - if ((pickmapActive || archPanel.getArchPanelSelection() == null) - && CPickmapPanel.getInstance().isLoadComplete() - && CPickmapPanel.getInstance().getCurrentPickmap() != null) { + if ((pickmapActive || archPanel.getArchPanelSelection() == null) && CPickmapPanel.getInstance().isLoadComplete() && CPickmapPanel.getInstance().getCurrentPickmap() != null) { // get the active pickmap final MapControl pmap = CPickmapPanel.getInstance().getCurrentPickmap(); @@ -315,8 +313,7 @@ */ @Nullable public List<GameObject> getArchPanelSelection() { - if ((pickmapActive || archPanel.getArchPanelSelection() == null) - && CPickmapPanel.getInstance().isLoadComplete()) { + if ((pickmapActive || archPanel.getArchPanelSelection() == null) && CPickmapPanel.getInstance().isLoadComplete()) { // get the active pickmap final MapControl pmap = CPickmapPanel.getInstance().getCurrentPickmap(); if (pmap != null) { Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -161,9 +161,7 @@ // store a clone of the gameObject in the CopyBuffer // (for multiparts, only the heads get copied into the buffer) // arches that don't match the view settings are ignored! - if ((mode == Mode.DO_CUT || mode == Mode.DO_COPY) - && gameObject.isHead() && !gameObject.isInContainer() - && mainControl.isTileEdit(gameObject)) { + if ((mode == Mode.DO_CUT || mode == Mode.DO_COPY) && gameObject.isHead() && !gameObject.isInContainer() && mainControl.isTileEdit(gameObject)) { // copy this gameObject final GameObject clone = gameObject.createClone(posx - offset.x, posy - offset.y); assert copyMapCtrl != null; @@ -300,8 +298,7 @@ for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { for (final GameObject node : map.getMapSquare(pos)) { // only non multi suckers - if (!node.isTail()) - { + if (!node.isTail()) { count++; } } Modified: trunk/daimonin/src/daieditor/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -319,9 +319,7 @@ final int replaceListSize = replaceList == null ? 0 : replaceList.size(); for (final MapSquare<GameObject> square : entireMap ? mapControl.getMapModel() : mapViewIFrame.getView().getSelectedSquares()) { for (final GameObject node : square) { - if (!node.isMulti() - && (matchCriteria == MATCH_ARCH_NAME && node.getArchetypeName() != null && node.getArchetypeName().equalsIgnoreCase(matchString) - || matchCriteria == MATCH_OBJ_NAME && node.getBestName().equalsIgnoreCase(matchString))) { + if (!node.isMulti() && (matchCriteria == MATCH_ARCH_NAME && node.getArchetypeName() != null && node.getArchetypeName().equalsIgnoreCase(matchString) || matchCriteria == MATCH_OBJ_NAME && node.getBestName().equalsIgnoreCase(matchString))) { if (replaceListSize > 0 && !deleteOnly) { GameObject randomArch; if (replaceListSize == 1) { Modified: trunk/daimonin/src/daieditor/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/ScriptArchData.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/daimonin/src/daieditor/ScriptArchData.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -470,8 +470,7 @@ final GameObject replaceObject = getScriptedEvent(eventType); if (replaceObject != null) { // collision with existing event -> ask user: replace? - if (JOptionPane.showConfirmDialog(frame, "An event of type \"" + typeName(eventType) + "\" already exists for this object.\n" + "Do you want to replace the existing event?", "Event exists", - JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.NO_OPTION) { + if (JOptionPane.showConfirmDialog(frame, "An event of type \"" + typeName(eventType) + "\" already exists for this object.\n" + "Do you want to replace the existing event?", "Event exists", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.NO_OPTION) { // bail out return false; } @@ -522,8 +521,7 @@ } // file does not exist -> aks user: create new file? - if (JOptionPane.showConfirmDialog(frame, "Create new script '" + newScriptFile.getName() + "'?", "Confirm", - JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.YES_OPTION) { + if (JOptionPane.showConfirmDialog(frame, "Create new script '" + newScriptFile.getName() + "'?", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.YES_OPTION) { // okay, create new script file and open it boolean couldCreateFile = false; // true when file creation successful try { Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -786,10 +786,9 @@ // now check if it is a negation of an entry in the default arch if (line.contains(" ")) { String attr_val = line.substring(line.indexOf(" ")).trim(); - if (!(archetype.getAttributeString(attrKey, null).length() > 0 && - (attr_val.equals("0") || attr_val.equals("null") || - attr_val.equals("none")))) + if (!(archetype.getAttributeString(attrKey, null).length() > 0 && (attr_val.equals("0") || attr_val.equals("null") || attr_val.equals("none")))) { errors += line.trim()+"\n"; // append line to the errors + } } else { errors += line.trim()+"\n"; // append line to the errors } Modified: trunk/daimonin/src/daieditor/gui/map/MapTilePane.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -575,8 +575,7 @@ tileHeaders[tileLink[i][ii][0]].map = level; repeatFlag = true; } else { - if (ACTION_FACTORY.showQuestionDialog(this, "mapErrorInvalid", tile_link_name[i], tileHeaders[i].linkPath, tile_link_name[tileLink[i][ii][0]], tile_link_name[tileLink[i][ii][1]], tileHeaders[i].maparch.getTilePath(tileLink[i][ii][1]), link)) - { + if (ACTION_FACTORY.showQuestionDialog(this, "mapErrorInvalid", tile_link_name[i], tileHeaders[i].linkPath, tile_link_name[tileLink[i][ii][0]], tile_link_name[tileLink[i][ii][1]], tileHeaders[i].maparch.getTilePath(tileLink[i][ii][1]), link)) { return; } } @@ -803,8 +802,7 @@ // update tilepaths boolean modifyTilepaths = false; // true when map tile-paths were modified for (int i = 0; i < 8; i++) { - if (map.getTilePath(i) == null && (tilePaths[i].getText() == null || tilePaths[i].getText().length() == 0) || (map.getTilePath(i) != null && !map.getTilePath(i).equals(tilePaths[i].getText()))) - { + if (map.getTilePath(i) == null && (tilePaths[i].getText() == null || tilePaths[i].getText().length() == 0) || (map.getTilePath(i) != null && !map.getTilePath(i).equals(tilePaths[i].getText()))) { modifyTilepaths = true; } map.setTilePath(i, tilePaths[i].getText()); Modified: trunk/daimonin/src/daieditor/map/MapArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -390,8 +390,7 @@ } } else { // ARCH: not found yet // looking for the map arch - if (line.toLowerCase().regionMatches(0, "arch ", 0, 5) - && line.toLowerCase().endsWith(" map")) { + if (line.toLowerCase().regionMatches(0, "arch ", 0, 5) && line.toLowerCase().endsWith(" map")) { archflag = true; } } Modified: trunk/teststuff/perfTest/PerfTestMapDecode.java =================================================================== --- trunk/teststuff/perfTest/PerfTestMapDecode.java 2006-12-10 17:24:25 UTC (rev 1022) +++ trunk/teststuff/perfTest/PerfTestMapDecode.java 2006-12-10 17:38:31 UTC (rev 1023) @@ -345,8 +345,9 @@ final int hash = word.hashCode(); int hashIndex; for (hashIndex = 0; hashIndex < hashes.length; hashIndex++) { - if (hashes[hashIndex] == hash) + if (hashes[hashIndex] == hash) { break; + } } switch (hashIndex) { case 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:19
|
Revision: 1021 http://svn.sourceforge.net/gridarta/?rev=1021&view=rev Author: akirschbaum Date: 2006-12-10 09:03:05 -0800 (Sun, 10 Dec 2006) Log Message: ----------- WorldMaker script: do not create broken images in cache if the script is aborted. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/resource/conf/scripts.xml trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-12-10 16:33:43 UTC (rev 1020) +++ trunk/crossfire/ChangeLog 2006-12-10 17:03:05 UTC (rev 1021) @@ -3,6 +3,7 @@ * Make WorldMaker script more robust: - create PictureDirectory if it does not exist - do not require a trailing / for PictureDirectory + - do not create broken images in cache if the script is aborted 2006-12-07 Andreas Kirschbaum Modified: trunk/crossfire/resource/conf/scripts.xml =================================================================== --- trunk/crossfire/resource/conf/scripts.xml 2006-12-10 16:33:43 UTC (rev 1020) +++ trunk/crossfire/resource/conf/scripts.xml 2006-12-10 17:03:05 UTC (rev 1021) @@ -20,13 +20,12 @@ return Location + PictureDirectory + getSimpleFilename(mapFilename) + ".png"; } -boolean updateMap(String mapFile, String pictureFile) { - File image = new File(pictureFile); +boolean updateMap(String mapFile, File pictureFile) { File map = new File(mapFile); if (!map.exists()) { return false; } - if (image.exists() && image.lastModified() >= map.lastModified()) { + if (pictureFile.exists() && pictureFile.lastModified() >= map.lastModified()) { return false; } print("converting " + mapFile + " to " + pictureFile + "."); @@ -90,7 +89,7 @@ currentY = StartY.intValue() + y; currentMap = Location + MapFilename + "_" + currentX + "_" + currentY; currentPicture = getPngImageFilename(currentMap); - didUpdate = updateMap(currentMap, currentPicture); + didUpdate = updateMap(currentMap, new File(currentPicture)); if ((didUpdate || firstRun) && fileExists(currentPicture)) { runCommand("pngtopnm " + currentPicture + " | pnmscale -xysize " + TileWidth + " " + TileHeight + " > /tmp/ppm.tmp"); sx = x * TileWidth.intValue(); Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-10 16:33:43 UTC (rev 1020) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-10 17:03:05 UTC (rev 1021) @@ -1081,8 +1081,12 @@ // there is no map open (should not happen due to disabled menus) ACTION_FACTORY.showMessageDialog(mainView, "createImgNoMap"); } else { + final File tmpFile = new File(file.getPath() + ".tmp"); try { - mapControl.getMapViewFrame().printFullImage(file); + mapControl.getMapViewFrame().printFullImage(tmpFile); + if (!tmpFile.renameTo(file)) { + throw new IOException("cannot rename " + tmpFile + " to " + file); + } if (log.isInfoEnabled()) { log.info(ACTION_FACTORY.format("imageCreated", file, mapControl.getMapFileName())); } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-12-10 16:33:43 UTC (rev 1020) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-12-10 17:03:05 UTC (rev 1021) @@ -1432,8 +1432,12 @@ // there is no map open (should not happen due to disabled menus) ACTION_FACTORY.showMessageDialog(mainView, "createImgNoMap"); } else { + final File tmpFile = new File(file.getPath() + ".tmp"); try { - mapControl.getMapViewFrame().printFullImage(file); + mapControl.getMapViewFrame().printFullImage(tmpFile); + if (!tmpFile.renameTo(file)) { + throw new IOException("cannot rename " + tmpFile + " to " + file); + } if (log.isInfoEnabled()) { log.info(ACTION_FACTORY.format("imageCreated", file, mapControl.getMapFileName())); } 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:19
|
Revision: 997 http://svn.sourceforge.net/gridarta/?rev=997&view=rev Author: akirschbaum Date: 2006-12-10 03:13:17 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Fix comment. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CSettings.java Modified: trunk/crossfire/src/cfeditor/CSettings.java =================================================================== --- trunk/crossfire/src/cfeditor/CSettings.java 2006-12-09 21:13:52 UTC (rev 996) +++ trunk/crossfire/src/cfeditor/CSettings.java 2006-12-10 11:13:17 UTC (rev 997) @@ -114,8 +114,8 @@ } /** - * Searches for the property with the specified key in this * property - * list. The method returns <code>null</code> if the * property is not found. + * Searches for the property with the specified key in this property list. + * The method returns <code>null</code> if the property is not found. * @param strKey The key that identifies the property. * @return Property value for the named key. */ 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:18
|
Revision: 1053 http://svn.sourceforge.net/gridarta/?rev=1053&view=rev Author: akirschbaum Date: 2006-12-11 12:27:03 -0800 (Mon, 11 Dec 2006) Log Message: ----------- Partially fix 'Lock All Pickmaps' function. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainView.java Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-12-11 20:21:20 UTC (rev 1052) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-12-11 20:27:03 UTC (rev 1053) @@ -710,13 +710,17 @@ return mapArchPanel; } + public boolean isLockAllPickmaps() { + return mainControl.isLockAllPickmaps(); + } + public void setLockAllPickmaps(final boolean lockAllPickmaps) { - final boolean locked = mainControl.isLockAllPickmaps(); - aAddNewPickmap.setEnabled(!locked); - aClosePickmap.setEnabled(!locked); - aOpenPickmap.setEnabled(!locked); - aSavePickmap.setEnabled(!locked); - aRevertPickmap.setEnabled(!locked); + mainControl.setLockAllPickmaps(lockAllPickmaps); + aAddNewPickmap.setEnabled(!lockAllPickmaps); + aClosePickmap.setEnabled(!lockAllPickmaps); + aOpenPickmap.setEnabled(!lockAllPickmaps); + aSavePickmap.setEnabled(!lockAllPickmaps); + aRevertPickmap.setEnabled(!lockAllPickmaps); } private final String[] directionsMap = {"enterNorthMap", "enterEastMap", "enterSouthMap", "enterWestMap", "enterNorthEastMap", "enterSouthEastMap", "enterSouthWestMap", "enterNorthWestMap"}; 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:18
|
Revision: 1054 http://svn.sourceforge.net/gridarta/?rev=1054&view=rev Author: akirschbaum Date: 2006-12-11 12:54:53 -0800 (Mon, 11 Dec 2006) Log Message: ----------- Whitespace changes. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-11 20:27:03 UTC (rev 1053) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-11 20:54:53 UTC (rev 1054) @@ -1533,7 +1533,6 @@ * to be saved as (false). * @return true if level can be just saved, false if not */ - boolean isPlainSaveEnabled() { return currentMap != null && currentMap.isPlainSaveEnabled(); } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-12-11 20:27:03 UTC (rev 1053) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-12-11 20:54:53 UTC (rev 1054) @@ -1916,7 +1916,6 @@ * to be saved as (false). * @return true if level can be just saved, false if not */ - boolean isPlainSaveEnabled() { return currentMap != null && currentMap.isPlainSaveEnabled(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |