From: <chr...@us...> - 2007-01-15 14:03:32
|
Revision: 1613 http://svn.sourceforge.net/gridarta/?rev=1613&view=rev Author: christianhujer Date: 2007-01-14 03:04:28 -0800 (Sun, 14 Jan 2007) Log Message: ----------- Moved about logo path to properties files. Modified Paths: -------------- trunk/crossfire/src/cfeditor/action.properties trunk/crossfire/src/cfeditor/gui/AboutDialog.java trunk/daimonin/src/daieditor/action.properties trunk/daimonin/src/daieditor/gui/AboutDialog.java Modified: trunk/crossfire/src/cfeditor/action.properties =================================================================== --- trunk/crossfire/src/cfeditor/action.properties 2007-01-14 10:59:22 UTC (rev 1612) +++ trunk/crossfire/src/cfeditor/action.properties 2007-01-14 11:04:28 UTC (rev 1613) @@ -124,6 +124,7 @@ onlineHelp.icon=general/Help16 about.icon=general/About16 +about.logo=icons/crossfireLogoSmall.png moveTileTop.icon=navigation/Top16 Modified: trunk/crossfire/src/cfeditor/gui/AboutDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/AboutDialog.java 2007-01-14 10:59:22 UTC (rev 1612) +++ trunk/crossfire/src/cfeditor/gui/AboutDialog.java 2007-01-14 11:04:28 UTC (rev 1613) @@ -74,7 +74,7 @@ tabs.add(licensePane); tabs.add(buildRuntimePropertiesTab()); add(tabs); - add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource("icons/crossfireLogoSmall.png"))), BorderLayout.NORTH); + add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource(ACTION_FACTORY.getString("about.logo")))), BorderLayout.NORTH); } /** Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2007-01-14 10:59:22 UTC (rev 1612) +++ trunk/daimonin/src/daieditor/action.properties 2007-01-14 11:04:28 UTC (rev 1613) @@ -146,6 +146,7 @@ tod.icon=general/TipOfTheDay16 about.icon=general/About16 +about.logo=icons/daimoninLogoSmall.png license.1.file=License license.2.file=japi.jar-LICENSE Modified: trunk/daimonin/src/daieditor/gui/AboutDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/AboutDialog.java 2007-01-14 10:59:22 UTC (rev 1612) +++ trunk/daimonin/src/daieditor/gui/AboutDialog.java 2007-01-14 11:04:28 UTC (rev 1613) @@ -76,7 +76,7 @@ tabs.add(buildRuntimePropertiesTab()); tabs.add(buildBuildPropertiesTab()); add(tabs); - add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource("icons/daimoninLogoSmall.png"))), BorderLayout.NORTH); + add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource(ACTION_FACTORY.getString("about.logo")))), BorderLayout.NORTH); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-15 16:37:58
|
Revision: 1602 http://svn.sourceforge.net/gridarta/?rev=1602&view=rev Author: akirschbaum Date: 2007-01-13 16:18:30 -0800 (Sat, 13 Jan 2007) Log Message: ----------- Unify about dialog code. Reset the tabs' state when the dialog is re-opened. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/AboutDialog.java trunk/daimonin/src/daieditor/gui/AboutDialog.java Modified: trunk/crossfire/src/cfeditor/gui/AboutDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/AboutDialog.java 2007-01-14 00:10:03 UTC (rev 1601) +++ trunk/crossfire/src/cfeditor/gui/AboutDialog.java 2007-01-14 00:18:30 UTC (rev 1602) @@ -44,9 +44,10 @@ import net.sf.japi.swing.ActionFactory; /** - * The AboutDialog displays information about the editor like properties and - * licenses. - * + * The AboutDialog displays information about the editor like properties, licenses and developers. + * TODO Refactor to use less memory + * TODO extract JAPI class + * TODO change ActionFactory * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @author Andreas Kirschbaum */ @@ -72,8 +73,8 @@ tabs.add(buildAboutTab()); licensePane = buildLicenseTab(); tabs.add(licensePane); + tabs.add(buildRuntimePropertiesTab()); add(tabs); - tabs.add(buildRuntimePropertiesTab()); add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource("icons/crossfireLogoSmall.png"))), BorderLayout.NORTH); } Modified: trunk/daimonin/src/daieditor/gui/AboutDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/AboutDialog.java 2007-01-14 00:10:03 UTC (rev 1601) +++ trunk/daimonin/src/daieditor/gui/AboutDialog.java 2007-01-14 00:18:30 UTC (rev 1602) @@ -1,3 +1,23 @@ +/* + * Gridarta Map Editor. + * Copyright (C) 2007 The Gridarta Developers + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + package daieditor.gui; import java.awt.BorderLayout; @@ -29,18 +49,30 @@ * TODO extract JAPI class * TODO change ActionFactory * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @author Andreas Kirschbaum */ public class AboutDialog extends JPanel { /** Action Factory to create Actions. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); + /** + * The main tabs. + */ + private final JTabbedPane tabs; + + /** + * The tabs in the license tab. + */ + private final JTabbedPane licensePane; + /** Create an AboutDialog. */ public AboutDialog() { super(new BorderLayout()); - final JTabbedPane tabs = new JTabbedPane(); + tabs = new JTabbedPane(); tabs.add(buildAboutTab()); - tabs.add(buildLicenseTab()); + licensePane = buildLicenseTab(); + tabs.add(licensePane); tabs.add(buildRuntimePropertiesTab()); tabs.add(buildBuildPropertiesTab()); add(tabs); @@ -52,6 +84,8 @@ * @param parent Parent component to show dialog on */ public void showAboutDialog(final Component parent) { + tabs.setSelectedIndex(0); + licensePane.setSelectedIndex(0); JOptionPane.showMessageDialog(parent, this, ACTION_FACTORY.getString("about.title"), JOptionPane.PLAIN_MESSAGE); } @@ -80,7 +114,7 @@ * Build the license tab. * @return component for license tab */ - private JComponent buildLicenseTab() { + private JTabbedPane buildLicenseTab() { final JTabbedPane licensePane = new JTabbedPane(); for (int i = 1; ACTION_FACTORY.getString("license." + i + ".title") != null; i++) { licensePane.add(buildLicenseSubTab(String.valueOf(i))); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-15 19:17:05
|
Revision: 1611 http://svn.sourceforge.net/gridarta/?rev=1611&view=rev Author: christianhujer Date: 2007-01-14 02:38:03 -0800 (Sun, 14 Jan 2007) Log Message: ----------- Changed production build to use a separate output directory. Modified Paths: -------------- trunk/crossfire/build.xml trunk/daimonin/build.xml Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2007-01-14 01:50:21 UTC (rev 1610) +++ trunk/crossfire/build.xml 2007-01-14 10:38:03 UTC (rev 1611) @@ -30,7 +30,7 @@ <property name="test.dir" value="test" /> <property name="resource.dir" value="resource" /> <property name="doc.dir" value="docs" /> - <property name="build.dir" value="class" /> + <property name="build.dir.production" value="class/production" /> <property name="jarname" value="CrossfireEditor.jar" /> <property name="build.source.version" value="1.5" /> <property name="build.target.version" value="${build.source.version}" /> @@ -62,15 +62,15 @@ <!-- delete and recreate the build directory --> <target name="clean" description="deletes compiled classes." depends="init"> - <delete dir="${build.dir}" /> - <mkdir dir="${build.dir}" /> + <delete dir="${build.dir.production}" /> + <mkdir dir="${build.dir.production}" /> </target> <!-- compiling all Java classes --> <target name="compile" depends="init,clean,ctags" description="compiles source."> <javac srcdir = "${src.dir}:../src/app" - destdir = "${build.dir}" + destdir = "${build.dir.production}" encoding = "${build.source.encoding}" source = "${build.source.version}" target = "${build.target.version}" @@ -88,33 +88,33 @@ <!-- create JAR file --> <target name="jar" depends="compile" description="compiles source and creates jar."> <!-- extract classes from jar files into the build dir --> - <unjar src="${lib.dir}/jdom.jar" dest="${build.dir}" /> - <unjar src="${lib.dir}/crimson.jar" dest="${build.dir}" /> - <unjar src="${lib.dir}/bsh-core.jar" dest="${build.dir}" /> - <unjar src="${lib.dir}/bsh-commands.jar" dest="${build.dir}" /> - <unjar src="${lib.dir}/bsh-classgen.jar" dest="${build.dir}" /> - <unjar src="${lib.dir}/bsh-util.jar" dest="${build.dir}" /> - <unjar src="${lib.dir}/log4j.jar" dest="${build.dir}" /> - <delete dir="${build.dir}/META-INF" /> + <unjar src="${lib.dir}/jdom.jar" dest="${build.dir.production}" /> + <unjar src="${lib.dir}/crimson.jar" dest="${build.dir.production}" /> + <unjar src="${lib.dir}/bsh-core.jar" dest="${build.dir.production}" /> + <unjar src="${lib.dir}/bsh-commands.jar" dest="${build.dir.production}" /> + <unjar src="${lib.dir}/bsh-classgen.jar" dest="${build.dir.production}" /> + <unjar src="${lib.dir}/bsh-util.jar" dest="${build.dir.production}" /> + <unjar src="${lib.dir}/log4j.jar" dest="${build.dir.production}" /> + <delete dir="${build.dir.production}/META-INF" /> <!-- copy the resource files into the build dir --> - <copy todir="${build.dir}/${resource.dir}"> + <copy todir="${build.dir.production}/${resource.dir}"> <fileset dir="${resource.dir}"> <exclude name="**/.xvpics/**"/> </fileset> </copy> - <copy todir="${build.dir}"> + <copy todir="${build.dir.production}"> <fileset dir="../src/app" excludes="**/*.java,**/package.html,**/overview.html" /> </copy> - <move file="${build.dir}/${resource.dir}/icons" todir="${build.dir}" /> - <delete dir="${build.dir}/pickmaps" /> + <move file="${build.dir.production}/${resource.dir}/icons" todir="${build.dir.production}" /> + <delete dir="${build.dir.production}/pickmaps" /> <jar destfile = "${jarname}" index = "true" > <!-- pack everything into the jar file --> - <fileset dir="${build.dir}" excludes="MANIFEST.MF,test/**"/> + <fileset dir="${build.dir.production}" excludes="MANIFEST.MF,test/**"/> <fileset dir="${src.dir}" includes="**/*.properties" /> <fileset file="build.properties" /> <fileset file="../COPYING" /> @@ -133,7 +133,7 @@ </jar> <!-- delete the build directory --> - <delete dir="${build.dir}" /> + <delete dir="${build.dir.production}" /> </target> <!-- run the jar file with default memory (64 Mb on most systems) --> Modified: trunk/daimonin/build.xml =================================================================== --- trunk/daimonin/build.xml 2007-01-14 01:50:21 UTC (rev 1610) +++ trunk/daimonin/build.xml 2007-01-14 10:38:03 UTC (rev 1611) @@ -31,7 +31,7 @@ <property name="resource.dir" value="resource" /> <property name="arch.dir" value="../arch" /> <property name="config.dir" value="../arch/dev/editor/conf" /> - <property name="build.dir" value="class" /> + <property name="build.dir.production" value="class/production" /> <property name="jarname" value="DaimoninEditor.jar" /> <property name="build.source.version" value="1.5" /> <property name="build.target.version" value="${build.source.version}" /> @@ -64,15 +64,15 @@ <!-- delete and recreate the build directory --> <target name="clean" description="deletes compiled classes." depends="init"> - <delete dir="${build.dir}" /> - <mkdir dir="${build.dir}" /> + <delete dir="${build.dir.production}" /> + <mkdir dir="${build.dir.production}" /> </target> <!-- compiling all Java classes --> <target name="compile" depends="init,clean,ctags" description="compiles source."> <javac srcdir = "${src.dir}:../src/app" - destdir = "${build.dir}" + destdir = "${build.dir.production}" encoding = "${build.source.encoding}" source = "${build.source.version}" target = "${build.target.version}" @@ -89,10 +89,10 @@ <!-- create JAR file --> <target name="jar" depends="compile" description="compiles source and creates jar."> - <delete dir="${build.dir}/META-INF" /> + <delete dir="${build.dir.production}/META-INF" /> <!-- copy the resource files into the build dir --> - <copy todir="${build.dir}"> + <copy todir="${build.dir.production}"> <fileset dir="${resource.dir}"> <include name="icons/**/*.*"/> <include name="toolbarButtonGraphics/**/*.*"/> @@ -101,26 +101,26 @@ <exclude name="**/.xvpics/**"/> </fileset> </copy> - <copy todir="${build.dir}"> + <copy todir="${build.dir.production}"> <fileset dir="../src/app" excludes="**/*.java,**/package.html,**/overview.html" /> </copy> - <!--copy todir="${build.dir}"> + <!--copy todir="${build.dir.production}"> <fileset dir="${config.dir}" /> </copy--> - <copy todir="${build.dir}"> + <copy todir="${build.dir.production}"> <fileset dir="${src.dir}" includes="**/*.properties" /> </copy> - <!--copy file="${arch.dir}/archetypes" todir="${build.dir}" /--> - <!--copy file="${arch.dir}/daimonin.0" todir="${build.dir}" /--> - <!--copy file="${arch.dir}/treasures" todir="${build.dir}" /--> - <delete dir="${build.dir}/customize" /> + <!--copy file="${arch.dir}/archetypes" todir="${build.dir.production}" /--> + <!--copy file="${arch.dir}/daimonin.0" todir="${build.dir.production}" /--> + <!--copy file="${arch.dir}/treasures" todir="${build.dir.production}" /--> + <delete dir="${build.dir.production}/customize" /> <jar destfile = "${jarname}" index = "true" > <!-- pack everything into the jar file --> - <fileset dir="${build.dir}" excludes="MANIFEST.MF,test/**"/> + <fileset dir="${build.dir.production}" excludes="MANIFEST.MF,test/**"/> <fileset file="build.properties" /> <fileset file="../COPYING" /> <fileset dir="lib"> @@ -143,7 +143,7 @@ </jar> <!-- delete the build directory --> - <delete dir="${build.dir}" /> + <delete dir="${build.dir.production}" /> </target> <!-- run the jar file with default memory (64 Mb on most systems) --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-15 20:45:27
|
Revision: 1615 http://svn.sourceforge.net/gridarta/?rev=1615&view=rev Author: christianhujer Date: 2007-01-14 03:43:02 -0800 (Sun, 14 Jan 2007) Log Message: ----------- Merged AboutDialog. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainView.java trunk/daimonin/src/daieditor/CMainView.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/AboutDialog.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/gui/AboutDialog.java trunk/daimonin/src/daieditor/gui/AboutDialog.java Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2007-01-14 11:28:15 UTC (rev 1614) +++ trunk/crossfire/src/cfeditor/CMainView.java 2007-01-14 11:43:02 UTC (rev 1615) @@ -25,7 +25,6 @@ package cfeditor; import cfeditor.gameobject.GameObject; -import cfeditor.gui.AboutDialog; import cfeditor.gui.GameObjectAttributesPanel; import cfeditor.gui.InsertionObjectChooser; import cfeditor.gui.pickmapchooser.PickmapChooserControl; @@ -55,6 +54,7 @@ import javax.swing.JTabbedPane; import javax.swing.UIManager; import javax.swing.event.InternalFrameEvent; +import net.sf.gridarta.gui.AboutDialog; import net.sf.gridarta.gui.GSplitPane; import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.StatusBar; @@ -786,7 +786,7 @@ } /** The AboutDialog. */ - private final AboutDialog aboutDialog = new AboutDialog(); + private final AboutDialog aboutDialog = new AboutDialog("cfeditor"); /** Action method for about. */ public void about() { Deleted: trunk/crossfire/src/cfeditor/gui/AboutDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/AboutDialog.java 2007-01-14 11:28:15 UTC (rev 1614) +++ trunk/crossfire/src/cfeditor/gui/AboutDialog.java 2007-01-14 11:43:02 UTC (rev 1615) @@ -1,188 +0,0 @@ -/* - * Gridarta Map Editor. - * Copyright (C) 2007 The Gridarta Developers - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -package cfeditor.gui; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Font; -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; -import java.util.Properties; -import java.util.ResourceBundle; -import java.util.SortedSet; -import java.util.TreeSet; -import javax.swing.ImageIcon; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTabbedPane; -import javax.swing.JTextArea; -import javax.swing.SwingConstants; -import net.sf.japi.swing.ActionFactory; - -/** - * The AboutDialog displays information about the editor like properties, licenses and developers. - * TODO Refactor to use less memory - * TODO extract JAPI class - * TODO change ActionFactory - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @author Andreas Kirschbaum - */ -public class AboutDialog extends JPanel { - - /** Action Factory to create Actions. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); - - /** - * The main tabs. - */ - private final JTabbedPane tabs; - - /** - * The tabs in the license tab. - */ - private final JTabbedPane licensePane; - - /** Create an AboutDialog. */ - public AboutDialog() { - super(new BorderLayout()); - tabs = new JTabbedPane(); - tabs.add(buildAboutTab()); - licensePane = buildLicenseTab(); - tabs.add(licensePane); - tabs.add(buildRuntimePropertiesTab()); - add(tabs); - add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource(ACTION_FACTORY.getString("about.logo")))), BorderLayout.NORTH); - } - - /** - * Show about dialog. - * @param parent Parent component to show dialog on - */ - public void showAboutDialog(final Component parent) { - tabs.setSelectedIndex(0); - licensePane.setSelectedIndex(0); - JOptionPane.showMessageDialog(parent, this, ACTION_FACTORY.getString("about.title"), JOptionPane.PLAIN_MESSAGE); - } - - /** - * Build the about tab. - * @return component for about tab - */ - private static JComponent buildAboutTab() { - String buildNumber = "unknown"; - String buildDeveloper = "unknown"; - String buildTstamp = "unknown"; - try { - final ResourceBundle bundle = ResourceBundle.getBundle("build"); - buildDeveloper = bundle.getString("build.developer"); - buildNumber = bundle.getString("build.number"); - buildTstamp = bundle.getString("build.tstamp"); - } catch (final Exception e) { - /* ignore */ - } - final JLabel aboutTab = new JLabel(ACTION_FACTORY.format("about", System.getProperty("java.version"), buildNumber, buildDeveloper, buildTstamp), SwingConstants.CENTER); - aboutTab.setName(ACTION_FACTORY.getString("aboutTab.title")); - return aboutTab; - } - - /** - * Build the license tab. - * @return component for license tab - */ - private JTabbedPane buildLicenseTab() { - final JTabbedPane licensePane = new JTabbedPane(); - for (int i = 1; ACTION_FACTORY.getString("license." + i + ".title") != null; i++) { - licensePane.add(buildLicenseSubTab(String.valueOf(i))); - } - licensePane.setName(ACTION_FACTORY.getString("license.title")); - return licensePane; - } - - /** - * Build a XY license tab. - * @param number number of license - * @return component for XY license tab - */ - private JComponent buildLicenseSubTab(final String number) { - String licenseText; - try { - final Reader in = new InputStreamReader(new BufferedInputStream(getClass().getClassLoader().getResource(ACTION_FACTORY.getString("license." + number + ".file")).openStream())); - try { - final StringBuilder sb = new StringBuilder(); - final char[] buf = new char[4096]; - for (int bytesRead; (bytesRead = in.read(buf)) != -1; sb.append(buf, 0, bytesRead)) { - ; - } - licenseText = sb.toString(); - } finally { - in.close(); - } - } catch (final NullPointerException e) { - licenseText = ACTION_FACTORY.getString("license.missing"); - } catch (final IOException e) { - licenseText = ACTION_FACTORY.getString("license.missing"); - } - final JTextArea license = new JTextArea(licenseText, 16, 80); - license.setLineWrap(true); - license.setWrapStyleWord(true); - license.setEditable(false); - license.setFont(new Font("Monospaced", Font.PLAIN, license.getFont().getSize())); - final JScrollPane scroller = new JScrollPane(license); - scroller.setFocusable(true); - scroller.setName(ACTION_FACTORY.getString("license." + number + ".title")); - return scroller; - } - - /** - * Build the runtime properties tab. - * @return component for runtime properties tab - */ - private static JComponent buildRuntimePropertiesTab() { - final StringBuilder propertiesText = new StringBuilder(); - final SortedSet<String> keys = new TreeSet<String>(); - final Properties props = System.getProperties(); - for (final Object key : props.keySet()) { - if (key instanceof String) { - keys.add((String) key); - } - } - for (final String key : keys) { - propertiesText - .append(key) - .append('=') - .append(props.getProperty(key)) - .append('\n'); - } - final JTextArea properties = new JTextArea(propertiesText.toString(), 16, 77); - properties.setEditable(false); - properties.setFont(new Font("Monospaced", Font.PLAIN, properties.getFont().getSize())); - final JScrollPane scroller = new JScrollPane(properties); - scroller.setName(ACTION_FACTORY.getString("aboutRuntimeProperties.title")); - scroller.setFocusable(true); - return scroller; - } - -} // class AboutDialog Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2007-01-14 11:28:15 UTC (rev 1614) +++ trunk/daimonin/src/daieditor/CMainView.java 2007-01-14 11:43:02 UTC (rev 1615) @@ -25,7 +25,6 @@ package daieditor; import daieditor.gameobject.GameObject; -import daieditor.gui.AboutDialog; import daieditor.gui.GameObjectAttributesPanel; import daieditor.gui.InsertionObjectChooser; import daieditor.gui.pickmapchooser.PickmapChooserControl; @@ -56,6 +55,7 @@ import static javax.swing.JSplitPane.VERTICAL_SPLIT; import javax.swing.JTabbedPane; import javax.swing.event.InternalFrameEvent; +import net.sf.gridarta.gui.AboutDialog; import net.sf.gridarta.gui.GSplitPane; import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.StatusBar; @@ -697,7 +697,7 @@ } /** The AboutDialog. */ - private final AboutDialog aboutDialog = new AboutDialog(); + private final AboutDialog aboutDialog = new AboutDialog("daieditor"); /** Action method for about. */ public void about() { Deleted: trunk/daimonin/src/daieditor/gui/AboutDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/AboutDialog.java 2007-01-14 11:28:15 UTC (rev 1614) +++ trunk/daimonin/src/daieditor/gui/AboutDialog.java 2007-01-14 11:43:02 UTC (rev 1615) @@ -1,222 +0,0 @@ -/* - * Gridarta Map Editor. - * Copyright (C) 2007 The Gridarta Developers - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -package daieditor.gui; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Font; -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; -import java.util.Enumeration; -import java.util.Properties; -import java.util.ResourceBundle; -import java.util.SortedSet; -import java.util.TreeSet; -import javax.swing.ImageIcon; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTabbedPane; -import javax.swing.JTextArea; -import javax.swing.SwingConstants; -import net.sf.japi.swing.ActionFactory; - -/** - * The AboutDialog displays information about the editor like properties, licenses and developers. - * TODO Refactor to use less memory - * TODO extract JAPI class - * TODO change ActionFactory - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @author Andreas Kirschbaum - */ -public class AboutDialog extends JPanel { - - /** Action Factory to create Actions. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); - - /** - * The main tabs. - */ - private final JTabbedPane tabs; - - /** - * The tabs in the license tab. - */ - private final JTabbedPane licensePane; - - /** Create an AboutDialog. */ - public AboutDialog() { - super(new BorderLayout()); - tabs = new JTabbedPane(); - tabs.add(buildAboutTab()); - licensePane = buildLicenseTab(); - tabs.add(licensePane); - tabs.add(buildRuntimePropertiesTab()); - tabs.add(buildBuildPropertiesTab()); - add(tabs); - add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource(ACTION_FACTORY.getString("about.logo")))), BorderLayout.NORTH); - } - - /** - * Show about dialog. - * @param parent Parent component to show dialog on - */ - public void showAboutDialog(final Component parent) { - tabs.setSelectedIndex(0); - licensePane.setSelectedIndex(0); - JOptionPane.showMessageDialog(parent, this, ACTION_FACTORY.getString("about.title"), JOptionPane.PLAIN_MESSAGE); - } - - /** - * Build the about tab. - * @return component for about tab - */ - private static JComponent buildAboutTab() { - String buildNumber = "unknown"; - String buildDeveloper = "unknown"; - String buildTstamp = "unknown"; - try { - final ResourceBundle bundle = ResourceBundle.getBundle("build"); - buildDeveloper = bundle.getString("build.developer"); - buildNumber = bundle.getString("build.number"); - buildTstamp = bundle.getString("build.tstamp"); - } catch (final Exception e) { - /* ignore */ - } - final JLabel aboutTab = new JLabel(ACTION_FACTORY.format("about", System.getProperty("java.version"), buildNumber, buildDeveloper, buildTstamp), SwingConstants.CENTER); - aboutTab.setName(ACTION_FACTORY.getString("aboutTab.title")); - return aboutTab; - } - - /** - * Build the license tab. - * @return component for license tab - */ - private JTabbedPane buildLicenseTab() { - final JTabbedPane licensePane = new JTabbedPane(); - for (int i = 1; ACTION_FACTORY.getString("license." + i + ".title") != null; i++) { - licensePane.add(buildLicenseSubTab(String.valueOf(i))); - } - licensePane.setName(ACTION_FACTORY.getString("license.title")); - return licensePane; - } - - /** - * Build a XY license tab. - * @param number number of license - * @return component for XY license tab - */ - private JComponent buildLicenseSubTab(final String number) { - String licenseText; - try { - final Reader in = new InputStreamReader(new BufferedInputStream(getClass().getClassLoader().getResource(ACTION_FACTORY.getString("license." + number + ".file")).openStream())); - try { - final StringBuilder sb = new StringBuilder(); - final char[] buf = new char[4096]; - for (int bytesRead; (bytesRead = in.read(buf)) != -1; sb.append(buf, 0, bytesRead)) { - ; - } - licenseText = sb.toString(); - } finally { - in.close(); - } - } catch (final NullPointerException e) { - licenseText = ACTION_FACTORY.getString("license.missing"); - } catch (final IOException e) { - licenseText = ACTION_FACTORY.getString("license.missing"); - } - final JTextArea license = new JTextArea(licenseText, 16, 80); - license.setLineWrap(true); - license.setWrapStyleWord(true); - license.setEditable(false); - license.setFont(new Font("Monospaced", Font.PLAIN, license.getFont().getSize())); - final JScrollPane scroller = new JScrollPane(license); - scroller.setFocusable(true); - scroller.setName(ACTION_FACTORY.getString("license." + number + ".title")); - return scroller; - } - - /** - * Build the runtime properties tab. - * @return component for runtime properties tab - */ - private static JComponent buildRuntimePropertiesTab() { - final StringBuilder propertiesText = new StringBuilder(); - final SortedSet<String> keys = new TreeSet<String>(); - final Properties props = System.getProperties(); - for (final Object key : props.keySet()) { - if (key instanceof String) { - keys.add((String) key); - } - } - for (final String key : keys) { - propertiesText - .append(key) - .append('=') - .append(props.getProperty(key)) - .append('\n'); - } - final JTextArea properties = new JTextArea(propertiesText.toString(), 16, 77); - properties.setEditable(false); - properties.setFont(new Font("Monospaced", Font.PLAIN, properties.getFont().getSize())); - final JScrollPane scroller = new JScrollPane(properties); - scroller.setName(ACTION_FACTORY.getString("aboutRuntimeProperties.title")); - scroller.setFocusable(true); - return scroller; - } - - - /** - * Build the build properties tab. - * @return component for build properties tab - */ - private static JComponent buildBuildPropertiesTab() { - final StringBuilder propertiesText = new StringBuilder(); - final SortedSet<String> keys = new TreeSet<String>(); - try { - final ResourceBundle bundle = ResourceBundle.getBundle("build"); - for (final Enumeration<String> uKeys = bundle.getKeys(); uKeys.hasMoreElements(); keys.add(uKeys.nextElement())) { - ; - } - for (final String key : keys) { - propertiesText - .append(key) - .append('=') - .append(bundle.getString(key)) - .append('\n'); - } - } catch (final Exception e) { - propertiesText.append(e.toString()); - } - final JTextArea properties = new JTextArea(propertiesText.toString(), 16, 77); - properties.setEditable(false); - properties.setFont(new Font("Monospaced", Font.PLAIN, properties.getFont().getSize())); - final JScrollPane scroller = new JScrollPane(properties); - scroller.setName(ACTION_FACTORY.getString("aboutBuildProperties.title")); - scroller.setFocusable(true); - return scroller; - } - -} // class AboutDialog Added: trunk/src/app/net/sf/gridarta/gui/AboutDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/AboutDialog.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/AboutDialog.java 2007-01-14 11:43:02 UTC (rev 1615) @@ -0,0 +1,242 @@ +/* + * Gridarta Map Editor. + * Copyright (C) 2007 The Gridarta Developers + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +package net.sf.gridarta.gui; + +import javax.swing.JPanel; +import javax.swing.JTabbedPane; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.JComponent; +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Font; +import java.awt.Component; +import java.io.BufferedInputStream; +import java.io.Reader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.SortedSet; +import java.util.ResourceBundle; +import java.util.Properties; +import java.util.TreeSet; +import java.util.Enumeration; +import net.sf.japi.swing.ActionFactory; + +/** + * Class for constructing and showing About dialogs. + * It features: + * <ul> + * <li>logo</li> + * <li>about text - a descriptive text, maybe HTML, for instance to list the developers</li> + * <li>Showing the developer that built the software, the version, the date built</li> + * <li>All runtime properties</li> + * <li>All licenses the software uses</li> + * </ul> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @author Andreas Kirschbaum + * @todo move this class to JAPI + */ +public class AboutDialog extends JPanel { + + /** Action Factory to create Actions. */ + protected final ActionFactory actionFactory; + + /** + * The main tabs. + */ + private final JTabbedPane tabs; + + /** + * The tabs in the license tab. + */ + private final JTabbedPane licensePane; + + /** + * Create an AboutDialog. + * @param actionFactoryName name of the ActionFactory to use. + */ + public AboutDialog(final String actionFactoryName) { + super(new BorderLayout()); + actionFactory = ActionFactory.getFactory(actionFactoryName); + tabs = new JTabbedPane(); + licensePane = buildLicenseTab(); + add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource(actionFactory.getString("about.logo")))), BorderLayout.NORTH); + add(tabs); + addTab(buildAboutTab()); + addTab(licensePane); + addTab(buildRuntimePropertiesTab()); + // TODO: Change this to use another way of configuration + if (actionFactoryName.equals("daieditor")) { + addTab(buildBuildPropertiesTab()); + } + } + + /** + * Show about dialog. + * @param parent Parent component to show dialog on + */ + public void showAboutDialog(final Component parent) { + tabs.setSelectedIndex(0); + licensePane.setSelectedIndex(0); + JOptionPane.showMessageDialog(parent, this, actionFactory.getString("about.title"), JOptionPane.PLAIN_MESSAGE); + } + + /** + * Adds a tab. + * @param component Component to add as tab + */ + public void addTab(final Component component) { + tabs.add(component); + } + + /** + * Build the license tab. + * @return component for license tab + */ + private JTabbedPane buildLicenseTab() { + final JTabbedPane licensePane = new JTabbedPane(); + for (int i = 1; actionFactory.getString("license." + i + ".title") != null; i++) { + licensePane.add(buildLicenseSubTab(String.valueOf(i))); + } + licensePane.setName(actionFactory.getString("license.title")); + return licensePane; + } + + /** + * Build a XY license tab. + * @param number number of license + * @return component for XY license tab + */ + private JComponent buildLicenseSubTab(final String number) { + String licenseText; + try { + final Reader in = new InputStreamReader(new BufferedInputStream(getClass().getClassLoader().getResource(actionFactory.getString("license." + number + ".file")).openStream())); + try { + final StringBuilder sb = new StringBuilder(); + final char[] buf = new char[4096]; + for (int bytesRead; (bytesRead = in.read(buf)) != -1; sb.append(buf, 0, bytesRead)) { + ; + } + licenseText = sb.toString(); + } finally { + in.close(); + } + } catch (final NullPointerException e) { + licenseText = actionFactory.getString("license.missing"); + } catch (final IOException e) { + licenseText = actionFactory.getString("license.missing"); + } + final JTextArea license = new JTextArea(licenseText, 16, 80); + license.setLineWrap(true); + license.setWrapStyleWord(true); + license.setEditable(false); + license.setFont(new Font("Monospaced", Font.PLAIN, license.getFont().getSize())); + final JScrollPane scroller = new JScrollPane(license); + scroller.setFocusable(true); + scroller.setName(actionFactory.getString("license." + number + ".title")); + return scroller; + } + + /** + * Build the about tab. + * @return component for about tab + */ + private JComponent buildAboutTab() { + String buildNumber = "unknown"; + String buildDeveloper = "unknown"; + String buildTstamp = "unknown"; + try { + final ResourceBundle bundle = ResourceBundle.getBundle("build"); + buildDeveloper = bundle.getString("build.developer"); + buildNumber = bundle.getString("build.number"); + buildTstamp = bundle.getString("build.tstamp"); + } catch (final Exception e) { + /* ignore */ + } + final JLabel aboutTab = new JLabel(actionFactory.format("about", System.getProperty("java.version"), buildNumber, buildDeveloper, buildTstamp), SwingConstants.CENTER); + aboutTab.setName(actionFactory.getString("aboutTab.title")); + return aboutTab; + } + + /** + * Build the runtime properties tab. + * @return component for runtime properties tab + */ + private JComponent buildRuntimePropertiesTab() { + final StringBuilder propertiesText = new StringBuilder(); + final SortedSet<String> keys = new TreeSet<String>(); + final Properties props = System.getProperties(); + for (final Object key : props.keySet()) { + if (key instanceof String) { + keys.add((String) key); + } + } + for (final String key : keys) { + propertiesText + .append(key) + .append('=') + .append(props.getProperty(key)) + .append('\n'); + } + final JTextArea properties = new JTextArea(propertiesText.toString(), 16, 77); + properties.setEditable(false); + properties.setFont(new Font("Monospaced", Font.PLAIN, properties.getFont().getSize())); + final JScrollPane scroller = new JScrollPane(properties); + scroller.setName(actionFactory.getString("aboutRuntimeProperties.title")); + scroller.setFocusable(true); + return scroller; + } + + /** + * Build the build properties tab. + * @return component for build properties tab + */ + private JComponent buildBuildPropertiesTab() { + final StringBuilder propertiesText = new StringBuilder(); + final SortedSet<String> keys = new TreeSet<String>(); + try { + final ResourceBundle bundle = ResourceBundle.getBundle("build"); + for (final Enumeration<String> uKeys = bundle.getKeys(); uKeys.hasMoreElements(); keys.add(uKeys.nextElement())) { + ; + } + for (final String key : keys) { + propertiesText + .append(key) + .append('=') + .append(bundle.getString(key)) + .append('\n'); + } + } catch (final Exception e) { + propertiesText.append(e.toString()); + } + final JTextArea properties = new JTextArea(propertiesText.toString(), 16, 77); + properties.setEditable(false); + properties.setFont(new Font("Monospaced", Font.PLAIN, properties.getFont().getSize())); + final JScrollPane scroller = new JScrollPane(properties); + scroller.setName(actionFactory.getString("aboutBuildProperties.title")); + scroller.setFocusable(true); + return scroller; + } + +} // class AboutDialog Property changes on: trunk/src/app/net/sf/gridarta/gui/AboutDialog.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-15 20:57:04
|
Revision: 1617 http://svn.sourceforge.net/gridarta/?rev=1617&view=rev Author: christianhujer Date: 2007-01-14 15:36:41 -0800 (Sun, 14 Jan 2007) Log Message: ----------- Replaced Gridarta about dialog with that of JAPI. Modified Paths: -------------- trunk/crossfire/crossfire.iml trunk/crossfire/src/cfeditor/CMainView.java trunk/daimonin/daimonin.iml trunk/daimonin/src/daieditor/CMainView.java trunk/gridarta.iml trunk/gridarta.ipr Added Paths: ----------- trunk/lib/japi-lib-swing-about-0.1.jar Removed Paths: ------------- trunk/src/app/net/sf/gridarta/gui/AboutDialog.java Modified: trunk/crossfire/crossfire.iml =================================================================== --- trunk/crossfire/crossfire.iml 2007-01-14 12:00:50 UTC (rev 1616) +++ trunk/crossfire/crossfire.iml 2007-01-14 23:36:41 UTC (rev 1617) @@ -70,6 +70,7 @@ <orderEntry type="library" name="japi-lib-swing-misc-0.1" level="project" /> <orderEntry type="library" name="japi-lib-swing-prefs-0.1" level="project" /> <orderEntry type="library" name="japi-lib-swing-extlib-0.1" level="project" /> + <orderEntry type="library" name="japi-lib-swing-about-0.1" level="project" /> <orderEntryProperties /> </component> <component name="copyright"> Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2007-01-14 12:00:50 UTC (rev 1616) +++ trunk/crossfire/src/cfeditor/CMainView.java 2007-01-14 23:36:41 UTC (rev 1617) @@ -54,13 +54,13 @@ import javax.swing.JTabbedPane; import javax.swing.UIManager; import javax.swing.event.InternalFrameEvent; -import net.sf.gridarta.gui.AboutDialog; import net.sf.gridarta.gui.GSplitPane; import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.StatusBar; import net.sf.gridarta.help.Help; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.ToggleAction; +import net.sf.japi.swing.about.AboutDialog; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Modified: trunk/daimonin/daimonin.iml =================================================================== --- trunk/daimonin/daimonin.iml 2007-01-14 12:00:50 UTC (rev 1616) +++ trunk/daimonin/daimonin.iml 2007-01-14 23:36:41 UTC (rev 1617) @@ -34,6 +34,7 @@ <orderEntry type="library" name="japi-lib-swing-prefs-0.1" level="project" /> <orderEntry type="library" name="japi-lib-swing-tod-0.1" level="project" /> <orderEntry type="library" name="japi-lib-swing-extlib-0.1" level="project" /> + <orderEntry type="library" name="japi-lib-swing-about-0.1" level="project" /> <orderEntryProperties /> </component> <component name="copyright"> Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2007-01-14 12:00:50 UTC (rev 1616) +++ trunk/daimonin/src/daieditor/CMainView.java 2007-01-14 23:36:41 UTC (rev 1617) @@ -55,12 +55,12 @@ import static javax.swing.JSplitPane.VERTICAL_SPLIT; import javax.swing.JTabbedPane; import javax.swing.event.InternalFrameEvent; -import net.sf.gridarta.gui.AboutDialog; import net.sf.gridarta.gui.GSplitPane; import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.StatusBar; import net.sf.gridarta.help.Help; import net.sf.japi.swing.ActionFactory; +import net.sf.japi.swing.about.AboutDialog; import net.sf.japi.util.ThrowableHandler; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; Modified: trunk/gridarta.iml =================================================================== --- trunk/gridarta.iml 2007-01-14 12:00:50 UTC (rev 1616) +++ trunk/gridarta.iml 2007-01-14 23:36:41 UTC (rev 1617) @@ -26,6 +26,7 @@ <orderEntry type="library" name="japi-lib-swing-misc-0.1" level="project" /> <orderEntry type="library" name="japi-lib-swing-prefs-0.1" level="project" /> <orderEntry type="library" name="japi-lib-swing-extlib-0.1" level="project" /> + <orderEntry type="library" name="japi-lib-swing-about-0.1" level="project" /> <orderEntryProperties /> </component> <component name="copyright"> Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2007-01-14 12:00:50 UTC (rev 1616) +++ trunk/gridarta.ipr 2007-01-14 23:36:41 UTC (rev 1617) @@ -2274,6 +2274,13 @@ <JAVADOC /> <SOURCES /> </library> + <library name="japi-lib-swing-about-0.1"> + <CLASSES> + <root url="jar://$PROJECT_DIR$/lib/japi-lib-swing-about-0.1.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> </component> <component name="org.tmatesoft.tmate.projectComponent" /> <component name="uidesigner-configuration"> Added: trunk/lib/japi-lib-swing-about-0.1.jar =================================================================== (Binary files differ) Property changes on: trunk/lib/japi-lib-swing-about-0.1.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/src/app/net/sf/gridarta/gui/AboutDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/AboutDialog.java 2007-01-14 12:00:50 UTC (rev 1616) +++ trunk/src/app/net/sf/gridarta/gui/AboutDialog.java 2007-01-14 23:36:41 UTC (rev 1617) @@ -1,298 +0,0 @@ -/* - * Gridarta Map Editor. - * Copyright (C) 2007 The Gridarta Developers - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -package net.sf.gridarta.gui; - -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Font; -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; -import java.util.Enumeration; -import java.util.Properties; -import java.util.ResourceBundle; -import java.util.SortedSet; -import java.util.TreeSet; -import javax.swing.ImageIcon; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTabbedPane; -import javax.swing.JTextArea; -import javax.swing.SwingConstants; -import net.sf.japi.swing.ActionFactory; -import org.jetbrains.annotations.Nullable; - -/** - * Class for constructing and showing About dialogs. - * It features: - * <ul> - * <li>logo</li> - * <li>about text - a descriptive text, maybe HTML, for instance to list the developers</li> - * <li>Showing the developer that built the software, the version, the date built</li> - * <li>All runtime properties</li> - * <li>All licenses the software uses</li> - * </ul> - * It requires the following properties to be available in the named ActionFactory: - * <ul> - * <li><code>about.logo</code> specifies the logo to display (optional)</li> - * <li><code>about.title</code> specifies the title for the about dialog (required)</li> - * <li><code>aboutTab.title</code> specifies the title for the about tab (required)</li> - * <li> - * <code>about</code> specifies the format string for the about text in the about tab. - * It takes the following parameters: - * <ol> - * <li>The runtime's Java Version</li> - * <li>The build number</li> - * <li>The build developer</li> - * <li>The build timestamp</li> - * </ol> - * (See information on the build for how to specify the build information) - * </li> - * <li> - * Licenses: - * <ul> - * <li><code>license.title</code> specifies the title for the tab that displays the licenses (required)</li> - * <li><code>license.<var>n</var>.title</code> specifies the title for license <var>n</var></li> - * <li><code>license.<var>n</var>.file</code> specifies the file for license <var>n</var></li> - * <li><code>license.missing</code> specifies the text that should be displayed if a license text couldn't be loaded (required)</li> - * <li><var>n</var> starts with 1 and must be ascending without skips.</li> - * </ul> - * </li> - * <li><code>aboutBuildProperties.title</code> specifies the title for the build properties tab (optional - only required if the build properties tab is used)</li> - * <li><code>aboutRuntimeProperties.title</code> specifies the title for the runtime properties tab (required)</li> - * </ul> - * The information on the build is specified by: - * <ul> - * <li> - * A ResourceBundle <code>build</code> (optional, e.g. <code>build.properties</code> toplevel on classpath) - * <ul> - * <li><code>build.developer</code> The developer that made the build (optional)</li> - * <li><code>build.number</code> The build number, e.g. incremented by Ant or the Subversion revision (optional)</li> - * <li><code>build.tstamp</code> The timestamp when the build was made (optional)</li> - * </ul> - * </li> - * </ul> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @author Andreas Kirschbaum - * @todo move this class to JAPI - */ -public class AboutDialog extends JPanel { - - /** Action Factory to create Actions. */ - protected final ActionFactory actionFactory; - - /** - * The main tabs. - */ - private final JTabbedPane tabs; - - /** - * The tabs in the license tab. - */ - private final JTabbedPane licensePane; - - /** - * Create an AboutDialog. - * @param actionFactoryName name of the ActionFactory to use. - */ - public AboutDialog(final String actionFactoryName) { - super(new BorderLayout()); - actionFactory = ActionFactory.getFactory(actionFactoryName); - tabs = new JTabbedPane(); - licensePane = buildLicenseTab(); - @Nullable final String logoURL = actionFactory.getString("about.logo"); - if (logoURL != null) { - add(new JLabel(new ImageIcon(getClass().getClassLoader().getResource(logoURL))), BorderLayout.NORTH); - } - add(tabs); - addTab(buildAboutTab()); - addTab(licensePane); - addTab(buildRuntimePropertiesTab()); - // TODO: Change this to use another way of configuration - if (actionFactoryName.equals("daieditor")) { - addTab(buildBuildPropertiesTab()); - } - } - - /** - * Show about dialog. - * @param parent Parent component to show dialog on - */ - public void showAboutDialog(final Component parent) { - tabs.setSelectedIndex(0); - licensePane.setSelectedIndex(0); - JOptionPane.showMessageDialog(parent, this, actionFactory.getString("about.title"), JOptionPane.PLAIN_MESSAGE); - } - - /** - * Adds a tab. - * @param component Component to add as tab - */ - public void addTab(final Component component) { - tabs.add(component); - } - - /** - * Build the license tab. - * @return component for license tab - */ - private JTabbedPane buildLicenseTab() { - final JTabbedPane licensePane = new JTabbedPane(); - for (int i = 1; actionFactory.getString("license." + i + ".title") != null; i++) { - licensePane.add(buildLicenseSubTab(String.valueOf(i))); - } - licensePane.setName(actionFactory.getString("license.title")); - return licensePane; - } - - /** - * Build a XY license tab. - * @param number number of license - * @return component for XY license tab - */ - private JComponent buildLicenseSubTab(final String number) { - String licenseText; - try { - final Reader in = new InputStreamReader(new BufferedInputStream(getClass().getClassLoader().getResource(actionFactory.getString("license." + number + ".file")).openStream())); - try { - final StringBuilder sb = new StringBuilder(); - final char[] buf = new char[4096]; - for (int bytesRead; (bytesRead = in.read(buf)) != -1; sb.append(buf, 0, bytesRead)) { - ; - } - licenseText = sb.toString(); - } finally { - in.close(); - } - } catch (final NullPointerException e) { - licenseText = actionFactory.getString("license.missing"); - } catch (final IOException e) { - licenseText = actionFactory.getString("license.missing"); - } - final JTextArea license = new JTextArea(licenseText, 16, 80); - license.setLineWrap(true); - license.setWrapStyleWord(true); - license.setEditable(false); - license.setFont(new Font("Monospaced", Font.PLAIN, license.getFont().getSize())); - final JScrollPane scroller = new JScrollPane(license); - scroller.setFocusable(true); - scroller.setName(actionFactory.getString("license." + number + ".title")); - return scroller; - } - - /** - * Build the about tab. - * @return component for about tab - */ - private JComponent buildAboutTab() { - String buildNumber = "unknown"; - String buildDeveloper = "unknown"; - String buildTstamp = "unknown"; - try { - final ResourceBundle bundle = ResourceBundle.getBundle("build"); - try { - buildDeveloper = bundle.getString("build.developer"); - } catch (final Exception e) { - /* ignore */ - } - try { - buildNumber = bundle.getString("build.number"); - } catch (final Exception e) { - /* ignore */ - } - try { - buildTstamp = bundle.getString("build.tstamp"); - } catch (final Exception e) { - /* ignore */ - } - } catch (final Exception e) { - /* ignore */ - } - final JLabel aboutTab = new JLabel(actionFactory.format("about", System.getProperty("java.version"), buildNumber, buildDeveloper, buildTstamp), SwingConstants.CENTER); - aboutTab.setName(actionFactory.getString("aboutTab.title")); - return aboutTab; - } - - /** - * Build the runtime properties tab. - * @return component for runtime properties tab - */ - private JComponent buildRuntimePropertiesTab() { - final StringBuilder propertiesText = new StringBuilder(); - final SortedSet<String> keys = new TreeSet<String>(); - final Properties props = System.getProperties(); - for (final Object key : props.keySet()) { - if (key instanceof String) { - keys.add((String) key); - } - } - for (final String key : keys) { - propertiesText - .append(key) - .append('=') - .append(props.getProperty(key)) - .append('\n'); - } - final JTextArea properties = new JTextArea(propertiesText.toString(), 16, 77); - properties.setEditable(false); - properties.setFont(new Font("Monospaced", Font.PLAIN, properties.getFont().getSize())); - final JScrollPane scroller = new JScrollPane(properties); - scroller.setName(actionFactory.getString("aboutRuntimeProperties.title")); - scroller.setFocusable(true); - return scroller; - } - - /** - * Build the build properties tab. - * @return component for build properties tab - */ - private JComponent buildBuildPropertiesTab() { - final StringBuilder propertiesText = new StringBuilder(); - final SortedSet<String> keys = new TreeSet<String>(); - try { - final ResourceBundle bundle = ResourceBundle.getBundle("build"); - for (final Enumeration<String> uKeys = bundle.getKeys(); uKeys.hasMoreElements(); keys.add(uKeys.nextElement())) { - ; - } - for (final String key : keys) { - propertiesText - .append(key) - .append('=') - .append(bundle.getString(key)) - .append('\n'); - } - } catch (final Exception e) { - propertiesText.append(e.toString()); - } - final JTextArea properties = new JTextArea(propertiesText.toString(), 16, 77); - properties.setEditable(false); - properties.setFont(new Font("Monospaced", Font.PLAIN, properties.getFont().getSize())); - final JScrollPane scroller = new JScrollPane(properties); - scroller.setName(actionFactory.getString("aboutBuildProperties.title")); - scroller.setFocusable(true); - return scroller; - } - -} // class AboutDialog This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-15 21:33:46
|
Revision: 1609 http://svn.sourceforge.net/gridarta/?rev=1609&view=rev Author: christianhujer Date: 2007-01-13 17:48:05 -0800 (Sat, 13 Jan 2007) Log Message: ----------- Fixed some minor code style and javadoc issues. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java trunk/src/app/net/sf/gridarta/gameobject/scripts/UndefinedEventArchetypeException.java trunk/src/app/net/sf/gridarta/gui/StatusBar.java trunk/src/app/net/sf/gridarta/map/MapControl.java Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-01-14 01:20:10 UTC (rev 1608) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-01-14 01:48:05 UTC (rev 1609) @@ -372,7 +372,7 @@ * @param mapControl MapControl of the active map we paste on * @param startX starting x-coord for floodfill * @param startY starting y-coord for floodfill - * @param arch GameObject to fill with + * @param archList List of GameObjects to fill with */ private void floodfill(final MapControl mapControl, final int startX, final int startY, final List<GameObject> archList) { final GameObject gameObject = archList.get(MainControl.rnd.nextInt(archList.size())); Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-14 01:20:10 UTC (rev 1608) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-14 01:48:05 UTC (rev 1609) @@ -82,6 +82,7 @@ * @param pluginName name of the plugin * @param scriptPath path to the file for this event * @param options options for this event + * @throws UndefinedEventArchetypeException In case there is no Archetype to create a ScriptedEvent. */ ScriptedEvent(final int eventType, final String pluginName, final String scriptPath, final String options) throws UndefinedEventArchetypeException { event = newEventGameObject(eventType); Modified: trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java 2007-01-14 01:20:10 UTC (rev 1608) +++ trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java 2007-01-14 01:48:05 UTC (rev 1609) @@ -26,7 +26,6 @@ import cfeditor.CMainControl; import cfeditor.gameobject.GameObject; -import cfeditor.gui.MapView; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; import java.awt.FlowLayout; Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java 2007-01-14 01:20:10 UTC (rev 1608) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java 2007-01-14 01:48:05 UTC (rev 1609) @@ -34,7 +34,7 @@ * The class <code>Actions</code> encapsulates functionality related to actions * used by the pickmap chooser. * - * @Author Andreas Kirschbaum + * @author Andreas Kirschbaum */ public class Actions { @@ -323,7 +323,7 @@ /** * Set whether all pickmaps are locked. * - * @param lockAddPickmaps <code>true</code> if all pickmaps are locked + * @param lockAllPickmaps <code>true</code> if all pickmaps are locked */ public void setLockAllPickmaps(final boolean lockAllPickmaps) { if (this.lockAllPickmaps == lockAllPickmaps) { Modified: trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java 2007-01-14 01:20:10 UTC (rev 1608) +++ trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java 2007-01-14 01:48:05 UTC (rev 1609) @@ -80,6 +80,7 @@ * @param pluginName name of the plugin * @param scriptPath path to the file for this event * @param options options for this event + * @throws UndefinedEventArchetypeException In case there is no Archetype to create a ScriptedEvent. */ ScriptedEvent(final int eventType, final String pluginName, final String scriptPath, final String options) throws UndefinedEventArchetypeException { event = newEventGameObject(eventType); @@ -111,7 +112,6 @@ scriptPath = scriptPath.replace('\\', '/'); // just make sure there are only slashes: '/' setEventData(pluginName, scriptPath, options); - return true; } Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java 2007-01-14 01:20:10 UTC (rev 1608) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java 2007-01-14 01:48:05 UTC (rev 1609) @@ -35,7 +35,7 @@ * The class <code>Actions</code> encapsulates functionality related to actions * used by the pickmap chooser. * - * @Author Andreas Kirschbaum + * @author Andreas Kirschbaum */ public class Actions { @@ -332,7 +332,7 @@ /** * Set whether all pickmaps are locked. * - * @param lockAddPickmaps <code>true</code> if all pickmaps are locked + * @param lockAllPickmaps <code>true</code> if all pickmaps are locked */ public void setLockAllPickmaps(final boolean lockAllPickmaps) { if (this.lockAllPickmaps == lockAllPickmaps) { Modified: trunk/src/app/net/sf/gridarta/gameobject/scripts/UndefinedEventArchetypeException.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/scripts/UndefinedEventArchetypeException.java 2007-01-14 01:20:10 UTC (rev 1608) +++ trunk/src/app/net/sf/gridarta/gameobject/scripts/UndefinedEventArchetypeException.java 2007-01-14 01:48:05 UTC (rev 1609) @@ -38,7 +38,7 @@ * * @param msg the exception message */ - public UndefinedEventArchetypeException(@NotNull final String msg) { + protected UndefinedEventArchetypeException(@NotNull final String msg) { super(msg); } Modified: trunk/src/app/net/sf/gridarta/gui/StatusBar.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/StatusBar.java 2007-01-14 01:20:10 UTC (rev 1608) +++ trunk/src/app/net/sf/gridarta/gui/StatusBar.java 2007-01-14 01:48:05 UTC (rev 1609) @@ -85,7 +85,7 @@ private final Point mouseMapTmp = new Point(); /** - * The map control for which {@link mapCursorListener} is registered, or + * The map control for which {@link #mapCursorListener} is registered, or * <code>null</code> if none is registered. */ @Nullable private MapControl mapControl = null; Modified: trunk/src/app/net/sf/gridarta/map/MapControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapControl.java 2007-01-14 01:20:10 UTC (rev 1608) +++ trunk/src/app/net/sf/gridarta/map/MapControl.java 2007-01-14 01:48:05 UTC (rev 1609) @@ -99,7 +99,7 @@ /** * Set the map fileName. - * @param fileName new map fileName + * @param mapFileName new map fileName */ void setMapFileName(@NotNull String mapFileName); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-15 22:01:28
|
Revision: 1604 http://svn.sourceforge.net/gridarta/?rev=1604&view=rev Author: akirschbaum Date: 2007-01-13 16:21:36 -0800 (Sat, 13 Jan 2007) Log Message: ----------- Unify comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-14 00:19:46 UTC (rev 1603) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-14 00:21:36 UTC (rev 1604) @@ -236,7 +236,6 @@ setOptions(newOptions); // unlike the above two, event options can be empty } - // GET/SET methods /** * Return the underlying event game object. * Modified: trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java 2007-01-14 00:19:46 UTC (rev 1603) +++ trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java 2007-01-14 00:21:36 UTC (rev 1604) @@ -237,7 +237,11 @@ } } - // GET/SET methods + /** + * Return the underlying event game object. + * + * @return the underlynig event game object + */ public GameObject getEventArch() { return event; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-15 22:03:46
|
Revision: 1601 http://svn.sourceforge.net/gridarta/?rev=1601&view=rev Author: akirschbaum Date: 2007-01-13 16:10:03 -0800 (Sat, 13 Jan 2007) Log Message: ----------- In map window title, use map-directory-relative map path if possible. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/MapViewIFrame.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/daimonin/src/daieditor/MapViewIFrame.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/src/app/net/sf/gridarta/io/PathManager.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-01-13 23:53:55 UTC (rev 1600) +++ trunk/crossfire/ChangeLog 2007-01-14 00:10:03 UTC (rev 1601) @@ -1,5 +1,8 @@ 2007-01-13 Andreas Kirschbaum + * In map window title, use map-directory-relative map path if + possible. + * Allow selection of tail parts in pickmaps. * Rename application to "CrossfireEditor.jar". Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-13 23:53:55 UTC (rev 1600) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-14 00:10:03 UTC (rev 1601) @@ -40,6 +40,7 @@ import static javax.swing.KeyStroke.getKeyStroke; import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.gridarta.gui.map.MapGridListener; +import net.sf.gridarta.io.PathManager; import net.sf.gridarta.map.MapControlListener; import net.sf.gridarta.map.MapModelEvent; import net.sf.gridarta.map.MapModelListener; @@ -128,7 +129,7 @@ */ public MapViewIFrame(final CMainControl mainControl, final MapControl mapControl, final Point initial) { // set title - super(mapControl.getMapFileName() + " [ " + mapControl.getMapArchObject().getMapDisplayName() + " ]" + (mapControl.isModified() ? " *" : ""), true, true, true, true); + super(PathManager.getMapPath(mapControl.getMapFileName()) + " [ " + mapControl.getMapArchObject().getMapDisplayName() + " ]" + (mapControl.isModified() ? " *" : ""), true, true, true, true); this.mapControl = mapControl; this.mainControl = mainControl; @@ -164,7 +165,7 @@ /** Update the Map-Window Title (according to name and changeFlag). */ private void updateTitle() { - setTitle(mapControl.getMapFileName() + " [ " + mapControl.getMapArchObject().getMapDisplayName() + " ]" + (mapControl.isModified() ? " *" : "")); + setTitle(PathManager.getMapPath(mapControl.getMapFileName()) + " [ " + mapControl.getMapArchObject().getMapDisplayName() + " ]" + (mapControl.isModified() ? " *" : "")); // disable menu file->revert to revert the map // XXX: should not be here Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-13 23:53:55 UTC (rev 1600) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-14 00:10:03 UTC (rev 1601) @@ -268,12 +268,6 @@ this.mapFileName = mapFileName; fireMapFileNameChanged(); - - if (mapViewFrame != null) { - final String title = mapFileName + " [ " + mapModel.getMapArchObject().getMapName() + " ]"; - assert mapViewFrame != null; - mapViewFrame.setTitle(title); - } } public boolean containsArchObject(final Point pos) { Modified: trunk/daimonin/src/daieditor/MapViewIFrame.java =================================================================== --- trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-01-13 23:53:55 UTC (rev 1600) +++ trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-01-14 00:10:03 UTC (rev 1601) @@ -41,6 +41,7 @@ import static javax.swing.KeyStroke.getKeyStroke; import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.gridarta.gui.map.MapGridListener; +import net.sf.gridarta.io.PathManager; import net.sf.gridarta.map.MapControlListener; import net.sf.gridarta.map.MapModelEvent; import net.sf.gridarta.map.MapModelListener; @@ -128,7 +129,7 @@ */ public MapViewIFrame(final CMainControl mainControl, final MapControl mapControl, final int number) { // set title - super(mapControl.getMapFileName() + " [ " + mapControl.getMapArchObject().getMapDisplayName() + " ] (" + number + ')', true, true, true, true); + super(PathManager.getMapPath(mapControl.getMapFileName()) + " [ " + mapControl.getMapArchObject().getMapDisplayName() + " ] (" + number + ')', true, true, true, true); this.mapControl = mapControl; this.mainControl = mainControl; this.number = number; @@ -168,7 +169,7 @@ /** Update the Map-Window Title (according to name and changeFlag). */ private void updateTitle() { - setTitle(mapControl.getMapFileName() + " [ " + mapControl.getMapArchObject().getMapDisplayName() + " ] (" + number + ")" + (mapControl.isModified() ? " *" : "")); + setTitle(PathManager.getMapPath(mapControl.getMapFileName()) + " [ " + mapControl.getMapArchObject().getMapDisplayName() + " ] (" + number + ")" + (mapControl.isModified() ? " *" : "")); // disable menu file->revert to revert the map // XXX: should not be here Modified: trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java 2007-01-13 23:53:55 UTC (rev 1600) +++ trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java 2007-01-14 00:10:03 UTC (rev 1601) @@ -251,11 +251,7 @@ } defScriptName += "Script.lua"; - try { - return PathManager.getMapPath(new File(getLocalMapDir(), defScriptName).getPath()); - } catch (final IOException e) { - return defScriptName; - } + return PathManager.getMapPath(new File(getLocalMapDir(), defScriptName).getPath()); } /** Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-13 23:53:55 UTC (rev 1600) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-14 00:10:03 UTC (rev 1601) @@ -274,12 +274,6 @@ this.mapFileName = mapFileName; fireMapFileNameChanged(); - - if (mapViewFrame != null) { - final String title = mapFileName + " [ " + mapModel.getMapArchObject().getMapDisplayName() + " ]"; - assert mapViewFrame != null; - mapViewFrame.setTitle(title); - } } /** Modified: trunk/src/app/net/sf/gridarta/io/PathManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/io/PathManager.java 2007-01-13 23:53:55 UTC (rev 1600) +++ trunk/src/app/net/sf/gridarta/io/PathManager.java 2007-01-14 00:10:03 UTC (rev 1601) @@ -78,9 +78,8 @@ * Replaces all occurences of '\' with '/' and removes the path to the map directory (absolute, relative or canonical) from the path. * @param path to create map path from * @return fixed path - * @throws IOException In case of problems converting / creating the map path. */ - public static String getMapPath(final String path) throws IOException { + public static String getMapPath(final String path) { final String mapDirName = mainControl.getMapDefaultFolder(); String mapPath = path.replace('\\', '/'); if (mapPath.startsWith(mapDirName)) { @@ -89,8 +88,12 @@ if (mapPath.startsWith(new File(mapDirName).getAbsolutePath())) { mapPath = mapPath.substring(new File(mapDirName).getAbsolutePath().length()); } - if (mapPath.startsWith(new File(mapDirName).getCanonicalPath())) { - mapPath = mapPath.substring(new File(mapDirName).getCanonicalPath().length()); + try { + if (mapPath.startsWith(new File(mapDirName).getCanonicalPath())) { + mapPath = mapPath.substring(new File(mapDirName).getCanonicalPath().length()); + } + } catch (final IOException ex) { + // ignore } mapPath = mapPath.replace('\\', '/'); return mapPath; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-20 00:04:26
|
Revision: 1623 http://svn.sourceforge.net/gridarta/?rev=1623&view=rev Author: christianhujer Date: 2007-01-19 16:04:25 -0800 (Fri, 19 Jan 2007) Log Message: ----------- Fixed about dialog title being 'null'. Modified Paths: -------------- trunk/crossfire/src/cfeditor/messages.properties trunk/crossfire/src/cfeditor/messages_de.properties trunk/crossfire/src/cfeditor/messages_fr.properties trunk/crossfire/src/cfeditor/messages_sv.properties trunk/daimonin/src/daieditor/messages.properties Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2007-01-19 23:59:08 UTC (rev 1622) +++ trunk/crossfire/src/cfeditor/messages.properties 2007-01-20 00:04:25 UTC (rev 1623) @@ -1,6 +1,7 @@ # Warning: This file MUST be ISO-8859-1 # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding +application.name=Gridarta for Crossfire mainWindow.title=Gridarta for Crossfire # Supported image set. The values must match the image file names: Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2007-01-19 23:59:08 UTC (rev 1622) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2007-01-20 00:04:25 UTC (rev 1623) @@ -1,7 +1,8 @@ # Warning: This file MUST be ISO-8859-1 # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding -mainWindow.title=Gridarta for Crossfire +application.name=Gridarta f\xFCr Crossfire +mainWindow.title=Gridarta f\xFCr Crossfire # Dialogs overwriteOtherFile.title=Datei \xFCberschreiben? Modified: trunk/crossfire/src/cfeditor/messages_fr.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_fr.properties 2007-01-19 23:59:08 UTC (rev 1622) +++ trunk/crossfire/src/cfeditor/messages_fr.properties 2007-01-20 00:04:25 UTC (rev 1623) @@ -2,6 +2,7 @@ # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding # Translation done by Marmoth +application.name=Gridarta for Crossfire mainWindow.title=Gridarta for Crossfire # Dialogs Modified: trunk/crossfire/src/cfeditor/messages_sv.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_sv.properties 2007-01-19 23:59:08 UTC (rev 1622) +++ trunk/crossfire/src/cfeditor/messages_sv.properties 2007-01-20 00:04:25 UTC (rev 1623) @@ -1,6 +1,7 @@ # Warning: This file MUST be ISO-8859-1 # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding +application.name=Gridarta for Crossfire mainWindow.title=Gridarta for Crossfire # Dialogs Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2007-01-19 23:59:08 UTC (rev 1622) +++ trunk/daimonin/src/daieditor/messages.properties 2007-01-20 00:04:25 UTC (rev 1623) @@ -1,6 +1,7 @@ # Warning: This file MUST be ISO-8859-1 # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding +application.name=Gridarta for Daimonin mainWindow.title=Gridarta for Daimonin {0} # Zoom This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-20 08:35:17
|
Revision: 1624 http://svn.sourceforge.net/gridarta/?rev=1624&view=rev Author: akirschbaum Date: 2007-01-20 00:35:17 -0800 (Sat, 20 Jan 2007) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/daimonin/src/daieditor/map/MapControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-20 00:04:25 UTC (rev 1623) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-20 08:35:17 UTC (rev 1624) @@ -591,10 +591,6 @@ mainView.showArchPanelQuickObject(gameObject); } - public GameObject getMapArch(final GameObject gameObject, final Point pos) { - return currentMap.getMapArch(gameObject, pos); - } - /** * Returns the main view. * @return the main view Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-20 00:04:25 UTC (rev 1623) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-20 08:35:17 UTC (rev 1624) @@ -229,10 +229,6 @@ getMapGrid().selectAll(); } - public GameObject getMapArch(final GameObject gameObject, final Point pos) { - return mapModel.getMapArch(gameObject, pos); - } - /** * Repaints the view. */ Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-20 00:04:25 UTC (rev 1623) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-20 08:35:17 UTC (rev 1624) @@ -567,9 +567,8 @@ /** * Create a new view of this level. - * @return the created view */ - public MapViewIFrame createView() { + public void createView() { mapViewFrame = new MapViewIFrame(mainControl, this, ++viewCounter); mapViewIFrames.add(mapViewFrame); if (!isPickmap) { @@ -577,8 +576,6 @@ assert mapViewFrame != null; mapViewFrame.setAutoscrolls(true); } - assert mapViewFrame != null; - return mapViewFrame; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-20 14:54:18
|
Revision: 1630 http://svn.sourceforge.net/gridarta/?rev=1630&view=rev Author: christianhujer Date: 2007-01-20 06:54:18 -0800 (Sat, 20 Jan 2007) Log Message: ----------- Fixed problem with tip of the days in debuggers. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/SplashScreen.java trunk/lib/japi-lib-swing-tod-0.1.jar Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-01-20 14:47:48 UTC (rev 1629) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-01-20 14:54:18 UTC (rev 1630) @@ -117,9 +117,9 @@ import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.ActionMethod; -import net.sf.japi.swing.TipOfTheDayManager; import net.sf.japi.swing.prefs.PreferencesGroup; import static net.sf.japi.swing.prefs.PreferencesPane.showPreferencesDialog; +import net.sf.japi.swing.tod.TipOfTheDayManager; import net.sf.japi.util.ThrowableHandler; import net.sf.japi.util.filter.file.EndingFileFilter; import net.sf.japi.util.filter.file.Factory; Modified: trunk/daimonin/src/daieditor/SplashScreen.java =================================================================== --- trunk/daimonin/src/daieditor/SplashScreen.java 2007-01-20 14:47:48 UTC (rev 1629) +++ trunk/daimonin/src/daieditor/SplashScreen.java 2007-01-20 14:54:18 UTC (rev 1630) @@ -31,7 +31,7 @@ import javax.swing.JFrame; import javax.swing.JLabel; import static javax.swing.JLabel.CENTER; -import net.sf.japi.swing.TipOfTheDayManager; +import net.sf.japi.swing.tod.TipOfTheDayManager; /** * Class for a splash screen that's displayed while loading. Modified: trunk/lib/japi-lib-swing-tod-0.1.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-20 16:54:00
|
Revision: 1631 http://svn.sourceforge.net/gridarta/?rev=1631&view=rev Author: akirschbaum Date: 2007-01-20 08:54:00 -0800 (Sat, 20 Jan 2007) Log Message: ----------- Rename variable names. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-20 14:54:18 UTC (rev 1630) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-20 16:54:00 UTC (rev 1631) @@ -382,8 +382,8 @@ */ private void selectEditType(final int newType) { // calculate the new type for all opened maps: - for (final MapControl level : levels) { - level.addEditType(newType); // calculate new type + for (final MapControl mapControl : levels) { + mapControl.addEditType(newType); // calculate new type } setTileEdit(newType); // activate the new type for all views @@ -647,10 +647,10 @@ // update the look and feel for all open map views if (!levels.isEmpty()) { - for (final MapControl level : levels) { - level.getMapViewFrame().updateLookAndFeel(); + for (final MapControl mapControl : levels) { + mapControl.getMapViewFrame().updateLookAndFeel(); if (log.isDebugEnabled()) { - log.debug("map " + level.getMapArchObject().getMapName()); + log.debug("map " + mapControl.getMapArchObject().getMapName()); } } } @@ -705,18 +705,18 @@ if (view) { setStatusText("Creating new map " + maparch.getMapDisplayName()); } - final MapControl map = new MapControl(this, objects, maparch, false, initial); - fireMapCreatedEvent(map); + final MapControl mapControl = new MapControl(this, objects, maparch, false, initial); + fireMapCreatedEvent(mapControl); if (view) { - map.addMapGridListener(mainActions); - map.addMapCursorListener(mainActions); - mainView.addLevelView(map.getMapViewFrame()); // one view... - map.getMapViewFrame().setAutoscrolls(true); - levels.add(map); - setCurrentLevel(map); + mapControl.addMapGridListener(mainActions); + mapControl.addMapCursorListener(mainActions); + mainView.addLevelView(mapControl.getMapViewFrame()); // one view... + mapControl.getMapViewFrame().setAutoscrolls(true); + levels.add(mapControl); + setCurrentLevel(mapControl); refreshMenusAndToolbars(); } - return map; + return mapControl; } /** Invoked when the user wants to close the current level. */ @@ -762,33 +762,33 @@ /** * Closes the given level, asking the user whether to save changes. - * @param level throws level to close + * @param mapControl throws level to close * @return <code>true</code> if the level was successfully closed, otherwise <code>false</code> */ - public boolean closeLevel(final MapControl level) { - return closeLevel(level, false); + public boolean closeLevel(final MapControl mapControl) { + return closeLevel(mapControl, false); } /** * Closes the given level, eventually asking the user whether to save changes. - * @param level the level to close + * @param mapControl the level to close * @param forced when true, user does not get asked and changes do not get saved * @return <code>true</code> if the level was successfully closed, otherwise <code>false</code> */ - public boolean closeLevel(final MapControl level, final boolean forced) { + public boolean closeLevel(final MapControl mapControl, final boolean forced) { - if (level == null) { + if (mapControl == null) { ACTION_FACTORY.showMessageDialog(mainView, "closeLevelNullLevel", levels.size(), currentMap); return false; } - if (!forced && level.isModified()) { - final int result = ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, "confirmSaveChanges", level.getMapArchObject().getMapDisplayName()); + if (!forced && mapControl.isModified()) { + final int result = ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, "confirmSaveChanges", mapControl.getMapArchObject().getMapDisplayName()); if (result == JOptionPane.YES_OPTION) { - if (level.isPlainSaveEnabled()) { - level.save(); + if (mapControl.isPlainSaveEnabled()) { + mapControl.save(); } else { - if (!saveLevelAsWanted(level)) { + if (!saveLevelAsWanted(mapControl)) { return false; } } @@ -797,17 +797,17 @@ } } - fireMapClosingEvent(level); + fireMapClosingEvent(mapControl); - if (level.isPickmap()) { + if (mapControl.isPickmap()) { // special case: close a pickmap - mainView.getPickmapChooserControl().closePickmap(level); - level.levelCloseNotify(); + mainView.getPickmapChooserControl().closePickmap(mapControl); + mapControl.levelCloseNotify(); } else { // Notify the level about the closing - level.levelCloseNotify(); - mainView.removeLevelView(level.getMapViewFrame()); - levels.remove(level); + mapControl.levelCloseNotify(); + mainView.removeLevelView(mapControl.getMapViewFrame()); + levels.remove(mapControl); if (!levels.isEmpty()) { // get next open map we can find and set it to currentMap @@ -919,18 +919,18 @@ } archetypeParser.sortTempList(objects); // sort the list (put multiparts at the end) - final MapControl control = newLevel(objects, maparch, show, initial); // init the map + final MapControl mapControl = newLevel(objects, maparch, show, initial); // init the map - control.setMapFile(file); - control.setMapFileName(file.getPath()); + mapControl.setMapFile(file); + mapControl.setMapFileName(file.getPath()); if (show) { // finally, show the map and refresh toolbars - control.setActiveEditType(tileEdit); // map is loaded with current view settings - control.resetModified(); + mapControl.setActiveEditType(tileEdit); // map is loaded with current view settings + mapControl.resetModified(); refreshMenusAndToolbars(); } - return control; + return mapControl; } /** @@ -1031,11 +1031,11 @@ /** * Invoked when user wants to save a level to certain file. - * @param level map control of the map to be saved + * @param mapControl map control of the map to be saved * @return <code>true</code> if the user confirmed saving the map and the map was saved successfully, otherwise <code>false</code> */ - public boolean saveLevelAsWanted(final MapControl level) { - if (level == null) { + public boolean saveLevelAsWanted(final MapControl mapControl) { + if (mapControl == null) { log.warn(ACTION_FACTORY.getString("logSaveLevelAsWithNull")); return false; } @@ -1053,10 +1053,10 @@ } // if file already exists, select it - if (level.getMapFile() != null && level.getMapFile().exists()) { - fileChooser.setSelectedFile(level.getMapFile()); + if (mapControl.getMapFile() != null && mapControl.getMapFile().exists()) { + fileChooser.setSelectedFile(mapControl.getMapFile()); } else { - fileChooser.setSelectedFile(new File(mapDir, level.getMapFileName())); + fileChooser.setSelectedFile(new File(mapDir, mapControl.getMapFileName())); } final int returnVal = fileChooser.showSaveDialog(mainView); @@ -1064,7 +1064,7 @@ hasChangedDir = true; // user has chosen an active dir final File file = fileChooser.getSelectedFile(); if (!file.exists() || ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.WARNING_MESSAGE, JOptionPane.OK_CANCEL_OPTION, "overwriteOtherFile", file.getName()) == JOptionPane.OK_OPTION) { - level.saveAs(file); + mapControl.saveAs(file); currentDir = fileChooser.getCurrentDirectory(); refreshMenusAndToolbars(); @@ -1173,11 +1173,11 @@ /** * Shows the given levels properties. - * @param level The level whose properties we want. + * @param mapControl The level whose properties we want. */ - void showMapProperties(final MapControl level) { - if (level != null) { - MapPropertiesDialog.showDialog(mainView, this, level); + void showMapProperties(final MapControl mapControl) { + if (mapControl != null) { + MapPropertiesDialog.showDialog(mainView, this, mapControl); } } @@ -1265,7 +1265,7 @@ return; } - final MapControl oldmap = currentMap; // store old map control + final MapControl oldMapControl = currentMap; // store old map control openFile(newfile); // open the new map if (exitPos.x == 0 && exitPos.y == 0) { @@ -1278,7 +1278,7 @@ // Update the main view so the new map instantly pops up. mainView.update(mainView.getGraphics()); - closeLevel(oldmap, false); // close the old map + closeLevel(oldMapControl, false); // close the old map } if (log.isDebugEnabled()) { log.debug("exit: '" + path + "' " + exitPos.x + ", " + exitPos.y); @@ -1342,12 +1342,12 @@ return; } - final MapControl oldmap = currentMap; // store old map control + final MapControl oldMapControl = currentMap; // store old map control openFile(newfile); // open the new map // set viewport view on the new map final JViewport newViewPort = currentMap.getMapViewFrame().getViewPort(); - final JViewport oldViewPort = oldmap.getMapViewFrame().getViewPort(); + final JViewport oldViewPort = oldMapControl.getMapViewFrame().getViewPort(); final Rectangle scrollto; // new vieport rect if (direction == IGUIConstants.SOUTH) { @@ -1380,7 +1380,7 @@ // Update the main view so the new map instantly pops up. mainView.update(mainView.getGraphics()); - closeLevel(oldmap, false); // close the old map + closeLevel(oldMapControl, false); // close the old map } } @@ -1399,12 +1399,12 @@ * @param map <code>MapControl</code> of the new current map. */ - public void setCurrentLevel(final MapControl map) { - if (currentMap == map) { + public void setCurrentLevel(final MapControl mapControl) { + if (currentMap == mapControl) { return; } - currentMap = map; + currentMap = mapControl; refreshMenusAndToolbars(); //StatusBar.getInstance().setLevelInfo(level); @@ -1454,11 +1454,11 @@ /** Invoked when user wants to revert the current map to previously saved state. */ public void revert() { - final MapControl modmap = currentMap; // "modified map" to be reverted - if (ACTION_FACTORY.showQuestionDialog(mainView, "confirmRevertMap", modmap.getMapFileName())) { - final File mfile = modmap.getMapFile(); // store file - final Point initial = modmap.getViewPosition(); - closeLevel(modmap, true); // close the old map + final MapControl mapControl = currentMap; // "modified map" to be reverted + if (ACTION_FACTORY.showQuestionDialog(mainView, "confirmRevertMap", mapControl.getMapFileName())) { + final File mfile = mapControl.getMapFile(); // store file + final Point initial = mapControl.getViewPosition(); + closeLevel(mapControl, true); // close the old map openFile(mfile, true, initial); // open the new map // Update the main view so the new map instantly pops up. Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-01-20 14:54:18 UTC (rev 1630) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-01-20 16:54:00 UTC (rev 1631) @@ -568,8 +568,8 @@ if (state) { alphaType |= v; // XXX THIS IS A BAD HACK - for (final MapControl level : levels) { - level.addEditType(v); // calculate new type + for (final MapControl mapControl : levels) { + mapControl.addEditType(v); // calculate new type } } else { alphaType &= ~v; @@ -636,10 +636,10 @@ * @return map of file <var>path</var> or <code>null</code> if map not open */ @Nullable public MapControl getMapIfOpened(final String path) { - for (final MapControl level : levels) { + for (final MapControl mapControl : levels) { try { - if (level.getMapFile() != null && level.getMapFile().getCanonicalPath().compareTo(path) == 0) { - return level; + if (mapControl.getMapFile() != null && mapControl.getMapFile().getCanonicalPath().compareTo(path) == 0) { + return mapControl; } } catch (final IOException e) { // ignore, get next map @@ -653,10 +653,10 @@ * @param path path to map file */ public void saveMapIfOpened(final String path) { - for (final MapControl level : levels) { + for (final MapControl mapControl : levels) { try { - if (level.getMapFile().getCanonicalPath().compareTo(path) == 0) { - level.save(); + if (mapControl.getMapFile().getCanonicalPath().compareTo(path) == 0) { + mapControl.save(); return; } } catch (final IOException e) { @@ -873,17 +873,17 @@ if (view) { setStatusText("Creating new map " + maparch.getMapName()); } - final MapControl map = new MapControl(this, objects, maparch, false, view); - fireMapCreatedEvent(map); - levels.add(map); + final MapControl mapControl = new MapControl(this, objects, maparch, false, view); + fireMapCreatedEvent(mapControl); + levels.add(mapControl); if (view) { - map.addMapGridListener(mainActions); - map.addMapCursorListener(mainActions); - setCurrentLevel(map); + mapControl.addMapGridListener(mainActions); + mapControl.addMapCursorListener(mainActions); + setCurrentLevel(mapControl); refreshMenusAndToolbars(); } - map.getMapModel().addMapModelListener(this); - return map; + mapControl.getMapModel().addMapModelListener(this); + return mapControl; } /** Invoked when the user wants to close the current level. */ @@ -933,33 +933,33 @@ /** * Closes the given level, asking the user whether to save changes. - * @param level throws level to close + * @param mapControl throws level to close * @return <code>true</code> if the level was successfully closed, otherwise <code>false</code> */ - public boolean closeLevel(final MapControl level) { - return closeLevel(level, false); + public boolean closeLevel(final MapControl mapControl) { + return closeLevel(mapControl, false); } /** * Closes the given level, eventually asking the user whether to save changes. - * @param level the level to close + * @param mapControl the level to close * @param forced when true, user does not get asked and changes do not get saved * @return <code>true</code> if the level was successfully closed, otherwise <code>false</code> */ - public boolean closeLevel(final MapControl level, final boolean forced) { + public boolean closeLevel(final MapControl mapControl, final boolean forced) { - if (level == null) { + if (mapControl == null) { ACTION_FACTORY.showMessageDialog(mainView, "closeLevelNullLevel", levels.size(), currentMap); return false; } - if (!forced && level.isModified()) { - final int result = ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, "confirmSaveChanges", level.getMapArchObject().getMapDisplayName()); + if (!forced && mapControl.isModified()) { + final int result = ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, "confirmSaveChanges", mapControl.getMapArchObject().getMapDisplayName()); if (result == JOptionPane.YES_OPTION) { - if (level.isPlainSaveEnabled()) { - level.save(); + if (mapControl.isPlainSaveEnabled()) { + mapControl.save(); } else { - if (!saveLevelAsWanted(level)) { + if (!saveLevelAsWanted(mapControl)) { return false; } } @@ -968,19 +968,19 @@ } } - fireMapClosingEvent(level); + fireMapClosingEvent(mapControl); - if (level.isPickmap()) { + if (mapControl.isPickmap()) { // special case: close a pickmap - mainView.getPickmapChooserControl().closePickmap(level); - level.levelCloseNotify(); + mainView.getPickmapChooserControl().closePickmap(mapControl); + mapControl.levelCloseNotify(); } else { // Notify the level about the closing - level.levelCloseNotify(); - while (level.getMapViewFrame() != null) { - level.closeView(level.getMapViewFrame()); + mapControl.levelCloseNotify(); + while (mapControl.getMapViewFrame() != null) { + mapControl.closeView(mapControl.getMapViewFrame()); } - levels.remove(level); + levels.remove(mapControl); if (!levels.isEmpty()) { // get next open map we can find and set it to currentMap @@ -1117,15 +1117,15 @@ // If so, return the previously loaded map. try { final File can = file.getCanonicalFile(); - for (final MapControl level : levels) { - final File levelFile = level.getMapFile(); + for (final MapControl mapControl : levels) { + final File levelFile = mapControl.getMapFile(); if (levelFile != null && can.equals(levelFile.getCanonicalFile())) { if (view) { - level.createView(); - setCurrentLevel(level); - setCurrentLevelView(level.getMapViewFrame()); + mapControl.createView(); + setCurrentLevel(mapControl); + setCurrentLevelView(mapControl.getMapViewFrame()); } - return level; + return mapControl; } } } catch (final IOException e) { @@ -1138,18 +1138,18 @@ final List<GameObject> objects = decoder.decodeMapFile(); // parse mapfile final MapArchObject maparch = decoder.getMapArch(); // get map arch // go to ArchetypeParser and add the default arch list information to them - final MapControl newMap = newLevel(objects, maparch, view); // init the map + final MapControl newMapControl = newLevel(objects, maparch, view); // init the map // finally, show the map and refresh toolbars - newMap.setMapFile(file); - newMap.setMapFileName(file.getPath()); - newMap.setActiveEditType(tileEdit); // map is loaded with current view settings - newMap.resetModified(); + newMapControl.setMapFile(file); + newMapControl.setMapFileName(file.getPath()); + newMapControl.setActiveEditType(tileEdit); // map is loaded with current view settings + newMapControl.resetModified(); if (view) { refreshMenusAndToolbars(); addRecent(currentMap.getMapArchObject().getMapDisplayName(), file.toString()); } - return newMap; + return newMapControl; } finally { decoder.close(); } @@ -1253,11 +1253,11 @@ /** * Invoked when user wants to save a level to certain file. - * @param level map control of the map to be saved + * @param mapControl map control of the map to be saved * @return <code>true</code> if the user confirmed saving the map and the map was saved successfully, otherwise <code>false</code> */ - public boolean saveLevelAsWanted(final MapControl level) { - if (level == null) { + public boolean saveLevelAsWanted(final MapControl mapControl) { + if (mapControl == null) { log.warn(ACTION_FACTORY.getString("logSaveLevelAsWithNull")); return false; } @@ -1278,10 +1278,10 @@ } // if file already exists, select it - if (level.getMapFile() != null && level.getMapFile().exists()) { - fileChooser.setSelectedFile(level.getMapFile()); + if (mapControl.getMapFile() != null && mapControl.getMapFile().exists()) { + fileChooser.setSelectedFile(mapControl.getMapFile()); } else { - fileChooser.setSelectedFile(new File(mapDir, level.getMapFileName())); + fileChooser.setSelectedFile(new File(mapDir, mapControl.getMapFileName())); } final int returnVal = fileChooser.showSaveDialog(mainView); @@ -1289,7 +1289,7 @@ hasChangedDir = true; // user has chosen an active dir final File file = fileChooser.getSelectedFile(); if (!file.exists() || ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.WARNING_MESSAGE, JOptionPane.OK_CANCEL_OPTION, "overwriteOtherFile", file.getName()) == JOptionPane.OK_OPTION) { - level.saveAs(file); + mapControl.saveAs(file); currentDir = fileChooser.getCurrentDirectory(); refreshMenusAndToolbars(); @@ -1384,11 +1384,11 @@ /** * Shows the given levels properties. - * @param level The level whose properties we want. + * @param mapControl The level whose properties we want. */ - void showMapProperties(final MapControl level) { - if (level != null) { - MapPropertiesDialog.showDialog(mainView, this, level); + void showMapProperties(final MapControl mapControl) { + if (mapControl != null) { + MapPropertiesDialog.showDialog(mainView, this, mapControl); } } @@ -1566,7 +1566,7 @@ // file path is added every time we use a ../ or a ./ . // This results in giant file names like "xx/../yy/../xx/../yy/.." // and after some times in buffer overflows. - final MapControl oldmap = currentMap; + final MapControl oldMapControl = currentMap; final boolean newFileOpened; try { newFileOpened = openFile(newfile.getCanonicalFile()); @@ -1582,7 +1582,7 @@ currentMap.getMapViewFrame().setHotspot(d); // set hotspot TODO set cursor instead if (newFileOpened && JOptionPane.YES_OPTION == ACTION_FACTORY.showOnetimeConfirmDialog(mainView, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, "enterExitClose")) { // only close current level if a new file was opened and user wants to close it - closeLevel(oldmap); // close the old map + closeLevel(oldMapControl); // close the old map } } @@ -1601,12 +1601,12 @@ * @param map <code>MapControl</code> of the new current map. */ - public void setCurrentLevel(final MapControl map) { - if (currentMap == map) { + public void setCurrentLevel(final MapControl mapControl) { + if (currentMap == mapControl) { return; } - currentMap = map; + currentMap = mapControl; refreshMenusAndToolbars(); //StatusBar.getInstance().setLevelInfo(level); @@ -1656,10 +1656,10 @@ /** Invoked when user wants to revert the current map to previously saved state. */ public void revert() { - final MapControl modmap = currentMap; // "modified map" to be reverted - if (ACTION_FACTORY.showQuestionDialog(mainView, "confirmRevertMap", modmap.getMapFileName())) { - final File mfile = modmap.getMapFile(); // store file - closeLevel(modmap, true); // close the old map + final MapControl modMapControl = currentMap; // "modified map" to be reverted + if (ACTION_FACTORY.showQuestionDialog(mainView, "confirmRevertMap", modMapControl.getMapFileName())) { + final File mfile = modMapControl.getMapFile(); // store file + closeLevel(modMapControl, true); // close the old map openFile(mfile); // open the new map // Update the main view so the new map instantly pops up. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-20 18:19:27
|
Revision: 1632 http://svn.sourceforge.net/gridarta/?rev=1632&view=rev Author: christianhujer Date: 2007-01-20 10:19:27 -0800 (Sat, 20 Jan 2007) Log Message: ----------- Unified much of CFArchTypeList. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java trunk/daimonin/src/daieditor/CFArchTypeList.java trunk/daimonin/src/daieditor/gui/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/CFArchType.java trunk/src/app/net/sf/gridarta/CFArchTypeList.java trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2007-01-20 16:54:00 UTC (rev 1631) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2007-01-20 18:19:27 UTC (rev 1632) @@ -27,25 +27,12 @@ import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import java.awt.Component; -import java.util.ArrayList; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; -import java.util.Map; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.xpath.XPathExpressionException; -import net.sf.gridarta.ArchTypeParseException; -import net.sf.gridarta.CAttribBitmask; -import net.sf.gridarta.CFArchAttrib; import net.sf.gridarta.CFArchType; -import net.sf.gridarta.CommonConstants; -import net.sf.japi.xml.NodeListIterator; -import static net.sf.japi.xml.NodeListIterator.getFirstChild; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.w3c.dom.Attr; -import org.w3c.dom.Element; /** * This class handles all the CFArchTypes and makes them conveniently @@ -53,25 +40,12 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public final class CFArchTypeList extends net.sf.gridarta.CFArchTypeList<CFArchType, GameObject, MapArchObject> { +public final class CFArchTypeList extends net.sf.gridarta.CFArchTypeList<GameObject, MapArchObject> { private static final Logger log = Logger.getLogger(CFArchTypeList.class); private final Spells spells = new Spells(); - /** - * Table with type numbers as keys (Integer), and type names as values (String). - */ - private final Map<Integer, String> archTypeNumbers = new HashMap<Integer, String>(); - - // table with type arch type name as keys (String), and arch type object as values (CFArchType) - private final Map<String, CFArchType> archTypeNames = new HashMap<String, CFArchType>(); - - /** - * Table with CAttribBitmask objects (value) accessible by name (key). - */ - private final Map<String, CAttribBitmask> bitmaskTable; - /** List of exit object types. (Integer values) */ private static final HashSet<Integer> EXIT_TYPES = new HashSet<Integer>(); @@ -103,7 +77,6 @@ */ CFArchTypeList() { // initialize the arrays of "special-data" - bitmaskTable = new HashMap<String, CAttribBitmask>(); try { initXML(); spells.loadSpellsFromXML(documentBuilder); @@ -116,11 +89,6 @@ } /** {@inheritDoc} */ - @Override protected CFArchType createDefaultArchType() { - return new CFArchType(null); - } - - /** {@inheritDoc} */ @Override protected Component getViewToBlock() { return CMainControl.getInstance().getMainView(); } @@ -130,75 +98,6 @@ return IGUIConstants.CONFIG_DIR; } - @Override protected void parseBitmasks(final Element root) throws XPathExpressionException { - for (final Element elem : new NodeListIterator<Element>(xpath, root, "bitmask|bitmasks/bitmask")) { - bitmaskTable.put(elem.getAttribute("name"), new CAttribBitmask(xpath, elem)); - } - } - - @Override protected void parseIgnoreLists(final Element root) throws XPathExpressionException { - for (final Element elem : new NodeListIterator<Element>(xpath, root, "ignore_list|ignorelists/ignore_list")) { - if (elem.getAttribute("name") == null) { - throw new RuntimeException("In file '" + CommonConstants.TYPEDEF_FILE + "': cannot load ignore_list element without 'name'."); - } else { - final String lname = elem.getAttribute("name").trim(); - final List<String> content = new ArrayList<String>(); - for (final Element el2 : new NodeListIterator<Element>(elem, CFArchType.XML_ATTRIBUTE)) { - final Attr a = el2.getAttributeNode(CFArchAttrib.XML_KEY_ARCH); - if (a != null) { - content.add(a.getValue().trim()); - } else { - throw new RuntimeException("In file '" + CommonConstants.TYPEDEF_FILE + "': ignore_list '" + lname + "' has " + CFArchType.XML_ATTRIBUTE + " missing '" + CFArchAttrib.XML_KEY_ARCH + "'."); - } - } - // now add the list vector to the ignoreListTable: - if (!content.isEmpty()) { - ignoreListTable.put(lname, content); - } - } - } - } - - @Override protected void parseDefaultType(final Element root) throws ArchTypeParseException { - // parse default type - final Element el = getFirstChild(root, "default_type"); - if (el == null) { - throw new RuntimeException("In file '" + CommonConstants.TYPEDEF_FILE + "': default_type element is missing!"); - } else { - defaultArchType.load(el, this); - } - } - - @Override protected void parseTypes(final Element root) throws ArchTypeParseException { - // parse all type elements - for (final Element elem : new NodeListIterator<Element>(root, "type")) { - if (!"no".equals(elem.getAttribute("available"))) { - // create a new CFArchType element - final CFArchType newType = new CFArchType(defaultArchType); - - // attach the new CFArchType element to the list - // if we manage to parse it properly from the file - if (newType.load(elem, this)) { - archTypeList.add(newType); - archTypeNames.put(newType.getTypeName(), newType); - } - } - archTypeNumbers.put(Integer.parseInt(elem.getAttribute("number")), elem.getAttribute("name")); - } - } - - /** {@inheritDoc} */ - @Override public Map<String, CAttribBitmask> getBitmaskTable() { - return bitmaskTable; - } - - /** {@inheritDoc} */ - @Override public CFArchType getTypeByName(final String typeName) { - // return: matching type or first type (misc) if no other found - final CFArchType type = archTypeNames.get(typeName.trim()); - return type == null ? archTypeList.get(0) : type; - } - @Nullable @Override public CFArchType getType(@NotNull final GameObject gameObject) { CFArchType result = null; for (final CFArchType type : archTypeList) { Modified: trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java 2007-01-20 16:54:00 UTC (rev 1631) +++ trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java 2007-01-20 18:19:27 UTC (rev 1632) @@ -53,7 +53,7 @@ * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @fixme I suck */ -public final class GameObjectAttributesDialog extends AbstractGameObjectAttributesDialog<CFArchType, GameObject, MapArchObject> { +public final class GameObjectAttributesDialog extends AbstractGameObjectAttributesDialog<GameObject, MapArchObject> { /** Logger. */ private static final Logger log = Logger.getLogger(GameObjectAttributesDialog.class); Modified: trunk/daimonin/src/daieditor/CFArchTypeList.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchTypeList.java 2007-01-20 16:54:00 UTC (rev 1631) +++ trunk/daimonin/src/daieditor/CFArchTypeList.java 2007-01-20 18:19:27 UTC (rev 1632) @@ -37,17 +37,11 @@ import java.util.Map; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPathExpressionException; -import net.sf.gridarta.ArchTypeParseException; -import net.sf.gridarta.CAttribBitmask; -import net.sf.gridarta.CFArchAttrib; import net.sf.gridarta.CFArchType; -import net.sf.gridarta.CommonConstants; import net.sf.japi.xml.NodeListIterator; -import static net.sf.japi.xml.NodeListIterator.getFirstChild; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.SAXException; @@ -58,35 +52,22 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public final class CFArchTypeList extends net.sf.gridarta.CFArchTypeList<CFArchType, GameObject, MapArchObject> { +public final class CFArchTypeList extends net.sf.gridarta.CFArchTypeList<GameObject, MapArchObject> { private static final Logger log = Logger.getLogger(CFArchTypeList.class); + private final Spells spells = new Spells(); + /** * Map with arch object matchers and their IDs. * @todo turn static field into instance field */ private static final Map<String, NamedGameObjectMatcher> archObjectMatchersByIds = new HashMap<String, NamedGameObjectMatcher>(); - private final Spells spells = new Spells(); - - /** - * Table with type numbers as keys (Integer), and type names as values (String). - */ - private final Map<Integer, String> archTypeNumbers = new HashMap<Integer, String>(); - /** List with arch object matchers. */ private final List<NamedGameObjectMatcher> archObjectMatchers = new ArrayList<NamedGameObjectMatcher>(); - // table with type arch type name as keys (String), and arch type object as values (CFArchType) - private final Map<String, CFArchType> archTypeNames = new HashMap<String, CFArchType>(); - /** - * Table with CAttribBitmask objects (value) accessible by name (key). - */ - private final Map<String, CAttribBitmask> bitmaskTable; - - /** * Check whether the GameObject is an exit. * @param arch GameObject to check * @return <code>true</code> if <var>arch</var> is an exit, otherwise <code>false</code> @@ -109,7 +90,6 @@ */ CFArchTypeList() { // initialize the arrays of "special-data" - bitmaskTable = new HashMap<String, CAttribBitmask>(); try { initXML(); spells.loadSpellsFromXML(documentBuilder); @@ -124,11 +104,6 @@ } /** {@inheritDoc} */ - @Override protected CFArchType createDefaultArchType() { - return new CFArchType(null); - } - - /** {@inheritDoc} */ @Override protected Component getViewToBlock() { return CMainControl.getInstance().getMainView(); } @@ -138,63 +113,7 @@ return CMainControl.getInstance().getArchDefaultFolder() + "/" + IGUIConstants.CONFIG_DIR; } - @Override protected void parseBitmasks(final Element root) throws XPathExpressionException { - for (final Element elem : new NodeListIterator<Element>(xpath, root, "bitmask|bitmasks/bitmask")) { - bitmaskTable.put(elem.getAttribute("name"), new CAttribBitmask(xpath, elem)); - } - } - @Override protected void parseIgnoreLists(final Element root) throws XPathExpressionException { - for (final Element elem : new NodeListIterator<Element>(xpath, root, "ignore_list|ignorelists/ignore_list")) { - if (elem.getAttribute("name") == null) { - throw new RuntimeException("In file '" + CommonConstants.TYPEDEF_FILE + "': cannot load ignore_list element without 'name'."); - } else { - final String lname = elem.getAttribute("name").trim(); - final List<String> content = new ArrayList<String>(); - for (final Element el2 : new NodeListIterator<Element>(elem, CFArchType.XML_ATTRIBUTE)) { - final Attr a = el2.getAttributeNode(CFArchAttrib.XML_KEY_ARCH); - if (a != null) { - content.add(a.getValue().trim()); - } else { - throw new RuntimeException("In file '" + CommonConstants.TYPEDEF_FILE + "': ignore_list '" + lname + "' has " + CFArchType.XML_ATTRIBUTE + " missing '" + CFArchAttrib.XML_KEY_ARCH + "'."); - } - } - // now add the list vector to the ignoreListTable: - if (!content.isEmpty()) { - ignoreListTable.put(lname, content); - } - } - } - } - - @Override protected void parseDefaultType(final Element root) throws ArchTypeParseException { - // parse default type - final Element el = getFirstChild(root, "default_type"); - if (el == null) { - throw new RuntimeException("In file '" + CommonConstants.TYPEDEF_FILE + "': default_type element is missing!"); - } else { - defaultArchType.load(el, this); - } - } - - @Override protected void parseTypes(final Element root) throws ArchTypeParseException { - // parse all type elements - for (final Element elem : new NodeListIterator<Element>(root, "type")) { - if (!"no".equals(elem.getAttribute("available"))) { - // create a new CFArchType element - final CFArchType newType = new CFArchType(defaultArchType); - - // attach the new CFArchType element to the list - // if we manage to parse it properly from the file - if (newType.load(elem, this)) { - archTypeList.add(newType); - archTypeNames.put(newType.getTypeName(), newType); - } - } - archTypeNumbers.put(Integer.parseInt(elem.getAttribute("number")), elem.getAttribute("name")); - } - } - private void readArchObjectMatchers() { final GameObjectMatchers aom = new GameObjectMatchers(xpath); final String baseDir = CMainControl.getInstance().getArchDefaultFolder() + "/" + IGUIConstants.CONFIG_DIR; @@ -220,18 +139,6 @@ } } - /** {@inheritDoc} */ - @Override public Map<String, CAttribBitmask> getBitmaskTable() { - return bitmaskTable; - } - - /** {@inheritDoc} */ - @Override public CFArchType getTypeByName(final String typeName) { - // return: matching type or first type (misc) if no other found - final CFArchType type = archTypeNames.get(typeName.trim()); - return type == null ? archTypeList.get(0) : type; - } - @Nullable @Override public CFArchType getType(@NotNull final GameObject gameObject) { for (final CFArchType type : archTypeList) { if (type.matches(gameObject)) { Modified: trunk/daimonin/src/daieditor/gui/GameObjectAttributesDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/GameObjectAttributesDialog.java 2007-01-20 16:54:00 UTC (rev 1631) +++ trunk/daimonin/src/daieditor/gui/GameObjectAttributesDialog.java 2007-01-20 18:19:27 UTC (rev 1632) @@ -53,7 +53,7 @@ * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @fixme I suck */ -public final class GameObjectAttributesDialog extends AbstractGameObjectAttributesDialog<CFArchType, GameObject, MapArchObject> { +public final class GameObjectAttributesDialog extends AbstractGameObjectAttributesDialog<GameObject, MapArchObject> { /** Logger. */ private static final Logger log = Logger.getLogger(GameObjectAttributesDialog.class); Modified: trunk/src/app/net/sf/gridarta/CFArchType.java =================================================================== --- trunk/src/app/net/sf/gridarta/CFArchType.java 2007-01-20 16:54:00 UTC (rev 1631) +++ trunk/src/app/net/sf/gridarta/CFArchType.java 2007-01-20 18:19:27 UTC (rev 1632) @@ -113,7 +113,7 @@ * @throws ArchTypeParseException In case <var>root</var> is malformed or contains bogus data. * @todo I'm sucking slow, improve me */ - public boolean load(final Element root, final CFArchTypeList<? extends CFArchType, ? extends GameObject, ? extends MapArchObject> tlist) throws ArchTypeParseException { + public boolean load(final Element root, final CFArchTypeList<? extends GameObject, ? extends MapArchObject> tlist) throws ArchTypeParseException { // this vector is used to store a temporare linked list of attributes final List<CFArchAttrib> attrList = new ArrayList<CFArchAttrib>(); Modified: trunk/src/app/net/sf/gridarta/CFArchTypeList.java =================================================================== --- trunk/src/app/net/sf/gridarta/CFArchTypeList.java 2007-01-20 16:54:00 UTC (rev 1631) +++ trunk/src/app/net/sf/gridarta/CFArchTypeList.java 2007-01-20 18:19:27 UTC (rev 1632) @@ -21,6 +21,7 @@ import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.SAXException; @@ -29,7 +30,7 @@ * Common base class for CFArchTypeList. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public abstract class CFArchTypeList<T extends CFArchType, G extends GameObject<G, A>, A extends MapArchObject> implements Iterable<T> { +public abstract class CFArchTypeList<G extends GameObject<G, A>, A extends MapArchObject> implements Iterable<CFArchType> { private static final Logger log = Logger.getLogger(CFArchTypeList.class); @@ -40,14 +41,14 @@ protected XPath xpath; /** The default type. */ - protected final T defaultArchType; + protected final CFArchType defaultArchType; /** * Lists with all CFArchTypes. * Contains all but the default CFArchType. * @todo verify whether the default CFArchType really is not included in this list. */ - protected final List<T> archTypeList = new ArrayList<T>(); // All but the default ArchType + protected final List<CFArchType> archTypeList = new ArrayList<CFArchType>(); // All but the default ArchType /** * Table with List objects for lists (value) accessible by name (key). @@ -61,11 +62,26 @@ */ protected Map<String, List<String>> ignoreListTable; + /** + * Table with CAttribBitmask objects (value) accessible by name (key). + */ + private final Map<String, CAttribBitmask> bitmaskTable; + + + /** + * Table with type numbers as keys (Integer), and type names as values (String). + */ + private final Map<Integer, String> archTypeNumbers = new HashMap<Integer, String>(); + + // table with type arch type name as keys (String), and arch type object as values (CFArchType) + private final Map<String, CFArchType> archTypeNames = new HashMap<String, CFArchType>(); + protected CFArchTypeList() { //noinspection AbstractMethodCallInConstructor defaultArchType = createDefaultArchType(); listTable = new HashMap<String, List<?>>(); ignoreListTable = new HashMap<String, List<String>>(); + bitmaskTable = new HashMap<String, CAttribBitmask>(); } /** @@ -74,7 +90,9 @@ * @warning This method is called early during object construction, do not use any members, neither your own nor inherited ones. * @return Newly created default arch type. */ - protected abstract T createDefaultArchType(); + private CFArchType createDefaultArchType() { + return new CFArchType(null); + } /** * Returns the spells. @@ -140,7 +158,11 @@ } } - protected abstract void parseBitmasks(final Element root) throws XPathExpressionException; + private void parseBitmasks(final Element root) throws XPathExpressionException { + for (final Element elem : new NodeListIterator<Element>(xpath, root, "bitmask|bitmasks/bitmask")) { + bitmaskTable.put(elem.getAttribute("name"), new CAttribBitmask(xpath, elem)); + } + } protected final void parseLists(final Element root) throws XPathExpressionException { for (final Element elem : new NodeListIterator<Element>(xpath, root, "list|lists/list")) { @@ -177,12 +199,57 @@ return list; } - protected abstract void parseIgnoreLists(final Element root) throws XPathExpressionException; + private void parseIgnoreLists(final Element root) throws XPathExpressionException { + for (final Element elem : new NodeListIterator<Element>(xpath, root, "ignore_list|ignorelists/ignore_list")) { + if (elem.getAttribute("name") == null) { + throw new RuntimeException("In file '" + CommonConstants.TYPEDEF_FILE + "': cannot load ignore_list element without 'name'."); + } else { + final String lname = elem.getAttribute("name").trim(); + final List<String> content = new ArrayList<String>(); + for (final Element el2 : new NodeListIterator<Element>(elem, CFArchType.XML_ATTRIBUTE)) { + final Attr a = el2.getAttributeNode(CFArchAttrib.XML_KEY_ARCH); + if (a != null) { + content.add(a.getValue().trim()); + } else { + throw new RuntimeException("In file '" + CommonConstants.TYPEDEF_FILE + "': ignore_list '" + lname + "' has " + CFArchType.XML_ATTRIBUTE + " missing '" + CFArchAttrib.XML_KEY_ARCH + "'."); + } + } + // now add the list vector to the ignoreListTable: + if (!content.isEmpty()) { + ignoreListTable.put(lname, content); + } + } + } + } - protected abstract void parseDefaultType(final Element root) throws XPathExpressionException, ArchTypeParseException; + private void parseDefaultType(final Element root) throws ArchTypeParseException { + // parse default type + final Element el = NodeListIterator.getFirstChild(root, "default_type"); + if (el == null) { + throw new RuntimeException("In file '" + CommonConstants.TYPEDEF_FILE + "': default_type element is missing!"); + } else { + defaultArchType.load(el, this); + } + } - protected abstract void parseTypes(final Element root) throws XPathExpressionException, ArchTypeParseException; + private void parseTypes(final Element root) throws ArchTypeParseException { + // parse all type elements + for (final Element elem : new NodeListIterator<Element>(root, "type")) { + if (!"no".equals(elem.getAttribute("available"))) { + // create a new CFArchType element + final CFArchType newType = new CFArchType(defaultArchType); + // attach the new CFArchType element to the list + // if we manage to parse it properly from the file + if (newType.load(elem, this)) { + archTypeList.add(newType); + archTypeNames.put(newType.getTypeName(), newType); + } + } + archTypeNumbers.put(Integer.parseInt(elem.getAttribute("number")), elem.getAttribute("name")); + } + } + /** * Return the ignore list table which contains all definitions of ignore lists for arch attributes. * @return ignore list table @@ -200,15 +267,15 @@ } /** {@inheritDoc} */ - public Iterator<T> iterator() { + public Iterator<CFArchType> iterator() { return archTypeList.iterator(); } - public T getArchType(final int n) { + public CFArchType getArchType(final int n) { return archTypeList.get(n); } - public int getArchTypeIndex(@NotNull final T archType) { + public int getArchTypeIndex(@NotNull final CFArchType archType) { return archTypeList.indexOf(archType); } @@ -233,9 +300,9 @@ * @return the <code>CFArchType</code> which belongs to this arch, * or the first (misc) type if no match is found. */ - public T getTypeOfArch(final GameObject object) { + public CFArchType getTypeOfArch(final GameObject object) { // check if the type of the object is present in the definitions - for (final T tmp : archTypeList) { + for (final CFArchType tmp : archTypeList) { if (tmp.getTypeNr() == object.getArchTypNr()) { if (tmp.getTypeAttr() == null) { // no type-attributes, so we only compared type-numbers @@ -271,13 +338,14 @@ * Return the bitmask table which contains all definitions of bitmask types for arch attributes. * @return bitmask table */ - public abstract Map<String, ?> getBitmaskTable(); - + public final Map<String, CAttribBitmask> getBitmaskTable() { + return bitmaskTable; + } /** * Returns the default arch type. * @return The default arch type. */ - public T getDefaultArchType() { + public CFArchType getDefaultArchType() { return defaultArchType; } @@ -298,9 +366,13 @@ * @return the <code>CFArchType</code> that matches, * or the first (misc) type if no match is found. */ - public abstract T getTypeByName(final String typeName); + public CFArchType getTypeByName(final String typeName) { + // return: matching type or first type (misc) if no other found + final CFArchType type = archTypeNames.get(typeName.trim()); + return type == null ? archTypeList.get(0) : type; + } // TODO: Javadoc - @Nullable public abstract T getType(@NotNull final G gameObject); + @Nullable public abstract CFArchType getType(@NotNull final G gameObject); } // class CFArchTypeList Modified: trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java 2007-01-20 16:54:00 UTC (rev 1631) +++ trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java 2007-01-20 18:19:27 UTC (rev 1632) @@ -84,7 +84,7 @@ * Common base class for game object attributes dialogs. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public abstract class AbstractGameObjectAttributesDialog<T extends CFArchType, G extends GameObject<G, A>, A extends MapArchObject> extends JOptionPane implements FocusListener { +public abstract class AbstractGameObjectAttributesDialog<G extends GameObject<G, A>, A extends MapArchObject> extends JOptionPane implements FocusListener { /** Logger. */ private static final Logger log = Logger.getLogger(AbstractGameObjectAttributesDialog.class); @@ -98,7 +98,7 @@ public static final int TEXTFIELD_COLUMNS = 18; /** Reference to the list of CFArchTypes. */ - protected final CFArchTypeList<T, G, A> archTypeList; + protected final CFArchTypeList<G, A> archTypeList; /** Reference to MainControl. */ protected final MainControl mainControl; @@ -114,7 +114,7 @@ protected final Archetype<G, A> archetype; - protected T type; // reference to the type data + protected CFArchType type; // reference to the type data // this differs from the GameObject if the type is undefined private int listNr; // the position of this type in the type list @@ -155,7 +155,7 @@ * @param gameObject GameObject to show dialog for. * @param mainControl MainControl, for retrieving AnimationObjects, FaceObjects etc.. */ - protected AbstractGameObjectAttributesDialog(final CFArchTypeList<T, G, A> archTypeList, @NotNull final G gameObject, @NotNull final MainControl mainControl) { + protected AbstractGameObjectAttributesDialog(final CFArchTypeList<G, A> archTypeList, @NotNull final G gameObject, @NotNull final MainControl mainControl) { this.archTypeList = archTypeList; this.gameObject = gameObject.getHead(); this.mainControl = mainControl; @@ -217,7 +217,7 @@ // read all type names int i = 0; - for (final T tmp : archTypeList) { + for (final CFArchType tmp : archTypeList) { namelist[i++] = " " + tmp.getTypeName(); } @@ -1375,7 +1375,7 @@ } else if (e.getStateChange() == ItemEvent.SELECTED && !e.getItem().equals(deselected)) { // new type was selected // first, get new type structure - final T newType = archTypeList.getTypeByName((String) e.getItem()); + final CFArchType newType = archTypeList.getTypeByName((String) e.getItem()); frame.typesel.hidePopup(); frame.update(frame.getGraphics()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-20 20:33:45
|
Revision: 1635 http://svn.sourceforge.net/gridarta/?rev=1635&view=rev Author: christianhujer Date: 2007-01-20 12:33:45 -0800 (Sat, 20 Jan 2007) Log Message: ----------- Fixed some documentation bugs. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/CFArchTypeList.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-20 19:14:39 UTC (rev 1634) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-20 20:33:45 UTC (rev 1635) @@ -1396,7 +1396,7 @@ /** * Sets the given level view as the current one. - * @param map <code>MapControl</code> of the new current map. + * @param mapControl <code>MapControl</code> of the new current map. */ public void setCurrentLevel(final MapControl mapControl) { Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-01-20 19:14:39 UTC (rev 1634) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-01-20 20:33:45 UTC (rev 1635) @@ -1598,7 +1598,7 @@ /** * Sets the given level view as the current one. - * @param map <code>MapControl</code> of the new current map. + * @param mapControl <code>MapControl</code> of the new current map. */ public void setCurrentLevel(final MapControl mapControl) { Modified: trunk/src/app/net/sf/gridarta/CFArchTypeList.java =================================================================== --- trunk/src/app/net/sf/gridarta/CFArchTypeList.java 2007-01-20 19:14:39 UTC (rev 1634) +++ trunk/src/app/net/sf/gridarta/CFArchTypeList.java 2007-01-20 20:33:45 UTC (rev 1635) @@ -77,7 +77,6 @@ private final Map<String, CFArchType> archTypeNames = new HashMap<String, CFArchType>(); protected CFArchTypeList() { - //noinspection AbstractMethodCallInConstructor defaultArchType = createDefaultArchType(); listTable = new HashMap<String, List<?>>(); ignoreListTable = new HashMap<String, List<String>>(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-20 21:32:35
|
Revision: 1641 http://svn.sourceforge.net/gridarta/?rev=1641&view=rev Author: christianhujer Date: 2007-01-20 13:32:35 -0800 (Sat, 20 Jan 2007) Log Message: ----------- Extracted authors into a separate file. Modified Paths: -------------- trunk/CREDITS trunk/README Added Paths: ----------- trunk/AUTHORS Added: trunk/AUTHORS =================================================================== --- trunk/AUTHORS (rev 0) +++ trunk/AUTHORS 2007-01-20 21:32:35 UTC (rev 1641) @@ -0,0 +1,24 @@ +The following people have contributed to Gridarta: + +* Pasi Keränen + He created Gridder, out of which Michhael Tönnis created CFJavaEditor. + +* Michael Tönnis <in...@da...> + He created CFJavaEditor and DaimoninEditor. + +* Andreas Vogel <av...@us...> + He did a lot of work adding new features to CFJavaEditor + +* Christian Hujer <ch...@ri...> + He maintained DaimoninEditor from 2005-2006, creator of Gridarta. + Takes care of Gridarta4Daimonin. + +* Daniel Viegas <der...@us...> + Added many new features. + +* Andreas Kirschbaum <aki...@us...> + Added many new features. + Takes care of Gridarta4Crossfire. + + +See also: CREDITS, MAINTAINERS Property changes on: trunk/AUTHORS ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/CREDITS =================================================================== --- trunk/CREDITS 2007-01-20 21:32:20 UTC (rev 1640) +++ trunk/CREDITS 2007-01-20 21:32:35 UTC (rev 1641) @@ -1,26 +1,7 @@ -The following people have contributed to Gridarta: +See file AUTHORS for a list of people that have contributed to Gridarta. +See file MAINTAINERS for people that are developing Gridarta these days. -* Pasi Keränen - He created Gridder, out of which Michhael Tönnis created CFJavaEditor. -* Michael Tönnis <in...@da...> - He created CFJavaEditor and DaimoninEditor. - -* Andreas Vogel <av...@us...> - He did a lot of work adding new features to CFJavaEditor - -* Christian Hujer <ch...@ri...> - He maintained DaimoninEditor from 2005-2006, creator of Gridarta. - Takes care of Gridarta4Daimonin. - -* Daniel Viegas <der...@us...> - Added many new features. - -* Andreas Kirschbaum <aki...@us...> - Added many new features. - Takes care of Gridarta4Crossfire. - - Gridarta wouldn't exist without the following projects: * Gridder, a simple 2D grid based game map editor. Modified: trunk/README =================================================================== --- trunk/README 2007-01-20 21:32:20 UTC (rev 1640) +++ trunk/README 2007-01-20 21:32:35 UTC (rev 1641) @@ -12,7 +12,7 @@ * system requirements * file structure * build / installation (see file INSTALL) -* maintainers / credits (see file CREDITS) +* authors / credits / maintainers (see files AUTHORS, CREDITS, MAINTAINERS) * project news (see file NEWS) * mailing lists * license information (see file LICENSE) @@ -53,6 +53,9 @@ FILE STRUCTURE -------------- +AUTHORS + People that contributed code to Gridarta. See also CREDITS, MAINTAINERS. + build.xml The build file to build the project with Ant. See also INSTALL. @@ -62,7 +65,7 @@ party libraries. CREDITS - List of project contributors. See also MAINTAINERS. + List of project contributions. See also AUTHORS, MAINTAINERS. crossfire/ Directory containing the Crossfire Map Editor / Crossfire specific code. @@ -94,7 +97,7 @@ File with license information. MAINTAINERS - List of current project maintainers. See also CREDITS. + List of current project maintainers. See also AUTHORS, CREDITS. NEWS Project News. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-20 22:18:44
|
Revision: 1643 http://svn.sourceforge.net/gridarta/?rev=1643&view=rev Author: christianhujer Date: 2007-01-20 14:18:43 -0800 (Sat, 20 Jan 2007) Log Message: ----------- Updated copyright statements in source files. Modified Paths: -------------- trunk/build.xml trunk/crossfire/build.xml trunk/crossfire/crossfire.iml trunk/crossfire/src/cfeditor/AutojoinList.java trunk/crossfire/src/cfeditor/AutojoinLists.java trunk/crossfire/src/cfeditor/BshThread.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFJavaEditor.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CFilterControl.java trunk/crossfire/src/cfeditor/CGUIUtils.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.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/CSettings.java trunk/crossfire/src/cfeditor/CStartupScreen.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/GridderException.java trunk/crossfire/src/cfeditor/IGUIConstants.java trunk/crossfire/src/cfeditor/MapViewIFrame.java trunk/crossfire/src/cfeditor/PluginParameter.java trunk/crossfire/src/cfeditor/PluginParameterFactory.java trunk/crossfire/src/cfeditor/PluginParameterView.java trunk/crossfire/src/cfeditor/ResourceFileManager.java trunk/crossfire/src/cfeditor/Spells.java trunk/crossfire/src/cfeditor/action.properties trunk/crossfire/src/cfeditor/filter/AttributeFilter.java trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java trunk/crossfire/src/cfeditor/filter/ConfigEvent.java trunk/crossfire/src/cfeditor/filter/ConfigEventType.java trunk/crossfire/src/cfeditor/filter/ConfigListener.java trunk/crossfire/src/cfeditor/filter/Filter.java trunk/crossfire/src/cfeditor/filter/FilterConfig.java trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java trunk/crossfire/src/cfeditor/filter/NamedFilterEvent.java trunk/crossfire/src/cfeditor/filter/NamedFilterEventType.java trunk/crossfire/src/cfeditor/filter/NamedFilterList.java trunk/crossfire/src/cfeditor/filter/NamedFilterListener.java trunk/crossfire/src/cfeditor/filter/SimpleFilterConfig.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java trunk/crossfire/src/cfeditor/gameobject/anim/package.html trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java trunk/crossfire/src/cfeditor/gameobject/face/package.html trunk/crossfire/src/cfeditor/gameobject/package.html trunk/crossfire/src/cfeditor/gameobject/scripts/PathButtonListener.java trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeTypeException.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/crossfire/src/cfeditor/gui/ArchetypeChooser.java trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java trunk/crossfire/src/cfeditor/gui/InsertionObjectChooser.java trunk/crossfire/src/cfeditor/gui/MapView.java trunk/crossfire/src/cfeditor/gui/NewMapDialog.java trunk/crossfire/src/cfeditor/gui/ObjectChoiceDisplay.java trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java trunk/crossfire/src/cfeditor/gui/ScriptEditor.java trunk/crossfire/src/cfeditor/gui/ScriptManager.java trunk/crossfire/src/cfeditor/gui/StackLayout.java trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java trunk/crossfire/src/cfeditor/gui/map/LevelRenderer.java trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java trunk/crossfire/src/cfeditor/gui/map/package.html trunk/crossfire/src/cfeditor/gui/package.html trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/ArchNPickChangeListener.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapSelectionListener.java trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java trunk/crossfire/src/cfeditor/gui/prefs/ResPrefs.java trunk/crossfire/src/cfeditor/gui/prefs/package.html trunk/crossfire/src/cfeditor/gui/selectedsquare/CellRenderer.java trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java trunk/crossfire/src/cfeditor/io/CMapReader.java trunk/crossfire/src/cfeditor/io/CMapWriter.java trunk/crossfire/src/cfeditor/io/package.html trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/crossfire/src/cfeditor/map/MapArchObject.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/crossfire/src/cfeditor/map/MapModel.java trunk/crossfire/src/cfeditor/messages.properties trunk/crossfire/src/cfeditor/messages_de.properties trunk/crossfire/src/cfeditor/messages_fr.properties trunk/crossfire/src/cfeditor/messages_sv.properties trunk/crossfire/src/cfeditor/package.html trunk/crossfire/src/cfeditor/parameter/ArchParameter.java trunk/crossfire/src/cfeditor/parameter/ArchParameterView.java trunk/crossfire/src/cfeditor/parameter/BooleanParameter.java trunk/crossfire/src/cfeditor/parameter/BooleanParameterView.java trunk/crossfire/src/cfeditor/parameter/DoubleParameter.java trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java trunk/crossfire/src/cfeditor/parameter/FilterParameter.java trunk/crossfire/src/cfeditor/parameter/FilterParameterView.java trunk/crossfire/src/cfeditor/parameter/IntegerParameter.java trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java trunk/crossfire/src/cfeditor/parameter/MapParameter.java trunk/crossfire/src/cfeditor/parameter/MapParameterView.java trunk/crossfire/src/cfeditor/parameter/ParameterDescriptionEditor.java trunk/crossfire/src/cfeditor/parameter/ParameterNameEditor.java trunk/crossfire/src/cfeditor/parameter/ParameterTypeEditor.java trunk/crossfire/src/cfeditor/parameter/StringParameter.java trunk/crossfire/src/cfeditor/parameter/StringParameterView.java trunk/crossfire/src/log4j.properties trunk/daimonin/build.xml trunk/daimonin/daimonin.iml trunk/daimonin/resource/HelpFiles/credits.html trunk/daimonin/resource/HelpFiles/faq.html trunk/daimonin/resource/HelpFiles/guide.html trunk/daimonin/resource/HelpFiles/pycredits.html trunk/daimonin/resource/HelpFiles/pyfaq.html trunk/daimonin/resource/HelpFiles/pyguide.html trunk/daimonin/resource/HelpFiles/pystart.html trunk/daimonin/resource/HelpFiles/start.html trunk/daimonin/resource/HelpFiles/treasure_multi.html trunk/daimonin/resource/HelpFiles/treasure_one.html trunk/daimonin/resource/HelpFiles/treasure_special.html trunk/daimonin/resource/HelpFiles/treasurelists.html trunk/daimonin/resource/HelpFiles/tut_DScript.html trunk/daimonin/resource/HelpFiles/tut_copypaste.html trunk/daimonin/resource/HelpFiles/tut_frames.html trunk/daimonin/resource/HelpFiles/tut_intro.html trunk/daimonin/resource/HelpFiles/tut_loading.html trunk/daimonin/resource/HelpFiles/tut_map.html trunk/daimonin/resource/HelpFiles/tut_mapattr.html trunk/daimonin/resource/HelpFiles/tut_objects.html trunk/daimonin/resource/HelpFiles/tut_scriptev.html trunk/daimonin/resource/HelpFiles/tut_view.html trunk/daimonin/resource/log4j.properties trunk/daimonin/src/daieditor/CFArchTypeList.java trunk/daimonin/src/daieditor/CFJavaEditor.java trunk/daimonin/src/daieditor/CFTreasureListTree.java trunk/daimonin/src/daieditor/CGUIUtils.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/CPreview.java trunk/daimonin/src/daieditor/CopyBuffer.java trunk/daimonin/src/daieditor/IGUIConstants.java trunk/daimonin/src/daieditor/MapViewIFrame.java trunk/daimonin/src/daieditor/MultiPositionData.java trunk/daimonin/src/daieditor/ProcessRunner.java trunk/daimonin/src/daieditor/ResourceFileManager.java trunk/daimonin/src/daieditor/Spells.java trunk/daimonin/src/daieditor/SplashScreen.java trunk/daimonin/src/daieditor/Updater.java trunk/daimonin/src/daieditor/action.properties trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/DuplicateArchetypeException.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java trunk/daimonin/src/daieditor/gameobject/anim/package.html trunk/daimonin/src/daieditor/gameobject/face/AbstractFaceProvider.java trunk/daimonin/src/daieditor/gameobject/face/ArchFaceProvider.java trunk/daimonin/src/daieditor/gameobject/face/DaimoninFaceProvider.java trunk/daimonin/src/daieditor/gameobject/face/DuplicateFaceException.java trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java trunk/daimonin/src/daieditor/gameobject/face/FaceProvider.java trunk/daimonin/src/daieditor/gameobject/face/FilterFaceProvider.java trunk/daimonin/src/daieditor/gameobject/face/package.html trunk/daimonin/src/daieditor/gameobject/match/AndGameObjectMatcher.java trunk/daimonin/src/daieditor/gameobject/match/AttribGameObjectMatcher.java trunk/daimonin/src/daieditor/gameobject/match/GameObjectMatcher.java trunk/daimonin/src/daieditor/gameobject/match/GameObjectMatchers.java trunk/daimonin/src/daieditor/gameobject/match/MutableNameGameObjectMatcher.java trunk/daimonin/src/daieditor/gameobject/match/MutableOrGameObjectMatcher.java trunk/daimonin/src/daieditor/gameobject/match/NamedGameObjectMatcher.java trunk/daimonin/src/daieditor/gameobject/match/NotGameObjectMatcher.java trunk/daimonin/src/daieditor/gameobject/match/OrGameObjectMatcher.java trunk/daimonin/src/daieditor/gameobject/match/TypeNrsGameObjectMatcher.java trunk/daimonin/src/daieditor/gameobject/match/ViewGameObjectMatcherManager.java trunk/daimonin/src/daieditor/gameobject/match/package.html trunk/daimonin/src/daieditor/gameobject/package.html trunk/daimonin/src/daieditor/gameobject/scripts/PathButtonListener.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java trunk/daimonin/src/daieditor/gui/ArchetypeChooser.java trunk/daimonin/src/daieditor/gui/DirectionLayout.java trunk/daimonin/src/daieditor/gui/ErrorListView.java trunk/daimonin/src/daieditor/gui/GameObjectAttributesDialog.java trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java trunk/daimonin/src/daieditor/gui/InsertionObjectChooser.java trunk/daimonin/src/daieditor/gui/MapFileFilter.java trunk/daimonin/src/daieditor/gui/NewMapDialog.java trunk/daimonin/src/daieditor/gui/ObjectChoiceDisplay.java trunk/daimonin/src/daieditor/gui/ReplaceDialog.java trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java trunk/daimonin/src/daieditor/gui/map/LevelRenderer.java trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java trunk/daimonin/src/daieditor/gui/map/MapTilePane.java trunk/daimonin/src/daieditor/gui/map/MapUserListener.java trunk/daimonin/src/daieditor/gui/map/MapViewSettings.java trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsEvent.java trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsListener.java trunk/daimonin/src/daieditor/gui/map/event/MouseOpAdapter.java trunk/daimonin/src/daieditor/gui/map/event/MouseOpEvent.java trunk/daimonin/src/daieditor/gui/map/event/MouseOpListener.java trunk/daimonin/src/daieditor/gui/map/event/package.html trunk/daimonin/src/daieditor/gui/map/package.html trunk/daimonin/src/daieditor/gui/map/tools/AbstractTool.java trunk/daimonin/src/daieditor/gui/map/tools/BasicAbstractTool.java trunk/daimonin/src/daieditor/gui/map/tools/DeletionTool.java trunk/daimonin/src/daieditor/gui/map/tools/InsertionTool.java trunk/daimonin/src/daieditor/gui/map/tools/SelectionTool.java trunk/daimonin/src/daieditor/gui/map/tools/Tool.java trunk/daimonin/src/daieditor/gui/map/tools/ToolPalette.java trunk/daimonin/src/daieditor/gui/map/tools/ToolSelector.java trunk/daimonin/src/daieditor/gui/map/tools/VoidTool.java trunk/daimonin/src/daieditor/gui/map/tools/action.properties trunk/daimonin/src/daieditor/gui/map/tools/package.html trunk/daimonin/src/daieditor/gui/package.html trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java trunk/daimonin/src/daieditor/gui/pickmapchooser/ArchNPickChangeListener.java trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapSelectionListener.java trunk/daimonin/src/daieditor/gui/prefs/AppPrefs.java trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java trunk/daimonin/src/daieditor/gui/prefs/MiscPrefs.java trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java trunk/daimonin/src/daieditor/gui/prefs/UpdatePrefs.java trunk/daimonin/src/daieditor/gui/prefs/package.html trunk/daimonin/src/daieditor/gui/selectedsquare/CellRenderer.java trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareControl.java trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java trunk/daimonin/src/daieditor/io/CMapReader.java trunk/daimonin/src/daieditor/io/CMapWriter.java trunk/daimonin/src/daieditor/io/package.html trunk/daimonin/src/daieditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/MapArchObject.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/daimonin/src/daieditor/map/MapModel.java trunk/daimonin/src/daieditor/map/package.html trunk/daimonin/src/daieditor/map/validation/AbstractValidator.java trunk/daimonin/src/daieditor/map/validation/CorrectableError.java trunk/daimonin/src/daieditor/map/validation/DefaultErrorCollector.java trunk/daimonin/src/daieditor/map/validation/DelegatingMapValidator.java trunk/daimonin/src/daieditor/map/validation/ErrorCollector.java trunk/daimonin/src/daieditor/map/validation/ErrorHandler.java trunk/daimonin/src/daieditor/map/validation/GameObjectValidationError.java trunk/daimonin/src/daieditor/map/validation/GameObjectValidator.java trunk/daimonin/src/daieditor/map/validation/GameObjectsValidationError.java trunk/daimonin/src/daieditor/map/validation/MapValidationError.java trunk/daimonin/src/daieditor/map/validation/MapValidator.java trunk/daimonin/src/daieditor/map/validation/SquareValidationError.java trunk/daimonin/src/daieditor/map/validation/SquareValidator.java trunk/daimonin/src/daieditor/map/validation/ValidationError.java trunk/daimonin/src/daieditor/map/validation/Validator.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedMobOrSpawnPointChecker.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedMobOrSpawnPointError.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareError.java trunk/daimonin/src/daieditor/map/validation/checks/ConnectedInsideContainerChecker.java trunk/daimonin/src/daieditor/map/validation/checks/ConnectedInsideContainerError.java trunk/daimonin/src/daieditor/map/validation/checks/ConnectedPickableChecker.java trunk/daimonin/src/daieditor/map/validation/checks/ConnectedPickableError.java trunk/daimonin/src/daieditor/map/validation/checks/DoubleLayerChecker.java trunk/daimonin/src/daieditor/map/validation/checks/DoubleLayerError.java trunk/daimonin/src/daieditor/map/validation/checks/DoubleTypeChecker.java trunk/daimonin/src/daieditor/map/validation/checks/DoubleTypeError.java trunk/daimonin/src/daieditor/map/validation/checks/EmptySpawnPointChecker.java trunk/daimonin/src/daieditor/map/validation/checks/EmptySpawnPointError.java trunk/daimonin/src/daieditor/map/validation/checks/ExitChecker.java trunk/daimonin/src/daieditor/map/validation/checks/ExitError.java trunk/daimonin/src/daieditor/map/validation/checks/MapDifficultyChecker.java trunk/daimonin/src/daieditor/map/validation/checks/MapDifficultyError.java trunk/daimonin/src/daieditor/map/validation/checks/MobOutsideSpawnPointChecker.java trunk/daimonin/src/daieditor/map/validation/checks/MobOutsideSpawnPointError.java trunk/daimonin/src/daieditor/map/validation/checks/SlayingChecker.java trunk/daimonin/src/daieditor/map/validation/checks/SlayingError.java trunk/daimonin/src/daieditor/map/validation/checks/SquareWithoutFloorChecker.java trunk/daimonin/src/daieditor/map/validation/checks/SquareWithoutFloorError.java trunk/daimonin/src/daieditor/map/validation/checks/SysObjectNotOnLayerZeroChecker.java trunk/daimonin/src/daieditor/map/validation/checks/SysObjectNotOnLayerZeroError.java trunk/daimonin/src/daieditor/map/validation/checks/TilePathsChecker.java trunk/daimonin/src/daieditor/map/validation/checks/TilePathsError.java trunk/daimonin/src/daieditor/map/validation/checks/package.html trunk/daimonin/src/daieditor/map/validation/package.html trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties trunk/daimonin/src/daieditor/messages_fr.properties trunk/daimonin/src/daieditor/messages_sv.properties trunk/daimonin/src/daieditor/overview.html trunk/daimonin/src/daieditor/package.html trunk/daimonin/src/daieditor/tod.properties trunk/daimonin/src/daieditor/tod_de.properties trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java trunk/daimonin/src/test/daieditor/gui/prefs/AppPrefsTest.java trunk/daimonin/src/test/daieditor/gui/prefs/ResPrefsTest.java trunk/daimonin/src/test/daieditor/io/PathManagerTest.java trunk/daimonin/src/test/daieditor/map/MapArchObjectTest.java trunk/daimonin/src/test/daieditor/map/package.html trunk/daimonin/src/test/daieditor/map/validation/AbstractValidatorTest.java trunk/gridarta.iml trunk/gridarta.ipr trunk/project.properties trunk/src/app/net/sf/gridarta/AbstractMainControl.java trunk/src/app/net/sf/gridarta/ArchTypeParseException.java trunk/src/app/net/sf/gridarta/CAttribBitmask.java trunk/src/app/net/sf/gridarta/CFArchAttrib.java trunk/src/app/net/sf/gridarta/CFArchType.java trunk/src/app/net/sf/gridarta/CFArchTypeList.java trunk/src/app/net/sf/gridarta/CFTreasureListTree.java trunk/src/app/net/sf/gridarta/CommonConstants.java trunk/src/app/net/sf/gridarta/CopyBuffer.java trunk/src/app/net/sf/gridarta/MainControl.java trunk/src/app/net/sf/gridarta/MainControlListener.java trunk/src/app/net/sf/gridarta/Size2D.java trunk/src/app/net/sf/gridarta/Spells.java trunk/src/app/net/sf/gridarta/action.properties trunk/src/app/net/sf/gridarta/data/AbstractNamedObject.java trunk/src/app/net/sf/gridarta/data/AbstractNamedObjects.java trunk/src/app/net/sf/gridarta/data/NamedObject.java trunk/src/app/net/sf/gridarta/data/NamedObjects.java trunk/src/app/net/sf/gridarta/data/NamedTreeNode.java trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeParser.java trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSet.java trunk/src/app/net/sf/gridarta/gameobject/ArchAttribType.java trunk/src/app/net/sf/gridarta/gameobject/Archetype.java trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java trunk/src/app/net/sf/gridarta/gameobject/Collectable.java trunk/src/app/net/sf/gridarta/gameobject/Collector.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObjectContainer.java trunk/src/app/net/sf/gridarta/gameobject/IsArchetypeException.java trunk/src/app/net/sf/gridarta/gameobject/MultiArchData.java trunk/src/app/net/sf/gridarta/gameobject/NotArchetypeException.java trunk/src/app/net/sf/gridarta/gameobject/NotInsideContainerException.java trunk/src/app/net/sf/gridarta/gameobject/RecursiveGameObjectIterator.java trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObject.java trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObject.java trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationParseException.java trunk/src/app/net/sf/gridarta/gameobject/anim/DuplicateAnimationException.java trunk/src/app/net/sf/gridarta/gameobject/anim/package.html trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObject.java trunk/src/app/net/sf/gridarta/gameobject/face/AbstractFaceObjects.java trunk/src/app/net/sf/gridarta/gameobject/face/FaceObject.java trunk/src/app/net/sf/gridarta/gameobject/face/FaceObjects.java trunk/src/app/net/sf/gridarta/gameobject/face/package.html trunk/src/app/net/sf/gridarta/gameobject/package.html trunk/src/app/net/sf/gridarta/gameobject/scripts/UndefinedEventArchetypeException.java trunk/src/app/net/sf/gridarta/gameobject/scripts/UndefinedEventArchetypeNameException.java trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/ArchetypeChooser.java trunk/src/app/net/sf/gridarta/gui/FileField.java trunk/src/app/net/sf/gridarta/gui/GSplitPane.java trunk/src/app/net/sf/gridarta/gui/HideFileFilterProxy.java trunk/src/app/net/sf/gridarta/gui/InsertionObjectChooser.java trunk/src/app/net/sf/gridarta/gui/MainView.java trunk/src/app/net/sf/gridarta/gui/StatusBar.java trunk/src/app/net/sf/gridarta/gui/connectionview/CellRenderer.java trunk/src/app/net/sf/gridarta/gui/connectionview/Connection.java trunk/src/app/net/sf/gridarta/gui/connectionview/ConnectionControl.java trunk/src/app/net/sf/gridarta/gui/connectionview/ConnectionView.java trunk/src/app/net/sf/gridarta/gui/map/LevelRenderer.java trunk/src/app/net/sf/gridarta/gui/map/MapCursor.java trunk/src/app/net/sf/gridarta/gui/map/MapCursorEvent.java trunk/src/app/net/sf/gridarta/gui/map/MapCursorListener.java trunk/src/app/net/sf/gridarta/gui/map/MapGrid.java trunk/src/app/net/sf/gridarta/gui/map/MapGridEvent.java trunk/src/app/net/sf/gridarta/gui/map/MapGridListener.java trunk/src/app/net/sf/gridarta/gui/map/MapSelectionEvent.java trunk/src/app/net/sf/gridarta/gui/map/MapSelectionListener.java trunk/src/app/net/sf/gridarta/gui/map/package.html trunk/src/app/net/sf/gridarta/gui/maptilelist/MapTileSelection.java trunk/src/app/net/sf/gridarta/gui/maptilelist/MapTileSelectionCache.java trunk/src/app/net/sf/gridarta/gui/package.html trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java trunk/src/app/net/sf/gridarta/help/Help.java trunk/src/app/net/sf/gridarta/help/HtmlPane.java trunk/src/app/net/sf/gridarta/help/package.html trunk/src/app/net/sf/gridarta/io/AbstractMapReader.java trunk/src/app/net/sf/gridarta/io/AbstractMapWriter.java trunk/src/app/net/sf/gridarta/io/IOUtils.java trunk/src/app/net/sf/gridarta/io/InvalidMapFormatException.java trunk/src/app/net/sf/gridarta/io/MapReader.java trunk/src/app/net/sf/gridarta/io/MapWriter.java trunk/src/app/net/sf/gridarta/io/PathManager.java trunk/src/app/net/sf/gridarta/io/package.html trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java trunk/src/app/net/sf/gridarta/map/AbstractMapModel.java trunk/src/app/net/sf/gridarta/map/MapArchObject.java trunk/src/app/net/sf/gridarta/map/MapArchObjectListener.java trunk/src/app/net/sf/gridarta/map/MapControl.java trunk/src/app/net/sf/gridarta/map/MapControlListener.java trunk/src/app/net/sf/gridarta/map/MapModel.java trunk/src/app/net/sf/gridarta/map/MapModelEvent.java trunk/src/app/net/sf/gridarta/map/MapModelListener.java trunk/src/app/net/sf/gridarta/map/MapSquare.java trunk/src/app/net/sf/gridarta/map/MapState.java trunk/src/app/net/sf/gridarta/map/MapTransactionListener.java trunk/src/app/net/sf/gridarta/map/MapType.java trunk/src/app/net/sf/gridarta/map/package.html trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/package.html trunk/src/app/net/sf/gridarta/undo/UndoModel.java trunk/src/app/net/sf/gridarta/undo/UndoState.java trunk/src/test/net/sf/gridarta/Size2DTest.java trunk/src/test/net/sf/gridarta/gui/HideFileFilterProxyTest.java trunk/src/test/net/sf/gridarta/gui/package.html trunk/src/test/net/sf/gridarta/package.html Added Paths: ----------- trunk/textedit.iml Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/build.xml 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + ~ Copyright (C) 2000-2007 The Gridarta Developers. + ~ + ~ This program is free software; you can redistribute it and/or modify + ~ it under the terms of the GNU General Public License as published by + ~ the Free Software Foundation; either version 2 of the License, or + ~ (at your option) any later version. + ~ + ~ This program is distributed in the hope that it will be useful, + ~ but WITHOUT ANY WARRANTY; without even the implied warranty of + ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ~ GNU General Public License for more details. + ~ + ~ You should have received a copy of the GNU General Public License along + ~ with this program; if not, write to the Free Software Foundation, Inc., + ~ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + --> + <!DOCTYPE project [ <!ENTITY catalogForAnt SYSTEM "src/doc/dtd/catalogForAnt.xml"> ]> Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/build.xml 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,24 +1,41 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - - This is the Ant buildfile for the Gridarta Editor for Crossfire - - (c) 2003 by Andreas Vogl - - (c) 2005-2006 by Christian Hujer - - - - Apache Ant is a Java-based cross-platform build tool. - - For more information about Ant, visit <http://ant.apache.org/> - - - - Do not move, edit or delete this file. It should stay in the - - main directory of the Crossfire Editor. - - - - How to use Ant for the Crossfire Editor: - - - - o Install Ant on your system. Make sure both the JAVA_HOME - - and ANT_HOME environment variables are set correctly. - - - - o Change into the Crossfire Editor main directory. - - run "ant" to compile, - - run "ant run" to run the editor. + ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + ~ Copyright (C) 2000-2007 The Gridarta Developers. + ~ + ~ This program is free software; you can redistribute it and/or modify + ~ it under the terms of the GNU General Public License as published by + ~ the Free Software Foundation; either version 2 of the License, or + ~ (at your option) any later version. + ~ + ~ This program is distributed in the hope that it will be useful, + ~ but WITHOUT ANY WARRANTY; without even the implied warranty of + ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ~ GNU General Public License for more details. + ~ + ~ You should have received a copy of the GNU General Public License along + ~ with this program; if not, write to the Free Software Foundation, Inc., + ~ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. --> + +<!-- + ~ This is the Ant buildfile for the Gridarta Editor for Crossfire + ~ + ~ Apache Ant is a Java-based cross-platform build tool. + ~ For more information about Ant, visit <http://ant.apache.org/> + ~ + ~ Do not move, edit or delete this file. It should stay in the + ~ main directory of the Crossfire Editor. + ~ + ~ How to use Ant for the Crossfire Editor: + ~ + ~ o Install Ant on your system. Make sure both the JAVA_HOME + ~ and ANT_HOME environment variables are set correctly. + ~ + ~ o Change into the Crossfire Editor main directory. + ~ run "ant" to compile, + ~ run "ant run" to run the editor. + --> <project name="Gridarta Editor for Crossfire" default="jar"> <!-- set properties and clean build directory --> Modified: trunk/crossfire/crossfire.iml =================================================================== --- trunk/crossfire/crossfire.iml 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/crossfire.iml 2007-01-20 22:18:43 UTC (rev 1643) @@ -59,7 +59,6 @@ <SOURCES /> </library> </orderEntry> - <orderEntry type="library" name="japi" level="project" /> <orderEntry type="library" name="log4j-1.2.13" level="project" /> <orderEntry type="library" name="junit-4.1" level="project" /> <orderEntry type="library" name="annotations" level="project" /> @@ -75,7 +74,7 @@ </component> <component name="copyright"> <Base> - <setting name="state" value="2" /> + <setting name="state" value="1" /> </Base> <LanguageOptions name="$TEMPLATE$"> <option name="templateOptions"> Modified: trunk/crossfire/src/cfeditor/AutojoinList.java =================================================================== --- trunk/crossfire/src/cfeditor/AutojoinList.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/AutojoinList.java 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,25 +1,20 @@ /* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. * - * (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 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. * - * 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. - * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package cfeditor; Modified: trunk/crossfire/src/cfeditor/AutojoinLists.java =================================================================== --- trunk/crossfire/src/cfeditor/AutojoinLists.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/AutojoinLists.java 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,21 +1,20 @@ /* - * Gridarta Map Editor. - * Copyright (C) 2007 The Gridarta Developers + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. + * This program is 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. + * 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. + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package cfeditor; Modified: trunk/crossfire/src/cfeditor/BshThread.java =================================================================== --- trunk/crossfire/src/cfeditor/BshThread.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/BshThread.java 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,4 +1,23 @@ /* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/* * Created on 07-nov.-2004 * * To change the template for this generated file go to Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,25 +1,20 @@ /* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. * - * (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 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. * - * 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. - * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package cfeditor; Modified: trunk/crossfire/src/cfeditor/CFJavaEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/CFJavaEditor.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/CFJavaEditor.java 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,25 +1,20 @@ /* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. * - * (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 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. * - * 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. - * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package cfeditor; Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,25 +1,20 @@ /* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. * - * (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 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. * - * 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. - * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package cfeditor; Modified: trunk/crossfire/src/cfeditor/CFilterControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CFilterControl.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/CFilterControl.java 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,4 +1,23 @@ /* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/* * Created on 12-sept.-2004 * * To change the template for this generated file go to Modified: trunk/crossfire/src/cfeditor/CGUIUtils.java =================================================================== --- trunk/crossfire/src/cfeditor/CGUIUtils.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/CGUIUtils.java 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,25 +1,20 @@ /* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. * - * (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 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. * - * 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. - * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package cfeditor; Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,26 +1,20 @@ /* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * Copyright (C) 2006 The Gridarta Developers + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. * - * (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 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. * - * 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. - * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package cfeditor; Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/CMainView.java 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,25 +1,20 @@ /* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. * - * (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 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. * - * 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. - * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package cfeditor; Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,25 +1,20 @@ /* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. * - * (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 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. * - * 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. - * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package cfeditor; Modified: trunk/crossfire/src/cfeditor/CResourceLoader.java =================================================================== --- trunk/crossfire/src/cfeditor/CResourceLoader.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/CResourceLoader.java 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,4 +1,23 @@ /* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/* * Created on 09-nov.-2004 * * To change the template for this generated file go to Modified: trunk/crossfire/src/cfeditor/CScriptController.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptController.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/CScriptController.java 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,4 +1,23 @@ /* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/* * Created on 01-nov.-2004 * * To change the template for this generated file go to Modified: trunk/crossfire/src/cfeditor/CScriptModel.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptModel.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/CScriptModel.java 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,4 +1,23 @@ /* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/* * Created on 01-nov.-2004 * * To change the template for this generated file go to Modified: trunk/crossfire/src/cfeditor/CScriptView.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptView.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/CScriptView.java 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,4 +1,23 @@ /* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/* * Created on 01-nov.-2004 * * To change the template for this generated file go to Modified: trunk/crossfire/src/cfeditor/CSettings.java =================================================================== --- trunk/crossfire/src/cfeditor/CSettings.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/CSettings.java 2007-01-20 22:18:43 UTC (rev 1643) @@ -1,25 +1,20 @@ /* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. * - * (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 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. * - * 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. - * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package cfeditor; Modified: trunk/crossfire/src/cfeditor/CStartupScreen.java =================================================================== --- trunk/crossfire/src/cfeditor/CStartupScreen.java 2007-01-20 21:34:20 UTC (rev 1642) +++ trunk/crossfire/src/cfeditor/CS... [truncated message content] |
From: <chr...@us...> - 2007-01-20 22:35:13
|
Revision: 1645 http://svn.sourceforge.net/gridarta/?rev=1645&view=rev Author: christianhujer Date: 2007-01-20 14:35:10 -0800 (Sat, 20 Jan 2007) Log Message: ----------- Fixed dependencies. Modified Paths: -------------- trunk/crossfire/crossfire.iml trunk/daimonin/daimonin.iml trunk/gridarta.iml trunk/textedit.iml Modified: trunk/crossfire/crossfire.iml =================================================================== --- trunk/crossfire/crossfire.iml 2007-01-20 22:34:49 UTC (rev 1644) +++ trunk/crossfire/crossfire.iml 2007-01-20 22:35:10 UTC (rev 1645) @@ -70,6 +70,7 @@ <orderEntry type="library" name="japi-lib-swing-prefs-0.1" level="project" /> <orderEntry type="library" name="japi-lib-swing-extlib-0.1" level="project" /> <orderEntry type="library" name="japi-lib-swing-about-0.1" level="project" /> + <orderEntry type="module" module-name="textedit" /> <orderEntryProperties /> </component> <component name="copyright"> Modified: trunk/daimonin/daimonin.iml =================================================================== --- trunk/daimonin/daimonin.iml 2007-01-20 22:34:49 UTC (rev 1644) +++ trunk/daimonin/daimonin.iml 2007-01-20 22:35:10 UTC (rev 1645) @@ -34,6 +34,7 @@ <orderEntry type="library" name="japi-lib-swing-tod-0.1" level="project" /> <orderEntry type="library" name="japi-lib-swing-extlib-0.1" level="project" /> <orderEntry type="library" name="japi-lib-swing-about-0.1" level="project" /> + <orderEntry type="module" module-name="textedit" /> <orderEntryProperties /> </component> <component name="copyright"> Modified: trunk/gridarta.iml =================================================================== --- trunk/gridarta.iml 2007-01-20 22:34:49 UTC (rev 1644) +++ trunk/gridarta.iml 2007-01-20 22:35:10 UTC (rev 1645) @@ -11,6 +11,7 @@ <excludeFolder url="file://$MODULE_DIR$/crossfire" /> <excludeFolder url="file://$MODULE_DIR$/daimonin" /> <excludeFolder url="file://$MODULE_DIR$/dest" /> + <excludeFolder url="file://$MODULE_DIR$/src/app/net/sf/gridarta/textedit" /> <excludeFolder url="file://$MODULE_DIR$/src/doc" /> </content> <orderEntry type="inheritedJdk" /> Modified: trunk/textedit.iml =================================================================== --- trunk/textedit.iml 2007-01-20 22:34:49 UTC (rev 1644) +++ trunk/textedit.iml 2007-01-20 22:35:10 UTC (rev 1645) @@ -1,13 +1,16 @@ <?xml version="1.0" encoding="UTF-8"?> <module version="4" relativePaths="true" type="JAVA_MODULE"> <component name="ModuleRootManager" /> - <component name="NewModuleRootManager" inherit-compiler-output="true"> + <component name="NewModuleRootManager" inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$/classes" /> <exclude-output /> <content url="file://$MODULE_DIR$/src/app/net/sf/gridarta/textedit"> <sourceFolder url="file://$MODULE_DIR$/src/app/net/sf/gridarta/textedit" isTestSource="false" packagePrefix="net.sf.gridarta.textedit" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" name="log4j-1.2.13" level="project" /> + <orderEntry type="library" name="annotations" level="project" /> <orderEntryProperties /> </component> <component name="copyright"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-21 12:10:54
|
Revision: 1650 http://svn.sourceforge.net/gridarta/?rev=1650&view=rev Author: akirschbaum Date: 2007-01-21 04:10:54 -0800 (Sun, 21 Jan 2007) Log Message: ----------- Properly enable/disable file menu entries. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CFJavaEditor.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/MapViewIFrame.java trunk/crossfire/src/cfeditor/action.properties trunk/crossfire/src/cfeditor/map/MapControl.java trunk/crossfire/src/cfeditor/messages.properties trunk/crossfire/src/cfeditor/messages_de.properties trunk/crossfire/src/cfeditor/messages_fr.properties trunk/crossfire/src/cfeditor/messages_sv.properties trunk/daimonin/src/daieditor/CFJavaEditor.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/MapViewIFrame.java trunk/daimonin/src/daieditor/action.properties trunk/daimonin/src/daieditor/map/MapControl.java trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties trunk/daimonin/src/daieditor/messages_fr.properties trunk/daimonin/src/daieditor/messages_sv.properties trunk/src/app/net/sf/gridarta/MainControl.java trunk/src/app/net/sf/gridarta/action.properties trunk/src/app/net/sf/gridarta/map/MapControl.java trunk/src/app/net/sf/gridarta/messages.properties Added Paths: ----------- trunk/src/app/net/sf/gridarta/map/MapFileActions.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/crossfire/ChangeLog 2007-01-21 12:10:54 UTC (rev 1650) @@ -1,3 +1,7 @@ +2007-01-21 Andreas Kirschbaum + + * Properly enable/disable file menu entries. + 2007-01-13 Andreas Kirschbaum * In map window title, use map-directory-relative map path if Modified: trunk/crossfire/src/cfeditor/CFJavaEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/CFJavaEditor.java 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/crossfire/src/cfeditor/CFJavaEditor.java 2007-01-21 12:10:54 UTC (rev 1650) @@ -20,6 +20,7 @@ package cfeditor; import static cfeditor.CMainControl.PREFS_LANGUAGE; +import cfeditor.map.MapControl; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; @@ -142,7 +143,7 @@ } if (outfile != null) { - mainControl.createImageWanted(new File(outfile)); // create map image + mainControl.createImageWanted(mainControl.getCurrentMap(), new File(outfile)); // create map image System.exit(0); // exit } @@ -156,9 +157,9 @@ } if (in.canRead()) { - mainControl.openFile(in); - mainControl.createImageWanted(out); - mainControl.close(); + final MapControl mapControl = mainControl.openFile(in); + mainControl.createImageWanted(mapControl, out); + mainControl.close(mapControl); } } Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-21 12:10:54 UTC (rev 1650) @@ -713,9 +713,9 @@ return mapControl; } - /** Invoked when the user wants to close the current level. */ - public void close() { - if (currentMap != null && closeLevel(currentMap) && currentMap != null) { + /** {@inheritDoc} */ + public void close(@NotNull final MapControl mapControl) { + if (closeLevel(mapControl) && currentMap != null) { if (currentMap.getMapViewFrame() != null) { mainView.setCurrentLevelView(currentMap.getMapViewFrame()); } @@ -1009,31 +1009,8 @@ return true; } - /** Invoked when user wants to save the current level. */ - public void save() { - if (currentMap == null) { - return; - } - - currentMap.save(); - } - - /** Invoked when user wants to save the current level to certain file. */ - public void saveAs() { - saveLevelAsWanted(currentMap); - } - - /** - * Invoked when user wants to save a level to certain file. - * @param mapControl map control of the map to be saved - * @return <code>true</code> if the user confirmed saving the map and the map was saved successfully, otherwise <code>false</code> - */ - public boolean saveLevelAsWanted(final MapControl mapControl) { - if (mapControl == null) { - log.warn(ACTION_FACTORY.getString("logSaveLevelAsWithNull")); - return false; - } - + /** {@inheritDoc} */ + public boolean saveLevelAsWanted(@NotNull final MapControl mapControl) { final JFileChooser fileChooser = new JFileChooser(); fileChooser.setDialogTitle("Save Level File As"); fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); @@ -1069,31 +1046,21 @@ } } - /** - * Create an image of the current map and save it as file. - * In this method, a filechooser is opened to let the user select - * an output file name/path for the png image. - */ - public void createImg() { - final MapControl mapControl = currentMap; // control of current map + /** {@inheritDoc} */ + public void createImage(@NotNull final MapControl mapControl) { + if (strImageDir == null) { + strImageDir = mapDir.getAbsolutePath(); + } - if (mapControl == null) { - // there is no map open (should not happen due to disabled menus) - ACTION_FACTORY.showMessageDialog(mainView, "createImgNoMap"); - } else { - if (strImageDir == null) { - strImageDir = mapDir.getAbsolutePath(); - } - - String filename = strImageDir + "/" + mapControl.getMapFileName() + ".png"; - try { - final JFileChooser fileChooser = new JFileChooser(strImageDir); - fileChooser.setDialogTitle("Save Image As"); - fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); - fileChooser.setMultiSelectionEnabled(false); - fileChooser.setSelectedFile(new File(filename)); - // set a file filter for "*.png" files - fileChooser.setFileFilter(new FileFilter() { + String filename = strImageDir + "/" + mapControl.getMapFileName() + ".png"; + try { + final JFileChooser fileChooser = new JFileChooser(strImageDir); + fileChooser.setDialogTitle("Save Image As"); + fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); + fileChooser.setMultiSelectionEnabled(false); + fileChooser.setSelectedFile(new File(filename)); + // set a file filter for "*.png" files + fileChooser.setFileFilter(new FileFilter() { @Override public String getDescription() { return "*.png"; } @@ -1103,60 +1070,43 @@ } }); - final int returnVal = fileChooser.showSaveDialog(mainView); - if (returnVal == JFileChooser.APPROVE_OPTION) { - // got the filepath, now create image - filename = fileChooser.getSelectedFile().getAbsolutePath(); - strImageDir = fileChooser.getSelectedFile().getParentFile().getAbsolutePath(); - if (!filename.endsWith(".png")) { - filename += ".png"; - } - final File file = new File(filename); - if (!file.exists() || ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, "overwriteOtherFile", filename) == JOptionPane.YES_OPTION) { - mapControl.getMapViewFrame().printFullImage(new File(filename)); - } + final int returnVal = fileChooser.showSaveDialog(mainView); + if (returnVal == JFileChooser.APPROVE_OPTION) { + // got the filepath, now create image + filename = fileChooser.getSelectedFile().getAbsolutePath(); + strImageDir = fileChooser.getSelectedFile().getParentFile().getAbsolutePath(); + if (!filename.endsWith(".png")) { + filename += ".png"; } - } catch (final IOException e) { - ACTION_FACTORY.showMessageDialog(mainView, "createImgIOException", filename, e.getMessage()); + final File file = new File(filename); + if (!file.exists() || ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, "overwriteOtherFile", filename) == JOptionPane.YES_OPTION) { + mapControl.getMapViewFrame().printFullImage(new File(filename)); + } } + } catch (final IOException e) { + ACTION_FACTORY.showMessageDialog(mainView, "createImageIOException", filename, e.getMessage()); } } /** - * Create an image of the current map and save it as file. - * In this method, the filename is already given, so the image - * is created directly (if possible). - * @param file the png image file to create - */ - public void createImageWanted(final File file) { - createImageWanted(currentMap, file); - } - - /** * Create an image of the specified map and save it as file. * In this method, the filename is already given, so the image * is created directly (if possible). * @param mapControl the controller of map to save * @param file the png image file to create */ - public void createImageWanted(final MapControl mapControl, final File file) { - - if (mapControl == null) { - // there is no map open (should not happen due to disabled menus) - ACTION_FACTORY.showMessageDialog(mainView, "createImgNoMap"); - } else { - final File tmpFile = new File(file.getPath() + ".tmp"); - try { - mapControl.getMapViewFrame().printFullImage(tmpFile); - if (!tmpFile.renameTo(file)) { - throw new IOException("cannot rename " + tmpFile + " to " + file); - } - if (log.isInfoEnabled()) { - log.info(ACTION_FACTORY.format("logImageCreated", file, mapControl.getMapFileName())); - } - } catch (final IOException e) { - ACTION_FACTORY.showMessageDialog(mainView, "createImgIOException", file); + public void createImageWanted(@NotNull final MapControl mapControl, final File file) { + final File tmpFile = new File(file.getPath() + ".tmp"); + try { + mapControl.getMapViewFrame().printFullImage(tmpFile); + if (!tmpFile.renameTo(file)) { + throw new IOException("cannot rename " + tmpFile + " to " + file); } + if (log.isInfoEnabled()) { + log.info(ACTION_FACTORY.format("logImageCreated", file, mapControl.getMapFileName())); + } + } catch (final IOException e) { + ACTION_FACTORY.showMessageDialog(mainView, "createImageIOException", file); } } @@ -1446,9 +1396,8 @@ listenerList.remove(MainControlListener.class, listener); } - /** Invoked when user wants to revert the current map to previously saved state. */ - public void revert() { - final MapControl mapControl = currentMap; // "modified map" to be reverted + /** {@inheritDoc} */ + public void revert(@NotNull final MapControl mapControl) { if (ACTION_FACTORY.showQuestionDialog(mainView, "confirmRevertMap", mapControl.getMapFileName())) { final File mfile = mapControl.getMapFile(); // store file final Point initial = mapControl.getViewPosition(); @@ -1499,23 +1448,6 @@ } /** - * Returns whether a level is being edited or not. - * @return true if a level is being edited or false if not - */ - boolean isLevelEdited() { - return currentMap != null && currentMap.isModified(); - } - - /** - * Returns whether the level can be just saved (true) or does it need - * to be saved as (false). - * @return true if level can be just saved, false if not - */ - boolean isPlainSaveEnabled() { - return currentMap != null && currentMap.isPlainSaveEnabled(); - } - - /** * Returns the grid icon. * @return The grid icon. */ Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/crossfire/src/cfeditor/CMainView.java 2007-01-21 12:10:54 UTC (rev 1650) @@ -53,6 +53,7 @@ import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.StatusBar; import net.sf.gridarta.help.Help; +import net.sf.gridarta.map.MapFileActions; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.ToggleAction; import net.sf.japi.swing.about.AboutDialog; @@ -150,12 +151,16 @@ /** The pickmap chooser control. */ private PickmapChooserControl pickmapChooserControl = null; + /** The map file actions for the global menubar. */ + @NotNull private final MapFileActions mapFileAction; + /** * Constructs the main view and registers the given main controller. */ CMainView() { super(ACTION_FACTORY.format("mainWindow.title")); initActions(); + mapFileAction = new MapFileActions(mainControl, null); final ImageIcon icon = CGUIUtils.getIcon(IGUIConstants.APP_ICON); if (icon != null) { @@ -491,11 +496,6 @@ mapArchPanel.refresh(); } - public void setRevertMenuEnabled(final boolean state) { - aRevert.setEnabled(state && mainControl.isPlainSaveEnabled()); - aSave.setEnabled(state && mainControl.isPlainSaveEnabled()); - } - /** Refresh the state of the menu only. */ public void refreshMenus() { // TODO: This method shouldn't really be invoked. @@ -828,16 +828,6 @@ aTileShow.setEnabled(false); // not yet implemented } - private final Action aClose = ACTION_FACTORY.createAction(true, "close", mainControl); - - private final Action aRevert = ACTION_FACTORY.createAction(true, "revert", mainControl); - - private final Action aSave = ACTION_FACTORY.createAction(true, "save", mainControl); - - private final Action aSaveAs = ACTION_FACTORY.createAction(true, "saveAs", mainControl); - - private final Action aCreateImg = ACTION_FACTORY.createAction(true, "createImg", mainControl); - private final Action aEnterExit = ACTION_FACTORY.createAction(true, "enterExit", mainControl); private final Action aTileShow = ACTION_FACTORY.createToggle(true, "tileShow", mainControl); @@ -884,12 +874,7 @@ aViewTreasurelists.setEnabled(true); final boolean mapState = mainControl.getCurrentMap() != null; - final boolean fLevelEdited = mapState && mainControl.isLevelEdited(); final boolean selState = mapState && mainControl.getCurrentMap().getMapViewFrame().isHighlight(); - aCreateImg.setEnabled(true); - aClose.setEnabled(mapState); - aSave.setEnabled(mapState && fLevelEdited && mainControl.isPlainSaveEnabled()); - aSaveAs.setEnabled(mapState); //aTileShow.setEnabled(mapState); aMapProperties.setEnabled(mapState); for (int direction = 0; direction < directionsMap.length; direction++) { @@ -897,7 +882,6 @@ ACTION_FACTORY.getAction(directionsMap[direction]).setEnabled(mtp != null && mtp.length() > 0); } aEnterExit.setEnabled(selState); - aRevert.setEnabled(mapState && fLevelEdited && mainControl.isPlainSaveEnabled()); aGridVisible.setEnabled(mapState); ((ToggleAction) aGridVisible).setSelected(mainControl.isGridVisible()); rebuildWindowMenu(); Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-21 12:10:54 UTC (rev 1650) @@ -37,6 +37,7 @@ import net.sf.gridarta.gui.map.MapGridListener; import net.sf.gridarta.io.PathManager; import net.sf.gridarta.map.MapControlListener; +import net.sf.gridarta.map.MapFileActions; import net.sf.gridarta.map.MapModelEvent; import net.sf.gridarta.map.MapModelListener; import net.sf.japi.swing.ActionFactory; @@ -69,6 +70,9 @@ /** The underlying mapview object. */ private final CMapViewBasic view; + /** The map file actions for this map. */ + @NotNull private final MapFileActions mapFileActions; + /** * The {@link MapModelListener} used to detect changes in the map model * that should be reflected in the window title. @@ -134,6 +138,7 @@ view = new CMapViewBasic(mainControl, mapControl, this, initial); getContentPane().setLayout(new BorderLayout()); getContentPane().add(view, BorderLayout.CENTER); + mapFileActions = null;//new MapFileActions(mainControl, mapControl); // XXX: uncomment this after JAPI can create multiple action sets setJMenuBar(ACTION_FACTORY.createMenuBar(true, "mapwindow")); mapControl.addMapControlListener(mapControlListener); @@ -161,12 +166,6 @@ /** Update the Map-Window Title (according to name and changeFlag). */ private void updateTitle() { setTitle(PathManager.getMapPath(mapControl.getMapFileName()) + " [ " + mapControl.getMapArchObject().getMapDisplayName() + " ]" + (mapControl.isModified() ? " *" : "")); - - // disable menu file->revert to revert the map - // XXX: should not be here - if (mainControl.getCurrentMap() == mapControl) { - mainControl.getMainView().setRevertMenuEnabled(mapControl.isModified()); - } } // following a bunch of wrapper methods which just pass access Modified: trunk/crossfire/src/cfeditor/action.properties =================================================================== --- trunk/crossfire/src/cfeditor/action.properties 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/crossfire/src/cfeditor/action.properties 2007-01-21 12:10:54 UTC (rev 1650) @@ -28,7 +28,7 @@ # Menus main.menubar=file edit map cursor pickmaps resources tools analyze view plugins window help -file.menu=createNew open close - save saveAs revert createImg - options - exit +file.menu=createNew open close - save saveAs revert createImage - options - exit edit.menu=undo redo - clear cut copy paste - replace fillAbove fillBelow randFillAbove randFillBelow floodfill - selectAll map.menu=autoJoin - gridVisible enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterUpperMap enterLowerMap tileShow - mapProperties cursor.menu=moveCursor - selectTile startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes @@ -43,7 +43,7 @@ mapwindow.menubar=mapwindowFile mapwindowEdit mapwindowMap mapwindowCursor mapwindowView -mapwindowFile.menu=save saveAs createImg - revert - close +mapwindowFile.menu=save saveAs createImage - revert - close mapwindowEdit.menu=undo redo - clear cut copy paste - replace fillAbove fillBelow randFillAbove randFillBelow floodfill mapwindowMap.menu=autoJoin - gridVisible enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterUpperMap enterLowerMap tileShow - mapProperties mapwindowCursor.menu=moveCursor - selectTile startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes @@ -60,18 +60,8 @@ open.icon=general/Open16 -close.icon=EmptySmallIcon - closeAll.icon=EmptySmallIcon -save.icon=general/Save16 - -saveAs.icon=general/SaveAs16 - -revert.icon=general/Refresh16 - -createImg.icon=CreateImageSmallIcon - options.icon=general/Preferences16 exit.icon=EmptySmallIcon Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-21 12:10:54 UTC (rev 1650) @@ -206,12 +206,7 @@ mapModel.deleteMapArch(gameObject, pos, join); } - /** - * Return whether the level can be just saved (true) or does it need to be - * saved as (false). - * @return <code>true</code> if level can be just saved, <code>false</code> - * if not - */ + /** {@inheritDoc} */ public boolean isPlainSaveEnabled() { final String mapFileName = getMapFileName(); return mapFile != null && mapFileName != null && !mapFileName.equals(IGUIConstants.DEF_MAPFNAME); @@ -268,9 +263,7 @@ return mapModel.getMapSquare(pos).getLast(); } - /** - * Save the level to a file. - */ + /** {@inheritDoc} */ public void save() { if (isPickmap()) { mainControl.setStatusText("Saving pickmap '" + getMapFileName() + "'..."); Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/crossfire/src/cfeditor/messages.properties 2007-01-21 12:10:54 UTC (rev 1650) @@ -114,34 +114,6 @@ open.mnemonic=O open.accel=ctrl pressed O -close.text=Close -close.shortdescription=Close map -close.longdescription=Closes the current map -close.mnemonic=C -close.accel=ctrl pressed W - -save.text=Save -save.shortdescription=Save map -save.longdescription=Saves the current map -save.mnemonic=S -save.accel=ctrl pressed S - -saveAs.text=Save As... -saveAs.shortdescription=Save map with new name -saveAs.longdescription=Saves map with a new filename -saveAs.mnemonic=A -saveAs.accel=ctrl shift pressed S - -revert.text=Revert -revert.shortdescription=Reverts map -revert.longdescription=Reverts the map to the last saved version -revert.mnemonic=R - -createImg.text=Create Image -createImg.shortdescription=Creates a snapshot -createImg.longdescription=Creates a snapshot image and saves it to a file -createImg.mnemonic=I - options.text=Options... options.shortdescription=Shows options options.longdescription=Shows an option dialog to change the editor settings Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2007-01-21 12:10:54 UTC (rev 1650) @@ -52,10 +52,8 @@ encodeMapFile.title=Fehler beim Sichern encodeMapFile.message=Beim Sichern von {0}\nist ein Fehler aufgetreten:\n{1} -createImgNoMap.title=Kann Bild nicht erzeugen -createImgNoMap.message=Um ein Bild einer Karte erstellen zu k\xF6nnen muss eine Karte ge\xF6ffnet sein. -createImgIOException.title=Kann Bild nicht erzeugen -createImgIOException.message=Das Bild kann nicht erzeugt werden, da ein Ein-/Ausgabefehler\nbeim Schreiben von {0} aufgetreten ist:\n{1} +createImageIOException.title=Kann Bild nicht erzeugen +createImageIOException.message=Das Bild kann nicht erzeugt werden, da ein Ein-/Ausgabefehler\nbeim Schreiben von {0} aufgetreten ist:\n{1} treasurelistForbidden.title=Ung\xFCltige Auswahl treasurelistForbidden.message=Die Schatzliste {0} darf in Karten nicht verwendet werden.\nSie wird vom Crossfire-Server intern verwendet. @@ -339,10 +337,10 @@ revert.longdescription=Macht alle \xC4nderungen r\xFCckg\xE4ngig und stellt die zuletzt gespeicherte Fassung wieder her revert.mnemonic=R -createImg.text=Bild speichern... -createImg.shortdescription=Bild der Karte speichern -createImg.longdescription=Erzeugt ein Foto der Karte und speichert es -createImg.mnemonic=I +createImage.text=Bild speichern... +createImage.shortdescription=Bild der Karte speichern +createImage.longdescription=Erzeugt ein Foto der Karte und speichert es +createImage.mnemonic=I options.text=Optionen... options.shortdescription=Optionen zeigen Modified: trunk/crossfire/src/cfeditor/messages_fr.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_fr.properties 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/crossfire/src/cfeditor/messages_fr.properties 2007-01-21 12:10:54 UTC (rev 1650) @@ -122,10 +122,10 @@ revert.longdescription=Restaure la carte selon la derni\xE8re version enregistr\xE9e revert.mnemonic=R -createImg.text=Cr\xE9er image -createImg.shortdescription=Cr\xE9er une image \xE0 partir de la carte -createImg.longdescription=Cr\xE9e une image \xE0 partir de la carte et l'enregistre dans un fichier -createImg.mnemonic=I +createImage.text=Cr\xE9er image +createImage.shortdescription=Cr\xE9er une image \xE0 partir de la carte +createImage.longdescription=Cr\xE9e une image \xE0 partir de la carte et l'enregistre dans un fichier +createImage.mnemonic=I options.text=Options... options.shortdescription=Affiche les options Modified: trunk/crossfire/src/cfeditor/messages_sv.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_sv.properties 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/crossfire/src/cfeditor/messages_sv.properties 2007-01-21 12:10:54 UTC (rev 1650) @@ -43,10 +43,8 @@ encodeMapFile.title=Misslyckades att spara karta encodeMapFile.message=Kunde inte skriva fil {0}. -createImgNoMap.title=Kunde inte skapa bild -createImgNoMap.message=Du kan inte skapa en bild om ingen karta \xE4r \xF6ppnad. -createImgIOException.title=Kunde inte skapa bild -createImgIOException.message=Bilden kunde inte skapas eftersom filen {0} inte g\xE5r att skriva till. +createImageIOException.title=Kunde inte skapa bild +createImageIOException.message=Bilden kunde inte skapas eftersom filen {0} inte g\xE5r att skriva till. enterExitNoExit.title=Ingen utg\xE5ng enterExitNoExit.message=Det finns ingen giltig utg\xE5ng p\xE5 den valda punkten. @@ -280,10 +278,10 @@ revert.longdescription=\xC5terst\xE4ller kartan till den senast sparade versionen revert.mnemonic=R -createImg.text=Skapa bild -createImg.shortdescription=Skapa bild av kartan -createImg.longdescription=Skapar en bild av kartan och sparar till fil -createImg.mnemonic=B +createImage.text=Skapa bild +createImage.shortdescription=Skapa bild av kartan +createImage.longdescription=Skapar en bild av kartan och sparar till fil +createImage.mnemonic=B options.text=Inst\xE4llningar... options.shortdescription=Justera inst\xE4llningar Modified: trunk/daimonin/src/daieditor/CFJavaEditor.java =================================================================== --- trunk/daimonin/src/daieditor/CFJavaEditor.java 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/daimonin/src/daieditor/CFJavaEditor.java 2007-01-21 12:10:54 UTC (rev 1650) @@ -20,6 +20,7 @@ package daieditor; import static daieditor.CMainControl.PREFS_LANGUAGE; +import daieditor.map.MapControl; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; @@ -127,7 +128,7 @@ if (infiles.size() > 1) { System.err.println("Warning: you specified more than 1 map for creating an image. I will create an image for only one of them."); } - mainControl.createImageWanted(new File(outfile)); // create map image + mainControl.createImageWanted(mainControl.getCurrentMap(), new File(outfile)); // create map image } mainControl.refreshMenusAndToolbars(); @@ -141,9 +142,9 @@ } if (in.canRead()) { - mainControl.openFile(in); - mainControl.createImageWanted(out); - mainControl.close(); + final MapControl mapControl = mainControl.openFile(in, true); + mainControl.createImageWanted(mapControl, out); + mainControl.close(mapControl); } } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-01-21 12:10:54 UTC (rev 1650) @@ -879,9 +879,9 @@ return mapControl; } - /** Invoked when the user wants to close the current level. */ - public void close() { - if (currentMap != null && closeLevel(currentMap) && currentMap != null) { + /** {@inheritDoc} */ + public void close(@NotNull final MapControl mapControl) { + if (closeLevel(mapControl) && currentMap != null) { if (currentMap.getMapViewFrame() != null) { mainView.setCurrentLevelView(currentMap.getMapViewFrame()); } @@ -1230,31 +1230,8 @@ } } - /** Invoked when user wants to save the current level. */ - public void save() { - if (currentMap == null) { - return; - } - - currentMap.save(); - } - - /** Invoked when user wants to save the current level to certain file. */ - public void saveAs() { - saveLevelAsWanted(currentMap); - } - - /** - * Invoked when user wants to save a level to certain file. - * @param mapControl map control of the map to be saved - * @return <code>true</code> if the user confirmed saving the map and the map was saved successfully, otherwise <code>false</code> - */ - public boolean saveLevelAsWanted(final MapControl mapControl) { - if (mapControl == null) { - log.warn(ACTION_FACTORY.getString("logSaveLevelAsWithNull")); - return false; - } - + /** {@inheritDoc} */ + public boolean saveLevelAsWanted(@NotNull final MapControl mapControl) { final JFileChooser fileChooser = new JFileChooser(); fileChooser.setDialogTitle("Save Map Or Script As"); fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); @@ -1293,47 +1270,36 @@ } } - /** - * Create an image of the current map and save it as file. - * In this method, a filechooser is opened to let the user select - * an output file name/path for the png image. - */ - public void createImg() { - final MapControl mapControl = currentMap; // control of current map + /** {@inheritDoc} */ + public void createImage(@NotNull final MapControl mapControl) { + if (strImageDir == null) { + strImageDir = mapDir.getAbsolutePath(); + } - if (mapControl == null) { - // there is no map open (should not happen due to disabled menus) - ACTION_FACTORY.showMessageDialog(mainView, "createImgNoMap"); - } else { - if (strImageDir == null) { - strImageDir = mapDir.getAbsolutePath(); - } + File file = new File(strImageDir, mapControl.getMapFileName() + ".png"); + try { + final JFileChooser fileChooser = new JFileChooser(strImageDir); + fileChooser.setDialogTitle("Save Image As"); + fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); + fileChooser.setMultiSelectionEnabled(false); + fileChooser.setSelectedFile(file); + // set a file filter for "*.png" files + fileChooser.setFileFilter(pngFileFilter); - File file = new File(strImageDir, mapControl.getMapFileName() + ".png"); - try { - final JFileChooser fileChooser = new JFileChooser(strImageDir); - fileChooser.setDialogTitle("Save Image As"); - fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); - fileChooser.setMultiSelectionEnabled(false); - fileChooser.setSelectedFile(file); - // set a file filter for "*.png" files - fileChooser.setFileFilter(pngFileFilter); - - final int returnVal = fileChooser.showSaveDialog(mainView); - if (returnVal == JFileChooser.APPROVE_OPTION) { - // got the filepath, now create image - file = fileChooser.getSelectedFile(); - if (!file.getName().endsWith(".png")) { - file = new File(file.getParentFile(), file.getName() + ".png"); - } - strImageDir = file.getParentFile().getAbsolutePath(); - if (!file.exists() || ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, "overwriteOtherFile", file) == JOptionPane.YES_OPTION) { - mapControl.getMapViewFrame().printFullImage(file); - } + final int returnVal = fileChooser.showSaveDialog(mainView); + if (returnVal == JFileChooser.APPROVE_OPTION) { + // got the filepath, now create image + file = fileChooser.getSelectedFile(); + if (!file.getName().endsWith(".png")) { + file = new File(file.getParentFile(), file.getName() + ".png"); } - } catch (final IOException e) { - ACTION_FACTORY.showMessageDialog(mainView, "createImgIOException", file, e.getMessage()); + strImageDir = file.getParentFile().getAbsolutePath(); + if (!file.exists() || ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, "overwriteOtherFile", file) == JOptionPane.YES_OPTION) { + mapControl.getMapViewFrame().printFullImage(file); + } } + } catch (final IOException e) { + ACTION_FACTORY.showMessageDialog(mainView, "createImageIOException", file, e.getMessage()); } } @@ -1341,27 +1307,21 @@ * Create an image of the current map and save it as file. * In this method, the filename is already given, so the image * is created directly (if possible). + * @param mapControl the controller of map to save * @param file the png image file to create */ - public void createImageWanted(final File file) { - final MapControl mapControl = currentMap; // control of current map - - if (mapControl == null) { - // there is no map open (should not happen due to disabled menus) - ACTION_FACTORY.showMessageDialog(mainView, "createImgNoMap"); - } else { - final File tmpFile = new File(file.getPath() + ".tmp"); - try { - mapControl.getMapViewFrame().printFullImage(tmpFile); - if (!tmpFile.renameTo(file)) { - throw new IOException("cannot rename " + tmpFile + " to " + file); - } - if (log.isInfoEnabled()) { - log.info(ACTION_FACTORY.format("logImageCreated", file, mapControl.getMapFileName())); - } - } catch (final IOException e) { - ACTION_FACTORY.showMessageDialog(mainView, "createImgIOException", file); + public void createImageWanted(@NotNull final MapControl mapControl, final File file) { + final File tmpFile = new File(file.getPath() + ".tmp"); + try { + mapControl.getMapViewFrame().printFullImage(tmpFile); + if (!tmpFile.renameTo(file)) { + throw new IOException("cannot rename " + tmpFile + " to " + file); } + if (log.isInfoEnabled()) { + log.info(ACTION_FACTORY.format("logImageCreated", file, mapControl.getMapFileName())); + } + } catch (final IOException e) { + ACTION_FACTORY.showMessageDialog(mainView, "createImageIOException", file); } } @@ -1647,12 +1607,11 @@ listenerList.remove(MainControlListener.class, listener); } - /** Invoked when user wants to revert the current map to previously saved state. */ - public void revert() { - final MapControl modMapControl = currentMap; // "modified map" to be reverted - if (ACTION_FACTORY.showQuestionDialog(mainView, "confirmRevertMap", modMapControl.getMapFileName())) { - final File mfile = modMapControl.getMapFile(); // store file - closeLevel(modMapControl, true); // close the old map + /** {@inheritDoc} */ + public void revert(@NotNull final MapControl mapControl) { + if (ACTION_FACTORY.showQuestionDialog(mainView, "confirmRevertMap", mapControl.getMapFileName())) { + final File mfile = mapControl.getMapFile(); // store file + closeLevel(mapControl, true); // close the old map openFile(mfile); // open the new map // Update the main view so the new map instantly pops up. @@ -1691,23 +1650,6 @@ mainView.refreshMenusAndToolbars(); } - /** - * Returns whether a level is being edited or not. - * @return true if a level is being edited or false if not - */ - boolean isLevelEdited() { - return currentMap != null; - } - - /** - * Returns whether the level can be just saved (true) or does it need - * to be saved as (false). - * @return true if level can be just saved, false if not - */ - boolean isPlainSaveEnabled() { - return currentMap != null && currentMap.isPlainSaveEnabled(); - } - public static ImageIcon getUnknownTileIcon() { return unknownTileIcon; } Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/daimonin/src/daieditor/CMainView.java 2007-01-21 12:10:54 UTC (rev 1650) @@ -54,6 +54,7 @@ import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.StatusBar; import net.sf.gridarta.help.Help; +import net.sf.gridarta.map.MapFileActions; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.about.AboutDialog; import net.sf.japi.util.ThrowableHandler; @@ -153,12 +154,16 @@ /** The pickmap chooser control. */ private PickmapChooserControl pickmapChooserControl = null; + /** The map file actions for the global menubar. */ + @NotNull private final MapFileActions mapFileAction; + /** * Constructs the main view and registers the given main controller. */ CMainView() { super(ACTION_FACTORY.format("mainWindow.title", CMainControl.getBuildNumberAsString())); initActions(); + mapFileAction = new MapFileActions(mainControl, null); final ImageIcon icon = CGUIUtils.getIcon(IGUIConstants.APP_ICON); if (icon != null) { @@ -448,11 +453,6 @@ mapArchPanel.refresh(); } - public void setRevertMenuEnabled(final boolean state) { - aRevert.setEnabled(state && mainControl.isPlainSaveEnabled()); - aSave.setEnabled(state && mainControl.isPlainSaveEnabled()); - } - /** Refresh the state of the menu only. */ public void refreshMenus() { // TODO: This method shouldn't really be invoked. @@ -721,16 +721,6 @@ ACTION_FACTORY.createToggles(true, mainControl, "drawDouble", "gridVisible"); } - private final Action aClose = ACTION_FACTORY.createAction(true, "close", mainControl); - - private final Action aRevert = ACTION_FACTORY.createAction(true, "revert", mainControl); - - private final Action aSave = ACTION_FACTORY.createAction(true, "save", mainControl); - - private final Action aSaveAs = ACTION_FACTORY.createAction(true, "saveAs", mainControl); - - private final Action aCreateImg = ACTION_FACTORY.createAction(true, "createImg", mainControl); - private final Action aEnterExit = ACTION_FACTORY.createAction(true, "enterExit", mainControl); private final Action aMapCreateView = ACTION_FACTORY.createAction(true, "mapCreateView", mainControl); @@ -762,12 +752,7 @@ aViewTreasurelists.setEnabled(true); final boolean mapState = mainControl.getCurrentMap() != null; - final boolean fLevelEdited = mapState && mainControl.isLevelEdited(); final boolean selState = mapState && mainControl.getCurrentMap().getMapCursor().isActive(); - aCreateImg.setEnabled(true); - aClose.setEnabled(fLevelEdited); - //aSave.setEnabled(mapState && mainControl.isPlainSaveEnabled()); - //aSaveAs.setEnabled(fLevelEdited); aMapCreateView.setEnabled(mapState); aMapProperties.setEnabled(mapState); for (int direction = 0; direction < 8; direction++) { @@ -775,7 +760,6 @@ ACTION_FACTORY.getAction(directionsMap[direction]).setEnabled(mtp != null && mtp.length() > 0); } aEnterExit.setEnabled(selState); - aRevert.setEnabled(mapState && fLevelEdited && mainControl.isPlainSaveEnabled()); //aGridToggle.setEnabled(mapState); //((ToggleAction) aGridToggle).setSelected(mapState && mainControl.isGridVisible()); // FIXME IMPORTANT!!! rebuildWindowMenu(); Modified: trunk/daimonin/src/daieditor/MapViewIFrame.java =================================================================== --- trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-01-21 12:10:54 UTC (rev 1650) @@ -38,6 +38,7 @@ import net.sf.gridarta.gui.map.MapGridListener; import net.sf.gridarta.io.PathManager; import net.sf.gridarta.map.MapControlListener; +import net.sf.gridarta.map.MapFileActions; import net.sf.gridarta.map.MapModelEvent; import net.sf.gridarta.map.MapModelListener; import net.sf.japi.swing.ActionFactory; @@ -74,6 +75,9 @@ /** The underlying mapview object. */ private final CMapViewBasic view; + /** The map file actions for this map. */ + @NotNull private final MapFileActions mapFileActions; + /** * The {@link MapModelListener} used to detect changes in the map model * that should be reflected in the window title. @@ -139,6 +143,7 @@ view = new CMapViewBasic(mainControl, mapControl); getContentPane().setLayout(new BorderLayout()); getContentPane().add(view, BorderLayout.CENTER); + mapFileActions = null;//new MapFileActions(mainControl, mapControl); // XXX: uncomment this after JAPI can create multiple action sets setJMenuBar(ACTION_FACTORY.createMenuBar(true, "mapwindow")); final Image img = this.mapControl.getIconImage(); if (img != null) { @@ -170,12 +175,6 @@ /** Update the Map-Window Title (according to name and changeFlag). */ private void updateTitle() { setTitle(PathManager.getMapPath(mapControl.getMapFileName()) + " [ " + mapControl.getMapArchObject().getMapDisplayName() + " ] (" + number + ")" + (mapControl.isModified() ? " *" : "")); - - // disable menu file->revert to revert the map - // XXX: should not be here - if (mainControl.getCurrentMap() == mapControl) { - mainControl.getMainView().setRevertMenuEnabled(mapControl.isModified()); - } } // following a bunch of wrapper methods which just pass access Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/daimonin/src/daieditor/action.properties 2007-01-21 12:10:54 UTC (rev 1650) @@ -27,7 +27,7 @@ ######## # Menus main.menubar=file edit map cursor pickmaps resources tools view window help -file.menu=createNew open recent close closeAll - save saveAs revert createImg - options - exit +file.menu=createNew open recent close closeAll - save saveAs revert createImage - options - exit edit.menu=undo redo - clear cut copy paste - replace fillAbove fillBelow randFillAbove randFillBelow floodfill - selectAll map.menu=enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties cursor.menu=moveCursor - selectTile startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes @@ -49,7 +49,7 @@ mapwindow.menubar=mapwindowFile mapwindowEdit mapwindowMap mapwindowCursor -mapwindowFile.menu=save saveAs createImg - revert - close +mapwindowFile.menu=save saveAs createImage - revert - close mapwindowEdit.menu=undo redo - clear cut copy paste - replace fillAbove fillBelow randFillAbove randFillBelow floodfill - selectAll mapwindowMap.menu=enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties mapwindowCursor.menu=moveCursor - selectTile startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes @@ -81,18 +81,8 @@ recent.icon=general/History16 -close.icon=EmptySmallIcon - closeAll.icon=EmptySmallIcon -save.icon=general/Save16 - -saveAs.icon=general/SaveAs16 - -revert.icon=general/Refresh16 - -createImg.icon=CreateImageSmallIcon - options.icon=general/Preferences16 exit.icon=EmptySmallIcon Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-21 12:10:54 UTC (rev 1650) @@ -215,12 +215,7 @@ return levelClosing; } - /** - * Return whether the level can be just saved (true) or does it need to be - * saved as (false). - * @return <code>true</code> if level can be just saved, <code>false</code> - * if not - */ + /** {@inheritDoc} */ public boolean isPlainSaveEnabled() { final String mapFileName = getMapFileName(); return mapFile != null && mapFileName != null && !mapFileName.equals(IGUIConstants.DEF_MAPFNAME); @@ -271,9 +266,7 @@ fireMapFileNameChanged(); } - /** - * Save the level to a file. - */ + /** {@inheritDoc} */ public void save() { if (isPickmap()) { mainControl.setStatusText("Saving pickmap '" + getMapFileName() + "'..."); Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/daimonin/src/daieditor/messages.properties 2007-01-21 12:10:54 UTC (rev 1650) @@ -255,45 +255,12 @@ recent.mnemonic=T recentItem.shortdescriptionformat=Opens map {0} ({1}) -close.text=Close -close.shortdescription=Close map -close.longdescription=Closes the current map -close.mnemonic=C -close.accel=ctrl pressed W - closeAll.text=Close All closeAll.shortdescription=Close all maps closeAll.longdescription=Closes all opened maps closeAll.mnemonic=L closeAll.accel=ctrl shift pressed W -save.text=Save -save.shortdescription=Save map -save.longdescription=Saves the current map -save.mnemonic=S -save.accel=ctrl pressed S -save.error.text.title=Error while saving -save.error.text=Error while saving:\n{0} - -saveAs.text=Save As... -saveAs.shortdescription=Save map with new name -saveAs.longdescription=Saves map with a new filename -saveAs.mnemonic=A -saveAs.accel=ctrl shift pressed S -saveAs.error.text=Error while saving as - -revert.text=Revert -revert.shortdescription=Reverts map -revert.longdescription=Reverts the map to the last saved version -revert.mnemonic=R -revert.error.text=Error while reverting map - -createImg.text=Create Image -createImg.shortdescription=Creates a snapshot -createImg.longdescription=Creates a snapshot image and saves it to a file -createImg.mnemonic=I -createImg.error.text=Error while creating snapshot image - options.text=Options... options.shortdescription=Shows options options.longdescription=Shows an option dialog to change the editor settings Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/daimonin/src/daieditor/messages_de.properties 2007-01-21 12:10:54 UTC (rev 1650) @@ -54,6 +54,9 @@ overwriteOtherFile.title=Datei \xFCberschreiben? overwriteOtherFile.message=Eine Datei mit Namen "{0}" existiert bereits.\n\nWirklich \xFCberschreiben? +createImageIOException.title=Kann Bild nicht erzeugen +createImageIOException.message=Das Bild kann nicht erzeugt werden, da ein Ein-/Ausgabefehler\nbeim Schreiben von {0} aufgetreten ist:\n{1} + treasurelistForbidden.title=Ung\xFCltige Auswahl treasurelistForbidden.message=Die Schatzliste {0} darf in Karten nicht verwendet werden.\nSie wird vom Crossfire-Server intern verwendet. @@ -243,11 +246,11 @@ revert.mnemonic=R revert.error.text=Fehler beim Zur\xFCcksetzen -createImg.text=Bild speichern... -createImg.shortdescription=Bild der Karte speichern -createImg.longdescription=Erzeugt ein Foto der Karte und speichert es -createImg.mnemonic=I -createImg.error.text=Fehler beim Bild speichern +createImage.text=Bild speichern... +createImage.shortdescription=Bild der Karte speichern +createImage.longdescription=Erzeugt ein Foto der Karte und speichert es +createImage.mnemonic=I +createImage.error.text=Fehler beim Bild speichern options.text=Optionen... options.shortdescription=Optionen zeigen Modified: trunk/daimonin/src/daieditor/messages_fr.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_fr.properties 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/daimonin/src/daieditor/messages_fr.properties 2007-01-21 12:10:54 UTC (rev 1650) @@ -105,12 +105,12 @@ revert.icon=RevertIcon revert.error.text=Erreur lors de la restauration de la carte. -createImg.text=Cr\xE9er image -createImg.shortdescription=Cr\xE9er une image \xE0 partir de la carte -createImg.longdescription=Cr\xE9e une image \xE0 partir de la carte et l'enregistre dans un fichier -createImg.mnemonic=I -createImg.icon=CreateImageSmallIcon -createImg.error.text=Erreur lors de la cr\xE9ation d'une image. +createImage.text=Cr\xE9er image +createImage.shortdescription=Cr\xE9er une image \xE0 partir de la carte +createImage.longdescription=Cr\xE9e une image \xE0 partir de la carte et l'enregistre dans un fichier +createImage.mnemonic=I +createImage.icon=CreateImageSmallIcon +createImage.error.text=Erreur lors de la cr\xE9ation d'une image. options.text=Options... options.shortdescription=Affiche les options Modified: trunk/daimonin/src/daieditor/messages_sv.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_sv.properties 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/daimonin/src/daieditor/messages_sv.properties 2007-01-21 12:10:54 UTC (rev 1650) @@ -110,10 +110,8 @@ savePickmapHidden.message=Plockkartor \xE4r dolda f\xF6r tillf\xE4llet.\nVar v\xE4nlig och v\xE4lj en plockkarta innan du aktiverar detta kommando. savePickmapNoPickmaps.title=Kan inte spara plockkarta savePickmapNoPickmaps.message=Det finns inga plockkartor. -createImgNoMap.title=Kunde inte skapa bild -createImgNoMap.message=Du kan inte skapa en bild om ingen karta \xE4r \xF6ppnad. -createImgIOException.title=Kunde inte skapa bild -createImgIOException.message=Bilden kunde inte skapas eftersom filen {0} inte g\xE5r att skriva till. +createImageIOException.title=Kunde inte skapa bild +createImageIOException.message=Bilden kunde inte skapas eftersom filen {0} inte g\xE5r att skriva till. enterExitNoExit.title=Ingen utg\xE5ng enterExitNoExit.message=Det finns ingen giltig utg\xE5ng p\xE5 den valda punkten. enterExitNowhere.title=M\xE5let ogiltigt @@ -421,11 +419,11 @@ revert.mnemonic=R revert.error.text=Kunde inte \xE5terst\xE4lla kartan -createImg.text=Skapa bild -createImg.shortdescription=Skapa bild av kartan -createImg.longdescription=Skapar en bild av kartan och sparar till fil -createImg.mnemonic=I -createImg.error.text=Kunde inte spara bilden +createImage.text=Skapa bild +createImage.shortdescription=Skapa bild av kartan +createImage.longdescription=Skapar en bild av kartan och sparar till fil +createImage.mnemonic=I +createImage.error.text=Kunde inte spara bilden options.text=Inst\xE4llningar... options.shortdescription=Justera inst\xE4llningar Modified: trunk/src/app/net/sf/gridarta/MainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/MainControl.java 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/src/app/net/sf/gridarta/MainControl.java 2007-01-21 12:10:54 UTC (rev 1650) @@ -110,7 +110,7 @@ * Returns the current map. * @return The current map. */ - MapControl getCurrentMap(); + C getCurrentMap(); /** * Sets the enabled state of the tab pane for Archetypes. @@ -139,4 +139,32 @@ */ void setStatusText(String string); + /** + * Invoked when user wants to save a map to certain file. + * @param mapControl the map to be saved + * @return <code>true</code> if the user confirmed saving the map and the + * map was saved successfully, otherwise <code>false</code> + */ + boolean saveLevelAsWanted(@NotNull C mapControl); + + /** + * Create an image of a map and save it as a file. In this method, a + * filechooser is opened to let the user select an output file name/path + * for the png image. + * @param mapControl the map to close + */ + void createImage(@NotNull C mapControl); + + /** + * Invoked when user wants to revert a map to the previously saved state. + * @param mapControl the map to revert + */ + void revert(@NotNull C mapControl); + + /** + * Invoked when the user wants to close a map. + * @param mapControl the map to close + */ + void close(@NotNull C mapControl); + } // interface MainControl Modified: trunk/src/app/net/sf/gridarta/action.properties =================================================================== --- trunk/src/app/net/sf/gridarta/action.properties 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/src/app/net/sf/gridarta/action.properties 2007-01-21 12:10:54 UTC (rev 1650) @@ -21,3 +21,14 @@ # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding ActionFactory.additionalBundles=net.sf.gridarta.messages + + +save.icon=general/Save16 + +saveAs.icon=general/SaveAs16 + +createImage.icon=CreateImageSmallIcon + +revert.icon=general/Refresh16 + +close.icon=EmptySmallIcon Modified: trunk/src/app/net/sf/gridarta/map/MapControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapControl.java 2007-01-21 11:51:17 UTC (rev 1649) +++ trunk/src/app/net/sf/gridarta/map/MapControl.java 2007-01-21 12:10:54 UTC (rev 1650) @@ -122,4 +122,17 @@ */ void setMapFileName(@NotNull String mapFileName); + /** + * Return whether the level can be just saved (true) or does it need to be + * saved as (false). + * @return <code>true</code> if level can be just saved, <code>false</code> + * if not + */ + boolean isPlainSaveEnabled(); + + /** + * Save the level to a file. + */ + void save(); + } // interface MapControl Added: trunk/src/app/net/sf/gridarta/map/MapFileActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapFileActions.java (rev 0) +++ trunk/src/app/net/sf/gridarta/map/MapFileActions.java 2007-01-21 12:10:54 UTC (rev 1650) @@ -0,0 +1,275 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.map; + +import javax.swing.Action; +import net.sf.gridarta.MainControl; +import net.sf.gridarta.MainControlListener; +import net.sf.gridarta.gameobject.GameObject; +import net.sf.japi.swing.ActionFactory; +import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * The class <code>MapFileActions</code> implements actions for the "file" menu + * attached to maps. + * + * @author Andreas Kirschbaum + */ +public class MapFileActions<G extends GameObject<G, A>, A extends MapArchObject, M extends MapControl<G, A>> { + + /** The Logger for printing log messages. */ + private static final Logger log = Logger.getLogger(MapFileActions.class); + + /** Action Factory to create Actions. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.gridarta"); + + /** + * The main control to forward actions to. + */ + @Nullable private final MainControl<G, A, M> mainControl; + + /** + * The map control to track, or <code>null</code> if {@link #mainControl}'s + * current map is tracked. + */ + @Nullable private final M mapControl; + + /** + * The currently tracked map, or <code>null</code> if no map is tracked. + * This map has the {@link #mapControlListener} attached. + */ + @Nullable private M currentMap; + + /** + * The action callback functions. + */ + private final Actions actions = new Actions(); + + /** The action for "save". */ + private final Action aSave = ACTION_FACTORY.createAction(true, "save", actions); + + /** The action for "save as". */ + private final Action aSaveAs = ACTION_FACTORY.createAction(true, "saveAs", actions); + + /** The action for "create image". */ + private final Action aCreateImage = ACTION_FACTORY.createAction(true, "createImage", actions); + + /** The action for "revert". */ + private final Action aRevert = ACTION_FACTORY.createAction(true, "revert", actions); + + /** The action for "close". */ + private final Action aClose = ACTION_FACTORY.createAction(true, "close", actions); + + /** + * The map control listener which is attached to {@link #currentMap}. + */ + private final MapControlListener<M> mapControlListener = new MapControlListener<M>() { + + /** {@inheritDoc} */ + public void modifiedChanged(@NotNull final M mapControl) { + updateActions(); + } + + /** {@inheritDoc} */ + public void mapFileNameChanged(@NotNull final M mapControl) { + // ignore + } + + }; + + /** + * The main control listener which is attached to {@link #mainControl} if + * the current map is tracked. Otherwise it is unused. + */ + private final MainControlListener<M> mainControlListener = new MainControlListener<M>() { + + /** {@inheritDoc} */ + public void curren... [truncated message content] |
From: <aki...@us...> - 2007-01-21 12:17:58
|
Revision: 1651 http://svn.sourceforge.net/gridarta/?rev=1651&view=rev Author: akirschbaum Date: 2007-01-21 04:17:58 -0800 (Sun, 21 Jan 2007) Log Message: ----------- Add undo/redo icons to menu entries. Modified Paths: -------------- trunk/crossfire/src/cfeditor/action.properties trunk/daimonin/src/daieditor/action.properties trunk/src/app/net/sf/gridarta/action.properties Modified: trunk/crossfire/src/cfeditor/action.properties =================================================================== --- trunk/crossfire/src/cfeditor/action.properties 2007-01-21 12:10:54 UTC (rev 1650) +++ trunk/crossfire/src/cfeditor/action.properties 2007-01-21 12:17:58 UTC (rev 1651) @@ -66,10 +66,6 @@ exit.icon=EmptySmallIcon -undo.icon=general/Undo16 - -redo.icon=general/Redo16 - clear.icon=general/Remove16 cut.icon=general/Cut16 Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2007-01-21 12:10:54 UTC (rev 1650) +++ trunk/daimonin/src/daieditor/action.properties 2007-01-21 12:17:58 UTC (rev 1651) @@ -88,10 +88,6 @@ exit.icon=EmptySmallIcon -undo.icon=general/Undo16 - -redo.icon=general/Redo16 - clear.icon=general/Remove16 cut.icon=general/Cut16 Modified: trunk/src/app/net/sf/gridarta/action.properties =================================================================== --- trunk/src/app/net/sf/gridarta/action.properties 2007-01-21 12:10:54 UTC (rev 1650) +++ trunk/src/app/net/sf/gridarta/action.properties 2007-01-21 12:17:58 UTC (rev 1651) @@ -32,3 +32,7 @@ revert.icon=general/Refresh16 close.icon=EmptySmallIcon + +undo.icon=general/Undo16 + +redo.icon=general/Redo16 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-22 17:59:44
|
Revision: 1655 http://svn.sourceforge.net/gridarta/?rev=1655&view=rev Author: akirschbaum Date: 2007-01-22 09:59:40 -0800 (Mon, 22 Jan 2007) Log Message: ----------- Fix memory leak when closing map windows. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/MapViewIFrame.java trunk/daimonin/src/daieditor/MapViewIFrame.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-01-22 17:41:51 UTC (rev 1654) +++ trunk/crossfire/ChangeLog 2007-01-22 17:59:40 UTC (rev 1655) @@ -1,3 +1,7 @@ +2007-01-22 Andreas Kirschbaum + + * Fix memory leak when closing map windows. + 2007-01-21 Andreas Kirschbaum * Properly enable/disable file menu entries. Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-22 17:41:51 UTC (rev 1654) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-22 17:59:40 UTC (rev 1655) @@ -151,6 +151,7 @@ public void closeNotify() { mapControl.removeMapControlListener(mapControlListener); mapControl.removeMapModelListener(mapModelListener); + setJMenuBar(null); } /** Modified: trunk/daimonin/src/daieditor/MapViewIFrame.java =================================================================== --- trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-01-22 17:41:51 UTC (rev 1654) +++ trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-01-22 17:59:40 UTC (rev 1655) @@ -160,6 +160,7 @@ public void closeNotify() { mapControl.removeMapControlListener(mapControlListener); mapControl.removeMapModelListener(mapModelListener); + setJMenuBar(null); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-22 18:42:44
|
Revision: 1658 http://svn.sourceforge.net/gridarta/?rev=1658&view=rev Author: akirschbaum Date: 2007-01-22 10:42:44 -0800 (Mon, 22 Jan 2007) Log Message: ----------- Fix memory leak when closing map windows. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/MapViewIFrame.java trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/MapViewIFrame.java trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/gui/maptilelist/MapTileSelectionCache.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2007-01-22 18:13:27 UTC (rev 1657) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2007-01-22 18:42:44 UTC (rev 1658) @@ -104,6 +104,8 @@ // interface for the mapview frame private final MapView frame; + @NotNull private final CListener listener; + /** * Constructs a level view. * @param mainControl the main controller @@ -144,7 +146,7 @@ getViewport().setViewPosition(initial); } - final CListener listener = new CListener(); + listener = new CListener(); renderer.addMouseListener(listener); renderer.addMouseMotionListener(listener); if (!isPickmap()) { @@ -157,6 +159,27 @@ } /** + * Must be called when this renderer is not used anymore. It unregisters + * all listeners. + */ + public void closeNotify() { + renderer.closeNotify(); + mapCursor.removeMapCursorListener(this); + if (!mapControl.isPickmap()) { + mapCursor.removeMapCursorListener(mainControl.getMainView().getMapTileListControl().getMapTileListView()); + mapCursor.removeMapCursorListener(mainControl.getMapCursorControl()); + } + setViewportView(null); + mapModel.removeMapModelListener(this); + renderer.removeMouseListener(listener); + renderer.removeMouseMotionListener(listener); + if (!isPickmap()) { + renderer.removeMouseMotionListener(mainControl.getMainView().getStatusBar()); + } + mapGrid.removeMapGridListener(renderer); + } + + /** * Get MapGrid of this view. * @return MapGrid of this view. */ Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-22 18:13:27 UTC (rev 1657) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-22 18:42:44 UTC (rev 1658) @@ -149,6 +149,7 @@ * This function must be called when the view is closed. */ public void closeNotify() { + view.closeNotify(); mapControl.removeMapControlListener(mapControlListener); mapControl.removeMapModelListener(mapModelListener); setJMenuBar(null); Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2007-01-22 18:13:27 UTC (rev 1657) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2007-01-22 18:42:44 UTC (rev 1658) @@ -190,6 +190,13 @@ mapModel.addMapModelListener(mapModelListener); } + /** + * Must be called when this renderer is not used anymore. + */ + public void closeNotify() { + mapModel.removeMapModelListener(mapModelListener); + } + /** This method is called when the look and feel has changed. */ @Override public void updateLookAndFeel() { // update background color of window Modified: trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java 2007-01-22 18:13:27 UTC (rev 1657) +++ trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java 2007-01-22 18:42:44 UTC (rev 1658) @@ -83,7 +83,7 @@ /** * The cache to store selections for each map control. */ - @NotNull private final MapTileSelectionCache<GameObject, MapArchObject, MapControl> mapTileSelectionCache = new MapTileSelectionCache<GameObject, MapArchObject, MapControl>(); + @NotNull private final MapTileSelectionCache<GameObject, MapArchObject, MapControl> mapTileSelectionCache; /** * The currently selected map tile. @@ -102,6 +102,7 @@ */ SelectedSquareView(@NotNull final SelectedSquareControl control, @NotNull final CMainControl mainControl, final boolean mapTileListBottom) { this.mainControl = mainControl; + mapTileSelectionCache = new MapTileSelectionCache<GameObject, MapArchObject, MapControl>(mainControl); setLayout(new BorderLayout()); Modified: trunk/daimonin/src/daieditor/CMapViewBasic.java =================================================================== --- trunk/daimonin/src/daieditor/CMapViewBasic.java 2007-01-22 18:13:27 UTC (rev 1657) +++ trunk/daimonin/src/daieditor/CMapViewBasic.java 2007-01-22 18:42:44 UTC (rev 1658) @@ -108,6 +108,8 @@ /** The ArchObjects that are known to contain errors. */ private final Map<net.sf.gridarta.gameobject.GameObject,ValidationError> erraneousArchObjects = new HashMap<net.sf.gridarta.gameobject.GameObject,ValidationError>(); + @NotNull private final MapUserListener mapUserListener; + /** * Constructs a level view. * @param mainControl the main controller @@ -140,7 +142,7 @@ // set the pixel increment scrolling for clicking once on a scrollbar arrow getVerticalScrollBar().setUnitIncrement(IGUIConstants.TILE_ISO_YLEN); getHorizontalScrollBar().setUnitIncrement(IGUIConstants.TILE_ISO_XLEN); - final MapUserListener mapUserListener = new MapUserListener(mainControl, mapControl, this); + mapUserListener = new MapUserListener(mainControl, mapControl, this); renderer.addMouseListener(mapUserListener); renderer.addMouseMotionListener(mapUserListener); if (!mapControl.isPickmap()) { @@ -154,6 +156,26 @@ } /** + * Must be called when this renderer is not used anymore. It unregisters + * all listeners. + */ + public void closeNotify() { + mapCursor.removeMapCursorListener(this); + if (!mapControl.isPickmap()) { + mapCursor.removeMapCursorListener(mainControl.getMainView().getMapTileListControl().getMapTileListView()); + mapCursor.removeMapCursorListener(mainControl.getMapCursorControl()); + } + setViewportView(null); + mapModel.removeMapModelListener(this); + renderer.removeMouseListener(mapUserListener); + renderer.removeMouseMotionListener(mapUserListener); + if (!mapControl.isPickmap()) { + renderer.removeMouseMotionListener(mainControl.getMainView().getStatusBar()); + } + mapGrid.removeMapGridListener(renderer); + } + + /** * Get MapGrid of this view. * @return MapGrid of this view. */ Modified: trunk/daimonin/src/daieditor/MapViewIFrame.java =================================================================== --- trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-01-22 18:13:27 UTC (rev 1657) +++ trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-01-22 18:42:44 UTC (rev 1658) @@ -158,6 +158,7 @@ * This function must be called when the view is closed. */ public void closeNotify() { + view.closeNotify(); mapControl.removeMapControlListener(mapControlListener); mapControl.removeMapModelListener(mapModelListener); setJMenuBar(null); Modified: trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java 2007-01-22 18:13:27 UTC (rev 1657) +++ trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java 2007-01-22 18:42:44 UTC (rev 1658) @@ -86,7 +86,7 @@ /** * The cache to store selections for each map control. */ - @NotNull private final MapTileSelectionCache<GameObject, MapArchObject, MapControl> mapTileSelectionCache = new MapTileSelectionCache<GameObject, MapArchObject, MapControl>(); + @NotNull private final MapTileSelectionCache<GameObject, MapArchObject, MapControl> mapTileSelectionCache; /** * The currently selected map tile. @@ -105,6 +105,7 @@ */ SelectedSquareView(@NotNull final SelectedSquareControl control, @NotNull final CMainControl mainControl, final boolean mapTileListBottom) { this.mainControl = mainControl; + mapTileSelectionCache = new MapTileSelectionCache<GameObject, MapArchObject, MapControl>(mainControl); setLayout(new BorderLayout()); Modified: trunk/src/app/net/sf/gridarta/gui/maptilelist/MapTileSelectionCache.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/maptilelist/MapTileSelectionCache.java 2007-01-22 18:13:27 UTC (rev 1657) +++ trunk/src/app/net/sf/gridarta/gui/maptilelist/MapTileSelectionCache.java 2007-01-22 18:42:44 UTC (rev 1658) @@ -19,8 +19,10 @@ package net.sf.gridarta.gui.maptilelist; +import java.util.HashMap; import java.util.Map; -import java.util.WeakHashMap; +import net.sf.gridarta.MainControl; +import net.sf.gridarta.MainControlListener; import net.sf.gridarta.gameobject.GameObject; import net.sf.gridarta.map.MapArchObject; import net.sf.gridarta.map.MapControl; @@ -42,9 +44,40 @@ * The cache to map {@link MapControl} instances to {@link * MapTileSelection} instances. */ - @NotNull private final Map<C, MapTileSelection<G, A, C>> cache = new WeakHashMap<C, MapTileSelection<G, A, C>>(); + @NotNull private final Map<C, MapTileSelection<G, A, C>> cache = new HashMap<C, MapTileSelection<G, A, C>>(); /** + * The map control listener used to remove closed maps from {@link #cache}. + */ + private final MainControlListener<C> mainControlListener = new MainControlListener<C>() { + + /** {@inheritDoc} */ + public void currentMapChanged(final @Nullable C mapControl) { + // ignore + } + + /** {@inheritDoc} */ + public void mapCreated(final @NotNull C mapControl) { + // ignore + } + + /** {@inheritDoc} */ + public void mapClosing(final @NotNull C mapControl) { + cache.remove(mapControl); + } + + }; + + /** + * Create a new instance. + * + * @param mainControl the main control to check for map changes + */ + public MapTileSelectionCache(@NotNull final MainControl mainControl) { + mainControl.addMainControlListener(mainControlListener); + } + + /** * Return the {@link MapTileSelection} instance associated to a {@link * MapControl} instance. If no instance exists, a new one is created. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-22 21:22:22
|
Revision: 1663 http://svn.sourceforge.net/gridarta/?rev=1663&view=rev Author: christianhujer Date: 2007-01-22 13:22:13 -0800 (Mon, 22 Jan 2007) Log Message: ----------- Fixed broken object attributes help button. Modified Paths: -------------- trunk/crossfire/src/cfeditor/messages.properties trunk/crossfire/src/cfeditor/messages_de.properties trunk/crossfire/src/cfeditor/messages_fr.properties trunk/crossfire/src/cfeditor/messages_sv.properties trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties trunk/daimonin/src/daieditor/messages_fr.properties trunk/daimonin/src/daieditor/messages_sv.properties trunk/src/app/net/sf/gridarta/messages.properties Added Paths: ----------- trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2007-01-22 19:24:58 UTC (rev 1662) +++ trunk/crossfire/src/cfeditor/messages.properties 2007-01-22 21:22:13 UTC (rev 1663) @@ -91,7 +91,6 @@ mapTop=Top mapBottom=Bottom -arcDoc.htmlText=<html><head><meta name="CrossfireEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">{0}</h1><h3 style="colour:navy;">Functionality of {0}:</h3><p>{1}</p><h3 style="colour:navy;">Notes on Usage:</h3><p>{2}</p></body></html> # Options optionsImageSet=Image Set Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2007-01-22 19:24:58 UTC (rev 1662) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2007-01-22 21:22:13 UTC (rev 1663) @@ -275,7 +275,6 @@ prefsRes.title=Pfade & Ressourcen prefsGUI.title=Aussehen -arcDoc.htmlText=<html><head><meta name="CrossfireEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">{0}</h1><h3 style="colour:navy;">Funktionalität von {0}:</h3><p>{1}</p><h3 style="colour:navy;">Nutzungshinweise:</h3><p>{2}</p></body></html> # Options Modified: trunk/crossfire/src/cfeditor/messages_fr.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_fr.properties 2007-01-22 19:24:58 UTC (rev 1662) +++ trunk/crossfire/src/cfeditor/messages_fr.properties 2007-01-22 21:22:13 UTC (rev 1663) @@ -77,7 +77,6 @@ ##################### # Preference Modules -arcDoc.htmlText=<html><head><meta name="CrossfireEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Fonctionalit\xE9s de {0}</h3><p>{1}</p><h3 style="colour:navy;">Notes d'utilisation:</h3><p>{2}</p></body></html> # Options Modified: trunk/crossfire/src/cfeditor/messages_sv.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_sv.properties 2007-01-22 19:24:58 UTC (rev 1662) +++ trunk/crossfire/src/cfeditor/messages_sv.properties 2007-01-22 21:22:13 UTC (rev 1663) @@ -220,7 +220,6 @@ ##################### # Preference Modules -arcDoc.htmlText=<html><head><meta name="CrossfireEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Funktionalitet f\xF6r {0}</h3><p>{1}</p><h3 style="colour:navy;">Tips f\xF6r anv\xE4ndning:</h3><p>{2}</p></body></html> # Options Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2007-01-22 19:24:58 UTC (rev 1662) +++ trunk/daimonin/src/daieditor/messages.properties 2007-01-22 21:22:13 UTC (rev 1663) @@ -176,8 +176,6 @@ replaceByCopyBuffer=clipboard -arcDoc.htmlText=<html><head><meta name="CFJavaEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">{0}</h1><h3 style="colour:navy;">Functionality of {0}:</h3><p>{1}</p><h3 style="colour:navy;">Notes on Usage:</h3><p>{2}</p></body></html> - # Options optionsTitle=Options Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2007-01-22 19:24:58 UTC (rev 1662) +++ trunk/daimonin/src/daieditor/messages_de.properties 2007-01-22 21:22:13 UTC (rev 1663) @@ -157,7 +157,6 @@ replacedMany.title=Ersetzung erfolgreich replacedMany.message={0} Objekte ersetzt. -arcDoc.htmlText=<html><head><meta name="CFJavaEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">{0}</h1><h3 style="colour:navy;">Funktionalität von {0}:</h3><p>{1}</p><h3 style="colour:navy;">Nutzungshinweise:</h3><p>{2}</p></body></html> # Options Modified: trunk/daimonin/src/daieditor/messages_fr.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_fr.properties 2007-01-22 19:24:58 UTC (rev 1662) +++ trunk/daimonin/src/daieditor/messages_fr.properties 2007-01-22 21:22:13 UTC (rev 1663) @@ -45,7 +45,6 @@ replacedMany.message={0} Les objets ont \xE9t\xE9 remplac\xE9s. -arcDoc.htmlText=<html><head><meta name="CFJavaEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Fonctionalit\xE9s de {0}</h3><p>{1}</p><h3 style="colour:navy;">Notes d'utilisation:</h3><p>{2}</p></body></html> ################## # Status Messages Modified: trunk/daimonin/src/daieditor/messages_sv.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_sv.properties 2007-01-22 19:24:58 UTC (rev 1662) +++ trunk/daimonin/src/daieditor/messages_sv.properties 2007-01-22 21:22:13 UTC (rev 1663) @@ -282,7 +282,6 @@ replaceCancel.text=Avbryt -arcDoc.htmlText=<html><head><meta name="CFJavaEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Funktionalitet f\xF6r {0}</h3><p>{1}</p><h3 style="colour:navy;">Tips f\xF6r anv\xE4ndning:</h3><p>{2}</p></body></html> # Options Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2007-01-22 19:24:58 UTC (rev 1662) +++ trunk/src/app/net/sf/gridarta/messages.properties 2007-01-22 21:22:13 UTC (rev 1663) @@ -278,3 +278,5 @@ optionsRestart.title=Warning optionsRestart.message=Most options require restarting the editor to take effect. optionsLoadArchColl.text=Load Arches from Collection + +arcDoc.htmlText=<html><head><meta name="Gridarta" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">{0}</h1><h3 style="colour:navy;">Functionality of {0}:</h3><p>{1}</p><h3 style="colour:navy;">Notes on Usage:</h3><p>{2}</p></body></html> Added: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties (rev 0) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2007-01-22 21:22:13 UTC (rev 1663) @@ -0,0 +1,23 @@ +# +# Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. +# Copyright (C) 2000-2007 The Gridarta Developers. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +# Warning: This file MUST be ISO-8859-1 +# See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding + +arcDoc.htmlText=<html><head><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">{0}</h1><h3 style="colour:navy;">Funktionalität von {0}:</h3><p>{1}</p><h3 style="colour:navy;">Nutzungshinweise:</h3><p>{2}</p></body></html> Property changes on: trunk/src/app/net/sf/gridarta/messages_de.properties ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties (rev 0) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2007-01-22 21:22:13 UTC (rev 1663) @@ -0,0 +1,23 @@ +# +# Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. +# Copyright (C) 2000-2007 The Gridarta Developers. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +# Warning: This file MUST be ISO-8859-1 +# See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding + +arcDoc.htmlText=<html><head><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Fonctionalit\xE9s de {0}</h3><p>{1}</p><h3 style="colour:navy;">Notes d'utilisation:</h3><p>{2}</p></body></html> Property changes on: trunk/src/app/net/sf/gridarta/messages_fr.properties ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties (rev 0) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2007-01-22 21:22:13 UTC (rev 1663) @@ -0,0 +1,23 @@ +# +# Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. +# Copyright (C) 2000-2007 The Gridarta Developers. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +# Warning: This file MUST be ISO-8859-1 +# See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding + +arcDoc.htmlText=<html><head><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Funktionalitet f\xF6r {0}</h3><p>{1}</p><h3 style="colour:navy;">Tips f\xF6r anv\xE4ndning:</h3><p>{2}</p></body></html> Property changes on: trunk/src/app/net/sf/gridarta/messages_sv.properties ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-22 22:15:53
|
Revision: 1665 http://svn.sourceforge.net/gridarta/?rev=1665&view=rev Author: akirschbaum Date: 2007-01-22 14:15:52 -0800 (Mon, 22 Jan 2007) Log Message: ----------- Fix #1641829 ("script pad" highlights wrong). Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/textedit/textarea/EmptyTokenMarker.java trunk/src/app/net/sf/gridarta/textedit/textarea/TokenMarkerFactory.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-01-22 21:31:14 UTC (rev 1664) +++ trunk/crossfire/ChangeLog 2007-01-22 22:15:52 UTC (rev 1665) @@ -1,5 +1,7 @@ 2007-01-22 Andreas Kirschbaum + * Fix #1641829 ("script pad" highlights wrong). + * Fix memory leak when closing map windows. 2007-01-21 Andreas Kirschbaum Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java 2007-01-22 21:31:14 UTC (rev 1664) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java 2007-01-22 22:15:52 UTC (rev 1665) @@ -43,8 +43,8 @@ import javax.swing.event.ChangeListener; import javax.swing.text.BadLocationException; import net.sf.gridarta.textedit.textarea.JEditTextArea; -import net.sf.gridarta.textedit.textarea.LuaTokenMarker; import net.sf.gridarta.textedit.textarea.SyntaxDocument; +import net.sf.gridarta.textedit.textarea.TokenMarkerFactory; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -119,7 +119,7 @@ final JEditTextArea ta = new JEditTextArea(); // open new TextArea //ta.setFont(new Font("Courier New", Font.PLAIN, 12)); ta.setDocument(new SyntaxDocument()); - ta.getDocument().setTokenMarker(new LuaTokenMarker()); //PythonTokenMarker()); + ta.getDocument().setTokenMarker(TokenMarkerFactory.createTokenMarker(file)); tabPane.addTab(title, ta); if (getTabCount() <= 1 || !isShowing()) { setVisible(true); Added: trunk/src/app/net/sf/gridarta/textedit/textarea/EmptyTokenMarker.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/EmptyTokenMarker.java (rev 0) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/EmptyTokenMarker.java 2007-01-22 22:15:52 UTC (rev 1665) @@ -0,0 +1,36 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.textedit.textarea; + +import javax.swing.text.Segment; + +/** + * Empty token marker. It does not mark anything. + * + * @author Andreas Kirschbaum + */ +public class EmptyTokenMarker extends TokenMarker { + + @Override public final byte markTokensImpl(final byte token, final Segment line, final int lineIndex) { + addToken(line.count, Token.NULL); + return token; + } + +} // class EmptyTokenMarker Property changes on: trunk/src/app/net/sf/gridarta/textedit/textarea/EmptyTokenMarker.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/textedit/textarea/TokenMarkerFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/TokenMarkerFactory.java (rev 0) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/TokenMarkerFactory.java 2007-01-22 22:15:52 UTC (rev 1665) @@ -0,0 +1,84 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.textedit.textarea; + +import java.io.File; +import java.util.HashMap; +import org.jetbrains.annotations.NotNull; + +/** + * The class <code>TokenMarkerFactory</code> creates {@link TokenMarker} + * instances for {@link File}s. + * + * @author Andreas Kirschbaum + */ +public class TokenMarkerFactory { + + /** + * Maps file extensions to token marker classes. + */ + private static final HashMap<String, Class<? extends TokenMarker>> tokenMarkers = new HashMap<String, Class<? extends TokenMarker>>(); + static { + tokenMarkers.put(".c", CTokenMarker.class); + tokenMarkers.put(".cc", CTokenMarker.class); + tokenMarkers.put(".cpp", CTokenMarker.class); + tokenMarkers.put(".h", CTokenMarker.class); + tokenMarkers.put(".hh", CTokenMarker.class); + tokenMarkers.put(".htm", HTMLTokenMarker.class); + tokenMarkers.put(".html", HTMLTokenMarker.class); + tokenMarkers.put(".js", JavaScriptTokenMarker.class); + tokenMarkers.put(".lua", LuaTokenMarker.class); + tokenMarkers.put(".py", PythonTokenMarker.class); + tokenMarkers.put(".xml", XMLTokenMarker.class); + } + + /** + * Prevent instantiation. + */ + private TokenMarkerFactory() { + } + + /* + * Create suitable a {@link TokenMarker} for a given file. + * + * @param file the file to create a TokenMarker for + * + * @return the created TokenMarker + */ + @NotNull public static TokenMarker createTokenMarker(@NotNull final File file) { + final String filename = file.getName(); + final int dotIndex = filename.lastIndexOf('.'); + if (dotIndex == -1) { + return new EmptyTokenMarker(); + } + final Class<? extends TokenMarker> class_ = tokenMarkers.get(filename.substring(dotIndex)); + if (class_ == null) { + return new EmptyTokenMarker(); + } + try { + return class_.newInstance(); + } catch (final InstantiationException ex) { + return new EmptyTokenMarker(); + } catch (final IllegalAccessException ex) { + return new EmptyTokenMarker(); + } + } + +} // TokenMarkerFactory Property changes on: trunk/src/app/net/sf/gridarta/textedit/textarea/TokenMarkerFactory.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-23 19:45:30
|
Revision: 1675 http://svn.sourceforge.net/gridarta/?rev=1675&view=rev Author: akirschbaum Date: 2007-01-23 11:45:28 -0800 (Tue, 23 Jan 2007) Log Message: ----------- Make text fields in Game Object Attributes Dialog and Panel wrap long lines. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-01-23 19:21:35 UTC (rev 1674) +++ trunk/crossfire/ChangeLog 2007-01-23 19:45:28 UTC (rev 1675) @@ -1,3 +1,8 @@ +2007-01-23 Andreas Kirschbaum + + * Make text fields in Game Object Attributes Dialog and Panel wrap + long lines. + 2007-01-22 Andreas Kirschbaum * Fix #1641829 ("script pad" highlights wrong). Modified: trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java 2007-01-23 19:21:35 UTC (rev 1674) +++ trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java 2007-01-23 19:45:28 UTC (rev 1675) @@ -231,6 +231,8 @@ updateFont(true); document = archEdit.getDocument(); + + archTextArea.setLineWrap(true); } /** Modified: trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java =================================================================== --- trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java 2007-01-23 19:21:35 UTC (rev 1674) +++ trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java 2007-01-23 19:45:28 UTC (rev 1675) @@ -248,6 +248,8 @@ updateFont(true); document = archEdit.getDocument(); + + archTextArea.setLineWrap(true); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java 2007-01-23 19:21:35 UTC (rev 1674) +++ trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java 2007-01-23 19:45:28 UTC (rev 1675) @@ -491,6 +491,7 @@ } final JTextArea input = new JTextArea(text, 10, 20); input.setBorder(BorderFactory.createEmptyBorder(3, 7, 0, 0)); + input.setLineWrap(true); final JScrollPane scrollPane = new JScrollPane(input); scrollPane.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-23 19:54:40
|
Revision: 1676 http://svn.sourceforge.net/gridarta/?rev=1676&view=rev Author: akirschbaum Date: 2007-01-23 11:54:37 -0800 (Tue, 23 Jan 2007) Log Message: ----------- Use all available space for the text field in the Game Object Attributes Panel. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-01-23 19:45:28 UTC (rev 1675) +++ trunk/crossfire/ChangeLog 2007-01-23 19:54:37 UTC (rev 1676) @@ -1,7 +1,8 @@ 2007-01-23 Andreas Kirschbaum * Make text fields in Game Object Attributes Dialog and Panel wrap - long lines. + long lines. Use all available space for the text field in the + Panel. 2007-01-22 Andreas Kirschbaum Modified: trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java 2007-01-23 19:45:28 UTC (rev 1675) +++ trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java 2007-01-23 19:54:37 UTC (rev 1676) @@ -505,7 +505,7 @@ /** Set up the text panel entry of the lower window. */ private void setupTextPanel() { - textPanel = new JPanel(); // new panel + textPanel = new JPanel(new GridLayout(1, 1)); archTextArea.setText(""); archTextArea.setForeground(Color.blue); Modified: trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java =================================================================== --- trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java 2007-01-23 19:45:28 UTC (rev 1675) +++ trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java 2007-01-23 19:54:37 UTC (rev 1676) @@ -640,7 +640,7 @@ /** Set up the text panel entry of the lower window. */ private void setupTextPanel() { - textPanel = new JPanel(); // new panel + textPanel = new JPanel(new GridLayout(1, 1)); archTextArea.setText(""); archTextArea.setForeground(Color.blue); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |