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: <chr...@us...> - 2006-12-09 17:33:37
|
Revision: 984 http://svn.sourceforge.net/gridarta/?rev=984&view=rev Author: christianhujer Date: 2006-12-09 09:33:36 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Improved CMapWriter performance. Modified Paths: -------------- trunk/crossfire/src/cfeditor/io/CMapWriter.java Modified: trunk/crossfire/src/cfeditor/io/CMapWriter.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapWriter.java 2006-12-09 17:24:34 UTC (rev 983) +++ trunk/crossfire/src/cfeditor/io/CMapWriter.java 2006-12-09 17:33:36 UTC (rev 984) @@ -177,15 +177,20 @@ Arrays.sort(keys, keyOrderComparator); // Actually write the fields. - append("arch " + gameObject.getArchetypeName() + "\n"); + append("arch "); + append(gameObject.getArchetypeName()); + append("\n"); for (final String key : keys) { final String value = fields.get(key); if (value != null) { + append(key); if (key.equals("msg") || key.equals("lore")) { - append(key + "\n" + value + "\n"); + append("\n"); } else { - append(key + " " + value + "\n"); + append(" "); } + append(value); + append("\n"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 17:24:33
|
Revision: 983 http://svn.sourceforge.net/gridarta/?rev=983&view=rev Author: christianhujer Date: 2006-12-09 09:24:34 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Added missing nullability annotations. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainStatusbar.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainStatusbar.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-09 17:22:37 UTC (rev 982) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-09 17:24:34 UTC (rev 983) @@ -500,12 +500,12 @@ } /** {@inheritDoc} */ - public void addArchPanel(final String name) { + public void addArchPanel(@NotNull final String name) { mainView.addArchPanel(name); } /** {@inheritDoc} */ - public int addArchPanelCombo(final String name) { + public int addArchPanelCombo(@NotNull final String name) { return mainView.addArchPanelCombo(name); } Modified: trunk/crossfire/src/cfeditor/CMainStatusbar.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainStatusbar.java 2006-12-09 17:22:37 UTC (rev 982) +++ trunk/crossfire/src/cfeditor/CMainStatusbar.java 2006-12-09 17:24:34 UTC (rev 983) @@ -41,6 +41,7 @@ import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.japi.swing.ActionFactory; import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.NotNull; /** * <code>CMainStatusbar</code> implements the main statusbar of the @@ -165,11 +166,11 @@ return null; } - public void mapCursorChangedPos(final MapCursorEvent e) { + public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { mapCursorChanged(e.getSource()); } - public void mapCursorChangedMode(final MapCursorEvent e) { + public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { mapCursorChanged(e.getSource()); } Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-12-09 17:22:37 UTC (rev 982) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-12-09 17:24:34 UTC (rev 983) @@ -53,6 +53,7 @@ import net.sf.japi.swing.Progress; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.NotNull; /** * The <code>ArchetypeSet</code> contains all the Archetypes. @@ -618,7 +619,7 @@ } /** {@inheritDoc} */ - public void collect(final Progress progress, final File dir) throws IOException { + public void collect(@NotNull final Progress progress, @NotNull final File dir) throws IOException { final File dfile = new File(dir, IGUIConstants.ARCH_FILE); // now open the output-stream final DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(dfile))); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-12-09 17:22:37 UTC (rev 982) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-12-09 17:24:34 UTC (rev 983) @@ -791,12 +791,12 @@ } /** {@inheritDoc} */ - public void addArchPanel(final String name) { + public void addArchPanel(@NotNull final String name) { mainView.addArchPanel(name); } /** {@inheritDoc} */ - public int addArchPanelCombo(final String name) { + public int addArchPanelCombo(@NotNull final String name) { return mainView.addArchPanelCombo(name); } Modified: trunk/daimonin/src/daieditor/CMainStatusbar.java =================================================================== --- trunk/daimonin/src/daieditor/CMainStatusbar.java 2006-12-09 17:22:37 UTC (rev 982) +++ trunk/daimonin/src/daieditor/CMainStatusbar.java 2006-12-09 17:24:34 UTC (rev 983) @@ -41,6 +41,7 @@ import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.japi.swing.ActionFactory; import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.NotNull; /** * <code>CMainStatusbar</code> implements the main statusbar of the @@ -165,11 +166,11 @@ return null; } - public void mapCursorChangedPos(final MapCursorEvent e) { + public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { mapCursorChanged(e.getSource()); } - public void mapCursorChangedMode(final MapCursorEvent e) { + public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { mapCursorChanged(e.getSource()); } Modified: trunk/daimonin/src/daieditor/CMapViewBasic.java =================================================================== --- trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-12-09 17:22:37 UTC (rev 982) +++ trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-12-09 17:24:34 UTC (rev 983) @@ -57,6 +57,7 @@ import net.sf.gridarta.map.MapSquare; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.NotNull; /** * <code>CMapViewBasic</code> is the true mapview object. However, it is not @@ -441,7 +442,7 @@ //} // class CPaintOp - public void mapCursorChangedPos(final MapCursorEvent e) { + public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { final MapCursor mapCursor = e.getSource(); if (mapCursor.isActive()) { final Rectangle rec = renderer.getTileBounds(mapCursor.getLocation()); @@ -449,7 +450,7 @@ } } - public void mapCursorChangedMode(final MapCursorEvent e) { + public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { // Ignore mode change events } Modified: trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2006-12-09 17:22:37 UTC (rev 982) +++ trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2006-12-09 17:24:34 UTC (rev 983) @@ -441,12 +441,12 @@ } /** {@inheritDoc} */ - public void mapGridChanged(final MapGridEvent e) { + public void mapGridChanged(@NotNull final MapGridEvent e) { repaint(); } /** {@inheritDoc} */ - public void mapGridResized(final MapGridEvent e) { + public void mapGridResized(@NotNull final MapGridEvent e) { mapSize = e.getSource().getSize(); calculateOrigin(); repaint(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 17:22:37
|
Revision: 982 http://svn.sourceforge.net/gridarta/?rev=982&view=rev Author: christianhujer Date: 2006-12-09 09:22:37 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Changed documenation of nullability. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-12-09 17:20:58 UTC (rev 981) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-12-09 17:22:37 UTC (rev 982) @@ -23,8 +23,10 @@ /** * Get the name of this Archetype. * @return The name of this Archetype. + * @note For Archetypes this method must not return <code>null</code>. + * However, this method is currently also implemented by {@link GameObject}, where it may return <code>null</code>. */ - @NotNull String getArchetypeName(); + @Nullable String getArchetypeName(); /** * Returns an attribute value of this Archetype. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 17:20:58
|
Revision: 981 http://svn.sourceforge.net/gridarta/?rev=981&view=rev Author: christianhujer Date: 2006-12-09 09:20:58 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Fixed bug: Result of replace was ignored. Modified Paths: -------------- trunk/crossfire/src/cfeditor/ScriptArchData.java Modified: trunk/crossfire/src/cfeditor/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-12-09 17:20:01 UTC (rev 980) +++ trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-12-09 17:20:58 UTC (rev 981) @@ -655,7 +655,7 @@ } } - filePath.replace('\\', '/'); // just make sure there are only slashes: '/' + filePath = filePath.replace('\\', '/'); // just make sure there are only slashes: '/' return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 17:20:02
|
Revision: 980 http://svn.sourceforge.net/gridarta/?rev=980&view=rev Author: christianhujer Date: 2006-12-09 09:20:01 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Added comment about a bug that needs fixing. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-12-09 17:16:31 UTC (rev 979) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-12-09 17:20:01 UTC (rev 980) @@ -420,7 +420,7 @@ stream.reset(); // jump to beginning of png data faceObjects[faceListCount] = new FaceObject(baseDir, IGUIConstants.PNG_FILE, filePosition, size); // lazy load object - stream.skip(size); + stream.skip(size); // FIXME: result of skip is ignored. filePosition += size; // put this png into the list of faces faceObjects[faceListCount].setName(face); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 17:16:31
|
Revision: 979 http://svn.sourceforge.net/gridarta/?rev=979&view=rev Author: christianhujer Date: 2006-12-09 09:16:31 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Made some members private. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/help/HtmlPane.java trunk/src/app/net/sf/gridarta/io/AbstractMapWriter.java trunk/src/app/net/sf/gridarta/io/IOUtils.java Modified: trunk/src/app/net/sf/gridarta/help/HtmlPane.java =================================================================== --- trunk/src/app/net/sf/gridarta/help/HtmlPane.java 2006-12-09 17:11:32 UTC (rev 978) +++ trunk/src/app/net/sf/gridarta/help/HtmlPane.java 2006-12-09 17:16:31 UTC (rev 979) @@ -166,7 +166,7 @@ * null argument. * @param u the URL to follow */ - void linkActivated(final URL u) { + private void linkActivated(final URL u) { final Cursor cursor = html.getCursor(); final Cursor waitCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR); html.setCursor(waitCursor); Modified: trunk/src/app/net/sf/gridarta/io/AbstractMapWriter.java =================================================================== --- trunk/src/app/net/sf/gridarta/io/AbstractMapWriter.java 2006-12-09 17:11:32 UTC (rev 978) +++ trunk/src/app/net/sf/gridarta/io/AbstractMapWriter.java 2006-12-09 17:16:31 UTC (rev 979) @@ -24,7 +24,7 @@ private final PrintWriter myOutput; /** The uri to write to. */ - protected final String uri; + private final String uri; /** * Open a resource for reading it as a map. Modified: trunk/src/app/net/sf/gridarta/io/IOUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/io/IOUtils.java 2006-12-09 17:11:32 UTC (rev 978) +++ trunk/src/app/net/sf/gridarta/io/IOUtils.java 2006-12-09 17:16:31 UTC (rev 979) @@ -22,7 +22,7 @@ public final class IOUtils { /** Maximum number of characters to read in readUntil. */ - public static final long READ_MAX = 10000L; + private static final long READ_MAX = 10000L; /** * Encoding to use for maps and other data. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 17:11:35
|
Revision: 978 http://svn.sourceforge.net/gridarta/?rev=978&view=rev Author: christianhujer Date: 2006-12-09 09:11:32 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Removed some redundant local variables. Modified Paths: -------------- trunk/crossfire/src/cfeditor/COptionDialog.java trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java trunk/daimonin/src/daieditor/MapViewIFrame.java Modified: trunk/crossfire/src/cfeditor/COptionDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/COptionDialog.java 2006-12-09 17:08:39 UTC (rev 977) +++ trunk/crossfire/src/cfeditor/COptionDialog.java 2006-12-09 17:11:32 UTC (rev 978) @@ -73,7 +73,6 @@ */ COptionDialog(final CMainControl mainControl, final Frame parentFrame) { super(parentFrame, "Options"); - final CMainControl mainControl1=mainControl; getContentPane().setLayout(new BorderLayout()); final JPanel mainPanel = new JPanel(); @@ -98,21 +97,21 @@ final JPanel archPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); archPanel.add(new JLabel("Archfiles: ")); m_archField = new JTextField(16); - m_archField.setText(mainControl1.getArchDefaultFolder()); + 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(mainControl1.getMapDefaultFolder()); + 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(mainControl1.getScriptDefaultFolder()); + m_scriptField.setText(mainControl.getScriptDefaultFolder()); scriptPanel.add(m_scriptField); mainPanel.add(optionPathPanel); @@ -128,18 +127,18 @@ IGUIConstants.DIALOG_INSETS))); final JPanel cbox; - if (mainControl1.getImageSet() != null) { - cbox = buildImageSetBox(mainControl1.getImageSet().equalsIgnoreCase("base")); + 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(mainControl1.isArchLoadedFromCollection()); + m_loadArches.setSelected(mainControl.isArchLoadedFromCollection()); m_loadArches.addActionListener(new SelectArchLoadAL(m_loadArches, this)); optionPartPanel.add(m_loadArches); - if (mainControl1.isArchLoadedFromCollection()) { + if (mainControl.isArchLoadedFromCollection()) { m_archField.setEnabled(false); } @@ -156,7 +155,7 @@ IGUIConstants.DIALOG_INSETS))); m_mapPanelBottom = new JCheckBox(" Separate Map-Tile Panel"); - m_mapPanelBottom.setSelected(!mainControl1.getMainView().isMapTileListBottom()); + m_mapPanelBottom.setSelected(!mainControl.getMainView().isMapTileListBottom()); optionLayoutPanel.add(m_mapPanelBottom); optionLayoutPanel.add(new JLabel("(Takes effect on next application start)")); mainPanel.add(optionLayoutPanel); Modified: trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java 2006-12-09 17:08:39 UTC (rev 977) +++ trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java 2006-12-09 17:11:32 UTC (rev 978) @@ -23,7 +23,6 @@ public WrappedMenuLocation(final MenuLocation location, final String parentName) { this.location = location; - final String parentName1 = parentName; name = parentName + "." + location.getName(); } Modified: trunk/daimonin/src/daieditor/MapViewIFrame.java =================================================================== --- trunk/daimonin/src/daieditor/MapViewIFrame.java 2006-12-09 17:08:39 UTC (rev 977) +++ trunk/daimonin/src/daieditor/MapViewIFrame.java 2006-12-09 17:11:32 UTC (rev 978) @@ -73,7 +73,6 @@ super(mapControl.getMapFileName() + " [ " + mapControl.getMapArch().getMapDisplayName() + " ] ("+ number + ')', true, true, true, true); this.mapControl = mapControl; this.mainControl = mainControl; - final int viewNumber = number; setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 17:08:39
|
Revision: 977 http://svn.sourceforge.net/gridarta/?rev=977&view=rev Author: christianhujer Date: 2006-12-09 09:08:39 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Removed some unneccessary semicolons. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CScriptController.java trunk/crossfire/src/cfeditor/CScriptModel.java trunk/crossfire/src/cfeditor/PluginParameter.java trunk/crossfire/src/cfeditor/parameter/BooleanParameter.java trunk/crossfire/src/cfeditor/parameter/DoubleParameter.java Modified: trunk/crossfire/src/cfeditor/CScriptController.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptController.java 2006-12-09 17:02:17 UTC (rev 976) +++ trunk/crossfire/src/cfeditor/CScriptController.java 2006-12-09 17:08:39 UTC (rev 977) @@ -309,8 +309,8 @@ private void notifyListeners() { final ChangeEvent e = new ChangeEvent(this); - for (Iterator<ChangeListener> i = listeners.iterator(); i.hasNext(); i.next().stateChanged(e)) { - ; + for (final ChangeListener listener : listeners) { + listener.stateChanged(e); } } Modified: trunk/crossfire/src/cfeditor/CScriptModel.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptModel.java 2006-12-09 17:02:17 UTC (rev 976) +++ trunk/crossfire/src/cfeditor/CScriptModel.java 2006-12-09 17:08:39 UTC (rev 977) @@ -9,7 +9,6 @@ import java.util.ArrayList; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; @@ -300,8 +299,8 @@ /** Tell all listeners plugged on this CScriptModel its content has changed. */ private void notifyListeners() { final ChangeEvent e = new ChangeEvent(this); - for (Iterator<ChangeListener> i = listeners.iterator(); i.hasNext(); i.next().stateChanged(e)) { - ; + for (final ChangeListener listener : listeners) { + listener.stateChanged(e); } } @@ -457,8 +456,8 @@ } root.addContent(modes); - for (Iterator<PluginParameter> i = params.iterator(); i.hasNext(); root.addContent(i.next().toXML())) { - ; + for (final PluginParameter param : (Iterable<PluginParameter>) params) { + root.addContent(param.toXML()); } return root; } Modified: trunk/crossfire/src/cfeditor/PluginParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/PluginParameter.java 2006-12-09 17:02:17 UTC (rev 976) +++ trunk/crossfire/src/cfeditor/PluginParameter.java 2006-12-09 17:08:39 UTC (rev 977) @@ -8,7 +8,6 @@ package cfeditor; import java.util.HashSet; -import java.util.Iterator; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import org.jdom.Element; @@ -102,8 +101,8 @@ protected void fireDataChanged() { final ChangeEvent e = new ChangeEvent(this); - for (Iterator<ChangeListener> i = listeners.iterator(); i.hasNext(); i.next().stateChanged(e)) { - ; + for (final ChangeListener listener : listeners) { + listener.stateChanged(e); } } Modified: trunk/crossfire/src/cfeditor/parameter/BooleanParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/BooleanParameter.java 2006-12-09 17:02:17 UTC (rev 976) +++ trunk/crossfire/src/cfeditor/parameter/BooleanParameter.java 2006-12-09 17:08:39 UTC (rev 977) @@ -65,7 +65,6 @@ } catch (final Exception ex) { setValue(Boolean.FALSE); } - ; final BooleanConfig cfg = new BooleanConfig(); cfg.setTrueText(e.getChildText("trueText")); cfg.setFalseText(e.getChildText("falseText")); Modified: trunk/crossfire/src/cfeditor/parameter/DoubleParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/DoubleParameter.java 2006-12-09 17:02:17 UTC (rev 976) +++ trunk/crossfire/src/cfeditor/parameter/DoubleParameter.java 2006-12-09 17:08:39 UTC (rev 977) @@ -65,7 +65,6 @@ } catch (final Exception ex) { setValue((double) 0); } - ; final DoubleConfig o = new DoubleConfig(); try { o.setMin(Double.parseDouble(e.getChildTextTrim("minimum"))); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 17:02:20
|
Revision: 976 http://svn.sourceforge.net/gridarta/?rev=976&view=rev Author: christianhujer Date: 2006-12-09 09:02:17 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Rationalized static member access. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CArchPanelPan.java trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/CArchPanelPan.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-12-09 16:33:59 UTC (rev 975) +++ trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-12-09 17:02:17 UTC (rev 976) @@ -277,9 +277,9 @@ setText(archetypeName); if (archetype.getFaceFlag()) { - setIcon(mainControl.getNofaceTileIcon()); + setIcon(CMainControl.getNofaceTileIcon()); } else if (archetype.getFaceNr() == -1) { - setIcon(mainControl.getUnknownTileIcon()); + setIcon(CMainControl.getUnknownTileIcon()); } else { setIcon(mainControl.getFace(archetype.getFaceNr())); } Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-09 16:33:59 UTC (rev 975) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-09 17:02:17 UTC (rev 976) @@ -1163,7 +1163,7 @@ if (inline != null) { final boolean isNone = inline.equals(CFTreasureListTree.NONE_SYM) || inline.length() == 0; - if (!isNone && !CFTreasureListTree.getInstance().containsTreasureList(inline) && !inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld()))) { + if (!isNone && !CFTreasureListTree.containsTreasureList(inline) && !inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld()))) { // The user has specified a WRONG treasurelist name, and it does not come // from the default gameObject. -> Error and out. JOptionPane.showMessageDialog(this, "In attribute '" + attr.ref.getNameNew() + "':\n" + "'" + inline + "' is not a known treasurelist name!", "Input Error", JOptionPane.ERROR_MESSAGE); Modified: trunk/crossfire/src/cfeditor/gui/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-12-09 16:33:59 UTC (rev 975) +++ trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-12-09 17:02:17 UTC (rev 976) @@ -263,9 +263,9 @@ icon.setIcon(null); icon.setText("No item selected"); } else if (arch.getFaceFlag()) { - icon.setIcon(mainControl.getEmptyTileIcon()); + icon.setIcon(CMainControl.getEmptyTileIcon()); } else if (arch.getFaceNr() == -1) { - icon.setIcon(mainControl.getUnknownTileIcon()); + icon.setIcon(CMainControl.getUnknownTileIcon()); } else { icon.setIcon(mainControl.getFace(arch.getFaceNr())); } @@ -425,9 +425,9 @@ setText(arch.getArchetypeName()); if (arch.getFaceFlag()) { - setIcon(mainControl.getEmptyTileIcon()); + setIcon(CMainControl.getEmptyTileIcon()); } else if (arch.getFaceNr() == -1) { - setIcon(mainControl.getUnknownTileIcon()); + setIcon(CMainControl.getUnknownTileIcon()); } else { setIcon(mainControl.getFace(arch.getFaceNr())); } Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-09 16:33:59 UTC (rev 975) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-09 17:02:17 UTC (rev 976) @@ -219,7 +219,7 @@ if (isPickmap) { grfx.fillRect(x * 32 + borderOffset, y * 32 + borderOffset, 32, 32); } else { - mainControl.getUnknownTileIcon().paintIcon(this, grfx, x * 32 + borderOffset, y * 32 + borderOffset); + CMainControl.getUnknownTileIcon().paintIcon(this, grfx, x * 32 + borderOffset, y * 32 + borderOffset); } } else { for (final GameObject node : mapControl.getMapModel().getMapSquare(new Point(x, y))) { @@ -229,12 +229,12 @@ } if (mainControl.isTileEdit(node.getEditType()) || mainControl.getTileEdit() == 0 || isPickmap) { if (node.getArchetypeName() == null) { - mainControl.getNoarchTileIcon().paintIcon(this, grfx, x * 32 + borderOffset, y * 32 + borderOffset); + CMainControl.getNoarchTileIcon().paintIcon(this, grfx, x * 32 + borderOffset, y * 32 + borderOffset); } else if (node.getFaceFlag()) { - mainControl.getNofaceTileIcon().paintIcon(this, grfx, x * 32 + borderOffset, y * 32 + borderOffset); + CMainControl.getNofaceTileIcon().paintIcon(this, grfx, x * 32 + borderOffset, y * 32 + borderOffset); } else { if (node.getFaceNr() == -1) { - mainControl.getUnknownTileIcon().paintIcon(this, grfx, x * 32 + borderOffset, y * 32 + borderOffset); + CMainControl.getUnknownTileIcon().paintIcon(this, grfx, x * 32 + borderOffset, y * 32 + borderOffset); } else { // draw object face final ImageIcon img = archlist.getFace(node.getFaceNr()); @@ -320,7 +320,7 @@ grfx.setColor(IGUIConstants.BG_COLOR); grfx.fillRect(point.x * 32 + borderOffset, point.y * 32 + borderOffset, 32, 32); } else { - mainControl.getUnknownTileIcon().paintIcon(this, grfx, point.x * 32, point.y * 32); + CMainControl.getUnknownTileIcon().paintIcon(this, grfx, point.x * 32, point.y * 32); } } else { tmpGrfx.fillRect(0, 0, 32, 32); @@ -332,12 +332,12 @@ } if (mainControl.isTileEdit(node.getEditType()) || mainControl.getTileEdit() == 0) { if (node.getArchetypeName() == null) { - mainControl.getNoarchTileIcon().paintIcon(this, tmpGrfx, 0, 0); + CMainControl.getNoarchTileIcon().paintIcon(this, tmpGrfx, 0, 0); } else if (node.getFaceFlag()) { - mainControl.getNofaceTileIcon().paintIcon(this, tmpGrfx, 0, 0); + CMainControl.getNofaceTileIcon().paintIcon(this, tmpGrfx, 0, 0); } else { if (node.getFaceNr() == -1) { - mainControl.getUnknownTileIcon().paintIcon(this, tmpGrfx, 0, 0); + CMainControl.getUnknownTileIcon().paintIcon(this, tmpGrfx, 0, 0); } else { final ImageIcon img = archlist.getFace(node.getFaceNr()); if (!node.isMulti() || (img.getIconWidth() == 32 && img.getIconHeight() == 32)) { @@ -408,7 +408,7 @@ // Highlight the selected square if (point.x >= topx && point.x <= botx && point.y >= topy && point.y <= boty) { - mainControl.getMapSelIcon().paintIcon(this, grfx, point.x * 32, point.y * 32); + CMainControl.getMapSelIcon().paintIcon(this, grfx, point.x * 32, point.y * 32); } } } @@ -445,7 +445,7 @@ // Draw the Icon: // Rectangular view - mainControl.getMapSelIcon().paintIcon(this, grfx, posx * 32 + borderOffset, posy * 32 + borderOffset); + CMainControl.getMapSelIcon().paintIcon(this, grfx, posx * 32 + borderOffset, posy * 32 + borderOffset); if (signY == 0) { break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 16:34:01
|
Revision: 975 http://svn.sourceforge.net/gridarta/?rev=975&view=rev Author: christianhujer Date: 2006-12-09 08:33:59 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Removed unneccessary boxing and unboxing. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CScriptModel.java trunk/crossfire/src/cfeditor/CScriptView.java trunk/crossfire/src/cfeditor/JarResources.java trunk/crossfire/src/cfeditor/io/CMapWriter.java trunk/crossfire/src/cfeditor/map/MapArchObject.java trunk/crossfire/src/cfeditor/parameter/DoubleParameter.java trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java trunk/crossfire/src/cfeditor/parameter/IntegerParameter.java trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-09 15:33:24 UTC (rev 974) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-09 16:33:59 UTC (rev 975) @@ -372,7 +372,7 @@ for (int i = 0; i < array.length; i++) { array[i] = (String) listData.get(i * 2 + 1); // put string to array - if (!hasSelection && ((Integer) listData.get(i * 2)).intValue() == active) { + if (!hasSelection && (Integer) listData.get(i * 2) == active) { hasSelection = true; // the selection is valid active = i; // set selection to this index in the array } Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-12-09 15:33:24 UTC (rev 974) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-12-09 16:33:59 UTC (rev 975) @@ -271,7 +271,7 @@ // every list entry adds value (Integer) and name (String) to the vector try { num = elem.getAttribute("value").getIntValue(); - list.add(new Integer(num)); + list.add(num); list.add(" " + elem.getAttribute("name").getValue().trim()); } catch (final DataConversionException e) { log.warn("In '" + IGUIConstants.TYPEDEF_FILE + "', list " + root.getAttribute("name").getValue() + ": value '" + elem.getAttribute("value").getValue() + "' is not an integer."); Modified: trunk/crossfire/src/cfeditor/CScriptModel.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptModel.java 2006-12-09 15:33:24 UTC (rev 974) +++ trunk/crossfire/src/cfeditor/CScriptModel.java 2006-12-09 16:33:59 UTC (rev 975) @@ -34,11 +34,11 @@ public static final int PLUGIN_SCRIPT = 4; - public static final Integer RUN_AUTOBOOT = new Integer(1); + public static final Integer RUN_AUTOBOOT = 1; - public static final Integer RUN_FILTER = new Integer(2); + public static final Integer RUN_FILTER = 2; - public static final Integer RUN_SCRIPT = new Integer(4); + public static final Integer RUN_SCRIPT = 4; private String code = ""; @@ -409,7 +409,7 @@ } else { final List<Element> modes = mode.getChildren(); for (final Element m : modes) { - final boolean b = Boolean.valueOf(m.getTextTrim()).booleanValue(); + final boolean b = Boolean.valueOf(m.getTextTrim()); final String name = m.getName(); if ("autoboot".equalsIgnoreCase(name) && b) { scriptType |= PLUGIN_AUTOBOOT; Modified: trunk/crossfire/src/cfeditor/CScriptView.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptView.java 2006-12-09 15:33:24 UTC (rev 974) +++ trunk/crossfire/src/cfeditor/CScriptView.java 2006-12-09 16:33:59 UTC (rev 975) @@ -268,7 +268,7 @@ dialog.setVisible(true); final Object result = p.getValue(); if (result instanceof Integer) { - if (((Integer) result).intValue() == JOptionPane.YES_OPTION) { + if ((Integer) result == JOptionPane.YES_OPTION) { return true; } } Modified: trunk/crossfire/src/cfeditor/JarResources.java =================================================================== --- trunk/crossfire/src/cfeditor/JarResources.java 2006-12-09 15:33:24 UTC (rev 974) +++ trunk/crossfire/src/cfeditor/JarResources.java 2006-12-09 16:33:59 UTC (rev 975) @@ -111,7 +111,7 @@ if (log.isDebugEnabled()) { log.debug(dumpZipEntry(ze)); } - htSizes.put(ze.getName(), new Integer((int) ze.getSize())); + htSizes.put(ze.getName(), (int) ze.getSize()); } zf.close(); @@ -131,7 +131,7 @@ int size = (int) ze.getSize(); // -1 means unknown size. if (size == -1) { - size = htSizes.get(ze.getName()).intValue(); + size = htSizes.get(ze.getName()); } final byte[] b = new byte[size]; int rb = 0; Modified: trunk/crossfire/src/cfeditor/io/CMapWriter.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapWriter.java 2006-12-09 15:33:24 UTC (rev 974) +++ trunk/crossfire/src/cfeditor/io/CMapWriter.java 2006-12-09 16:33:59 UTC (rev 975) @@ -206,8 +206,8 @@ public int compare(final String o1, final String o2) { final Integer i1 = keys.get(o1); final Integer i2 = keys.get(o2); - final int v1 = i1 == null ? Integer.MAX_VALUE : i1.intValue(); - final int v2 = i2 == null ? Integer.MAX_VALUE : i2.intValue(); + final int v1 = i1 == null ? Integer.MAX_VALUE : i1; + final int v2 = i2 == null ? Integer.MAX_VALUE : i2; if (v1 < v2) { return -1; } Modified: trunk/crossfire/src/cfeditor/map/MapArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-12-09 15:33:24 UTC (rev 974) +++ trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-12-09 16:33:59 UTC (rev 975) @@ -485,7 +485,7 @@ private double getLineValueAsDouble(final String s) { try { if (s.lastIndexOf(" ") > 0) { - return Double.valueOf(s.substring(s.lastIndexOf(" ") + 1)).doubleValue(); + return Double.valueOf(s.substring(s.lastIndexOf(" ") + 1)); } } catch (final NumberFormatException e) { } Modified: trunk/crossfire/src/cfeditor/parameter/DoubleParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/DoubleParameter.java 2006-12-09 15:33:24 UTC (rev 974) +++ trunk/crossfire/src/cfeditor/parameter/DoubleParameter.java 2006-12-09 16:33:59 UTC (rev 975) @@ -60,10 +60,10 @@ super.fromXML(e); final String val = e.getChildText("value"); try { - final Double iVal = new Double(Double.parseDouble(val)); + final Double iVal = Double.parseDouble(val); setValue(iVal); } catch (final Exception ex) { - setValue(new Double(0)); + setValue((double) 0); } ; final DoubleConfig o = new DoubleConfig(); @@ -106,8 +106,8 @@ public void setMax(final double max) { ((DoubleConfig) getConfig()).setMax(max); - if (((Double) getValue()).doubleValue() > ((DoubleConfig) getConfig()).getMax()) { - setValue(new Double(((DoubleConfig) getConfig()).getMax())); + if ((Double) getValue() > ((DoubleConfig) getConfig()).getMax()) { + setValue(((DoubleConfig) getConfig()).getMax()); } } @@ -117,8 +117,8 @@ public void setMin(final double min) { ((DoubleConfig) getConfig()).setMin(min); - if (((Double) getValue()).doubleValue() < ((DoubleConfig) getConfig()).getMin()) { - setValue(new Double(((DoubleConfig) getConfig()).getMin())); + if ((Double) getValue() < ((DoubleConfig) getConfig()).getMin()) { + setValue(((DoubleConfig) getConfig()).getMin()); } } } Modified: trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java 2006-12-09 15:33:24 UTC (rev 974) +++ trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java 2006-12-09 16:33:59 UTC (rev 975) @@ -128,8 +128,8 @@ } if (e.getActionCommand().equals("Config")) { - final String min = JOptionPane.showInputDialog("Minimum value:", new Double(parameter.getMin())); - final String max = JOptionPane.showInputDialog("Maximum value:", new Double(parameter.getMax())); + final String min = JOptionPane.showInputDialog("Minimum value:", parameter.getMin()); + final String max = JOptionPane.showInputDialog("Maximum value:", parameter.getMax()); try { final double iMin; final double iMax; @@ -137,8 +137,8 @@ iMax = Double.parseDouble(max); parameter.setMax(iMax); parameter.setMin(iMin); - ((SpinnerNumberModel) value.getModel()).setMinimum(new Double(parameter.getMin())); - ((SpinnerNumberModel) value.getModel()).setMaximum(new Double(parameter.getMax())); + ((SpinnerNumberModel) value.getModel()).setMinimum(parameter.getMin()); + ((SpinnerNumberModel) value.getModel()).setMaximum(parameter.getMax()); updateTooltip(); } catch (final Exception ex) { JOptionPane.showMessageDialog(null, "Could not change Double configuration"); Modified: trunk/crossfire/src/cfeditor/parameter/IntegerParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/IntegerParameter.java 2006-12-09 15:33:24 UTC (rev 974) +++ trunk/crossfire/src/cfeditor/parameter/IntegerParameter.java 2006-12-09 16:33:59 UTC (rev 975) @@ -58,10 +58,10 @@ super.fromXML(e); final String val = e.getChildText("value"); try { - final Integer iVal = new Integer(Integer.parseInt(val)); + final Integer iVal = Integer.parseInt(val); setValue(iVal); } catch (final Exception ex) { - setValue(new Integer(0)); + setValue(0); } final IntegerConfig o = new IntegerConfig(); try { @@ -103,8 +103,8 @@ public void setMax(final int max) { ((IntegerConfig) getConfig()).setMax(max); - if (((Integer) getValue()).intValue() > ((IntegerConfig) getConfig()).getMax()) { - setValue(new Integer(((IntegerConfig) getConfig()).getMax())); + if ((Integer) getValue() > ((IntegerConfig) getConfig()).getMax()) { + setValue(((IntegerConfig) getConfig()).getMax()); } } @@ -114,8 +114,8 @@ public void setMin(final int min) { ((IntegerConfig) getConfig()).setMin(min); - if (((Integer) getValue()).intValue() < ((IntegerConfig) getConfig()).getMin()) { - setValue(new Integer(((IntegerConfig) getConfig()).getMin())); + if ((Integer) getValue() < ((IntegerConfig) getConfig()).getMin()) { + setValue(((IntegerConfig) getConfig()).getMin()); } } } Modified: trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java 2006-12-09 15:33:24 UTC (rev 974) +++ trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java 2006-12-09 16:33:59 UTC (rev 975) @@ -124,8 +124,8 @@ log.debug("command: " + e.getActionCommand()); } if (e.getActionCommand().equals("Config")) { - final String min = JOptionPane.showInputDialog("Minimum value:", new Integer(parameter.getMin())); - final String max = JOptionPane.showInputDialog("Maximum value:", new Integer(parameter.getMax())); + final String min = JOptionPane.showInputDialog("Minimum value:", parameter.getMin()); + final String max = JOptionPane.showInputDialog("Maximum value:", parameter.getMax()); try { final int iMin; final int iMax; @@ -133,8 +133,8 @@ iMax = Integer.parseInt(max); parameter.setMax(iMax); parameter.setMin(iMin); - ((SpinnerNumberModel) value.getModel()).setMinimum(new Integer(parameter.getMin())); - ((SpinnerNumberModel) value.getModel()).setMaximum(new Integer(parameter.getMax())); + ((SpinnerNumberModel) value.getModel()).setMinimum(parameter.getMin()); + ((SpinnerNumberModel) value.getModel()).setMaximum(parameter.getMax()); updateTooltip(); } catch (final Exception ex) { JOptionPane.showMessageDialog(null, "Could not change integer configuration"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 15:33:24
|
Revision: 974 http://svn.sourceforge.net/gridarta/?rev=974&view=rev Author: christianhujer Date: 2006-12-09 07:33:24 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Simplified boolean returns. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFilterControl.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CFilterControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CFilterControl.java 2006-12-09 15:29:16 UTC (rev 973) +++ trunk/crossfire/src/cfeditor/CFilterControl.java 2006-12-09 15:33:24 UTC (rev 974) @@ -96,10 +96,7 @@ } public boolean highLightedSquare(final int path) { - if (highLightConfig[path].isEnabled()) { - return highLightResult[path]; - } - return false; + return highLightConfig[path].isEnabled() && highLightResult[path]; } public void objectInSquare(final GameObject o) { Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-09 15:29:16 UTC (rev 973) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-09 15:33:24 UTC (rev 974) @@ -561,11 +561,8 @@ // Set grid of level, if there is a level public boolean isGridVisible() { - if (currentMap == null) { - return false; - } + return currentMap != null && currentMap.getMapViewFrame().isGridVisible(); - return currentMap.getMapViewFrame().isGridVisible(); } /** Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-12-09 15:29:16 UTC (rev 973) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-12-09 15:33:24 UTC (rev 974) @@ -2191,10 +2191,7 @@ /** {@inheritDoc} */ @Override public boolean equals(final Object obj) { - if (obj == null || !(obj instanceof Recent)) { - return false; - } - return filename.equals(((Recent) obj).filename); + return !(obj == null || !(obj instanceof Recent)) && filename.equals(((Recent) obj).filename); } /** {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 15:29:15
|
Revision: 973 http://svn.sourceforge.net/gridarta/?rev=973&view=rev Author: christianhujer Date: 2006-12-09 07:29:16 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Removed pointless arithmetic expressions. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-09 15:28:21 UTC (rev 972) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-09 15:29:16 UTC (rev 973) @@ -271,13 +271,13 @@ for (int x = 0; x <= mapViewBasic.getMapSize().getWidth(); x++) { grfx.drawLine( x * 32 + borderOffset, - 0 + borderOffset, + borderOffset, x * 32 + borderOffset, mapViewBasic.getMapSize().getHeight() * 32 + borderOffset); } for (int y = 0; y <= mapViewBasic.getMapSize().getHeight(); y++) { grfx.drawLine( - 0 + borderOffset, + borderOffset, y * 32 + borderOffset, mapViewBasic.getMapSize().getWidth() * 32 + borderOffset, y * 32 + borderOffset); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 15:28:24
|
Revision: 972 http://svn.sourceforge.net/gridarta/?rev=972&view=rev Author: christianhujer Date: 2006-12-09 07:28:21 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Replaced string concatenations inside append with append. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CResourceLoader.java trunk/crossfire/src/cfeditor/JarResources.java Modified: trunk/crossfire/src/cfeditor/CResourceLoader.java =================================================================== --- trunk/crossfire/src/cfeditor/CResourceLoader.java 2006-12-09 15:27:44 UTC (rev 971) +++ trunk/crossfire/src/cfeditor/CResourceLoader.java 2006-12-09 15:28:21 UTC (rev 972) @@ -180,7 +180,7 @@ final StringBuffer buf = new StringBuffer(128); final String home = System.getProperty("user.home"); buf.append(home); - buf.append(File.separator + IGUIConstants.APP_SETTINGS_DIR); + buf.append(File.separator).append(IGUIConstants.APP_SETTINGS_DIR); final File rc = new File(buf.toString()); if (!rc.isDirectory()) { rc.mkdir(); Modified: trunk/crossfire/src/cfeditor/JarResources.java =================================================================== --- trunk/crossfire/src/cfeditor/JarResources.java 2006-12-09 15:27:44 UTC (rev 971) +++ trunk/crossfire/src/cfeditor/JarResources.java 2006-12-09 15:28:21 UTC (rev 972) @@ -180,9 +180,9 @@ } sb.append(ze.getName()); sb.append("\t"); - sb.append("" + ze.getSize()); + sb.append("").append(ze.getSize()); if (ze.getMethod() == ZipEntry.DEFLATED) { - sb.append("/" + ze.getCompressedSize()); + sb.append("/").append(ze.getCompressedSize()); } return sb.toString(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 15:27:44
|
Revision: 971 http://svn.sourceforge.net/gridarta/?rev=971&view=rev Author: christianhujer Date: 2006-12-09 07:27:44 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Removed unneccessary unboxing. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainMenu.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-09 15:24:26 UTC (rev 970) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-09 15:27:44 UTC (rev 971) @@ -29,9 +29,9 @@ import cfeditor.gameobject.GameObject; import cfeditor.gameobject.anim.AnimationObjects; import cfeditor.gameobject.face.FaceObjects; +import cfeditor.gui.map.MapPropertiesDialog; import cfeditor.io.CMapReader; import cfeditor.io.CMapWriter; -import cfeditor.gui.map.MapPropertiesDialog; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; import cfeditor.map.MapModel; @@ -41,7 +41,6 @@ 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; @@ -52,7 +51,6 @@ 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; @@ -381,14 +379,14 @@ imageSet = null; } - loadFromArchive = Boolean.valueOf(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(LOAD_ARCH_COLL, "true")).booleanValue(); + 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")).booleanValue()); + 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")).booleanValue()); + 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"))).intValue()) { + 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 Modified: trunk/crossfire/src/cfeditor/CMainMenu.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainMenu.java 2006-12-09 15:24:26 UTC (rev 970) +++ trunk/crossfire/src/cfeditor/CMainMenu.java 2006-12-09 15:27:44 UTC (rev 971) @@ -761,7 +761,7 @@ m_lockPickmaps = new CheckBoxMenuEntry("Lock All Pickmaps"); m_lockPickmaps.setMnemonic('L'); m_lockPickmaps.setChecked(Boolean.valueOf(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty( - CMainControl.PICKMAPS_LOCKED, "false")).booleanValue()); + CMainControl.PICKMAPS_LOCKED, "false"))); m_lockPickmaps.addActionListener( new ActionListener() { public void actionPerformed(final ActionEvent event) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 15:24:25
|
Revision: 970 http://svn.sourceforge.net/gridarta/?rev=970&view=rev Author: christianhujer Date: 2006-12-09 07:24:26 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Removed redundant String constructor invocations. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-09 15:23:32 UTC (rev 969) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-09 15:24:26 UTC (rev 970) @@ -376,7 +376,7 @@ mapDir = new File(currentDir.getAbsolutePath(), mapDir.getPath()); } - imageSet = new String(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(USE_IMAGESET, "base")); + imageSet = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(USE_IMAGESET, "base"); if (imageSet.equalsIgnoreCase("none")) { imageSet = null; } Modified: trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java 2006-12-09 15:23:32 UTC (rev 969) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java 2006-12-09 15:24:26 UTC (rev 970) @@ -46,7 +46,7 @@ //private ImageIcon face; private Object face; - private String name = new String(""); // name of face + private String name = ""; // name of face private String path; Modified: trunk/crossfire/src/cfeditor/gui/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-12-09 15:23:32 UTC (rev 969) +++ trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-12-09 15:24:26 UTC (rev 970) @@ -392,7 +392,7 @@ class MyCellRenderer extends DefaultListCellRenderer { - public final String sizeTester = new String("**Sizetester**"); + public final String sizeTester = "**Sizetester**"; private static final long serialVersionUID = 1L; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 15:23:33
|
Revision: 969 http://svn.sourceforge.net/gridarta/?rev=969&view=rev Author: christianhujer Date: 2006-12-09 07:23:32 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Removed redundant Boolean constructor calls. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainMenu.java trunk/crossfire/src/cfeditor/parameter/BooleanParameter.java trunk/crossfire/src/cfeditor/parameter/BooleanParameterView.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-09 15:21:56 UTC (rev 968) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-09 15:23:32 UTC (rev 969) @@ -381,11 +381,11 @@ imageSet = null; } - loadFromArchive = new Boolean(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(LOAD_ARCH_COLL, "true")).booleanValue(); + loadFromArchive = Boolean.valueOf(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(LOAD_ARCH_COLL, "true")).booleanValue(); - getMainView().setMapTileListBottom(new Boolean(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(CMainView.MAPTILE_BOTTOM_KEY, "false")).booleanValue()); + getMainView().setMapTileListBottom(Boolean.valueOf(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(CMainView.MAPTILE_BOTTOM_KEY, "false")).booleanValue()); - setLockAllPickmaps(new Boolean(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(PICKMAPS_LOCKED, "false")).booleanValue()); + setLockAllPickmaps(Boolean.valueOf(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()) { Modified: trunk/crossfire/src/cfeditor/CMainMenu.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainMenu.java 2006-12-09 15:21:56 UTC (rev 968) +++ trunk/crossfire/src/cfeditor/CMainMenu.java 2006-12-09 15:23:32 UTC (rev 969) @@ -760,7 +760,7 @@ m_lockPickmaps = new CheckBoxMenuEntry("Lock All Pickmaps"); m_lockPickmaps.setMnemonic('L'); - m_lockPickmaps.setChecked(new Boolean(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty( + m_lockPickmaps.setChecked(Boolean.valueOf(CSettings.getInstance(IGUIConstants.APP_NAME).getProperty( CMainControl.PICKMAPS_LOCKED, "false")).booleanValue()); m_lockPickmaps.addActionListener( new ActionListener() { Modified: trunk/crossfire/src/cfeditor/parameter/BooleanParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/BooleanParameter.java 2006-12-09 15:21:56 UTC (rev 968) +++ trunk/crossfire/src/cfeditor/parameter/BooleanParameter.java 2006-12-09 15:23:32 UTC (rev 969) @@ -63,7 +63,7 @@ final Boolean iVal = Boolean.valueOf(val); setValue(iVal); } catch (final Exception ex) { - setValue(new Boolean(false)); + setValue(Boolean.FALSE); } ; final BooleanConfig cfg = new BooleanConfig(); Modified: trunk/crossfire/src/cfeditor/parameter/BooleanParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/BooleanParameterView.java 2006-12-09 15:21:56 UTC (rev 968) +++ trunk/crossfire/src/cfeditor/parameter/BooleanParameterView.java 2006-12-09 15:23:32 UTC (rev 969) @@ -59,10 +59,10 @@ public void actionPerformed(final ActionEvent e) { if (e.getActionCommand().equals("toggle")) { if (value.isSelected()) { - parameter.setValue(new Boolean(true)); + parameter.setValue(Boolean.TRUE); value.setText(parameter.getTrueText()); } else { - parameter.setValue(new Boolean(false)); + parameter.setValue(Boolean.FALSE); value.setText(parameter.getFalseText()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 15:21:56
|
Revision: 968 http://svn.sourceforge.net/gridarta/?rev=968&view=rev Author: christianhujer Date: 2006-12-09 07:21:56 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Removed redundant casts. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/JarResources.java trunk/crossfire/src/cfeditor/filter/NamedFilterList.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/io/CMapWriter.java trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java trunk/daimonin/src/daieditor/gui/map/MapTilePane.java trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-09 15:12:43 UTC (rev 967) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-09 15:21:56 UTC (rev 968) @@ -711,9 +711,9 @@ input = buildSpellBox(type.getAttr()[i]); break; case LIST: - if (type.getAttr()[i].getMisc() != null && typelist.getListTable().containsKey((String) (type.getAttr()[i].getMisc()[0]))) { + if (type.getAttr()[i].getMisc() != null && typelist.getListTable().containsKey(type.getAttr()[i].getMisc()[0])) { // build the list from vector data - input = buildArrayBox(type.getAttr()[i], typelist.getListTable().get((String) (type.getAttr()[i].getMisc()[0]))); + input = buildArrayBox(type.getAttr()[i], typelist.getListTable().get(type.getAttr()[i].getMisc()[0])); } else { // error: list data is missing or corrupt cComp = new JLabel("Error: Undefined List"); @@ -733,9 +733,9 @@ break; case BITMASK: { newAttr = new BitmaskAttrib(type.getAttr()[i]); - if (type.getAttr()[i].getMisc() != null && typelist.getBitmaskTable().containsKey((String) (type.getAttr()[i].getMisc()[0]))) { + if (type.getAttr()[i].getMisc() != null && typelist.getBitmaskTable().containsKey(type.getAttr()[i].getMisc()[0])) { // fetch the bitmask data, then build the attribute panel - final CAttribBitmask bitmask = (CAttribBitmask) (typelist.getBitmaskTable().get((String) (type.getAttr()[i].getMisc()[0]))); + final CAttribBitmask bitmask = typelist.getBitmaskTable().get((String) (type.getAttr()[i].getMisc()[0])); ((BitmaskAttrib) (DialogAttrib<JTextComponent>) newAttr).bitmask = bitmask; cLabel = new JButton(new MaskChangeAL(type.getAttr()[i].getNameNew() + ':', (BitmaskAttrib) (DialogAttrib<JTextComponent>) newAttr)); final JTextArea input = new JTextArea(); Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-12-09 15:12:43 UTC (rev 967) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-12-09 15:21:56 UTC (rev 968) @@ -314,7 +314,7 @@ // now try to get the topmost object GameObject arch = null; if (pmap.isPointValid(pmap.getMapViewFrame().getHighlightStart())) { - arch = (GameObject) pmap.getMapModel().getMapSquare(pmap.getMapViewFrame().getHighlightStart()).getFirst(); + arch = pmap.getMapModel().getMapSquare(pmap.getMapViewFrame().getHighlightStart()).getFirst(); } if (arch != null) { // so here we return the arch from the pickmap Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-09 15:12:43 UTC (rev 967) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-09 15:21:56 UTC (rev 968) @@ -136,7 +136,7 @@ setBackground(IGUIConstants.BG_COLOR); } renderer = new DefaultLevelRenderer(this, mainControl, mapControl, isPickmap()); - setViewportView((JComponent) renderer); + setViewportView(renderer); getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); refreshDataFromModel(); @@ -150,7 +150,7 @@ } final CListener listener = new CListener(); - ((JComponent) renderer).addMouseListener(listener); + renderer.addMouseListener(listener); if (!isPickmap()) { renderer.addMouseMotionListener(listener); renderer.addMouseMotionListener(mainControl.getMainView().getStatusBar()); @@ -313,12 +313,12 @@ log.debug("refreshDataFromModel"); // define how much drawing space we need for the map forcedSize = new Dimension(mapSize.getWidth() * 32 + (isPickmap() ? 0 : 64), mapSize.getHeight() * 32 + (isPickmap() ? 0 : 64)); - ((JComponent) renderer).setPreferredSize(forcedSize); - ((JComponent) renderer).setMinimumSize(forcedSize); + renderer.setPreferredSize(forcedSize); + renderer.setMinimumSize(forcedSize); changedFlagNotify(); if (renderer.resizeBackBuffer()) { - ((JComponent) renderer).setSize(forcedSize); - ((JComponent) renderer).revalidate(); + renderer.setSize(forcedSize); + renderer.revalidate(); } renderer.modelChanged(); } Modified: trunk/crossfire/src/cfeditor/JarResources.java =================================================================== --- trunk/crossfire/src/cfeditor/JarResources.java 2006-12-09 15:12:43 UTC (rev 967) +++ trunk/crossfire/src/cfeditor/JarResources.java 2006-12-09 15:21:56 UTC (rev 968) @@ -133,11 +133,11 @@ if (size == -1) { size = htSizes.get(ze.getName()).intValue(); } - final byte[] b = new byte[(int) size]; + final byte[] b = new byte[size]; int rb = 0; int chunk; while (size - rb > 0) { - chunk = zis.read(b, rb, (int) size - rb); + chunk = zis.read(b, rb, size - rb); if (chunk == -1) { break; } Modified: trunk/crossfire/src/cfeditor/filter/NamedFilterList.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/NamedFilterList.java 2006-12-09 15:12:43 UTC (rev 967) +++ trunk/crossfire/src/cfeditor/filter/NamedFilterList.java 2006-12-09 15:21:56 UTC (rev 968) @@ -111,7 +111,7 @@ } if (nfc.isSubFilterEnabled(name)) { log.debug("enabled!"); - final Filter f = (Filter) subFilters.get(name); + final Filter f = subFilters.get(name); if (f.match(nfc.getConfig(name), object)) { log.debug("and matched!"); return !nfc.isInverted(); @@ -263,10 +263,10 @@ inverted.addContent(Boolean.toString(fConfig.isInverted())); result.addContent(inverted); for (final Map.Entry<String, Filter> entry : subFilters.entrySet()) { - final Element filterValue = ((Filter) entry.getValue()).toXML(fConfig.getConfig((String) entry.getKey())); + final Element filterValue = entry.getValue().toXML(fConfig.getConfig(entry.getKey())); final Element subfilter = new Element("subfilter"); final Element fName = new Element("name"); - fName.addContent((String) entry.getKey()); + fName.addContent(entry.getKey()); subfilter.addContent(fName); subfilter.addContent(filterValue); result.addContent(subfilter); @@ -326,7 +326,7 @@ return; } - final JComponent c = (JComponent) content.get(name); + final JComponent c = content.get(name); content.remove(name); component.remove(c); } Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-12-09 15:12:43 UTC (rev 967) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-12-09 15:21:56 UTC (rev 968) @@ -501,7 +501,7 @@ for (final GameObject arch : getArchetypes()) { final String faceName = arch.getFaceName(); if (faceName != null) { - final Integer num = (Integer) faceMap.get(faceName); + final Integer num = faceMap.get(faceName); if (num != null) { arch.setFaceNr(num); } Modified: trunk/crossfire/src/cfeditor/io/CMapWriter.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapWriter.java 2006-12-09 15:12:43 UTC (rev 967) +++ trunk/crossfire/src/cfeditor/io/CMapWriter.java 2006-12-09 15:21:56 UTC (rev 968) @@ -173,13 +173,13 @@ } // Sort fields to match server/crossedit order. - final String[] keys = (String[]) fields.keySet().toArray(new String[0]); + final String[] keys = fields.keySet().toArray(new String[0]); Arrays.sort(keys, keyOrderComparator); // Actually write the fields. append("arch " + gameObject.getArchetypeName() + "\n"); for (final String key : keys) { - final String value = (String) fields.get(key); + final String value = fields.get(key); if (value != null) { if (key.equals("msg") || key.equals("lore")) { append(key + "\n" + value + "\n"); Modified: trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java 2006-12-09 15:12:43 UTC (rev 967) +++ trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java 2006-12-09 15:21:56 UTC (rev 968) @@ -105,8 +105,8 @@ } if (item instanceof AbstractButton) { //((AbstractButton)item).setText(getName()); - ((AbstractButton) item).setVisible(isVisible()); - ((AbstractButton) item).setEnabled(isEnabled()); + item.setVisible(isVisible()); + item.setEnabled(isEnabled()); //((AbstractButton)item).setMnemonic(mnemonic); //((AbstractButton)item).setActionCommand(getName()); } Modified: trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java 2006-12-09 15:12:43 UTC (rev 967) +++ trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java 2006-12-09 15:21:56 UTC (rev 968) @@ -103,7 +103,7 @@ value.addChangeListener(new ChangeListener() { public void stateChanged(final ChangeEvent e) { try { - parameter.setValue((Double) ((SpinnerNumberModel) value.getModel()).getNumber()); + parameter.setValue(((SpinnerNumberModel) value.getModel()).getNumber()); } catch (final Exception ex) { ex.printStackTrace(); } Modified: trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java 2006-12-09 15:12:43 UTC (rev 967) +++ trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java 2006-12-09 15:21:56 UTC (rev 968) @@ -100,7 +100,7 @@ value.addChangeListener(new ChangeListener() { public void stateChanged(final ChangeEvent e) { try { - parameter.setValue((Integer) ((SpinnerNumberModel) value.getModel()).getNumber()); + parameter.setValue(((SpinnerNumberModel) value.getModel()).getNumber()); } catch (final Exception ex) { ex.printStackTrace(); } Modified: trunk/daimonin/src/daieditor/gui/map/MapTilePane.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2006-12-09 15:12:43 UTC (rev 967) +++ trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2006-12-09 15:21:56 UTC (rev 968) @@ -224,6 +224,7 @@ for (int index = 0; index <= 7; index++) { final JPanel tilePanel = tilePaths[index] = new TilePanel(index); // DO NOT REMOVE THE CAST. it's required to call add(Component, Object), NOT add(Component, int) + //noinspection RedundantCast tilePanels.add(tilePanel, (Object) (Integer) index); } return tilePanels; Modified: trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java 2006-12-09 15:12:43 UTC (rev 967) +++ trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java 2006-12-09 15:21:56 UTC (rev 968) @@ -99,7 +99,7 @@ /** {@inheritDoc} */ public boolean isChanged() { return !( - (Proxy.Type) proxyType.getSelectedItem() == Proxy.Type.valueOf(PREFS.get(NET_PREFS_KEY_TYPE, "DIRECT")) + proxyType.getSelectedItem() == Proxy.Type.valueOf(PREFS.get(NET_PREFS_KEY_TYPE, "DIRECT")) && PREFS.get(NET_PREFS_KEY_HOST, "").equals(proxyHost.getText()) && PREFS.getInt(NET_PREFS_KEY_PORT, 3128) == (Integer) proxyPort.getValue() ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 15:12:46
|
Revision: 967 http://svn.sourceforge.net/gridarta/?rev=967&view=rev Author: christianhujer Date: 2006-12-09 07:12:43 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Removed redundant array creation. Modified Paths: -------------- trunk/daimonin/src/daieditor/Spells.java trunk/daimonin/src/daieditor/gui/MapFileFilter.java Modified: trunk/daimonin/src/daieditor/Spells.java =================================================================== --- trunk/daimonin/src/daieditor/Spells.java 2006-12-09 15:11:02 UTC (rev 966) +++ trunk/daimonin/src/daieditor/Spells.java 2006-12-09 15:12:43 UTC (rev 967) @@ -62,7 +62,7 @@ private int[] spellNumbers; // array of spell numbers /** File filter for filtering spellist.h files. */ - private static final FileFilter SPELLIST_H_FILE_FILTER = new FilenameFileFilter(true, "spellist.h", new String[]{"spellist.h"}); + private static final FileFilter SPELLIST_H_FILE_FILTER = new FilenameFileFilter(true, "spellist.h", "spellist.h"); /** * Opens a file chooser to select the spellist file, Modified: trunk/daimonin/src/daieditor/gui/MapFileFilter.java =================================================================== --- trunk/daimonin/src/daieditor/gui/MapFileFilter.java 2006-12-09 15:11:02 UTC (rev 966) +++ trunk/daimonin/src/daieditor/gui/MapFileFilter.java 2006-12-09 15:12:43 UTC (rev 967) @@ -59,7 +59,7 @@ /** Create a MapFileFilter. */ private MapFileFilter() { - super(true, true, ACTION_FACTORY.getString("fileDialog.filter.maps"), new String[]{".lua", ".py", ".txt", ".text"}); + super(true, true, ACTION_FACTORY.getString("fileDialog.filter.maps"), ".lua", ".py", ".txt", ".text"); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 15:11:04
|
Revision: 966 http://svn.sourceforge.net/gridarta/?rev=966&view=rev Author: christianhujer Date: 2006-12-09 07:11:02 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Improved cloning. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CScriptModel.java Modified: trunk/crossfire/src/cfeditor/CScriptModel.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptModel.java 2006-12-09 14:54:02 UTC (rev 965) +++ trunk/crossfire/src/cfeditor/CScriptModel.java 2006-12-09 15:11:02 UTC (rev 966) @@ -90,11 +90,7 @@ } @Override public Object clone() throws CloneNotSupportedException { - final Parameter p = new Parameter(); - p.name = new String(name); - p.description = new String(description); - p.value = new String(value); - return p; + return super.clone(); } } @@ -316,8 +312,8 @@ */ @Override public Object clone() throws CloneNotSupportedException { final CScriptModel mdl = new CScriptModel(ctrl); - mdl.code = new String(code); - mdl.name = new String(name); + mdl.code = code; + mdl.name = name; mdl.scriptType = scriptType; for (Object param : params) { final PluginParameter original = (PluginParameter) param; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 14:54:07
|
Revision: 965 http://svn.sourceforge.net/gridarta/?rev=965&view=rev Author: christianhujer Date: 2006-12-09 06:54:02 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Replaced for- and while-loops with foreach-loops. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFArchType.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFilterControl.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainMenu.java trunk/crossfire/src/cfeditor/CMapTileList.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CResourceLoader.java trunk/crossfire/src/cfeditor/CScriptController.java trunk/crossfire/src/cfeditor/CScriptModel.java trunk/crossfire/src/cfeditor/CScriptView.java trunk/crossfire/src/cfeditor/ScriptArchData.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/io/CMapWriter.java trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java trunk/crossfire/src/cfeditor/menu/LocationMenuEntry.java trunk/crossfire/src/cfeditor/menu/MenuHelper.java trunk/crossfire/src/cfeditor/menu/MenuManager.java trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java trunk/crossfire/src/cfeditor/parameter/MapParameter.java trunk/daimonin/src/daieditor/CFArchType.java Modified: trunk/crossfire/src/cfeditor/CFArchType.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchType.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/CFArchType.java 2006-12-09 14:54:02 UTC (rev 965) @@ -196,8 +196,8 @@ } else if (tlist.getIgnoreListTable().containsKey(a1.getValue().trim())) { // just copy everything from ignorelist to this ignore section final List<String> ignlist = tlist.getIgnoreListTable().get(a1.getValue().trim()); - for (int k = 0; k < ignlist.size(); k++) { - ignoreTable.put(ignlist.get(k), ""); + for (final String ignItem : ignlist) { + ignoreTable.put(ignItem, ""); } } else { log.error("In '" + XML_IGNORE + "' section of type " + typeName + ": ignore_list with name \"" + a1.getValue() + "\" is undefined."); @@ -275,10 +275,10 @@ // create an array to store the references to the default atrribs: final CFArchAttrib[] defList = new CFArchAttrib[defaultArchType.attr.length]; - for (int t = 0; t < defaultArchType.attr.length; t++) { + for (final CFArchAttrib attrib : defaultArchType.attr) { // add all attributes from the default_type which are not in the ignoreTable - if (!ignoreTable.containsKey(defaultArchType.attr[t].getNameOld())) { - defList[numDef] = defaultArchType.attr[t]; + if (!ignoreTable.containsKey(attrib.getNameOld())) { + defList[numDef] = attrib; j++; numDef++; } @@ -303,20 +303,20 @@ // initialize array to store imported attribs importList = new CFArchAttrib[impType.attr.length]; - for (int z = 0; z < impType.attr.length; z++) { - if (!impType.attr[z].getSecName().equalsIgnoreCase("general")) { + for (final CFArchAttrib attrib : impType.attr) { + if (!attrib.getSecName().equalsIgnoreCase("general")) { // import this attrib: - if (!impType.attr[z].getSecName().equalsIgnoreCase("general") && - !impType.attr[z].getSecName().equalsIgnoreCase("special") && - !secNames.contains(impType.attr[z].getSecName())) { + if (!attrib.getSecName().equalsIgnoreCase("general") && + !attrib.getSecName().equalsIgnoreCase("special") && + !secNames.contains(attrib.getSecName())) { sectionNum++; // increment number of valid sections - secNames.add(impType.attr[z].getSecName()); + secNames.add(attrib.getSecName()); } - importList[importNum] = impType.attr[z].getClone(); + importList[importNum] = attrib.getClone(); // get section id - final int newId = secNames.indexOf(impType.attr[z].getSecName()); + final int newId = secNames.indexOf(attrib.getSecName()); if (newId >= 0) { importList[importNum].setSecId(newId + 2); } Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-12-09 14:54:02 UTC (rev 965) @@ -41,7 +41,6 @@ import javax.swing.JFileChooser; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.io.IOUtils; -import net.sf.japi.xml.NodeListIterator; import org.apache.log4j.Logger; import org.jdom.Attribute; import org.jdom.DataConversionException; @@ -203,8 +202,8 @@ if (children2 != null && children2.size() > 0) { // load all attribute entries final List<String> content = new ArrayList<String>(); - for (int k = 0; k < children2.size(); k++) { - elem = children2.get(k); + for (Element aChildren2 : children2) { + elem = aChildren2; if ((a = elem.getAttribute(CFArchAttrib.XML_KEY_ARCH)) != null) { content.add(a.getValue().trim()); } else { @@ -572,8 +571,8 @@ bufferedWriter.write(" ##########################################################\n-->\n"); // write spell-entries: - for (int i = 0; i < list.size(); i++) { - tmp = String.valueOf(list.get(i)); + for (final String entry : list) { + tmp = String.valueOf(entry); final String id = tmp.substring(0, tmp.indexOf(" ")).trim(); final String name = tmp.substring(tmp.indexOf(" ") + 1).trim(); String space = ""; Modified: trunk/crossfire/src/cfeditor/CFilterControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CFilterControl.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/CFilterControl.java 2006-12-09 14:54:02 UTC (rev 965) @@ -136,9 +136,9 @@ if (mapControl != null) { mapControl.repaint(); } else { - final MapControl[] maps = CMainControl.getInstance().getOpenedMaps(); - for (int i = 0; i < maps.length; i++) { - maps[i].repaint(); + final MapControl[] mapControls = CMainControl.getInstance().getOpenedMaps(); + for (final MapControl mapControl : mapControls) { + mapControl.repaint(); } } } Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-09 14:54:02 UTC (rev 965) @@ -905,8 +905,7 @@ final List<GameObject> tailList = new ArrayList<GameObject>(); // first: attach our map sucker to a default arch we have loaded - for (final Iterator<GameObject> it = objects.iterator(); it.hasNext();) { - final GameObject gameObject = it.next(); + for (final GameObject gameObject : objects) { final GameObject archetype = archetypeSet.getArchetype(gameObject.getArchetypeName()); if (archetype == null) { // we had an unknown arch here!! Modified: trunk/crossfire/src/cfeditor/CMainMenu.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainMenu.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/CMainMenu.java 2006-12-09 14:54:02 UTC (rev 965) @@ -458,18 +458,18 @@ entry.setMnemonic('V'); final CSettings settings = CSettings.getInstance(IGUIConstants.APP_NAME); - final UIManager.LookAndFeelInfo[] aInfos = UIManager.getInstalledLookAndFeels(); + final UIManager.LookAndFeelInfo[] lafInfos = UIManager.getInstalledLookAndFeels(); final MenuGroup group = new MenuGroup(); //JCheckBoxMenuItem selectedMenuItem = null; final String strSelectedLNFName = settings.getProperty(CMainView.SELECTED_LNF_KEY, UIManager.getCrossPlatformLookAndFeelClassName()); - for (int i = 0; i < aInfos.length; i++) { - final CheckBoxMenuEntry menuItem = new CheckBoxMenuEntry(aInfos[i].getName()); - if (strSelectedLNFName.compareTo(aInfos[i].getClassName()) == 0) { + for (final UIManager.LookAndFeelInfo lafInfo : lafInfos) { + final CheckBoxMenuEntry menuItem = new CheckBoxMenuEntry(lafInfo.getName()); + if (strSelectedLNFName.compareTo(lafInfo.getClassName()) == 0) { menuItem.setChecked(true); } - menuItem.addActionListener(new CLNFActionListener(aInfos[i].getClassName())); + menuItem.addActionListener(new CLNFActionListener(lafInfo.getClassName())); menuManager.addMenuEntry("main.view", menuItem); group.add(menuItem); } Modified: trunk/crossfire/src/cfeditor/CMapTileList.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapTileList.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/CMapTileList.java 2006-12-09 14:54:02 UTC (rev 965) @@ -354,17 +354,14 @@ */ private int addInvObjects(final GameObject node, final GameObject gameObject) { int selListCounter = -1; - final Iterator it = node.getHead().iterator(); - while (it.hasNext()) { - final GameObject arch = (GameObject) it.next(); - - if (arch == gameObject) { + for (final GameObject invItem : node.getHead()) { + if (invItem == gameObject) { selListCounter = listCounter; } listCounter++; - model.addElement(arch); + model.addElement(invItem); - final int tmpListCounter = addInvObjects(arch, gameObject); + final int tmpListCounter = addInvObjects(invItem, gameObject); if (tmpListCounter != -1) { selListCounter = tmpListCounter; } Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-09 14:54:02 UTC (rev 965) @@ -659,8 +659,8 @@ // on that square and redraw the map GameObject tmpArch = null; final Iterator<GameObject> it = mapControl.getMapModel().getMapSquare(temp).reverse().iterator(); - while (it.hasNext()) { - tmpArch = it.next(); + for (final GameObject gameObject : mapControl.getMapModel().getMapSquare(temp).reverse()) { + tmpArch = gameObject; // now search backwards for matching view settings if (mainControl.getTileEdit() == 0 || mainControl.isTileEdit(tmpArch.getEditType())) { @@ -707,7 +707,8 @@ // get name of inserted arch (this is display in status bar while dragging) @Nullable final GameObject insArch = mainControl.getArchPanelHighlight(); - final String insertArchName;if (insArch != null) { + final String insertArchName; + if (insArch != null) { if (insArch.getObjName() != null && insArch.getObjName().length() > 0) { insertArchName = insArch.getObjName(); } else if (insArch.getArchetypeName() != null && insArch.getArchetypeName().length() > 0) { @@ -781,8 +782,8 @@ // and redraw the map GameObject tmpArch = null; final Iterator<GameObject> it = mapControl.getMapModel().getMapSquare(mapLoc).reverse().iterator(); - while (it.hasNext()) { - tmpArch = it.next(); + for (final GameObject gameObject : mapControl.getMapModel().getMapSquare(mapLoc).reverse()) { + tmpArch = gameObject; if (mainControl.getTileEdit() == 0 || mainControl.isTileEdit(tmpArch.getEditType())) { break; } Modified: trunk/crossfire/src/cfeditor/CResourceLoader.java =================================================================== --- trunk/crossfire/src/cfeditor/CResourceLoader.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/CResourceLoader.java 2006-12-09 14:54:02 UTC (rev 965) @@ -260,12 +260,12 @@ final Document[] docList = new Document[]{jarDoc, homeDoc, currentDoc,}; Document mainDoc = null; - for (int i = 0; i < docList.length; i++) { - if (docList[i] != null && docList[i].hasRootElement()) { + for (final Document document : docList) { + if (document != null && document.hasRootElement()) { if (mainDoc == null) { - mainDoc = docList[i]; + mainDoc = document; } else { - mainDoc.getRootElement().addContent(docList[i].getRootElement().removeContent()); + mainDoc.getRootElement().addContent(document.getRootElement().removeContent()); } } } Modified: trunk/crossfire/src/cfeditor/CScriptController.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptController.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/CScriptController.java 2006-12-09 14:54:02 UTC (rev 965) @@ -110,10 +110,10 @@ log.info("no script found"); return; } - for (int i = 0; i < scriptList.size(); i++) { + for (final Object o : scriptList) { log.debug("Reading one script"); final CScriptModel cScript = new CScriptModel(this); - cScript.fromXML((Element) scriptList.get(i)); + cScript.fromXML((Element) o); log.debug("script: " + cScript.getName()); if (override || !scripts.containsKey(cScript.getName())) { if (log.isDebugEnabled()) { @@ -174,8 +174,7 @@ public void exportXML(final OutputStream destination) { final Element root = new Element("scripts"); final Document d = new Document(root); - for (Iterator<CScriptModel> i = scripts.values().iterator(); i.hasNext();) { - final CScriptModel sm = i.next(); + for (final CScriptModel sm : scripts.values()) { root.addContent(sm.toXML()); } final XMLOutputter out = new XMLOutputter(); Modified: trunk/crossfire/src/cfeditor/CScriptModel.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptModel.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/CScriptModel.java 2006-12-09 14:54:02 UTC (rev 965) @@ -255,8 +255,7 @@ public String[] getParameters() { final ArrayList<String> l = new ArrayList<String>(); - for (Iterator<PluginParameter> it = params.iterator(); it.hasNext();) { - final PluginParameter p = it.next(); + for (final PluginParameter p : (Iterable<PluginParameter>) params) { if (!l.contains(p.getName())) { l.add(p.getName()); } @@ -320,8 +319,8 @@ mdl.code = new String(code); mdl.name = new String(name); mdl.scriptType = scriptType; - for (int i = 0; i < params.size(); i++) { - final PluginParameter original = (PluginParameter) params.get(i); + for (Object param : params) { + final PluginParameter original = (PluginParameter) param; mdl.addParameter((PluginParameter) original.clone()); } return mdl; @@ -413,8 +412,7 @@ scriptType = PLUGIN_SCRIPT; } else { final List<Element> modes = mode.getChildren(); - for (Iterator<Element> i = modes.iterator(); i.hasNext();) { - final Element m = i.next(); + for (final Element m : modes) { final boolean b = Boolean.valueOf(m.getTextTrim()).booleanValue(); final String name = m.getName(); if ("autoboot".equalsIgnoreCase(name) && b) { @@ -428,8 +426,7 @@ } final List<Element> params = node.getChildren("parameter"); if (params != null && !params.isEmpty()) { - for (int j = 0; j < params.size(); j++) { - final Element parameter = params.get(j); + for (final Element parameter : params) { final PluginParameter p = PluginParameterFactory.createParameter(parameter); addParameter(p); } Modified: trunk/crossfire/src/cfeditor/CScriptView.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptView.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/CScriptView.java 2006-12-09 14:54:02 UTC (rev 965) @@ -95,8 +95,8 @@ private synchronized void updateMenu() { JMenu menu = menuScripts; if (entryScript != null && entryScript.length > 0) { - for (int i = 0; i < entryScript.length; i++) { - entryScript[i].removeActionListener(this); + for (final JMenuItem item : entryScript) { + item.removeActionListener(this); } } if (menu != null) { @@ -108,14 +108,14 @@ } final String[] scripts = ctrl.listScript(); final ArrayList<JMenuItem> visibleScripts = new ArrayList<JMenuItem>(); - for (int i = 0; i < scripts.length; i++) { - if (!ctrl.getScript(scripts[i]).isBash()) { + for (final String script : scripts) { + if (!ctrl.getScript(script).isBash()) { continue; } - final JMenuItem item = new JMenuItem("Run " + scripts[i]); + final JMenuItem item = new JMenuItem("Run " + script); item.addActionListener(this); - item.setActionCommand(scripts[i]); + item.setActionCommand(script); item.setIcon(CGUIUtils.getIcon(IGUIConstants.RUN_PLUGIN_SMALLICON)); menu.add(item); visibleScripts.add(item); Modified: trunk/crossfire/src/cfeditor/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-12-09 14:54:02 UTC (rev 965) @@ -219,8 +219,7 @@ final StringBuilder buff = new StringBuilder(); if (eventList != null && eventList.size() > 0) { - for (int i = 0; i < eventList.size(); i++) { - final ScriptedEvent se = eventList.get(i); + for (final ScriptedEvent se : eventList) { buff.append(se.getMapArchText()); } } Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-12-09 14:54:02 UTC (rev 965) @@ -25,7 +25,6 @@ package cfeditor.gameobject; -import cfeditor.CArchPanel; import cfeditor.CFTreasureListTree; import cfeditor.CMainControl; import cfeditor.CPickmapPanel; @@ -225,8 +224,8 @@ final String[] children = f.list(); if (children != null) { Arrays.sort(children); - for (int i = 0; i < children.length; i++) { - loadArchetypesFromFiles(new File(f, children[i]), index); + for (final String child : children) { + loadArchetypesFromFiles(new File(f, child), index); } } folderLevel--; Modified: trunk/crossfire/src/cfeditor/io/CMapWriter.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapWriter.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/io/CMapWriter.java 2006-12-09 14:54:02 UTC (rev 965) @@ -178,10 +178,9 @@ // Actually write the fields. append("arch " + gameObject.getArchetypeName() + "\n"); - for (int i = 0; i < keys.length; i++) { - final String value = (String) fields.get(keys[i]); + for (final String key : keys) { + final String value = (String) fields.get(key); if (value != null) { - final String key = keys[i]; if (key.equals("msg") || key.equals("lore")) { append(key + "\n" + value + "\n"); } else { Modified: trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java 2006-12-09 14:54:02 UTC (rev 965) @@ -6,7 +6,6 @@ package cfeditor.menu; -import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Set; import org.apache.log4j.Logger; @@ -119,8 +118,8 @@ return true; } - for (Iterator<WrappedMenuLocation> i = subMenus.values().iterator(); i.hasNext();) { - if (i.next().contains(entry)) { + for (final WrappedMenuLocation wrappedMenuLocation : subMenus.values()) { + if (wrappedMenuLocation.contains(entry)) { return true; } } @@ -138,8 +137,8 @@ } this.menuManager = menuManager; if (!subMenus.isEmpty()) { - for (Iterator<WrappedMenuLocation> i = subMenus.values().iterator(); i.hasNext();) { - menuManager.addMenuLocation(i.next()); + for (final WrappedMenuLocation wrappedMenuLocation : subMenus.values()) { + menuManager.addMenuLocation(wrappedMenuLocation); } } } Modified: trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java 2006-12-09 14:54:02 UTC (rev 965) @@ -117,9 +117,9 @@ public void actionPerformed(final ActionEvent e) { synchronized (listeners) { - for (Iterator<ActionListener> i = listeners.iterator(); i.hasNext();) { + for (final ActionListener listener : listeners) { log.debug("One more actionPerformed Listerner"); - i.next().actionPerformed(e); + listener.actionPerformed(e); } } log.debug("Acton performed done"); @@ -135,8 +135,7 @@ update(); cleanUpQueue(componentQueue); synchronized (refs) { - for (Iterator<WeakReference<JComponent>> i = refs.iterator(); i.hasNext();) { - final WeakReference<JComponent> wf = i.next(); + for (final WeakReference<JComponent> wf : refs) { final JComponent item = wf.get(); if (log.isDebugEnabled()) { log.debug("Updating item: " + item); Modified: trunk/crossfire/src/cfeditor/menu/LocationMenuEntry.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/LocationMenuEntry.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/menu/LocationMenuEntry.java 2006-12-09 14:54:02 UTC (rev 965) @@ -6,7 +6,6 @@ package cfeditor.menu; -import java.util.Iterator; import java.util.Set; import javax.swing.JComponent; import javax.swing.JMenu; @@ -46,9 +45,9 @@ } final Set entries = loc.getMenuEntries(); - for (Iterator i = entries.iterator(); i.hasNext();) { + for (final Object entry : entries) { log.debug("One more item added"); - menu.add(((MenuEntry) i.next()).getMenuItemComponent()); + menu.add(((MenuEntry) entry).getMenuItemComponent()); } log.debug("returning..."); } Modified: trunk/crossfire/src/cfeditor/menu/MenuHelper.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/MenuHelper.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/menu/MenuHelper.java 2006-12-09 14:54:02 UTC (rev 965) @@ -7,7 +7,6 @@ package cfeditor.menu; -import java.util.Iterator; import java.util.Set; import javax.swing.JMenuBar; @@ -30,8 +29,8 @@ public static JMenuBar getLocationBar(final MenuLocation location) { final JMenuBar bar = new JMenuBar(); final Set s = location.getMenuEntries(); - for (Iterator i = s.iterator(); i.hasNext();) { - bar.add(((MenuEntry) i.next()).getMenuBarComponent()); + for (final Object value : s) { + bar.add(((MenuEntry) value).getMenuBarComponent()); } return bar; } Modified: trunk/crossfire/src/cfeditor/menu/MenuManager.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/MenuManager.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/menu/MenuManager.java 2006-12-09 14:54:02 UTC (rev 965) @@ -164,8 +164,7 @@ log.debug("Removing listener " + listener + " from all locations"); } - for (Iterator<Set<MenuListener>> i = listeners.values().iterator(); i.hasNext();) { - final Set<MenuListener> s = i.next(); + for (final Set<MenuListener> s : listeners.values()) { s.remove(listener); } } @@ -187,8 +186,8 @@ if (loc != null) { final Set<MenuListener> s = getListeners(location); final MenuChangeEvent e = new MenuChangeEvent(loc, entry, type); - for (Iterator<MenuListener> i = s.iterator(); i.hasNext();) { - i.next().menuChanged(e); + for (final MenuListener value : s) { + value.menuChanged(e); } } else { log.warn("Tried to notify a change to unknown location " + location); @@ -208,8 +207,7 @@ } final HashSet<MenuListener> l = new HashSet<MenuListener>(); - for (Iterator<MenuLocation> i = locations.values().iterator(); i.hasNext();) { - final MenuLocation ml = i.next(); + for (final MenuLocation ml : locations.values()) { if (!ml.contains(entry)) { continue; } @@ -221,8 +219,8 @@ * ensure each listener is notified only once. */ final MenuChangeEvent e = new MenuChangeEvent(null, entry, type); - for (Iterator<MenuListener> i = l.iterator(); i.hasNext();) { - i.next().menuChanged(e); + for (final MenuListener aL : l) { + aL.menuChanged(e); } } Modified: trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java 2006-12-09 14:54:02 UTC (rev 965) @@ -66,10 +66,10 @@ } else { c.setToolTipText(tip); } - final Component[] cs = c.getComponents(); - for (int i = 0; i < cs.length; i++) { - if (cs[i] instanceof JComponent) { - forceTooltip((JComponent) cs[i], tip); + final Component[] components = c.getComponents(); + for (final Component component : components) { + if (component instanceof JComponent) { + forceTooltip((JComponent) component, tip); } } } Modified: trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java 2006-12-09 14:54:02 UTC (rev 965) @@ -66,10 +66,10 @@ } else { c.setToolTipText(tip); } - final Component[] cs = c.getComponents(); - for (int i = 0; i < cs.length; i++) { - if (cs[i] instanceof JComponent) { - forceTooltip((JComponent) cs[i], tip); + final Component[] components = c.getComponents(); + for (final Component component : components) { + if (component instanceof JComponent) { + forceTooltip((JComponent) component, tip); } } } Modified: trunk/crossfire/src/cfeditor/parameter/MapParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/MapParameter.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/crossfire/src/cfeditor/parameter/MapParameter.java 2006-12-09 14:54:02 UTC (rev 965) @@ -59,10 +59,10 @@ return CMainControl.getInstance().getCurrentMap(); } - final MapControl[] maps = CMainControl.getInstance().getOpenedMaps(); - for (int i = 0; i < maps.length; i++) { - if (maps[i].getMapFileName().equalsIgnoreCase(s)) { - return maps[i]; + final MapControl[] mapControls = CMainControl.getInstance().getOpenedMaps(); + for (final MapControl mapControl : mapControls) { + if (mapControl.getMapFileName().equalsIgnoreCase(s)) { + return mapControl; } } Modified: trunk/daimonin/src/daieditor/CFArchType.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchType.java 2006-12-09 14:25:07 UTC (rev 964) +++ trunk/daimonin/src/daieditor/CFArchType.java 2006-12-09 14:54:02 UTC (rev 965) @@ -260,10 +260,10 @@ // create an array to store the references to the default atrribs: final CFArchAttrib[] defList = new CFArchAttrib[defaultArchType.attr.length]; - for (int t = 0; t < defaultArchType.attr.length; t++) { + for (final CFArchAttrib attrib : defaultArchType.attr) { // add all attributes from the default_type which are not in the ignoreTable - if (!ignoreTable.containsKey(defaultArchType.attr[t].getNameOld())) { - defList[numDef] = defaultArchType.attr[t]; + if (!ignoreTable.containsKey(attrib.getNameOld())) { + defList[numDef] = attrib; j++; numDef++; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 14:25:07
|
Revision: 964 http://svn.sourceforge.net/gridarta/?rev=964&view=rev Author: christianhujer Date: 2006-12-09 06:25:07 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Simplified some expressions. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CScriptController.java trunk/crossfire/src/cfeditor/CScriptModel.java trunk/crossfire/src/cfeditor/PluginParameterFactory.java trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java trunk/crossfire/src/cfeditor/gui/ScriptEditor.java trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java Modified: trunk/crossfire/src/cfeditor/CScriptController.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptController.java 2006-12-09 14:14:29 UTC (rev 963) +++ trunk/crossfire/src/cfeditor/CScriptController.java 2006-12-09 14:25:07 UTC (rev 964) @@ -218,8 +218,7 @@ final Interpreter runner = new Interpreter(); try { setInterpreterValues(runner, "filter"); - final Filter cfc = (Filter) runner.eval(script.getCode()); - return cfc; + return (Filter) runner.eval(script.getCode()); } catch (final EvalError e) { log.warn("Evaluation error on (filter)" + script.getName(), e); } catch (final ClassCastException e) { Modified: trunk/crossfire/src/cfeditor/CScriptModel.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptModel.java 2006-12-09 14:14:29 UTC (rev 963) +++ trunk/crossfire/src/cfeditor/CScriptModel.java 2006-12-09 14:25:07 UTC (rev 964) @@ -211,8 +211,7 @@ */ @Nullable public Object getParamValue(final int index) { try { - final Object o = ((PluginParameter) params.get(index)).getValue(); - return o; + return ((PluginParameter) params.get(index)).getValue(); } catch (final Exception e) { e.printStackTrace(); return null; Modified: trunk/crossfire/src/cfeditor/PluginParameterFactory.java =================================================================== --- trunk/crossfire/src/cfeditor/PluginParameterFactory.java 2006-12-09 14:14:29 UTC (rev 963) +++ trunk/crossfire/src/cfeditor/PluginParameterFactory.java 2006-12-09 14:25:07 UTC (rev 964) @@ -63,8 +63,7 @@ log.debug("trying to instance a class of type " + c.getName()); } - final PluginParameter p = c.newInstance(); - return p; + return c.newInstance(); } catch (final Exception e) { e.printStackTrace(); return null; Modified: trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java 2006-12-09 14:14:29 UTC (rev 963) +++ trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java 2006-12-09 14:25:07 UTC (rev 964) @@ -183,14 +183,8 @@ /** Verifies if x and y are within the icon's borders. */ public boolean contains(final int xEvent, final int yEvent) { - if (!(xEvent >= x) || !(xEvent <= x + width)) { - return false; - } - if (!(yEvent >= y) || !(yEvent <= y + height)) { - return false; - } - - return true; + return !(!(xEvent >= x) || !(xEvent <= x + width)) && !(!(yEvent >= y) || !(yEvent <= y + height)); } + } } Modified: trunk/crossfire/src/cfeditor/gui/ScriptEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2006-12-09 14:14:29 UTC (rev 963) +++ trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2006-12-09 14:25:07 UTC (rev 964) @@ -228,8 +228,6 @@ "Delete?", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { getScript().removeParameter(selectedRow); } - - return; } }); paramButtons.add(addParameter); Modified: trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java 2006-12-09 14:14:29 UTC (rev 963) +++ trunk/crossfire/src/cfeditor/menu/BasicMenuEntry.java 2006-12-09 14:25:07 UTC (rev 964) @@ -80,8 +80,7 @@ if (action == null) { synchronized (this) { if (action == null) { - final BasicAction bas = new BasicAction(this, getName()); - action = bas; + action = new BasicAction(this, getName()); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-09 14:14:31
|
Revision: 963 http://svn.sourceforge.net/gridarta/?rev=963&view=rev Author: christianhujer Date: 2006-12-09 06:14:29 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Converted variables that could be local variables into local variables. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CFilterControl.java trunk/crossfire/src/cfeditor/CGUIUtils.java trunk/crossfire/src/cfeditor/CMainMenu.java trunk/crossfire/src/cfeditor/CMainToolbar.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/COptionDialog.java trunk/crossfire/src/cfeditor/filter/NamedFilterList.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/crossfire/src/cfeditor/gui/ScriptEditor.java trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java trunk/crossfire/src/cfeditor/parameter/MapParameterView.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CFTreasureListTree.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/MapViewIFrame.java trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-09 14:14:29 UTC (rev 963) @@ -115,12 +115,6 @@ private JComboBox typesel; // selection box for type - private JTextField nameTF; // textfield for gameObject name - - private JTextField archetypeTF; // textfield for name of the Archetype - - private JLabel imagePanel; // panel for object's face (png) - private final GameObject gameObject; private final Archetype<GameObject> archetype; @@ -413,7 +407,7 @@ gbc.weightx = 0.0; gbc.weighty = 3.0; gbc.gridheight = 3; - imagePanel = new JLabel(mainControl.getArchetypeSet().getFace(gameObject.getFaceNr())); + final JLabel imagePanel=new JLabel(mainControl.getArchetypeSet().getFace(gameObject.getFaceNr())); imagePanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); header.add(imagePanel, gbc); gbc.gridheight = 1; @@ -433,7 +427,7 @@ gbc.gridx = 3; gbc.gridy = 1; gbc.weightx = 1.0; - if (gameObject.getObjName() != null && gameObject.getObjName().length() > 0) { + final JTextField nameTF;if (gameObject.getObjName() != null && gameObject.getObjName().length() > 0) { nameTF = new JTextField(gameObject.getObjName(), 16); } else if (archetype.getObjName() != null && archetype.getObjName().length() > 0) { nameTF = new JTextField(archetype.getObjName(), 16); @@ -445,7 +439,7 @@ gbc.gridy++; header.add(buildTypesBox(), gbc); // build type-selection box gbc.gridy++; - archetypeTF = new JTextField(archetype.getArchetypeName(), 16); + final JTextField archetypeTF=new JTextField(archetype.getArchetypeName(), 16); archetypeTF.setEditable(false); header.add(archetypeTF, gbc); Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-12-09 14:14:29 UTC (rev 963) @@ -103,8 +103,6 @@ private JButton noneButton; - private JButton cancelButton; - // the textfield in the attribute dialog where the result gets written to private JTextField input; // input textfield @@ -586,7 +584,7 @@ }); rightSide.add(noneButton); - cancelButton = new JButton("Cancel"); + final JButton cancelButton = new JButton("Cancel"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { frame.setVisible(false); Modified: trunk/crossfire/src/cfeditor/CFilterControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CFilterControl.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/crossfire/src/cfeditor/CFilterControl.java 2006-12-09 14:14:29 UTC (rev 963) @@ -46,8 +46,6 @@ private final boolean filterOut = false; - private final boolean highLight[]; - private static final NamedFilterList filterList = NamedFilterList.getDefaultList(); private final NamedFilterConfig filterOutConfig; @@ -66,7 +64,7 @@ * @param mapControl MapControl to create FilterControl for. */ public CFilterControl(final MapControl mapControl) { - highLight = new boolean[]{false, false, false,}; + final boolean[] highLight = new boolean[]{false, false, false,}; filterOutConfig = (NamedFilterConfig) filterList.createConfig(); highLightConfig = new NamedFilterConfig[]{ (NamedFilterConfig) filterList.createConfig(), Modified: trunk/crossfire/src/cfeditor/CGUIUtils.java =================================================================== --- trunk/crossfire/src/cfeditor/CGUIUtils.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/crossfire/src/cfeditor/CGUIUtils.java 2006-12-09 14:14:29 UTC (rev 963) @@ -183,6 +183,7 @@ } else if (gray > 255) { gray = 255; } + //noinspection PointlessBitwiseExpression return (rgb & 0xff000000) | (gray << 16) | (gray << 8) | (gray << 0); } } Modified: trunk/crossfire/src/cfeditor/CMainMenu.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainMenu.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/crossfire/src/cfeditor/CMainMenu.java 2006-12-09 14:14:29 UTC (rev 963) @@ -56,33 +56,12 @@ private AggregateMenuLocation mainLocation; - private AggregateMenuLocation toolbarLocation; - private AggregateMenuLocation currentmapLocation; - private SimpleMenuLocation menu_file; - - private SimpleMenuLocation menu_edit; - - private SimpleMenuLocation menu_map; - - private SimpleMenuLocation menu_pickmaps; - - private SimpleMenuLocation menu_collect; - private SimpleMenuLocation menu_analyze; - //private JMenu menu_script; - private SimpleMenuLocation menu_view; - - private JMenu menu_help; - private JMenu menu_window; - private SimpleMenuEntry m_new; - - private SimpleMenuEntry m_open; - private SimpleMenuEntry m_close; private SimpleMenuEntry m_revert; @@ -93,10 +72,6 @@ private SimpleMenuEntry m_createImg; - private SimpleMenuEntry m_options; - - private SimpleMenuEntry m_exit; - private SimpleMenuEntry m_collectArch; private SimpleMenuEntry m_spellC; @@ -105,11 +80,6 @@ private JMenuItem m_scriptMenu; - //private JMenuItem m_analyzeMenu; - private JMenuItem m_helpMenu; - - private JMenuItem m_aboutMenu; - private CheckBoxMenuEntry m_autojoin; private CheckBoxMenuEntry m_gridToggle; @@ -158,10 +128,6 @@ private SimpleMenuEntry m_fill_below; - private SimpleMenuEntry m_rand_fill_above; - - private SimpleMenuEntry m_rand_fill_below; - private CheckBoxMenuEntry se_monster; private CheckBoxMenuEntry se_exit; @@ -178,8 +144,6 @@ private CheckBoxMenuEntry se_connected; - private SimpleMenuEntry m_show_all; - private JMenuItem m_newWindow; private JMenuItem m_closeAll; @@ -218,7 +182,7 @@ private void buildAggregates() { mainLocation = new AggregateMenuLocation("main"); - toolbarLocation = new AggregateMenuLocation("toolbar"); + final AggregateMenuLocation toolbarLocation = new AggregateMenuLocation("toolbar"); currentmapLocation = new AggregateMenuLocation("currentmap"); MenuManager.getMenuManager().addMenuLocation(mainLocation); MenuManager.getMenuManager().addMenuLocation(toolbarLocation); @@ -241,14 +205,14 @@ */ private void buildFileMenu() { final MenuManager menuManager = MenuManager.getMenuManager(); - menu_file = new SimpleMenuLocation("main.file"); + final SimpleMenuLocation menu_file = new SimpleMenuLocation("main.file"); menuManager.addMenuLocation(menu_file); mainLocation.addMenuLocation(menu_file); final LocationMenuEntry entry = new LocationMenuEntry("main.file", "File"); menuManager.addMenuEntry("main", entry); entry.setMnemonic('F'); - m_new = new SimpleMenuEntry("New..."); + final SimpleMenuEntry m_new = new SimpleMenuEntry("New..."); m_new.setIcon(CGUIUtils.getIcon(IGUIConstants.NEW_LEVEL_SMALLICON)); m_new.setMnemonic('N'); m_new.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, Event.CTRL_MASK)); @@ -260,7 +224,7 @@ }); menuManager.addMenuEntry("main.file", m_new); - m_open = new SimpleMenuEntry("Open..."); + final SimpleMenuEntry m_open = new SimpleMenuEntry("Open..."); m_open.setIcon(CGUIUtils.getIcon(IGUIConstants.OPEN_LEVEL_SMALLICON)); m_open.setMnemonic('O'); m_open.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, Event.CTRL_MASK)); @@ -334,7 +298,7 @@ menuManager.addMenuEntry("main.file", SimpleMenuEntry.getSeparator()); - m_options = new SimpleMenuEntry("Options..."); + final SimpleMenuEntry m_options = new SimpleMenuEntry("Options..."); m_options.setIcon(CGUIUtils.getIcon(IGUIConstants.EMPTY_SMALLICON)); m_options.setMnemonic('P'); m_options.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, Event.ALT_MASK)); @@ -348,7 +312,7 @@ menuManager.addMenuEntry("main.file", SimpleMenuEntry.getSeparator()); - m_exit = new SimpleMenuEntry("Exit"); + final SimpleMenuEntry m_exit = new SimpleMenuEntry("Exit"); m_exit.setIcon(CGUIUtils.getIcon(IGUIConstants.EMPTY_SMALLICON)); m_exit.setMnemonic('X'); m_exit.addActionListener( @@ -366,7 +330,7 @@ */ private void buildEditMenu() { final MenuManager menuManager = MenuManager.getMenuManager(); - menu_edit = new SimpleMenuLocation("main.edit"); + final SimpleMenuLocation menu_edit = new SimpleMenuLocation("main.edit"); mainLocation.addMenuLocation(menu_edit); menuManager.addMenuLocation(menu_edit); final LocationMenuEntry entry = new LocationMenuEntry("main.edit", "Edit"); @@ -458,7 +422,7 @@ menuManager.addMenuEntry("main.edit", m_fill_below); // Random Fill: - m_rand_fill_above = new SimpleMenuEntry("Random Fill Above"); + final SimpleMenuEntry m_rand_fill_above = new SimpleMenuEntry("Random Fill Above"); m_rand_fill_above.setIcon(CGUIUtils.getIcon(IGUIConstants.EMPTY_SMALLICON)); m_rand_fill_above.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, Event.CTRL_MASK)); m_rand_fill_above.addActionListener( @@ -470,7 +434,7 @@ menuManager.addMenuEntry("main.edit", m_rand_fill_above); // Random Fill: - m_rand_fill_below = new SimpleMenuEntry("Random Fill Below"); + final SimpleMenuEntry m_rand_fill_below = new SimpleMenuEntry("Random Fill Below"); m_rand_fill_below.setIcon(CGUIUtils.getIcon(IGUIConstants.EMPTY_SMALLICON)); m_rand_fill_below.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, Event.CTRL_MASK | Event.SHIFT_MASK)); m_rand_fill_below.addActionListener( @@ -486,7 +450,7 @@ private void buildViewMenu() { final MenuManager menuManager = MenuManager.getMenuManager(); - menu_view = new SimpleMenuLocation("main.view"); + final SimpleMenuLocation menu_view = new SimpleMenuLocation("main.view"); mainLocation.addMenuLocation(menu_view); menuManager.addMenuLocation(menu_view); final LocationMenuEntry entry = new LocationMenuEntry("main.view", "View"); @@ -630,7 +594,7 @@ }); menuManager.addMenuEntry("main.view", se_connected); menuManager.addMenuEntry("main.view", SimpleMenuEntry.getSeparator()); - m_show_all = new SimpleMenuEntry("Reset View"); + final SimpleMenuEntry m_show_all = new SimpleMenuEntry("Reset View"); m_show_all.addActionListener( new ActionListener() { public void actionPerformed(final ActionEvent event) { @@ -653,7 +617,7 @@ } private void buildMapMenu() { - menu_map = new SimpleMenuLocation("main.map"); + final SimpleMenuLocation menu_map = new SimpleMenuLocation("main.map"); final LocationMenuEntry entry = new LocationMenuEntry("main.map", "Map"); final MenuManager menuManager = MenuManager.getMenuManager(); menuManager.addMenuLocation(menu_map); @@ -786,7 +750,7 @@ } private void buildPickmapsMenu() { - menu_pickmaps = new SimpleMenuLocation("main.pickmaps"); + final SimpleMenuLocation menu_pickmaps = new SimpleMenuLocation("main.pickmaps"); final LocationMenuEntry entry = new LocationMenuEntry("main.pickmaps", "Pickmaps"); final MenuManager menuManager = MenuManager.getMenuManager(); mainLocation.addMenuLocation(menu_pickmaps); @@ -891,7 +855,7 @@ } private void buildResourceMenu() { - menu_collect = new SimpleMenuLocation("main.resources"); + final SimpleMenuLocation menu_collect = new SimpleMenuLocation("main.resources"); final LocationMenuEntry entry = new LocationMenuEntry("main.resources", "Resources"); final MenuManager menuManager = MenuManager.getMenuManager(); mainLocation.addMenuLocation(menu_collect); @@ -1083,10 +1047,10 @@ /** Create the help-about window with the credits. */ private void buildHelpMenu() { - menu_help = new JMenu("Help"); + final JMenu menu_help = new JMenu("Help"); menu_help.setMnemonic('H'); - m_helpMenu = new JMenuItem("Online Help"); + final JMenuItem m_helpMenu = new JMenuItem("Online Help"); m_helpMenu.setMnemonic('H'); m_helpMenu.addActionListener( new ActionListener() { @@ -1096,7 +1060,7 @@ }); menu_help.add(m_helpMenu); menu_help.addSeparator(); - m_aboutMenu = new JMenuItem("About..."); + final JMenuItem m_aboutMenu = new JMenuItem("About..."); m_aboutMenu.setMnemonic('A'); m_aboutMenu.addActionListener( new ActionListener() { Modified: trunk/crossfire/src/cfeditor/CMainToolbar.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainToolbar.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/crossfire/src/cfeditor/CMainToolbar.java 2006-12-09 14:14:29 UTC (rev 963) @@ -67,19 +67,10 @@ /** The popup menu. */ private final CPopupMenu m_popupMenu; - // UI elements - private JButton m_new; - - private JButton m_open; - private JButton m_save; private JButton m_saveAs; - private JButton m_nextWindow; - - private JButton m_prevWindow; - private static final long serialVersionUID = 1L; /** @@ -140,7 +131,7 @@ setMargin(new Insets(IGUIConstants.DIALOG_INSETS, 0, IGUIConstants.DIALOG_INSETS, IGUIConstants.DIALOG_INSETS)); final Vector<JButton> buttons = new Vector<JButton>(10, 2); - m_new = new CFancyButton( + final JButton m_new = new CFancyButton( checkLabel("New"), "New Map", checkIcon(IGUIConstants.NEW_LEVEL_ICON), @@ -154,7 +145,7 @@ buttons.addElement(m_new); add(m_new); - m_open = new CFancyButton( + final JButton m_open = new CFancyButton( checkLabel("Open"), "Open Map File", checkIcon(IGUIConstants.OPEN_LEVEL_ICON), @@ -199,7 +190,7 @@ addSeparator(); - m_prevWindow = new CFancyButton( + final JButton m_prevWindow = new CFancyButton( checkLabel("Prev"), "Show Previous Window", checkIcon(IGUIConstants.PREVIOUS_WINDOW_ICON), @@ -213,7 +204,7 @@ buttons.addElement(m_prevWindow); add(m_prevWindow); - m_nextWindow = new CFancyButton( + final JButton m_nextWindow = new CFancyButton( checkLabel("Next"), "Show Next Window", checkIcon(IGUIConstants.NEXT_WINDOW_ICON), Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-09 14:14:29 UTC (rev 963) @@ -505,8 +505,6 @@ private Point startMapLoc = null; - private String insertArchName = ""; // name of arch being inserted - private Rectangle previewRect = null; private Point[] needRedraw = null; // array of tile coords which need to be redrawn @@ -709,7 +707,7 @@ // get name of inserted arch (this is display in status bar while dragging) @Nullable final GameObject insArch = mainControl.getArchPanelHighlight(); - if (insArch != null) { + final String insertArchName;if (insArch != null) { if (insArch.getObjName() != null && insArch.getObjName().length() > 0) { insertArchName = insArch.getObjName(); } else if (insArch.getArchetypeName() != null && insArch.getArchetypeName().length() > 0) { Modified: trunk/crossfire/src/cfeditor/COptionDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/COptionDialog.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/crossfire/src/cfeditor/COptionDialog.java 2006-12-09 14:14:29 UTC (rev 963) @@ -52,8 +52,6 @@ */ public final class COptionDialog extends CDialogBase { - private final CMainControl mainControl; - private final JTextField m_archField; private final JTextField m_mapField; @@ -75,7 +73,7 @@ */ COptionDialog(final CMainControl mainControl, final Frame parentFrame) { super(parentFrame, "Options"); - this.mainControl = mainControl; + final CMainControl mainControl1=mainControl; getContentPane().setLayout(new BorderLayout()); final JPanel mainPanel = new JPanel(); @@ -100,21 +98,21 @@ final JPanel archPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); archPanel.add(new JLabel("Archfiles: ")); m_archField = new JTextField(16); - m_archField.setText(this.mainControl.getArchDefaultFolder()); + m_archField.setText(mainControl1.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(this.mainControl.getMapDefaultFolder()); + m_mapField.setText(mainControl1.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(this.mainControl.getScriptDefaultFolder()); + m_scriptField.setText(mainControl1.getScriptDefaultFolder()); scriptPanel.add(m_scriptField); mainPanel.add(optionPathPanel); @@ -130,18 +128,18 @@ IGUIConstants.DIALOG_INSETS))); final JPanel cbox; - if (this.mainControl.getImageSet() != null) { - cbox = buildImageSetBox(this.mainControl.getImageSet().equalsIgnoreCase("base")); + if (mainControl1.getImageSet() != null) { + cbox = buildImageSetBox(mainControl1.getImageSet().equalsIgnoreCase("base")); } else { cbox = buildImageSetBox(false); } optionPartPanel.add(cbox); m_loadArches = new JCheckBox(" Load Arches from Collection"); - m_loadArches.setSelected(this.mainControl.isArchLoadedFromCollection()); + m_loadArches.setSelected(mainControl1.isArchLoadedFromCollection()); m_loadArches.addActionListener(new SelectArchLoadAL(m_loadArches, this)); optionPartPanel.add(m_loadArches); - if (this.mainControl.isArchLoadedFromCollection()) { + if (mainControl1.isArchLoadedFromCollection()) { m_archField.setEnabled(false); } @@ -158,7 +156,7 @@ IGUIConstants.DIALOG_INSETS))); m_mapPanelBottom = new JCheckBox(" Separate Map-Tile Panel"); - m_mapPanelBottom.setSelected(!this.mainControl.getMainView().isMapTileListBottom()); + m_mapPanelBottom.setSelected(!mainControl1.getMainView().isMapTileListBottom()); optionLayoutPanel.add(m_mapPanelBottom); optionLayoutPanel.add(new JLabel("(Takes effect on next application start)")); mainPanel.add(optionLayoutPanel); Modified: trunk/crossfire/src/cfeditor/filter/NamedFilterList.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/NamedFilterList.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/crossfire/src/cfeditor/filter/NamedFilterList.java 2006-12-09 14:14:29 UTC (rev 963) @@ -45,8 +45,6 @@ private final EventListenerList listenerList = new EventListenerList(); - private final boolean inverted; - private static final NamedFilterList DEFAULT_LIST = new NamedFilterList(); public static NamedFilterList getDefaultList() { @@ -55,7 +53,7 @@ /** Create a new NameFilterList. */ public NamedFilterList() { - inverted = false; + final boolean inverted = false; subFilters = new LinkedHashMap<String, Filter>(); AttributeFilter f; f = new AttributeFilter(); Modified: trunk/crossfire/src/cfeditor/gui/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-12-09 14:14:29 UTC (rev 963) @@ -54,8 +54,6 @@ private final ArchComboBoxEditor editor; - private final MyCellRenderer renderer; - private final ArchComboBoxModel archComboBoxModel; private static final long serialVersionUID = 1L; @@ -63,7 +61,7 @@ public ArchComboBox() { setMaximumRowCount(4); mainControl = CMainControl.getInstance(); - renderer = new MyCellRenderer(); + final MyCellRenderer renderer = new MyCellRenderer(); editor = new ArchComboBoxEditor(); //setPrototypeDisplayValue(renderer.sizeTester); setRenderer(renderer); @@ -108,10 +106,8 @@ boolean locked = false; - private final ArchComboBoxModel archModel; - public ArchComboBoxEditor() { - archModel = new ArchComboBoxModel(); + final ArchComboBoxModel archModel = new ArchComboBoxModel(); } public synchronized void lockEditor() { Modified: trunk/crossfire/src/cfeditor/gui/ScriptEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2006-12-09 14:14:29 UTC (rev 963) @@ -55,16 +55,10 @@ private static final Logger log = Logger.getLogger(ScriptEditor.class); - private final JTabbedPane tabs; - - private final JPanel parameterTab; - private final JPanel paramTable; - private final JPanel optionsTab; + private final JButton removeParameter; - private final JButton addParameter, removeParameter; - private final JTextArea code; private TableModel paramsModel; @@ -83,8 +77,6 @@ private int selectedRow = -1; - private int selectedCol = -1; - private final MouseListener cellMouseListener = new MouseListener() { public void mouseClicked(final MouseEvent e) { selectTableComponent((Component) e.getSource()); @@ -129,10 +121,10 @@ public ScriptEditor(final CScriptModel script) { super(); this.script = script; - tabs = new JTabbedPane(); + final JTabbedPane tabs = new JTabbedPane(); this.setLayout(new BorderLayout()); this.add(tabs); - optionsTab = new JPanel(new GridBagLayout()); + final JPanel optionsTab = new JPanel(new GridBagLayout()); final GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 1.0; @@ -205,7 +197,7 @@ }); optionsTab.add(btn, gbc); tabs.add("Options", optionsTab); - parameterTab = new JPanel(new BorderLayout()); + final JPanel parameterTab = new JPanel(new BorderLayout()); paramTable = new JPanel(new GridBagLayout()); redrawTable(); script.addChangeListener(new ChangeListener() { @@ -218,7 +210,7 @@ //parameterTab.add(paramTable, BorderLayout.CENTER); final JPanel paramButtons = new JPanel(); paramButtons.setLayout(new StackLayout(5)); - addParameter = new JButton("Add parameter"); + final JButton addParameter = new JButton("Add parameter"); addParameter.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { getScript().newParameter(); @@ -280,7 +272,7 @@ final GridBagConstraints gbc = l.getConstraints(c); if (gbc != null) { selectedRow = gbc.gridy - 1; - selectedCol = gbc.gridx; + final int selectedCol = gbc.gridx; } } Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-09 14:14:29 UTC (rev 963) @@ -87,8 +87,6 @@ private final CMainControl mainControl; - private final AttributeFilter af; - private final Color[] highLightMask; private BufferedImage backBuffer; @@ -104,7 +102,7 @@ this.mainControl = mainControl; this.mapControl = mapControl; - af = new AttributeFilter(); + final AttributeFilter af = new AttributeFilter(); af.addAttribute("no_pass", "1"); isPickmap = pickmap; // initialize the tmp. graphic buffer Modified: trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java =================================================================== --- trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/crossfire/src/cfeditor/menu/AggregateMenuLocation.java 2006-12-09 14:14:29 UTC (rev 963) @@ -18,15 +18,13 @@ private class WrappedMenuLocation implements MenuLocation { - private final String parentName; - private final String name; private final MenuLocation location; public WrappedMenuLocation(final MenuLocation location, final String parentName) { this.location = location; - this.parentName = parentName; + final String parentName1 = parentName; name = parentName + "." + location.getName(); } Modified: trunk/crossfire/src/cfeditor/parameter/MapParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/MapParameterView.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/crossfire/src/cfeditor/parameter/MapParameterView.java 2006-12-09 14:14:29 UTC (rev 963) @@ -38,13 +38,11 @@ private final JComboBox value; - private final MyComboBoxModel myModel; - public MapParameterView(final MapParameter param) { super(); this.parameter = param; value = new JComboBox(); - myModel = new MyComboBoxModel(); + final MyComboBoxModel myModel = new MyComboBoxModel(); value.setModel(myModel); if (log.isDebugEnabled()) { log.debug("opened maps: " + CMainControl.getInstance().getOpenedMaps() + " len: " + CMainControl.getInstance().getOpenedMaps().length); Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-12-09 14:14:29 UTC (rev 963) @@ -120,10 +120,6 @@ private JComboBox typesel; // selection box for type - private JTextField nameTF; // textfield for gameObject name - - private JTextField archetypeTF; // textfield for name of the Archetype - private JLabel imagePanel; // panel for object's face (png) private final GameObject gameObject; @@ -439,7 +435,7 @@ gbc.gridx = 3; gbc.gridy = 1; gbc.weightx = 1.0; - if (gameObject.getObjName() != null && gameObject.getObjName().length() > 0) { + final JTextField nameTF;if (gameObject.getObjName() != null && gameObject.getObjName().length() > 0) { nameTF = new JTextField(gameObject.getObjName(), 16); } else if (archetype.getObjName() != null && archetype.getObjName().length() > 0) { nameTF = new JTextField(archetype.getObjName(), 16); @@ -451,7 +447,7 @@ gbc.gridy++; header.add(buildTypesBox(), gbc); // build type-selection box gbc.gridy++; - archetypeTF = new JTextField(archetype.getArchetypeName(), 16); + final JTextField archetypeTF=new JTextField(archetype.getArchetypeName(), 16); archetypeTF.setEditable(false); header.add(archetypeTF, gbc); Modified: trunk/daimonin/src/daieditor/CFTreasureListTree.java =================================================================== --- trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-12-09 14:14:29 UTC (rev 963) @@ -113,8 +113,6 @@ private JButton noneButton; - private JButton cancelButton; - // the textfield in the attribute dialog where the result gets written to private JTextField input; // input textfield @@ -612,7 +610,7 @@ }); rightSide.add(noneButton); - cancelButton = new JButton("Cancel"); + final JButton cancelButton = new JButton("Cancel"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { frame.setVisible(false); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-12-09 14:14:29 UTC (rev 963) @@ -201,8 +201,6 @@ public static ImageIcon mapCursorIcon; - private static ImageIcon mapGridIcon; - private static ImageIcon unknownTileIcon; private static ImageIcon warningSquareIcon; @@ -1940,7 +1938,7 @@ * access. */ private static void loadDefTiles() { - mapGridIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_IGRID_TILE); + final ImageIcon mapGridIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_IGRID_TILE); mapPreSelIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_IPRESEL_TILE); mapSelIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_ISEL_TILE); mapCursorIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_ICURSOR); Modified: trunk/daimonin/src/daieditor/MapViewIFrame.java =================================================================== --- trunk/daimonin/src/daieditor/MapViewIFrame.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/daimonin/src/daieditor/MapViewIFrame.java 2006-12-09 14:14:29 UTC (rev 963) @@ -62,9 +62,6 @@ /** The underlying mapview object. */ private final CMapViewBasic view; - /** Number of this view. */ - private final int viewNumber; - /** * Constructs a level view. * @param mainControl the main controller @@ -76,7 +73,7 @@ super(mapControl.getMapFileName() + " [ " + mapControl.getMapArch().getMapDisplayName() + " ] ("+ number + ')', true, true, true, true); this.mapControl = mapControl; this.mainControl = mainControl; - viewNumber = number; + final int viewNumber = number; setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); Modified: trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2006-12-09 00:04:15 UTC (rev 962) +++ trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2006-12-09 14:14:29 UTC (rev 963) @@ -74,9 +74,6 @@ /** Time of last core painting (includes selection painting). */ private transient long lastCorePaint; - /** Time of last overall painting (includes core and thus selection). */ - private transient long lastPaint; - /** The origin is the point in the north-west corner */ private Point origin = new Point(); @@ -91,9 +88,6 @@ /** The MapSquares that are known to contain errors. */ private Map<MapSquare<? extends net.sf.gridarta.gameobject.GameObject>,ValidationError> erraneousMapSquares; - /** The ArchObjects that are known to contain errors. */ - private Map<net.sf.gridarta.gameobject.GameObject,ValidationError> erraneousArchObjects; - /** Used to avoid creation millions of points */ private final Point tmpPoint = new Point(); @@ -208,7 +202,7 @@ @Override public void paintComponent(final Graphics grfx) { final long start = System.currentTimeMillis(); paintComponent2((Graphics2D) grfx); - lastPaint = System.currentTimeMillis() - start; + final long lastPaint = System.currentTimeMillis() - start; mainControl.setStatusText("Sel: " + lastSelectionPaint + " Core: " + lastCorePaint + " All: " + lastPaint); } @@ -472,7 +466,7 @@ * @param erraneousArchObjects the ArchObjects that are known to contain errors. */ public void setErraneousArchObjects(final Map<net.sf.gridarta.gameobject.GameObject, ValidationError> erraneousArchObjects) { - this.erraneousArchObjects = erraneousArchObjects; + final Map<net.sf.gridarta.gameobject.GameObject, ValidationError> erraneousArchObjects1 = erraneousArchObjects; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-09 00:04:14
|
Revision: 962 http://svn.sourceforge.net/gridarta/?rev=962&view=rev Author: akirschbaum Date: 2006-12-08 16:04:15 -0800 (Fri, 08 Dec 2006) Log Message: ----------- Unify ResourceFileManager. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/ResourceFileManager.java Added Paths: ----------- trunk/crossfire/src/cfeditor/ResourceFileManager.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-08 23:35:12 UTC (rev 961) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-09 00:04:15 UTC (rev 962) @@ -84,18 +84,6 @@ private static final String DOCU_VERSION_KEY = "docuVersion"; - private static final String MAP_DIR_KEY = "mapDirectory"; - - private static final String DEFAULT_MAP_DIR = "maps"; - - private static final String ARCH_DIR_KEY = "archDirectory"; - - private static final String DEFAULT_ARCH_DIR = "arch"; - - private static final String SCRIPT_DIR_KEY = "scriptDirectory"; - - private static final String DEFAULT_SCRIPT_DIR = "script"; - private static final String USE_IMAGESET = "useImageSet"; private static final String USE_FONT = "useFont"; @@ -368,9 +356,9 @@ */ private void readGlobalSettings() { // Get the directories - strMapDir = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(MAP_DIR_KEY, DEFAULT_MAP_DIR); - strArchDir = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(ARCH_DIR_KEY, DEFAULT_ARCH_DIR); - strScriptDir = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(SCRIPT_DIR_KEY, DEFAULT_SCRIPT_DIR); + 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); + strScriptDir = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(ResourceFileManager.SCRIPT_DIR_KEY, ResourceFileManager.DEFAULT_SCRIPT_DIR); // set map dir if (strMapDir.length() > 0) { @@ -423,9 +411,9 @@ map = map.substring(0, map.length() - 1); // path should not end with slash } - CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(ARCH_DIR_KEY, arch); - CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(MAP_DIR_KEY, map); - CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(SCRIPT_DIR_KEY, script); + 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"); Added: trunk/crossfire/src/cfeditor/ResourceFileManager.java =================================================================== --- trunk/crossfire/src/cfeditor/ResourceFileManager.java (rev 0) +++ trunk/crossfire/src/cfeditor/ResourceFileManager.java 2006-12-09 00:04:15 UTC (rev 962) @@ -0,0 +1,43 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2006 Christian Hujer + * + * (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; + +/** + * TODO + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public final class ResourceFileManager { + + public static final String MAP_DIR_KEY = "mapDirectory"; + + public static final String DEFAULT_MAP_DIR = "maps"; + + public static final String ARCH_DIR_KEY = "archDirectory"; + + public static final String DEFAULT_ARCH_DIR = "arch"; + + public static final String SCRIPT_DIR_KEY = "scriptDirectory"; + + public static final String DEFAULT_SCRIPT_DIR = "script"; + +} // class ResourceFileManager Property changes on: trunk/crossfire/src/cfeditor/ResourceFileManager.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/daimonin/src/daieditor/ResourceFileManager.java =================================================================== --- trunk/daimonin/src/daieditor/ResourceFileManager.java 2006-12-08 23:35:12 UTC (rev 961) +++ trunk/daimonin/src/daieditor/ResourceFileManager.java 2006-12-09 00:04:15 UTC (rev 962) @@ -1,3 +1,25 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2006 Christian Hujer + * + * (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 daieditor; /** @@ -21,4 +43,5 @@ public static final String MEDIA_DIR_KEY = "mediaDirectory"; public static final String DEFAULT_MEDIA_DIR = "../client/media"; + } // class ResourceFileManager This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-08 23:35:12
|
Revision: 961 http://svn.sourceforge.net/gridarta/?rev=961&view=rev Author: akirschbaum Date: 2006-12-08 15:35:12 -0800 (Fri, 08 Dec 2006) Log Message: ----------- Unify CMapArchPanel implementation. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapArchPanel.java Modified: trunk/daimonin/src/daieditor/CMapArchPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-12-08 23:28:46 UTC (rev 960) +++ trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-12-08 23:35:12 UTC (rev 961) @@ -30,9 +30,7 @@ import daieditor.map.validation.ErrorCollector; import daieditor.map.validation.ErrorHandler; import java.awt.BorderLayout; -import static java.awt.Color.black; -import static java.awt.Color.blue; -import static java.awt.Color.red; +import java.awt.Color; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; @@ -49,18 +47,15 @@ import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; -import static javax.swing.JSplitPane.HORIZONTAL_SPLIT; +import javax.swing.JSplitPane; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.JTextPane; import javax.swing.JToggleButton; -import static javax.swing.JViewport.SIMPLE_SCROLL_MODE; -import static javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED; -import static javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER; -import static javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS; -import static javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED; -import static javax.swing.SwingConstants.TOP; +import javax.swing.JViewport; +import javax.swing.ScrollPaneConstants; +import javax.swing.SwingConstants; import javax.swing.border.EtchedBorder; import javax.swing.text.BadLocationException; import javax.swing.text.Document; @@ -202,13 +197,13 @@ scrollPane2.setBackground(archEdit.getBackground()); scrollPane2.getViewport().add(archEdit); add(scrollPane2, BorderLayout.EAST); - scrollPane2.setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_AS_NEEDED); - scrollPane2.setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_ALWAYS); - scrollPane2.getViewport().setScrollMode(SIMPLE_SCROLL_MODE); + scrollPane2.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + scrollPane2.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); + scrollPane2.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); - panelDesktop = new JTabbedPane(TOP); + panelDesktop = new JTabbedPane(SwingConstants.TOP); mapArchPanel.setLayout(new BorderLayout()); - splitPane = new GSplitPane(HORIZONTAL_SPLIT, mapArchPanel, scrollPane2); + splitPane = new GSplitPane(JSplitPane.HORIZONTAL_SPLIT, mapArchPanel, scrollPane2); final JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new GridLayout(0, 1)); @@ -450,6 +445,7 @@ return text.replaceAll("\\s+", "").length() > 0; } + /** Set up the animation panel. */ private void setupAnimationPanel() { final GridBagLayout gridbag = new GridBagLayout(); final GridBagConstraints gbc = new GridBagConstraints(); @@ -484,7 +480,7 @@ gbc.insets = new Insets(4, 4, 0, 0); archNameField.setText(""); - archNameField.setForeground(blue); + archNameField.setForeground(Color.blue); gbc.gridx = 0; gbc.gridy = 0; gbc.gridwidth = 1; @@ -652,13 +648,13 @@ textPanel = new JPanel(); // new panel archTextArea.setText(""); - archTextArea.setForeground(blue); + archTextArea.setForeground(Color.blue); // create ScrollPane for text scrolling final JScrollPane sta = new JScrollPane(archTextArea); sta.setBorder(new EtchedBorder()); - sta.setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_AS_NEEDED); - sta.setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_NEVER); + sta.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); + sta.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //textPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED)); textPanel.add(sta); @@ -671,8 +667,8 @@ // create ScrollPane for jlist scrolling final JScrollPane ssa = new JScrollPane(eventList); ssa.setBorder(new EtchedBorder()); - ssa.setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_AS_NEEDED); - ssa.setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_NEVER); + ssa.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); + ssa.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); ssa.setPreferredSize(new Dimension(80, 40)); // create buttons @@ -730,9 +726,9 @@ * @param refresh if true, the window is redrawn after setting the fonts */ public void updateFont(final boolean refresh) { - archMapPos.setForeground(black); - archTypeText.setForeground(black); - archFaceText.setForeground(black); + archMapPos.setForeground(Color.black); + archTypeText.setForeground(Color.black); + archFaceText.setForeground(Color.black); // document needs to be set! @@ -774,10 +770,10 @@ aPath.setEnabled(false); aRemove.setEnabled(false); } - panelDesktop.setForegroundAt(0, black); - panelDesktop.setForegroundAt(1, black); - panelDesktop.setForegroundAt(2, black); - panelDesktop.setForegroundAt(3, black); + panelDesktop.setForegroundAt(0, Color.black); + panelDesktop.setForegroundAt(1, Color.black); + panelDesktop.setForegroundAt(2, Color.black); + panelDesktop.setForegroundAt(3, Color.black); aInvChange.setEnabled(false); aAttrWin.setEnabled(false); @@ -793,7 +789,7 @@ // are displayed (Only the head can store information!). final GameObject gameObject = activeGameObject.getHead(); - panelDesktop.setForegroundAt(0, blue); + panelDesktop.setForegroundAt(0, Color.blue); aInvChange.setEnabled(true); aAttrWin.setEnabled(true); aSubmitChange.setEnabled(true); @@ -814,7 +810,7 @@ // no text, we try to set the default text final boolean hasMessage; if (gameObject.getMsgText() == null && archetype != null) { - archTextArea.setForeground(black); + archTextArea.setForeground(Color.black); if (archetype.getMsgText() == null) { archTextArea.setText(""); hasMessage = false; @@ -823,23 +819,23 @@ hasMessage = true; } } else { - archTextArea.setForeground(blue); + archTextArea.setForeground(Color.blue); archTextArea.setText(gameObject.getMsgText()); hasMessage = true; } archTextArea.setCaretPosition(0); if (hasMessage) { - panelDesktop.setForegroundAt(1, blue); + panelDesktop.setForegroundAt(1, Color.blue); } // end msg text if (gameObject.getAnimName() != null || archetype != null && archetype.getAnimName() != null) { - panelDesktop.setForegroundAt(3, blue); + panelDesktop.setForegroundAt(3, Color.blue); } // *** OBJECT NAME *** if (gameObject.getObjName() == null && archetype != null) { - archNameField.setForeground(black); + archNameField.setForeground(Color.black); if (archetype.getObjName() == null) { // gameObject name if (gameObject.getArchetypeName() != null) { @@ -853,7 +849,7 @@ } } else { // object name ("special") - archNameField.setForeground(blue); + archNameField.setForeground(Color.blue); archNameField.setText(gameObject.getObjName()); } // end ObjName @@ -869,7 +865,7 @@ final StringBuilder specialText = new StringBuilder(); specialText.append("Status: in node ").append(gameObject.getMapX()).append(", ").append(gameObject.getMapY()).append(' '); if (gameObject.isScripted()) { - panelDesktop.setForegroundAt(2, blue); + panelDesktop.setForegroundAt(2, Color.blue); specialText.append("(script)"); } if (hasMessage) { @@ -931,10 +927,10 @@ faceText.append("archetype anim"); break; } + faceText.append(")"); } archFaceText.setText(faceText.toString()); - String animName = gameObject.getAnimName(); if (animName == null && archetype != null) { animName = archetype.getAnimName(); @@ -943,7 +939,7 @@ if (animName != null) { animText.append(animName); if (!mainControl.getAnimationObjects().containsKey(animName)) { - panelDesktop.setForegroundAt(3, red); + panelDesktop.setForegroundAt(3, Color.red); animText.append(" (** unknown animation **)"); } } @@ -953,17 +949,17 @@ archEdit.setEnabled(true); final Style currentAttributes = archEdit.getStyle(StyleContext.DEFAULT_STYLE); try { - // blue: the "special" attributes, differ from the default archetype - StyleConstants.setForeground(currentAttributes, blue); + // Color.blue: the "special" attributes, differ from the default archetype + StyleConstants.setForeground(currentAttributes, Color.blue); if (gameObject.getObjectText() != null) { document.insertString(document.getLength(), gameObject.getObjectText(), currentAttributes); } // document.insertString(document.getLength(), "ID#"+gameObject+ " inv#: "+gameObject.countInvObjects()+"\n", currentAttributes); - // black: the attributes from the default archetype + // Color.black: the attributes from the default archetype // that don't exist among the "special" ones - StyleConstants.setForeground(currentAttributes, black); + StyleConstants.setForeground(currentAttributes, Color.black); if (gameObject.getObjectText() != null && archetype != null) { document.insertString(document.getLength(), gameObject.diffArchText(archetype.getObjectText(), true), currentAttributes); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-08 23:28:48
|
Revision: 960 http://svn.sourceforge.net/gridarta/?rev=960&view=rev Author: akirschbaum Date: 2006-12-08 15:28:46 -0800 (Fri, 08 Dec 2006) Log Message: ----------- Unify CMapArchPanel. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/crossfire/src/cfeditor/messages_de.properties trunk/daimonin/src/daieditor/messages.properties trunk/src/app/net/sf/gridarta/messages.properties Modified: trunk/crossfire/src/cfeditor/CMapArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-12-07 23:38:31 UTC (rev 959) +++ trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-12-08 23:28:46 UTC (rev 960) @@ -34,8 +34,7 @@ import java.awt.GridLayout; import java.awt.Insets; import java.awt.Toolkit; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; +import javax.swing.Action; import javax.swing.BoxLayout; import javax.swing.DefaultListModel; import javax.swing.JButton; @@ -43,11 +42,14 @@ import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; +import javax.swing.JSplitPane; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.JTextPane; import javax.swing.JViewport; +import javax.swing.ScrollPaneConstants; +import javax.swing.SwingConstants; import javax.swing.border.EtchedBorder; import javax.swing.text.BadLocationException; import javax.swing.text.Document; @@ -55,6 +57,8 @@ import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; import net.sf.gridarta.gui.GSplitPane; +import net.sf.japi.swing.ActionFactory; +import net.sf.japi.swing.ActionMethod; /** * <code>CMapArchPanel</code> implements the panel that holds information about @@ -67,6 +71,9 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); + // constants for the 'task' parameter in editScriptWanted() public static final int SCRIPT_OPEN = 0; @@ -110,15 +117,13 @@ private final Document document; - private final JScrollPane scrollArchPane = new JScrollPane(); - /** Panel with name/face etc. */ private final JPanel archPanel; /** Panel with message text. */ private JPanel textPanel; - private JPanel scriptPanel; + private final JPanel animationPanel; /** Arch text field. */ private final JTextArea archTextArea = new JTextArea(4, 25); @@ -129,33 +134,30 @@ /** Arch face field. */ private final JTextField archFaceField = new JTextField(14); - private JLabel archInvCount = new JLabel(); + private final JLabel archMapPos = new JLabel(); - private JLabel archMapPos = new JLabel(); + private final JLabel archFaceText = new JLabel(); private final JLabel archTypeText = new JLabel(); - private final JLabel archTileText = new JLabel(); + private final JLabel archAnimText = new JLabel(); private final JPanel mapArchPanel = new JPanel(); - private final JButton submitChange; + private final Action aSubmitChange = ACTION_FACTORY.createAction(false, "mapArchApply", this); - private final JButton submitMultiChange; + private final Action aInvChange = ACTION_FACTORY.createAction(false, "mapArchAddInv", this); - private final JButton invChange; + private final Action aAttrWin = ACTION_FACTORY.createAction(false, "mapArchAttrib", this); - private final JButton attrWin; + private final Action aNew = ACTION_FACTORY.createAction(false, "scriptAddNew", this); - // stuff for scripting tab - private JButton aNew; + private final Action aPath = ACTION_FACTORY.createAction(false, "scriptEditData", this); - private JButton aPath; + private final Action aModify = ACTION_FACTORY.createAction(false, "scriptEdit", this); - private JButton aModify; + private final Action aRemove = ACTION_FACTORY.createAction(false, "scriptRemove", this); - private JButton aRemove; - private JList eventList; private GameObject selectedObject; @@ -169,20 +171,16 @@ // scrollPane2 contains the document for archtext editing final JScrollPane scrollPane2 = new JScrollPane(archEdit); + scrollPane2.setBackground(archEdit.getBackground()); scrollPane2.getViewport().add(archEdit); add(scrollPane2, BorderLayout.EAST); - scrollPane2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); - scrollPane2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); + scrollPane2.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + scrollPane2.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scrollPane2.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); - final JScrollPane scrollPane3 = new JScrollPane(mapArchPanel); - scrollPane3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); - scrollPane3.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER); - scrollPane3.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); - - panelDesktop = new JTabbedPane(JTabbedPane.TOP); + panelDesktop = new JTabbedPane(SwingConstants.TOP); mapArchPanel.setLayout(new BorderLayout()); - splitPane = new GSplitPane(GSplitPane.HORIZONTAL_SPLIT, scrollPane3, scrollPane2); + splitPane = new GSplitPane(JSplitPane.HORIZONTAL_SPLIT, mapArchPanel, scrollPane2); final JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new GridLayout(0, 1)); @@ -190,17 +188,9 @@ mapArchPanel.add(buttonPanel, BorderLayout.WEST); // our buttons - submitChange = new JButton("Apply"); - buttonPanel.add(submitChange); - invChange = new JButton("Add Inv."); - buttonPanel.add(invChange); - attrWin = new JButton("Attributes"); - attrWin.setForeground(Color.red); - buttonPanel.add(attrWin); - submitMultiChange = new JButton("Apply multi"); - submitMultiChange.setEnabled(false); - submitMultiChange.setVisible(false); - buttonPanel.add(submitMultiChange); + buttonPanel.add(new JButton(aSubmitChange)); + buttonPanel.add(new JButton(aInvChange)); + buttonPanel.add(new JButton(aAttrWin)); mapArchPanel.add(panelDesktop, BorderLayout.CENTER); @@ -213,79 +203,94 @@ gbc.fill = GridBagConstraints.BOTH; gbc.anchor = GridBagConstraints.NORTHWEST; + animationPanel = new JPanel(); + setupArchPanel(); setupTextPanel(); - setupScriptPanel(); + setupAnimationPanel(); panelDesktop.add(archPanel, "Arch"); + panelDesktop.add(textPanel, "Msg Text"); - panelDesktop.add(textPanel, "Text"); + panelDesktop.add(createScriptPanel(), "Scripts"); - panelDesktop.add(scriptPanel, "Scripts"); - - final JPanel animationPanel = new JPanel(); panelDesktop.add(animationPanel, "Animation"); // calculate default value in case there is no settings file final Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); - final int divLocation = Integer.parseInt(settings.getProperty(MAPARCHPANEL_LOCATION_KEY, "" + (int) (0.49 * screen.getWidth()))); - - splitPane.setDividerLocation(divLocation); - splitPane.setDividerSize(5); + splitPane.setDividerLocation(Integer.parseInt(settings.getProperty(MAPARCHPANEL_LOCATION_KEY, "" + (int) (0.49 * screen.getWidth())))); add(splitPane, BorderLayout.CENTER); + updateFont(true); + document = archEdit.getDocument(); + } - submitChange.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent event) { - applyArchPanelChanges(mainView.getMapTileSelection()); - } - }); + /** + * Action method for applying the changes made in the arch panel. + */ + @ActionMethod public void mapArchApply() { + applyArchPanelChanges(mainView.getMapTileSelection()); + } - attrWin.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent event) { - openAttrDialog(mainView.getMapTileSelection()); - } - }); + /** + * Action method for displaying the attributes of the currently selected object. + */ + @ActionMethod public void mapArchAttrib() { + mainControl.openAttrDialog(mainView.getMapTileSelection()); + } - invChange.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent event) { - final GameObject arch = mainControl.getArchPanelHighlight(); - if (arch == null) { // nothing selected? - return; - } + /** + * Action method for adding an object to the inventory of the currently selected object. + */ + @ActionMethod public void mapArchAddInv() { + final GameObject arch = mainControl.getArchPanelHighlight(); + if (arch == null) { // nothing selected? + return; + } - // no single tile? - if (arch.isMulti()) { - return; - } + // no single tile? + if(arch.isMulti()) { + return; + } - GameObject inv = mainView.getMapTileSelection(); - if (inv == null) { - return; - } + GameObject inv = mainView.getMapTileSelection(); + if (inv == null) { + return; + } - // if this is a multi-tail, we put the new arch into the head's inv. - inv = inv.getHead(); + // if this is a multi-tail, we put the new arch into the head's inv. + inv = inv.getHead(); - final GameObject invnew; - if (arch.isArchetype()) { - // create a new copy of a default arch - invnew = arch.createArch(); - } else { - // create clone from a pickmap - invnew = arch.createClone(inv.getMapX(), inv.getMapY()); - } + final GameObject invnew; + if (arch.isArchetype()) { + // create a new copy of a default arch + invnew = arch.createArch(); + } else { + // create clone from a pickmap + invnew = arch.createClone(inv.getMapX(), inv.getMapY()); + } - inv.addLast(invnew); - mainControl.getArchetypeParser().postParseGameObject(invnew, 0); - mainControl.getMainView().setMapTileList(mainControl.getCurrentMap(), inv); - mainControl.getCurrentMap().setLevelChangedFlag(); // the map has been modified - } - }); + mainControl.getArchetypeParser().postParseGameObject(invnew, 0); + inv.addLast(invnew); + mainControl.getMainView().setMapTileList(mainControl.getCurrentMap(), inv); + mainControl.getCurrentMap().setLevelChangedFlag(); // the map has been modified } + public void updateMapTileList() { + GameObject inv = mainView.getMapTileSelection(); + if (inv == null) { + return; + } + + // if this is a multi-tail, we put the new arch into the head's inv. + inv = inv.getHead(); + + mainControl.getMainView().setMapTileList(mainControl.getCurrentMap(), inv); + mainControl.getCurrentMap().setLevelChangedFlag(); // the map has been modified + } + /** * When the "apply"-button on the ArchPanel (at the bottom of the window) * is pressed, this function updates the active arch object. @@ -385,6 +390,8 @@ String newMsgText = archTextArea.getText(); if (newMsgText != null) { newMsgText = newMsgText.trim(); + } else { + newMsgText = ""; } if (newMsgText.equals(archetype.getMsgText().trim())) { gameObject.deleteMsgText(); // yes, we don't need it in map @@ -429,7 +436,10 @@ // now here will be the special panels added! refresh(); + updateMapTileList(); + // if needed (due to face changes), we also redraw the map + mainControl.getMainView().refreshMapTileList(); if (needRedraw) { mainControl.getCurrentMap().repaint(); } @@ -437,14 +447,30 @@ // simple "white space test, to eliminate ' ' // perhaps we should include here a real white space test - public boolean isNonwhitespaceText(final String text) { - for (int i = 0; i < text.length(); i++) { - if (text.charAt(i) != ' ') { - return true; - } - } + private static boolean isNonwhitespaceText(final String text) { + return text.replaceAll("\\s+", "").length() > 0; + } - return false; + /** Set up the animation panel. */ + private void setupAnimationPanel() { + final GridBagLayout gridbag = new GridBagLayout(); + final GridBagConstraints gbc = new GridBagConstraints(); + + animationPanel.setLayout(gridbag); + gbc.fill = GridBagConstraints.BOTH; + gbc.weightx = 1.0; + gbc.weighty = 0; + gbc.anchor = GridBagConstraints.NORTHWEST; + gbc.insets = new Insets(3, 3, 0, 0); + + archAnimText.setText("Animation: "); + gbc.gridx = 0; + gbc.gridy = 0; + gbc.gridwidth = 1; + gbc.gridheight = 1; + gridbag.setConstraints(archAnimText, gbc); + animationPanel.add(archAnimText); + } /** Set up the arch panel entry of the lower window. */ @@ -457,60 +483,51 @@ gbc.weightx = 1.0; gbc.weighty = 0; gbc.anchor = GridBagConstraints.NORTHWEST; - gbc.insets = new Insets(5, 5, 0, 0); - // add our elements + gbc.insets = new Insets(4, 4, 0, 0); - archInvCount = new JLabel(""); - gbc.gridx = 1; - gbc.gridy = 0; - gbc.gridwidth = 1; - gridbag.setConstraints(archInvCount, gbc); - archPanel.add(archInvCount); - archNameField.setText(""); archNameField.setForeground(Color.blue); gbc.gridx = 0; gbc.gridy = 0; gbc.gridwidth = 1; + gbc.gridheight = 1; gridbag.setConstraints(archNameField, gbc); archPanel.add(archNameField); - archMapPos = new JLabel(""); - gbc.gridx = 1; - gbc.gridy = 1; - gbc.gridwidth = 1; - gridbag.setConstraints(archMapPos, gbc); - archPanel.add(archMapPos); - archFaceField.setText(""); archFaceField.setForeground(Color.blue); gbc.gridx = 0; gbc.gridy = 1; gbc.gridwidth = 1; + gbc.gridheight = 1; gridbag.setConstraints(archFaceField, gbc); archPanel.add(archFaceField); + archFaceText.setText(""); + gbc.gridx = 0; + gbc.gridy = 2; + gbc.gridwidth = 1; + gbc.gridheight = 1; + gridbag.setConstraints(archFaceText, gbc); + archPanel.add(archFaceText); + archTypeText.setText(""); gbc.gridx = 0; - gbc.gridy = 2; + gbc.gridy = 3; + gbc.gridwidth = 1; + gbc.gridheight = 1; gridbag.setConstraints(archTypeText, gbc); archPanel.add(archTypeText); - archTileText.setText(""); - gbc.gridx = 1; - gbc.gridy = 2; - gridbag.setConstraints(archTileText, gbc); - archPanel.add(archTileText); + archMapPos.setText(""); + gbc.gridx = 0; + gbc.gridy = 4; + gbc.gridwidth = 1; + gbc.gridheight = 1; + gridbag.setConstraints(archMapPos, gbc); + archPanel.add(archMapPos); } - /** - * Open an attribute dialog window for the currently selected arch. - * @param arch currently selected arch - */ - private void openAttrDialog(final GameObject arch) { - mainControl.openAttrDialog(arch); - } - /** Set up the text panel entry of the lower window. */ private void setupTextPanel() { textPanel = new JPanel(); // new panel @@ -521,83 +538,68 @@ // create ScrollPane for text scrolling final JScrollPane sta = new JScrollPane(archTextArea); sta.setBorder(new EtchedBorder()); - sta.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); - sta.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + sta.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); + sta.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //textPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED)); textPanel.add(sta); } /** Set up the script panel tab. */ - private void setupScriptPanel() { - scriptPanel = new JPanel(); // new panel - scriptPanel.setLayout(new BoxLayout(scriptPanel, BoxLayout.X_AXIS)); - + private JPanel createScriptPanel() { eventList = new JList(); // create ScrollPane for jlist scrolling final JScrollPane ssa = new JScrollPane(eventList); ssa.setBorder(new EtchedBorder()); - ssa.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); - ssa.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + ssa.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); + ssa.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); ssa.setPreferredSize(new Dimension(80, 40)); // create buttons final JPanel grid = new JPanel(new GridLayout(2, 2)); - aNew = new JButton("Create New"); - aNew.setMargin(new Insets(3, 3, 3, 3)); - aNew.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent e) { - addNewScriptWanted(); - } - }); - grid.add(aNew); + grid.add(new JButton(aNew)); + grid.add(new JButton(aPath)); + grid.add(new JButton(aModify)); + grid.add(new JButton(aRemove)); - aPath = new JButton("Edit Params"); - aPath.setMargin(new Insets(3, 3, 3, 3)); - aPath.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent e) { - editScriptWanted(CMapArchPanel.SCRIPT_EDIT_PATH); - } - }); - grid.add(aPath); - - aModify = new JButton("Edit Script"); - aModify.setMargin(new Insets(3, 3, 3, 3)); - aModify.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent e) { - editScriptWanted(CMapArchPanel.SCRIPT_OPEN); - } - }); - grid.add(aModify); - - aRemove = new JButton("Remove"); - aRemove.setMargin(new Insets(3, 3, 3, 3)); - aRemove.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent e) { - editScriptWanted(CMapArchPanel.SCRIPT_REMOVE); - } - }); - grid.add(aRemove); - // disable all the buttons in the beginning aNew.setEnabled(false); aModify.setEnabled(false); aPath.setEnabled(false); aRemove.setEnabled(false); - grid.setPreferredSize(new Dimension((int) (Math.max(aModify.getMinimumSize().getWidth() * 2, aNew.getMinimumSize().getWidth() * 2)), 40)); - + final JPanel scriptPanel = new JPanel(); // new panel + scriptPanel.setLayout(new BoxLayout(scriptPanel, BoxLayout.X_AXIS)); scriptPanel.add(ssa); scriptPanel.add(grid); scriptPanel.setPreferredSize(new Dimension(100, 40)); + return scriptPanel; } + /** Action method for creating a new Script. */ + @ActionMethod public void scriptAddNew() { + addNewScriptWanted(); + } + + /** Action method for editing the data of an existing Script. */ + @ActionMethod public void scriptEditData() { + editScriptWanted(SCRIPT_EDIT_PATH); + } + + /** Action method for editing an existing Script. */ + @ActionMethod public void scriptEdit() { + editScriptWanted(SCRIPT_OPEN); + } + + /** Action method for removing an existing script. */ + @ActionMethod public void scriptRemove() { + editScriptWanted(SCRIPT_REMOVE); + } + void appExitNotify() { final CSettings settings = CSettings.getInstance(IGUIConstants.APP_NAME); - settings.setProperty(MAPARCHPANEL_LOCATION_KEY, "" + - splitPane.getDividerLocation()); - + settings.setProperty(MAPARCHPANEL_LOCATION_KEY, "" + splitPane.getDividerLocation()); } void refresh() { @@ -606,6 +608,23 @@ } /** + * Update the map arch panel to display the custom font. + * @param refresh if true, the window is redrawn after setting the fonts + */ + public void updateFont(final boolean refresh) { + archMapPos.setForeground(Color.black); + archTypeText.setForeground(Color.black); + archFaceText.setForeground(Color.black); + + // document needs to be set! + + // refresh if desired + if (refresh) { + refresh(); + } + } + + /** * If an arch is selected, the MapArchPanels (bottom right windows) get * updated. * @return the selected arch @@ -619,16 +638,14 @@ * updated. * @param activeGameObject the selected arch */ - public void setMapArchPanelObject(final GameObject activeGameObject) { + void setMapArchPanelObject(final GameObject activeGameObject) { selectedObject = activeGameObject; // reset panel archNameField.setText(""); + archFaceText.setText("Image:"); archTypeText.setText("Type:"); - archTileText.setText("Tile:"); archTextArea.setText(""); - archFaceField.setText(""); - archInvCount.setText(""); - archMapPos.setText(""); + archMapPos.setText("Status: "); // reset list archEdit.setEnabled(false); @@ -645,6 +662,14 @@ aPath.setEnabled(false); aRemove.setEnabled(false); } + panelDesktop.setForegroundAt(0, Color.black); + panelDesktop.setForegroundAt(1, Color.black); + panelDesktop.setForegroundAt(2, Color.black); + panelDesktop.setForegroundAt(3, Color.black); + + aInvChange.setEnabled(false); + aAttrWin.setEnabled(false); + aSubmitChange.setEnabled(false); return; } @@ -652,15 +677,22 @@ // are displayed (Only the head can store information!). final GameObject gameObject = activeGameObject.getHead(); + panelDesktop.setForegroundAt(0, Color.blue); + aInvChange.setEnabled(true); + aAttrWin.setEnabled(true); + aSubmitChange.setEnabled(true); + + final GameObject archetype = gameObject.getArchetype(); + // no text, we try to set the default text final boolean hasMessage; - if (gameObject.getMsgText() == null && gameObject.getArchetypeName() != null) { + if (gameObject.getMsgText() == null && archetype != null) { archTextArea.setForeground(Color.black); - if (gameObject.getArchetype().getMsgText() == null) { + if (archetype.getMsgText() == null) { archTextArea.setText(""); hasMessage = false; } else { - archTextArea.setText(gameObject.getArchetype().getMsgText()); + archTextArea.setText(archetype.getMsgText()); hasMessage = true; } } else { @@ -669,6 +701,9 @@ hasMessage = true; } archTextArea.setCaretPosition(0); + if (hasMessage) { + panelDesktop.setForegroundAt(1, Color.blue); + } // end msg text // SET FACE @@ -679,13 +714,16 @@ archFaceField.setText(gameObject.getFaceName()); } else if (gameObject.getArchetypeName() != null) { archFaceField.setForeground(Color.black); - archFaceField.setText(gameObject.getArchetype().getFaceName()); + archFaceField.setText(archetype.getFaceName()); } // end face + if (gameObject.getAnimName() != null || archetype != null && archetype.getAnimName() != null) { + panelDesktop.setForegroundAt(3, Color.blue); + } // *** OBJECT NAME *** - if (gameObject.getObjName() == null && gameObject.getArchetypeName() != null) { + if (gameObject.getObjName() == null && archetype != null) { archNameField.setForeground(Color.black); - if (gameObject.getArchetype().getObjName() == null) { + if (archetype.getObjName() == null) { // gameObject name if (gameObject.getArchetypeName() != null) { archNameField.setText(gameObject.getArchetypeName()); @@ -694,7 +732,7 @@ } } else { // default name - archNameField.setText(gameObject.getArchetype().getObjName()); + archNameField.setText(archetype.getObjName()); } } else { // object name ("special") @@ -704,47 +742,86 @@ // set hint for "specials": scripts/inventory/message final StringBuilder specialText = new StringBuilder(); - final int i; - if ((i = gameObject.countInvObjects()) > 0) { - specialText.append("Inv: ").append(Integer.toString(i)); - } + specialText.append("Status: in node ").append(gameObject.getMapX()).append(", ").append(gameObject.getMapY()).append(' '); if (gameObject.isScripted()) { - if (specialText.length() > 0) { - specialText.append(", "); - } - specialText.append("Script"); + panelDesktop.setForegroundAt(2, Color.blue); + specialText.append("(script)"); } if (hasMessage) { - if (specialText.length() > 0) { - specialText.append(", "); + specialText.append("(msg)"); + } + final int invObjects = gameObject.countInvObjects(); + if (invObjects > 0) { + specialText.append(" (inv: ").append(invObjects).append(')'); + } + if (gameObject.isInContainer()) { + final GameObject cont = (GameObject) gameObject.getContainer(); + if (cont.getArchetypeName() != null) { + specialText.append(" (env: ").append(cont.getArchetypeName()).append(')'); + } else { + specialText.append(" (env: ><)"); } - specialText.append("Msg"); } - archInvCount.setText(specialText.toString()); // set text to label - archMapPos.setText("Map: " + gameObject.getMapX() + ", " + gameObject.getMapY()); + archMapPos.setText(specialText.toString()); - if (gameObject.getArchetypeName() != null) { - archTypeText.setText("Type: " + mainControl.getArchetypeParser().getArchTypeName(gameObject.getArchTypNr()) - + " (" + gameObject.getArchTypNr() + ") [" + gameObject.getArchetypeName() + "]"); + final StringBuilder typeText = new StringBuilder(); + if (archetype != null) { + typeText.append("Type: ").append(mainControl.getTypeList().getArchTypeName(gameObject.getArchTypNr())).append(" (").append(gameObject.getArchTypNr()).append(") [").append(gameObject.getArchetypeName()).append(']'); } else { - archTypeText.setText("Type: <unknown>"); + typeText.append("Type: <unknown>"); } // check for multi tile if (gameObject.isMulti()) { // multi: print size - archTileText.setText("Tile: " + gameObject.getSizeX() + "x" + gameObject.getSizeY()); + typeText.append(" [").append(gameObject.getSizeX()).append('x').append(gameObject.getSizeY()).append(']'); } else { // single - archTileText.setText("Tile: single"); + typeText.append(" [single]"); } + archTypeText.setText(typeText.toString()); + + final StringBuilder faceText = new StringBuilder(); + if (gameObject.getFaceFlag()) { + faceText.append("Image: >no face<"); + } else { + final String faceName = gameObject.getFaceName(); + if (faceName != null) { + faceText.append("Image: ").append(faceName); + } else if (archetype == null) { + faceText.append("Image: >no face<"); + } else { + final String archFaceName = archetype.getFaceName(); + if (archFaceName != null) { + faceText.append("Image: ").append(archFaceName); + } else { + faceText.append("Image: >no face<"); + } + } + } + archFaceText.setText(faceText.toString()); + + String animName = gameObject.getAnimName(); + if (animName == null && archetype != null) { + animName = archetype.getAnimName(); + } + final StringBuilder animText = new StringBuilder("Animation: "); + if (animName != null) { + animText.append(animName); + if (!mainControl.getAnimationObjects().containsKey(animName)) { + panelDesktop.setForegroundAt(3, Color.red); + animText.append(" (** unknown animation **)"); + } + } + archAnimText.setText(animText.toString()); + // drawing the gameObject's attributes in the text field (archEdit) at the bottom right archEdit.setEnabled(true); final Style currentAttributes = archEdit.getStyle(StyleContext.DEFAULT_STYLE); try { - // blue: the "special" attributes, differ from the default archetype + // Color.blue: the "special" attributes, differ from the default archetype StyleConstants.setForeground(currentAttributes, Color.blue); if (gameObject.getObjectText() != null) { document.insertString(document.getLength(), gameObject.getObjectText(), currentAttributes); @@ -752,11 +829,11 @@ // document.insertString(document.getLength(), "ID#"+gameObject+ " inv#: "+gameObject.countInvObjects()+"\n", currentAttributes); - // black: the attributes from the default archetype + // Color.black: the attributes from the default archetype // that don't exist among the "special" ones StyleConstants.setForeground(currentAttributes, Color.black); - if (gameObject.getObjectText() != null && mainControl.getArchetypeSet().getArchetype(gameObject.getArchetypeName()) != null) { - document.insertString(document.getLength(), gameObject.diffArchText(mainControl.getArchetypeSet().getArchetype(gameObject.getArchetypeName()).getObjectText(), true), currentAttributes); + if (gameObject.getObjectText() != null && archetype != null) { + document.insertString(document.getLength(), gameObject.diffArchText(archetype.getObjectText(), true), currentAttributes); } } catch (final BadLocationException e) { // TODO Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2006-12-07 23:38:31 UTC (rev 959) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2006-12-08 23:28:46 UTC (rev 960) @@ -224,3 +224,20 @@ statusSelect=Cursor x:{0,number,integer} y:{1,number,integer} Offset x:{2,number,integer} y:{3,number,integer} statusNormal=Cursor x:{0,number,integer} y:{1,number,integer} statusCursorOff=Maus nicht auf Karte + +################# +# Map Arch Panel + +mapArchApply.text=Anwenden +mapArchApply.shortdescription=\xDCbernimmt die \xC4nderungen + +mapArchAttrib.text=Attribute +mapArchAttrib.shortdescription=\xD6ffnet den Attribute-Dialog + +mapArchAddInv.text=Einf\xFCgen +mapArchAddInv.shortdescription=F\xFCgt ein Objekt zum Inventory hinzu + +scriptAddNew.text=Script hinzuf\xFCgen +scriptEditData.text=Daten \xE4ndern +scriptEdit.text=Script \xE4ndern +scriptRemove.text=Script l\xF6schen Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2006-12-07 23:38:31 UTC (rev 959) +++ trunk/daimonin/src/daieditor/messages.properties 2006-12-08 23:28:46 UTC (rev 960) @@ -300,18 +300,8 @@ edit.text=Edit edit.mnemonic=E -undo.text=Undo -undo.shortdescription=Undo last action -undo.longdescription=Undoes the last action if possible -undo.mnemonic=U -undo.accel=ctrl pressed Z undo.error.text=Can''t undo last action -redo.text=Redo -redo.shortdescription=Redo last undo action -redo.longdescription=Redoes the last undone action if possible -redo.mnemonic=R -redo.accel=ctrl shift pressed Z redo.error.text=Can''t redo clear.text=Clear @@ -695,15 +685,6 @@ ################# # Map Arch Panel -mapArchApply.text=Apply -mapArchApply.shortdescription=Apply object changes - -mapArchAttrib.text=Attributes -mapArchAttrib.shortdescription=Open attributes dialog - -mapArchAddInv.text=Add Inv -mapArchAddInv.shortdescription=Add object to inventory - direction0.text=0 direction0.shortdescription=direction 0 @@ -727,11 +708,6 @@ moveTileUp.shortdescription=Move Tile Position Up moveTileDown.shortdescription=Move Tile Position Down -scriptAddNew.text=Create New -scriptEditData.text=Edit Data -scriptEdit.text=Edit Script -scriptRemove.text=Remove Script - ##################### # Preference Modules Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2006-12-07 23:38:31 UTC (rev 959) +++ trunk/src/app/net/sf/gridarta/messages.properties 2006-12-08 23:28:46 UTC (rev 960) @@ -193,3 +193,33 @@ # Various Log Messages saveLevelAsWithNull=DEBUG: CMainControl.saveLevelAsWanted(CMapControl level) invoked with null argument. imageCreated=Created image "{0}" of map "{1}". + +# Edit +undo.text=Undo +undo.shortdescription=Undo last action +undo.longdescription=Undoes the last action if possible +undo.mnemonic=U +undo.accel=ctrl pressed Z + +redo.text=Redo +redo.shortdescription=Redo last undo action +redo.longdescription=Redoes the last undone action if possible +redo.mnemonic=R +redo.accel=ctrl shift pressed Z + +################# +# Map Arch Panel + +mapArchApply.text=Apply +mapArchApply.shortdescription=Apply object changes + +mapArchAttrib.text=Attributes +mapArchAttrib.shortdescription=Open attributes dialog + +mapArchAddInv.text=Add Inv +mapArchAddInv.shortdescription=Add object to inventory + +scriptAddNew.text=Create New +scriptEditData.text=Edit Data +scriptEdit.text=Edit Script +scriptRemove.text=Remove Script This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |