From: <aki...@us...> - 2011-08-31 04:24:42
|
Revision: 8976 http://gridarta.svn.sourceforge.net/gridarta/?rev=8976&view=rev Author: akirschbaum Date: 2011-08-31 04:24:35 +0000 (Wed, 31 Aug 2011) Log Message: ----------- Add copyright headers. Modified Paths: -------------- trunk/src/doc/cleanupXhtml11.xslt trunk/src/doc/dev/SafeCopy.java trunk/src/doc/dev/changelog.xslt trunk/src/doc/faq2txt.xslt trunk/src/doc/sitestyle.css trunk/src/doc/transform.xslt trunk/src/doc/xhtml2html.xslt trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/GameObjectMatchers.xml trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/TreasureLists.xml trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/spells.xml trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/types.xml trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/TreasureLists.xml trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/spells.xml trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/types.xml Modified: trunk/src/doc/cleanupXhtml11.xslt =================================================================== --- trunk/src/doc/cleanupXhtml11.xslt 2011-08-28 13:08:53 UTC (rev 8975) +++ trunk/src/doc/cleanupXhtml11.xslt 2011-08-31 04:24:35 UTC (rev 8976) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="utf-8"?><!-- + ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + ~ Copyright (C) 2000-2010 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. + --> + +<!-- - $Id: cleanupXhtml11.xslt,v 1.2 2006/01/24 21:13:35 christianhujer Exp $ - - Transformation cleaning up XHTML: Modified: trunk/src/doc/dev/SafeCopy.java =================================================================== --- trunk/src/doc/dev/SafeCopy.java 2011-08-28 13:08:53 UTC (rev 8975) +++ trunk/src/doc/dev/SafeCopy.java 2011-08-31 04:24:35 UTC (rev 8976) @@ -1,3 +1,22 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 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. + */ + import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; Modified: trunk/src/doc/dev/changelog.xslt =================================================================== --- trunk/src/doc/dev/changelog.xslt 2011-08-28 13:08:53 UTC (rev 8975) +++ trunk/src/doc/dev/changelog.xslt 2011-08-31 04:24:35 UTC (rev 8976) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + ~ Copyright (C) 2000-2010 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. + --> + <xsl:transform version="2.0" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns="http://www.w3.org/1999/xhtml" xmlns:String="http://saxon.sf.net/java.lang.String" xmlns:System="http://saxon.sf.net/java.lang.System" xmlns:File="http://saxon.sf.net/java.io.File" xmlns:URI="http://saxon.sf.net/java.net.URI" exclude-result-prefixes="xi xs xsl String System File URI"> <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" encoding="utf-8" indent="no" method="xml" omit-xml-declaration="no"/> Modified: trunk/src/doc/faq2txt.xslt =================================================================== --- trunk/src/doc/faq2txt.xslt 2011-08-28 13:08:53 UTC (rev 8975) +++ trunk/src/doc/faq2txt.xslt 2011-08-31 04:24:35 UTC (rev 8976) @@ -1,4 +1,23 @@ -<?xml version="1.0" encoding="utf-8"?><!-- Transformation to convert a FAQ to plain text. --> +<?xml version="1.0" encoding="utf-8"?><!-- + ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + ~ Copyright (C) 2000-2010 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. + --> + +<!-- Transformation to convert a FAQ to plain text. --> <xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:html="http://www.w3.org/1999/xhtml"> <xsl:strip-space elements="html:*"/> Modified: trunk/src/doc/sitestyle.css =================================================================== --- trunk/src/doc/sitestyle.css 2011-08-28 13:08:53 UTC (rev 8975) +++ trunk/src/doc/sitestyle.css 2011-08-31 04:24:35 UTC (rev 8976) @@ -1,3 +1,22 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 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. + */ + html, body { background-color: white; color: #11111A; Modified: trunk/src/doc/transform.xslt =================================================================== --- trunk/src/doc/transform.xslt 2011-08-28 13:08:53 UTC (rev 8975) +++ trunk/src/doc/transform.xslt 2011-08-31 04:24:35 UTC (rev 8976) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + ~ Copyright (C) 2000-2010 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. + --> + <xsl:transform version="2.0" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xi html xsl"> <xsl:output cdata-section-elements="html:script html:style" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" encoding="utf-8" indent="no" method="xml" omit-xml-declaration="no"/> Modified: trunk/src/doc/xhtml2html.xslt =================================================================== --- trunk/src/doc/xhtml2html.xslt 2011-08-28 13:08:53 UTC (rev 8975) +++ trunk/src/doc/xhtml2html.xslt 2011-08-31 04:24:35 UTC (rev 8976) @@ -1,4 +1,23 @@ -<?xml version="1.0" encoding="utf-8"?><!-- $Header: /cvsroot/japi/japi/src/doc/xhtml2html.xslt,v 1.3 2006/01/21 13:39:21 christianhujer Exp $ --> +<?xml version="1.0" encoding="utf-8"?><!-- + ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + ~ Copyright (C) 2000-2010 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. + --> + +<!-- $Header: /cvsroot/japi/japi/src/doc/xhtml2html.xslt,v 1.3 2006/01/21 13:39:21 christianhujer Exp $ --> <xsl:transform version="2.0" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="html" xmlns:saxon="http://saxon.sf.net/"> <!-- Ausgabe: HTML 4.01 / UTF-8 --> Modified: trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/GameObjectMatchers.xml =================================================================== --- trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/GameObjectMatchers.xml 2011-08-28 13:08:53 UTC (rev 8975) +++ trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/GameObjectMatchers.xml 2011-08-31 04:24:35 UTC (rev 8976) @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + ~ Copyright (C) 2000-2010 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 GameObjectMatchers SYSTEM "GameObjectMatchers.dtd"> <GameObjectMatchers> <!-- Objects to be put below the floor in insertion tool --> Modified: trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/TreasureLists.xml =================================================================== --- trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/TreasureLists.xml 2011-08-28 13:08:53 UTC (rev 8975) +++ trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/TreasureLists.xml 2011-08-31 04:24:35 UTC (rev 8976) @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + ~ Copyright (C) 2000-2010 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 lists SYSTEM "TreasureLists.dtd"> <lists> </lists> Modified: trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/spells.xml =================================================================== --- trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/spells.xml 2011-08-28 13:08:53 UTC (rev 8975) +++ trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/spells.xml 2011-08-31 04:24:35 UTC (rev 8976) @@ -1,4 +1,23 @@ -<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE spells SYSTEM "spells.dtd"> +<?xml version="1.0" encoding="UTF-8" ?><!-- + ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + ~ Copyright (C) 2000-2010 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 spells SYSTEM "spells.dtd"> <spells> <spell id="0" name="none"/> </spells> Modified: trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/types.xml =================================================================== --- trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/types.xml 2011-08-28 13:08:53 UTC (rev 8975) +++ trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/types.xml 2011-08-31 04:24:35 UTC (rev 8976) @@ -1,4 +1,23 @@ -<?xml version="1.0" standalone="no" ?><!DOCTYPE types SYSTEM "types.dtd"> +<?xml version="1.0" standalone="no" ?><!-- + ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + ~ Copyright (C) 2000-2010 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 types SYSTEM "types.dtd"> <types> <bitmasks/> <lists> Modified: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml =================================================================== --- trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml 2011-08-28 13:08:53 UTC (rev 8975) +++ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml 2011-08-31 04:24:35 UTC (rev 8976) @@ -1,4 +1,23 @@ -<?xml version="1.0"?><!DOCTYPE GameObjectMatchers SYSTEM "GameObjectMatchers.dtd"> +<?xml version="1.0"?><!-- + ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + ~ Copyright (C) 2000-2010 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 GameObjectMatchers SYSTEM "GameObjectMatchers.dtd"> <GameObjectMatchers> <GameObjectMatcher id="system_floor" system="true"> Modified: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/TreasureLists.xml =================================================================== --- trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/TreasureLists.xml 2011-08-28 13:08:53 UTC (rev 8975) +++ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/TreasureLists.xml 2011-08-31 04:24:35 UTC (rev 8976) @@ -1,2 +1,21 @@ -<?xml version="1.0"?><!DOCTYPE lists SYSTEM "TreasureLists.dtd"> +<?xml version="1.0"?><!-- + ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + ~ Copyright (C) 2000-2010 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 lists SYSTEM "TreasureLists.dtd"> <lists/> Modified: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/spells.xml =================================================================== --- trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/spells.xml 2011-08-28 13:08:53 UTC (rev 8975) +++ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/spells.xml 2011-08-31 04:24:35 UTC (rev 8976) @@ -1,4 +1,23 @@ -<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE spells SYSTEM "spells.dtd"> +<?xml version="1.0" encoding="UTF-8" ?><!-- + ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + ~ Copyright (C) 2000-2010 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 spells SYSTEM "spells.dtd"> <spells> <spell id="0" name="none"/> </spells> Modified: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/types.xml =================================================================== --- trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/types.xml 2011-08-28 13:08:53 UTC (rev 8975) +++ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/types.xml 2011-08-31 04:24:35 UTC (rev 8976) @@ -1,4 +1,23 @@ -<?xml version="1.0" standalone="no" ?><!DOCTYPE types SYSTEM "types.dtd"> +<?xml version="1.0" standalone="no" ?><!-- + ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + ~ Copyright (C) 2000-2010 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 types SYSTEM "types.dtd"> <types> <bitmasks/> <lists> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-08-31 04:34:41
|
Revision: 8977 http://gridarta.svn.sourceforge.net/gridarta/?rev=8977&view=rev Author: akirschbaum Date: 2011-08-31 04:34:24 +0000 (Wed, 31 Aug 2011) Log Message: ----------- Update copyright headers. Modified Paths: -------------- trunk/build.xml trunk/gridarta.ipr trunk/project.properties trunk/resource/log4j.properties trunk/resource/system/dtd/GameObjectMatchers.dtd trunk/resource/system/dtd/TreasureLists.dtd trunk/resource/system/dtd/spells.dtd trunk/resource/system/dtd/types.dtd trunk/src/app/net/sf/gridarta/action.properties trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java trunk/src/app/net/sf/gridarta/actions/CannotLoadMapFileException.java trunk/src/app/net/sf/gridarta/actions/CannotSaveMapFileException.java trunk/src/app/net/sf/gridarta/actions/ExitConnectorActions.java trunk/src/app/net/sf/gridarta/actions/InvalidPathNameException.java trunk/src/app/net/sf/gridarta/actions/MapSizeMismatchException.java trunk/src/app/net/sf/gridarta/actions/UndoActions.java trunk/src/app/net/sf/gridarta/commands/BatchPngCommand.java trunk/src/app/net/sf/gridarta/commands/CollectArchesCommand.java trunk/src/app/net/sf/gridarta/commands/Collector.java trunk/src/app/net/sf/gridarta/commands/Command.java trunk/src/app/net/sf/gridarta/commands/SinglePngCommand.java trunk/src/app/net/sf/gridarta/gui/autovalidator/AutoValidator.java trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java trunk/src/app/net/sf/gridarta/gui/data/NamedNodeTreeCellRenderer.java trunk/src/app/net/sf/gridarta/gui/data/NamedObjectsUtils.java trunk/src/app/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListener.java trunk/src/app/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListenerManager.java trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/BookmarkActions.java trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/BookmarkDirectoryDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/EditBookmarkDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/ManageBookmarksDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/MapMenuEntryIcons.java trunk/src/app/net/sf/gridarta/gui/dialog/errorview/ConsoleErrorView.java trunk/src/app/net/sf/gridarta/gui/dialog/errorview/DefaultErrorView.java trunk/src/app/net/sf/gridarta/gui/dialog/errorview/ErrorEntry.java trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/FindArchetypesDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/FindArchetypesDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/TableModel.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/ConfirmErrorsDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeAnimationName.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFaceName.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeString.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeText.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialogFactory.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GuiInfo.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/HelpActionListener.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/MaskChangeAL.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/ScrollToVisibleFocusListener.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/StringKeyManager.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/TypesBoxItemListener.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/ViewTreasurelistAL.java trunk/src/app/net/sf/gridarta/gui/dialog/golocation/GoLocationDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/golocation/GoLocationDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/gomap/GoMapDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/gomap/GoMapDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/gomap/MapListCellRenderer.java trunk/src/app/net/sf/gridarta/gui/dialog/help/Help.java trunk/src/app/net/sf/gridarta/gui/dialog/help/HtmlPane.java trunk/src/app/net/sf/gridarta/gui/dialog/help/package.html trunk/src/app/net/sf/gridarta/gui/dialog/mapproperties/MapPropertiesDialogFactory.java trunk/src/app/net/sf/gridarta/gui/dialog/newmap/AbstractMapsizeNewMapDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/newmap/AbstractNewMapDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/newmap/NewMapDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/newmap/NewMapDialogFactory.java trunk/src/app/net/sf/gridarta/gui/dialog/newmap/NewPickmapDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/newmap/NewPickmapFolderDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/CloseableTabbedPane.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/ClosingIcon.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/ClosingListener.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginController.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginEditor.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginManager.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginManagerFactory.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginViewPane.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/StackLayout.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ArchComboBox.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ArchComboBoxCellRenderer.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ArchComboBoxEditor.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ArchComboBoxModel.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ArchParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/BooleanParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/DoubleParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/FilterParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/IntegerParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/MapParameterCellRenderer.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/MapParameterComboBoxModel.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/MapParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ParameterDescriptionEditor.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ParameterNameEditor.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ParameterTypeEditor.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/PluginParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/PluginParameterViewFactory.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/StringParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/TooltipSpinner.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/AppPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/AppPreferencesModel.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/DevPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/GUIPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/MapValidatorPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/MiscPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/NetPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/PreferencesHelper.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/ResPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/UpdatePreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/package.html trunk/src/app/net/sf/gridarta/gui/dialog/replace/ArchetypeNameMatchCriteria.java trunk/src/app/net/sf/gridarta/gui/dialog/replace/MatchCriteria.java trunk/src/app/net/sf/gridarta/gui/dialog/replace/ObjectNameMatchCriteria.java trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/shortcuts/KeyStrokeDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/shortcuts/KeyStrokeField.java trunk/src/app/net/sf/gridarta/gui/dialog/shortcuts/KeyStrokeFieldListener.java trunk/src/app/net/sf/gridarta/gui/dialog/shortcuts/ShortcutsDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/shortcuts/ShortcutsManager.java trunk/src/app/net/sf/gridarta/gui/dialog/shrinkmapsize/ShrinkMapSizeDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/shrinkmapsize/ShrinkMapSizeDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/shrinkmapsize/ShrinkMapSizeUtils.java trunk/src/app/net/sf/gridarta/gui/exitconnector/ExitConnectorController.java trunk/src/app/net/sf/gridarta/gui/filter/BtnPopup.java trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java trunk/src/app/net/sf/gridarta/gui/filter/FilterComponent.java trunk/src/app/net/sf/gridarta/gui/filter/FilterControl.java trunk/src/app/net/sf/gridarta/gui/filter/FilterMenuEntry.java trunk/src/app/net/sf/gridarta/gui/filter/FilterState.java trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java trunk/src/app/net/sf/gridarta/gui/filter/package.html trunk/src/app/net/sf/gridarta/gui/mainwindow/GameObjectTab.java trunk/src/app/net/sf/gridarta/gui/mainwindow/GameObjectTextEditorTab.java trunk/src/app/net/sf/gridarta/gui/mainwindow/WarningsTab.java trunk/src/app/net/sf/gridarta/gui/map/AbstractPerMapDialogManager.java trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java trunk/src/app/net/sf/gridarta/gui/map/MapPreviewAccessory.java trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpAdapter.java trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpEvent.java trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpListener.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapLocation.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/NoExitPathException.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/FlatMapTilePane.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/IsoMapTilePane.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/MapTilePanel.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/TilePanel.java trunk/src/app/net/sf/gridarta/gui/map/mapview/AbstractMapViewBasic.java trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewBasic.java trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewFactory.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewFactory.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewManager.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewManagerListener.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViews.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsListener.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java trunk/src/app/net/sf/gridarta/gui/map/package.html trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractSimpleIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/GridMapSquarePainter.java trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator.java trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/MapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/RendererFactory.java trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/ToolTipAppender.java trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewAction.java trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewActions.java trunk/src/app/net/sf/gridarta/gui/mapcursor/MapCursorActions.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowMenuManager.java trunk/src/app/net/sf/gridarta/gui/mapfiles/DuplicateMapFolderException.java trunk/src/app/net/sf/gridarta/gui/mapfiles/DuplicatePickmapException.java trunk/src/app/net/sf/gridarta/gui/mapfiles/InvalidNameException.java trunk/src/app/net/sf/gridarta/gui/mapfiles/Loader.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFile.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFileNameComparator.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolder.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderListener.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderNotEmptyException.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTree.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeAction.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeListener.java trunk/src/app/net/sf/gridarta/gui/mapimagecache/ImageType.java trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCache.java trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheListener.java trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/mapmenu/ActionFactory.java trunk/src/app/net/sf/gridarta/gui/mapmenu/AutoscrollJTree.java trunk/src/app/net/sf/gridarta/gui/mapmenu/BookmarksMapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenu.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuAction.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntryDir.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntryMap.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntryTreeCellRenderer.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntryVisitor.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuLoader.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuUtils.java trunk/src/app/net/sf/gridarta/gui/mapmenu/RecentMapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/mapmenu/TransferableTreeNode.java trunk/src/app/net/sf/gridarta/gui/mapmenu/TreeDragSource.java trunk/src/app/net/sf/gridarta/gui/mapmenu/TreeDropTarget.java trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListener.java trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListenerManager.java trunk/src/app/net/sf/gridarta/gui/misc/About.java trunk/src/app/net/sf/gridarta/gui/misc/DefaultFileControl.java trunk/src/app/net/sf/gridarta/gui/misc/HelpActions.java trunk/src/app/net/sf/gridarta/gui/misc/MainToolbar.java trunk/src/app/net/sf/gridarta/gui/misc/MainView.java trunk/src/app/net/sf/gridarta/gui/misc/MainViewActions.java trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java trunk/src/app/net/sf/gridarta/gui/misc/ShiftProcessor.java trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java trunk/src/app/net/sf/gridarta/gui/package.html trunk/src/app/net/sf/gridarta/gui/panel/archetypechooser/ArchetypeChooserControl.java trunk/src/app/net/sf/gridarta/gui/panel/archetypechooser/ArchetypeChooserView.java trunk/src/app/net/sf/gridarta/gui/panel/archetypechooser/ArchetypeChooserViewListener.java trunk/src/app/net/sf/gridarta/gui/panel/archetypechooser/ArchetypeIconCellRenderer.java trunk/src/app/net/sf/gridarta/gui/panel/archetypechooser/ArchetypeNameCellRenderer.java trunk/src/app/net/sf/gridarta/gui/panel/archetypechooser/ArchetypePanel.java trunk/src/app/net/sf/gridarta/gui/panel/archetypechooser/DirectionPane.java trunk/src/app/net/sf/gridarta/gui/panel/archetypechooser/DisplayMode.java trunk/src/app/net/sf/gridarta/gui/panel/archetypechooser/DisplayNameCellRenderer.java trunk/src/app/net/sf/gridarta/gui/panel/archetypechooser/FolderListCellRenderer.java trunk/src/app/net/sf/gridarta/gui/panel/archetypechooser/package.html trunk/src/app/net/sf/gridarta/gui/panel/connectionview/CellRenderer.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/Connection.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ConnectionControl.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ConnectionView.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/Control.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsControl.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsView.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/LockedItemsControl.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/LockedItemsView.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/MonsterCellRenderer.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/MonsterControl.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/MonsterView.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/View.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/package.html trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/AbstractGameObjectAttributesTab.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ArchTab.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ErrorListView.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ErrorListViewListener.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/EventsTab.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/FaceTab.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesControlListener.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesModel.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesModelListener.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesTab.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesTabListener.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/MsgTextTab.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/TextEditorTab.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjecttexteditor/GameObjectTextEditor.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjecttexteditor/ScrollingTextPane.java trunk/src/app/net/sf/gridarta/gui/panel/objectchoicedisplay/ObjectChoiceDisplay.java trunk/src/app/net/sf/gridarta/gui/panel/objectchooser/DefaultObjectChooser.java trunk/src/app/net/sf/gridarta/gui/panel/objectchooser/ObjectChooser.java trunk/src/app/net/sf/gridarta/gui/panel/objectchooser/ObjectChooserListener.java trunk/src/app/net/sf/gridarta/gui/panel/objectchooser/ObjectChooserTab.java trunk/src/app/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserModel.java trunk/src/app/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserModelListener.java trunk/src/app/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserView.java trunk/src/app/net/sf/gridarta/gui/panel/pickmapchooser/package.html trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/CellRenderer.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/MapSquareSelection.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/MapSquareSelectionCache.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/MapSquareSelectionListener.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/ModelUpdater.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareActions.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareControl.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareModel.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareModelListener.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/package.html trunk/src/app/net/sf/gridarta/gui/panel/tools/AbstractTool.java trunk/src/app/net/sf/gridarta/gui/panel/tools/BasicAbstractTool.java trunk/src/app/net/sf/gridarta/gui/panel/tools/DeletionTool.java trunk/src/app/net/sf/gridarta/gui/panel/tools/InsertionTool.java trunk/src/app/net/sf/gridarta/gui/panel/tools/SelectionTool.java trunk/src/app/net/sf/gridarta/gui/panel/tools/Tool.java trunk/src/app/net/sf/gridarta/gui/panel/tools/ToolPalette.java trunk/src/app/net/sf/gridarta/gui/panel/tools/ToolSelector.java trunk/src/app/net/sf/gridarta/gui/panel/tools/VoidTool.java trunk/src/app/net/sf/gridarta/gui/panel/tools/action.properties trunk/src/app/net/sf/gridarta/gui/panel/tools/action_de.properties trunk/src/app/net/sf/gridarta/gui/panel/tools/action_fr.properties trunk/src/app/net/sf/gridarta/gui/panel/tools/action_sv.properties trunk/src/app/net/sf/gridarta/gui/panel/tools/package.html trunk/src/app/net/sf/gridarta/gui/scripts/AbstractScriptArchUtils.java trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java trunk/src/app/net/sf/gridarta/gui/scripts/PathButtonListener.java trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchEditor.java trunk/src/app/net/sf/gridarta/gui/scripts/ScriptTask.java trunk/src/app/net/sf/gridarta/gui/scripts/ScriptedEventEditor.java trunk/src/app/net/sf/gridarta/gui/spells/SpellsUtils.java trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java trunk/src/app/net/sf/gridarta/gui/treasurelist/TreasureCellRenderer.java trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java trunk/src/app/net/sf/gridarta/gui/undo/package.html trunk/src/app/net/sf/gridarta/gui/utils/AbstractDialogManager.java trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java trunk/src/app/net/sf/gridarta/gui/utils/AnimationComponent.java trunk/src/app/net/sf/gridarta/gui/utils/AsynchronousProgress.java trunk/src/app/net/sf/gridarta/gui/utils/DirectionComponent.java trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java trunk/src/app/net/sf/gridarta/gui/utils/FaceComponent.java trunk/src/app/net/sf/gridarta/gui/utils/FaceTreeChooseAction.java trunk/src/app/net/sf/gridarta/gui/utils/GList.java trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java trunk/src/app/net/sf/gridarta/gui/utils/GUIConstants.java trunk/src/app/net/sf/gridarta/gui/utils/MenuUtils.java trunk/src/app/net/sf/gridarta/gui/utils/Severity.java trunk/src/app/net/sf/gridarta/gui/utils/SwingUtils.java trunk/src/app/net/sf/gridarta/gui/utils/TextComponentUtils.java trunk/src/app/net/sf/gridarta/gui/utils/ToggleTristateCheckBox.java trunk/src/app/net/sf/gridarta/gui/utils/ToolTipProvider.java trunk/src/app/net/sf/gridarta/gui/utils/TreeChooseAction.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderPanel.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderPanelListener.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPaneListener.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/Location.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/VerticalToggleButton.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/ButtonList.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/ButtonListListener.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/ButtonLists.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/ButtonListsListener.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/DoubleButtonList.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/MoveToActions.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/Tab.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabButtonAction.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabListener.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateButtonModel.java trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateState.java trunk/src/app/net/sf/gridarta/gui/utils/tristate/package.html trunk/src/app/net/sf/gridarta/mainactions/DefaultExiter.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/mainactions/RandomFillDialog.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaRunMode.java trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties trunk/src/app/net/sf/gridarta/package.html trunk/src/app/net/sf/gridarta/updater/Updater.java trunk/src/app/net/sf/gridarta/updater/UpdaterManager.java trunk/src/app/overview.html trunk/src/checkstyle.xml trunk/src/doc/cleanupXhtml11.xslt trunk/src/doc/copyright.xhtml trunk/src/doc/dev/SafeCopy.java trunk/src/doc/dev/changelog.xslt trunk/src/doc/dev/codeStyle.xhtml trunk/src/doc/dev/howToHelp.xhtml trunk/src/doc/dev/start.xhtml trunk/src/doc/dev/todo.xhtml trunk/src/doc/dev/transactions.xhtml trunk/src/doc/dev/typeParameters.xhtml trunk/src/doc/faq.xhtml trunk/src/doc/faq2txt.xslt trunk/src/doc/hist/MergingEditors.xhtml trunk/src/doc/history.xhtml trunk/src/doc/news/2006-05-27_1.xhtml trunk/src/doc/news/start.xhtml trunk/src/doc/ref/GameObjectMatcher.xhtml trunk/src/doc/ref/validators.xhtml trunk/src/doc/sitestyle.css trunk/src/doc/start.xhtml trunk/src/doc/status404.xhtml trunk/src/doc/subversion.xhtml trunk/src/doc/transform.xslt trunk/src/doc/xhtml2html.xslt trunk/src/test/net/sf/gridarta/actions/ExitConnectorActionsTest.java trunk/src/test/net/sf/gridarta/actions/UndoActionsTest.java trunk/src/test/net/sf/gridarta/gui/copybuffer/CopyBufferTest.java trunk/src/test/net/sf/gridarta/gui/map/mapview/TestMapView.java trunk/src/test/net/sf/gridarta/gui/map/mapview/TestMapViewBasic.java trunk/src/test/net/sf/gridarta/gui/map/mapview/TestMapViewFactory.java trunk/src/test/net/sf/gridarta/gui/map/renderer/TestMapRenderer.java trunk/src/test/net/sf/gridarta/gui/map/renderer/TestRendererFactory.java trunk/src/test/net/sf/gridarta/gui/map/renderer/ToolTipAppenderTest.java trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuPreferencesTest.java trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuTest.java trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuUtilsTest.java trunk/src/test/net/sf/gridarta/gui/mapmenu/TestMapMenuPreferences.java trunk/src/test/net/sf/gridarta/gui/mapmenu/testLoad1.properties trunk/src/test/net/sf/gridarta/gui/panel/selectedsquare/MapSquareSelectionTest.java trunk/src/test/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareActionsTest.java trunk/src/test/net/sf/gridarta/gui/utils/GSplitPaneTestApplication.java trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/GameObjectMatchers.xml trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/TreasureLists.xml trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/spells.xml trunk/test-mapvalidator/atrinik/arch/dev/editor/conf/types.xml trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/TreasureLists.xml trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/spells.xml trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/types.xml Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/build.xml 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?><!-- ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - ~ Copyright (C) 2000-2010 The Gridarta Developers. + ~ Copyright (C) 2000-2011 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 Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/gridarta.ipr 2011-08-31 04:34:24 UTC (rev 8977) @@ -233,7 +233,7 @@ </component> <component name="CopyrightManager" default="Gridarta"> <copyright> - <option name="notice" value="Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. Copyright (C) 2000-2010 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." /> + <option name="notice" value="Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. Copyright (C) 2000-2011 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." /> <option name="keyword" value="Copyright" /> <option name="allowReplaceKeyword" value="" /> <option name="myName" value="Gridarta" /> Modified: trunk/project.properties =================================================================== --- trunk/project.properties 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/project.properties 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ # # Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. -# Copyright (C) 2000-2010 The Gridarta Developers. +# Copyright (C) 2000-2011 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 Modified: trunk/resource/log4j.properties =================================================================== --- trunk/resource/log4j.properties 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/resource/log4j.properties 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ # # Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. -# Copyright (C) 2000-2010 The Gridarta Developers. +# Copyright (C) 2000-2011 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 Modified: trunk/resource/system/dtd/GameObjectMatchers.dtd =================================================================== --- trunk/resource/system/dtd/GameObjectMatchers.dtd 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/resource/system/dtd/GameObjectMatchers.dtd 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!-- ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - ~ Copyright (C) 2000-2010 The Gridarta Developers. + ~ Copyright (C) 2000-2011 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 Modified: trunk/resource/system/dtd/TreasureLists.dtd =================================================================== --- trunk/resource/system/dtd/TreasureLists.dtd 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/resource/system/dtd/TreasureLists.dtd 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!-- ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - ~ Copyright (C) 2000-2010 The Gridarta Developers. + ~ Copyright (C) 2000-2011 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 Modified: trunk/resource/system/dtd/spells.dtd =================================================================== --- trunk/resource/system/dtd/spells.dtd 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/resource/system/dtd/spells.dtd 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!-- ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - ~ Copyright (C) 2000-2010 The Gridarta Developers. + ~ Copyright (C) 2000-2011 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 Modified: trunk/resource/system/dtd/types.dtd =================================================================== --- trunk/resource/system/dtd/types.dtd 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/resource/system/dtd/types.dtd 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!-- ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - ~ Copyright (C) 2000-2010 The Gridarta Developers. + ~ Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/action.properties =================================================================== --- trunk/src/app/net/sf/gridarta/action.properties 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/action.properties 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ # # Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. -# Copyright (C) 2000-2010 The Gridarta Developers. +# Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java =================================================================== --- trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/actions/CannotLoadMapFileException.java =================================================================== --- trunk/src/app/net/sf/gridarta/actions/CannotLoadMapFileException.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/actions/CannotLoadMapFileException.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/actions/CannotSaveMapFileException.java =================================================================== --- trunk/src/app/net/sf/gridarta/actions/CannotSaveMapFileException.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/actions/CannotSaveMapFileException.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/actions/ExitConnectorActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/actions/ExitConnectorActions.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/actions/ExitConnectorActions.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/actions/InvalidPathNameException.java =================================================================== --- trunk/src/app/net/sf/gridarta/actions/InvalidPathNameException.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/actions/InvalidPathNameException.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/actions/MapSizeMismatchException.java =================================================================== --- trunk/src/app/net/sf/gridarta/actions/MapSizeMismatchException.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/actions/MapSizeMismatchException.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/actions/UndoActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/actions/UndoActions.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/actions/UndoActions.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/commands/BatchPngCommand.java =================================================================== --- trunk/src/app/net/sf/gridarta/commands/BatchPngCommand.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/commands/BatchPngCommand.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/commands/CollectArchesCommand.java =================================================================== --- trunk/src/app/net/sf/gridarta/commands/CollectArchesCommand.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/commands/CollectArchesCommand.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/commands/Collector.java =================================================================== --- trunk/src/app/net/sf/gridarta/commands/Collector.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/commands/Collector.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/commands/Command.java =================================================================== --- trunk/src/app/net/sf/gridarta/commands/Command.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/commands/Command.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/commands/SinglePngCommand.java =================================================================== --- trunk/src/app/net/sf/gridarta/commands/SinglePngCommand.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/commands/SinglePngCommand.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/autovalidator/AutoValidator.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/autovalidator/AutoValidator.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/autovalidator/AutoValidator.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/data/NamedNodeTreeCellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/data/NamedNodeTreeCellRenderer.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/data/NamedNodeTreeCellRenderer.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/data/NamedObjectsUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/data/NamedObjectsUtils.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/data/NamedObjectsUtils.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListener.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListener.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListenerManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListenerManager.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListenerManager.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/BookmarkActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/BookmarkActions.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/BookmarkActions.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/BookmarkDirectoryDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/BookmarkDirectoryDialog.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/BookmarkDirectoryDialog.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/EditBookmarkDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/EditBookmarkDialog.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/EditBookmarkDialog.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/ManageBookmarksDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/ManageBookmarksDialog.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/ManageBookmarksDialog.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/MapMenuEntryIcons.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/MapMenuEntryIcons.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/MapMenuEntryIcons.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/dialog/errorview/ConsoleErrorView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/errorview/ConsoleErrorView.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/dialog/errorview/ConsoleErrorView.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/dialog/errorview/DefaultErrorView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/errorview/DefaultErrorView.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/dialog/errorview/DefaultErrorView.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/dialog/errorview/ErrorEntry.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/errorview/ErrorEntry.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/dialog/errorview/ErrorEntry.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/FindArchetypesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/FindArchetypesDialog.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/FindArchetypesDialog.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/FindArchetypesDialogManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/FindArchetypesDialogManager.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/FindArchetypesDialogManager.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/TableModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/TableModel.java 2011-08-31 04:24:35 UTC (rev 8976) +++ trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/TableModel.java 2011-08-31 04:34:24 UTC (rev 8977) @@ -1,6 +1,6 @@ /* * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. + * Copyright (C) 2000-2011 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 Modified: trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/ConfirmErrorsDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/ConfirmErrorsDialog.java ... [truncated message content] |
From: <aki...@us...> - 2011-09-03 12:32:50
|
Revision: 8978 http://gridarta.svn.sourceforge.net/gridarta/?rev=8978&view=rev Author: akirschbaum Date: 2011-09-03 12:32:43 +0000 (Sat, 03 Sep 2011) Log Message: ----------- Remember last saved directory in save/save as dialogs. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettings.java trunk/model/src/test/net/sf/gridarta/model/settings/TestGlobalSettings.java trunk/src/app/net/sf/gridarta/gui/misc/DefaultFileControl.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-08-31 04:34:24 UTC (rev 8977) +++ trunk/atrinik/ChangeLog 2011-09-03 12:32:43 UTC (rev 8978) @@ -1,3 +1,7 @@ +2011-09-03 Andreas Kirschbaum + + * Remember last saved directory in save/save as dialogs. + 2011-08-28 Andreas Kirschbaum * Fix incorrect contents of selected square view after deleting Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2011-08-31 04:34:24 UTC (rev 8977) +++ trunk/crossfire/ChangeLog 2011-09-03 12:32:43 UTC (rev 8978) @@ -1,3 +1,7 @@ +2011-09-03 Andreas Kirschbaum + + * Remember last saved directory in save/save as dialogs. + 2011-08-28 Andreas Kirschbaum * Fix incorrect contents of selected square view after deleting Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2011-08-31 04:34:24 UTC (rev 8977) +++ trunk/daimonin/ChangeLog 2011-09-03 12:32:43 UTC (rev 8978) @@ -1,3 +1,7 @@ +2011-09-03 Andreas Kirschbaum + + * Remember last saved directory in save/save as dialogs. + 2011-08-28 Andreas Kirschbaum * Fix incorrect contents of selected square view after deleting Modified: trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java 2011-08-31 04:34:24 UTC (rev 8977) +++ trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java 2011-09-03 12:32:43 UTC (rev 8978) @@ -162,12 +162,6 @@ private String imageSet; /** - * The current main directory. - */ - @NotNull - private File currentDirectory = new File(System.getProperty("user.dir")); - - /** * The image directory. By default, created images are stored in this * directory. */ @@ -181,15 +175,15 @@ private ConfigSource configSource; /** - * Indicates whether the user has ever changed the active directory since - * the program started. + * Time for an automated documentation popup. */ - private boolean hasChangedDir = false; + private boolean autoPopupDocumentation = false; /** - * Time for an automated documentation popup. + * The the default directory for saving maps. */ - private boolean autoPopupDocumentation = false; + @NotNull + private File currentSaveMapDirectory; /** * Creates a new instance. @@ -239,6 +233,8 @@ // update documentation version right now, because we want the help popup only one time preferences.putInt(DOCUMENTATION_VERSION_KEY, documentationVersion); } + + currentSaveMapDirectory = mapsDirectory.exists() ? mapsDirectory : new File(System.getProperty("user.dir")); } /** @@ -318,24 +314,7 @@ /** * {@inheritDoc} */ - @NotNull @Override - public File getCurrentDirectory() { - return currentDirectory; - } - - /** - * {@inheritDoc} - */ - @Override - public void setCurrentDirectory(@NotNull final File currentDirectory) { - this.currentDirectory = currentDirectory; - } - - /** - * {@inheritDoc} - */ - @Override public boolean hasMediaDirectory() { return hasMediaDefaultDirectory; } @@ -458,17 +437,18 @@ /** * {@inheritDoc} */ + @NotNull @Override - public boolean hasChangedDir() { - return hasChangedDir; + public File getCurrentSaveMapDirectory() { + return currentSaveMapDirectory; } /** * {@inheritDoc} */ @Override - public void setChangedDir(final boolean hasChangedDir) { - this.hasChangedDir = hasChangedDir; + public void setCurrentSaveMapDirectory(@NotNull final File currentSaveMapDirectory) { + this.currentSaveMapDirectory = currentSaveMapDirectory; } /** Modified: trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettings.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettings.java 2011-08-31 04:34:24 UTC (rev 8977) +++ trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettings.java 2011-09-03 12:32:43 UTC (rev 8978) @@ -100,19 +100,23 @@ */ void setConfigSource(@NotNull ConfigSource configSource); - boolean hasChangedDir(); + /** + * Returns the default directory for saving maps. + * @return the default directory for saving maps + */ + @NotNull + File getCurrentSaveMapDirectory(); - void setChangedDir(boolean hasChangedDir); + /** + * Sets the default directory for saving maps. + * @param currentSaveMapDirectory the default directory for saving maps + */ + void setCurrentSaveMapDirectory(@NotNull File currentSaveMapDirectory); boolean isAutoPopupDocumentation(); void setAutoPopupDocumentation(boolean autoPopupDocumentation); - @NotNull - File getCurrentDirectory(); - - void setCurrentDirectory(@NotNull File currentDirectory); - /** * Returns the pickmap directory. * @return the pickmap directory Modified: trunk/model/src/test/net/sf/gridarta/model/settings/TestGlobalSettings.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/settings/TestGlobalSettings.java 2011-08-31 04:34:24 UTC (rev 8977) +++ trunk/model/src/test/net/sf/gridarta/model/settings/TestGlobalSettings.java 2011-09-03 12:32:43 UTC (rev 8978) @@ -129,8 +129,9 @@ /** * {@inheritDoc} */ + @NotNull @Override - public boolean hasChangedDir() { + public File getCurrentSaveMapDirectory() { throw new AssertionError(); } @@ -138,7 +139,7 @@ * {@inheritDoc} */ @Override - public void setChangedDir(final boolean hasChangedDir) { + public void setCurrentSaveMapDirectory(@NotNull final File currentSaveMapDirectory) { throw new AssertionError(); } @@ -161,24 +162,7 @@ /** * {@inheritDoc} */ - @NotNull @Override - public File getCurrentDirectory() { - throw new AssertionError(); - } - - /** - * {@inheritDoc} - */ - @Override - public void setCurrentDirectory(@NotNull final File currentDirectory) { - throw new AssertionError(); - } - - /** - * {@inheritDoc} - */ - @Override @NotNull public File getPickmapDir() { throw new AssertionError(); Modified: trunk/src/app/net/sf/gridarta/gui/misc/DefaultFileControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/DefaultFileControl.java 2011-08-31 04:34:24 UTC (rev 8977) +++ trunk/src/app/net/sf/gridarta/gui/misc/DefaultFileControl.java 2011-09-03 12:32:43 UTC (rev 8978) @@ -209,8 +209,6 @@ return; } - globalSettings.setChangedDir(true); // user has chosen an active dir - final File dir = tmpFileChooser.getCurrentDirectory(); final File[] files = tmpFileChooser.getSelectedFiles(); for (final File file : files) { final boolean isScriptFile = file.getName().toLowerCase().endsWith(scriptExtension); @@ -218,7 +216,6 @@ if (isScriptFile) { scriptEditControl.openScriptFile(file.getAbsolutePath()); } else { - globalSettings.setCurrentDirectory(dir); try { mapViewsManager.openMapFileWithView(file, null, null); } catch (final IOException ex) { @@ -317,28 +314,23 @@ @Nullable private File saveMapAs(@NotNull final MapControl<G, A, R> mapControl) { final JFileChooser saveFileChooser = new JFileChooser(); + saveFileChooser.setDialogType(JFileChooser.SAVE_DIALOG); saveFileChooser.setDialogTitle("Save Map Or Script As"); - saveFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); + saveFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); saveFileChooser.setMultiSelectionEnabled(false); saveFileChooser.resetChoosableFileFilters(); saveFileChooser.addChoosableFileFilter(scriptFileFilter); saveFileChooser.setFileFilter(mapFileFilter); - // default folder is the map-folder at first time, then the active folder - if (!globalSettings.hasChangedDir() && globalSettings.getMapsDirectory().exists()) { - FileChooserUtils.setCurrentDirectory(saveFileChooser, globalSettings.getMapsDirectory()); - } else if (globalSettings.getCurrentDirectory().exists()) { - FileChooserUtils.setCurrentDirectory(saveFileChooser, globalSettings.getCurrentDirectory()); - } else { - FileChooserUtils.sanitizeCurrentDirectory(saveFileChooser); - } - - // if file already exists, select it final File mapFile = mapControl.getMapModel().getMapFile(); - if (mapFile != null && mapFile.exists()) { + final File defaultDir = mapFile == null ? null : mapFile.getParentFile(); + if (defaultDir != null && defaultDir.exists()) { + FileChooserUtils.setCurrentDirectory(saveFileChooser, defaultDir); saveFileChooser.setSelectedFile(mapFile); } else { - saveFileChooser.setSelectedFile(new File(globalSettings.getMapsDirectory(), CommonConstants.DEFAULT_MAP_FILENAME)); + final File currentSaveMapDirectory = globalSettings.getCurrentSaveMapDirectory(); + FileChooserUtils.setCurrentDirectory(saveFileChooser, currentSaveMapDirectory); + saveFileChooser.setSelectedFile(new File(currentSaveMapDirectory, mapFile == null ? CommonConstants.DEFAULT_MAP_FILENAME : mapFile.getName())); } final int returnVal = saveFileChooser.showSaveDialog(parent); @@ -346,7 +338,7 @@ return null; } - globalSettings.setChangedDir(true); // user has chosen an active dir + globalSettings.setCurrentSaveMapDirectory(saveFileChooser.getCurrentDirectory()); final File file = saveFileChooser.getSelectedFile(); if (file.exists() && ACTION_BUILDER.showConfirmDialog(parent, JOptionPane.WARNING_MESSAGE, JOptionPane.OK_CANCEL_OPTION, "overwriteOtherFile", file.getName()) != JOptionPane.OK_OPTION) { return null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-09-21 19:05:03
|
Revision: 8986 http://gridarta.svn.sourceforge.net/gridarta/?rev=8986&view=rev Author: akirschbaum Date: 2011-09-21 19:04:54 +0000 (Wed, 21 Sep 2011) Log Message: ----------- Implement Map|Go To Exit... which opens a dialog listing all exits out of the current map. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/tod.properties trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/tod_de.properties trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/tod.properties trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/tod_de.properties trunk/daimonin/ChangeLog trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/tod.properties trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/tod_de.properties trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapLocation.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/dialog/goexit/ trunk/src/app/net/sf/gridarta/gui/dialog/goexit/GoExitDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/goexit/GoExitDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/goexit/MapListCellRenderer.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/EnterMap.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-09-21 18:56:25 UTC (rev 8985) +++ trunk/atrinik/ChangeLog 2011-09-21 19:04:54 UTC (rev 8986) @@ -1,3 +1,8 @@ +2011-09-21 Andreas Kirschbaum + + * Implement Map|Go To Exit... which opens a dialog listing all + exits out of the current map. + 2011-09-03 Andreas Kirschbaum * Remember last saved directory in save/save as dialogs. Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties 2011-09-21 18:56:25 UTC (rev 8985) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties 2011-09-21 19:04:54 UTC (rev 8986) @@ -42,7 +42,7 @@ mapwindowFile.menu=saveMap saveMapAs createImage - revertMap - closeMap mapwindowEdit.menu=undo redo - clear cut copy paste pasteTiled - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll invertSelection expandEmptySelection growSelection shrinkSelection -mapwindowMap.menu=gridVisible enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects +mapwindowMap.menu=gridVisible - goExit enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects mapwindowCursor.menu=moveCursor - exitConnector - selectSquare startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes ########## Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/tod.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/tod.properties 2011-09-21 18:56:25 UTC (rev 8985) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/tod.properties 2011-09-21 19:04:54 UTC (rev 8986) @@ -56,3 +56,4 @@ tod.text.32=<html>Beware when editing large maps. You might run out of memory.<br>Be sure to increase the heap size (-Xmx parameter) of Gridarta''s Virtual Machine when editing large maps (e.g. 240\xD7240). tod.text.33=<html>It''s amazing how much archetypes you could find using "Search archetype".<p>Menu: <code>Archetypes -> Find archetype</code>. tod.text.34=<html>You can quickly switch to the game object text editor with <code>CTRl-ALT-E</code>. Press these keys again to close it. +tod.text.35=<html>To navigate to maps connected through exits, select Map|Go To Exit... or press <kbd>Ctrl-F12</kbd>. Then select the exit and press <kbd>Enter</kbd>. Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/tod_de.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/tod_de.properties 2011-09-21 18:56:25 UTC (rev 8985) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/tod_de.properties 2011-09-21 19:04:54 UTC (rev 8986) @@ -52,3 +52,4 @@ tod.text.32=<html>Vorsicht beim Bearbeiten von gro\xDFen Karten: der Platz im Hauptspeicher k\xF6nnte nicht ausreichen.<br>Vergr\xF6\xDFern Sie die "heap size" (Parameter -Xmx beim Aufruf von java) von Gridarta, wenn Sie gro\xDFe Karten (bspw. 240\xD7240) bearbeiten m\xF6chten. tod.text.33=<html>Es ist verbl\xFCffend, wie viele Archetypen man mit "Archetypen finden" entdecken kann.<p>Men\xFC: <code>Archetypen -> Archetypen finden</code>. tod.text.34=<html>Sie k\xF6nnen den Objekt-Editor \xFCber die Tastenkombination <code>CTRl-ALT-E</code> \xF6ffnen. Dieselbe Tastenkombination schlie\xDFt ihn wieder. +tod.text.35=<html>Sie k\xF6nnen Karten hinter Ausg\xE4ngen \xFCber <code>Karte -> Folge Ausgang...</code> oder \xFCber die Tastenkombination <code>CTRL-F12</code> \xF6ffnen. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2011-09-21 18:56:25 UTC (rev 8985) +++ trunk/crossfire/ChangeLog 2011-09-21 19:04:54 UTC (rev 8986) @@ -1,3 +1,8 @@ +2011-09-21 Andreas Kirschbaum + + * Implement Map|Go To Exit... which opens a dialog listing all + exits out of the current map. + 2011-09-03 Andreas Kirschbaum * Remember last saved directory in save/save as dialogs. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties 2011-09-21 18:56:25 UTC (rev 8985) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties 2011-09-21 19:04:54 UTC (rev 8986) @@ -42,7 +42,7 @@ mapwindowFile.menu=saveMap saveMapAs createImage - revertMap - closeMap mapwindowEdit.menu=undo redo - clear cut copy paste pasteTiled - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll invertSelection expandEmptySelection growSelection shrinkSelection -mapwindowMap.menu=gridVisible smoothing enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap tileShow - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects +mapwindowMap.menu=gridVisible smoothing - goExit enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap tileShow - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects mapwindowCursor.menu=moveCursor - exitConnector - selectSquare startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes ########## Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/tod.properties =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/tod.properties 2011-09-21 18:56:25 UTC (rev 8985) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/tod.properties 2011-09-21 19:04:54 UTC (rev 8986) @@ -37,3 +37,4 @@ tod.text.13=<html>Beware when editing large maps. You might run out of memory.<br>Be sure to increase the heap size (-Xmx parameter) of Gridarta''s Virtual Machine when editing large maps (e.g. 240\xD7240). tod.text.14=<html>It''s amazing how many archetypes you could find using "Search archetype".<p>Menu: <code>Archetypes -> Find archetype</code>. tod.text.15=<html>You can quickly switch to the game object text editor with <code>CTRl-ALT-E</code>. Press these keys again to close it. +tod.text.16=<html>To navigate to maps connected through exits, select Map|Go To Exit... or press <kbd>Ctrl-F12</kbd>. Then select the exit and press <kbd>Enter</kbd>. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/tod_de.properties =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/tod_de.properties 2011-09-21 18:56:25 UTC (rev 8985) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/tod_de.properties 2011-09-21 19:04:54 UTC (rev 8986) @@ -37,3 +37,4 @@ tod.text.13=<html>Vorsicht beim Bearbeiten von gro\xDFen Karten: der Platz im Hauptspeicher k\xF6nnte nicht ausreichen.<br>Vergr\xF6\xDFern Sie die "heap size" (Parameter -Xmx beim Aufruf von java) von Gridarta, wenn Sie gro\xDFe Karten (bspw. 240\xD7240) bearbeiten m\xF6chten. tod.text.14=<html>Es ist verbl\xFCffend, wie viele Archetypen man mit "Archetypen finden" entdecken kann.<p>Men\xFC: <code>Archetypen -> Archetypen finden</code>. tod.text.15=<html>Sie k\xF6nnen den Objekt-Editor \xFCber die Tastenkombination <code>CTRl-ALT-E</code> \xF6ffnen. Dieselbe Tastenkombination schlie\xDFt ihn wieder. +tod.text.16=<html>Sie k\xF6nnen Karten hinter Ausg\xE4ngen \xFCber <code>Karte -> Folge Ausgang...</code> oder \xFCber die Tastenkombination <code>CTRL-F12</code> \xF6ffnen. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2011-09-21 18:56:25 UTC (rev 8985) +++ trunk/daimonin/ChangeLog 2011-09-21 19:04:54 UTC (rev 8986) @@ -1,3 +1,8 @@ +2011-09-21 Andreas Kirschbaum + + * Implement Map|Go To Exit... which opens a dialog listing all + exits out of the current map. + 2011-09-03 Andreas Kirschbaum * Remember last saved directory in save/save as dialogs. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties 2011-09-21 18:56:25 UTC (rev 8985) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties 2011-09-21 19:04:54 UTC (rev 8986) @@ -42,7 +42,7 @@ mapwindowFile.menu=saveMap saveMapAs createImage - revertMap - closeMap mapwindowEdit.menu=undo redo - clear cut copy paste pasteTiled - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll invertSelection expandEmptySelection growSelection shrinkSelection -mapwindowMap.menu=gridVisible enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects +mapwindowMap.menu=gridVisible - goExit enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects mapwindowCursor.menu=moveCursor - exitConnector - selectSquare startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes ########## Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/tod.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/tod.properties 2011-09-21 18:56:25 UTC (rev 8985) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/tod.properties 2011-09-21 19:04:54 UTC (rev 8986) @@ -56,3 +56,4 @@ tod.text.32=<html>Beware when editing large maps. You might run out of memory.<br>Be sure to increase the heap size (-Xmx parameter) of Gridarta''s Virtual Machine when editing large maps (e.g. 240\xD7240). tod.text.33=<html>It''s amazing how much archetypes you could find using "Search archetype".<p>Menu: <code>Archetypes -> Find archetype</code>. tod.text.34=<html>You can quickly switch to the game object text editor with <code>CTRl-ALT-E</code>. Press these keys again to close it. +tod.text.35=<html>To navigate to maps connected through exits, select Map|Go To Exit... or press <kbd>Ctrl-F12</kbd>. Then select the exit and press <kbd>Enter</kbd>. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/tod_de.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/tod_de.properties 2011-09-21 18:56:25 UTC (rev 8985) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/tod_de.properties 2011-09-21 19:04:54 UTC (rev 8986) @@ -52,3 +52,4 @@ tod.text.32=<html>Vorsicht beim Bearbeiten von gro\xDFen Karten: der Platz im Hauptspeicher k\xF6nnte nicht ausreichen.<br>Vergr\xF6\xDFern Sie die "heap size" (Parameter -Xmx beim Aufruf von java) von Gridarta, wenn Sie gro\xDFe Karten (bspw. 240\xD7240) bearbeiten m\xF6chten. tod.text.33=<html>Es ist verbl\xFCffend, wie viele Archetypen man mit "Archetypen finden" entdecken kann.<p>Men\xFC: <code>Archetypen -> Archetypen finden</code>. tod.text.34=<html>Sie k\xF6nnen den Objekt-Editor \xFCber die Tastenkombination <code>CTRl-ALT-E</code> \xF6ffnen. Dieselbe Tastenkombination schlie\xDFt ihn wieder. +tod.text.35=<html>Sie k\xF6nnen Karten hinter Ausg\xE4ngen \xFCber <code>Karte -> Folge Ausgang...</code> oder \xFCber die Tastenkombination <code>CTRL-F12</code> \xF6ffnen. Added: trunk/src/app/net/sf/gridarta/gui/dialog/goexit/GoExitDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/goexit/GoExitDialog.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/dialog/goexit/GoExitDialog.java 2011-09-21 19:04:54 UTC (rev 8986) @@ -0,0 +1,356 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.dialog.goexit; + +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.Collection; +import java.util.TreeSet; +import javax.swing.DefaultListModel; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JList; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.ListSelectionModel; +import javax.swing.ScrollPaneConstants; +import javax.swing.WindowConstants; +import net.sf.gridarta.gui.map.mapactions.EnterMap; +import net.sf.gridarta.gui.map.mapactions.MapLocation; +import net.sf.gridarta.gui.map.mapactions.NoExitPathException; +import net.sf.gridarta.gui.map.mapview.MapView; +import net.sf.gridarta.gui.utils.SwingUtils; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.face.FaceObjectProviders; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.io.PathManager; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmodel.MapModel; +import net.sf.gridarta.model.match.GameObjectMatcher; +import net.sf.gridarta.utils.ActionBuilderUtils; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.swing.action.ActionMethod; +import org.jetbrains.annotations.NotNull; + +/** + * A dialog to ask the user for a map to open. + * @author Andreas Kirschbaum + */ +public class GoExitDialog<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { + + /** + * The {@link ActionBuilder}. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * An empty array of {@link JButton} instances. + */ + @NotNull + private static final JButton[] EMPTY_BUTTON_ARRAY = new JButton[0]; + + /** + * The {@link MapView} for this dialog. + */ + @NotNull + private final MapView<G, A, R> mapView; + + /** + * The {@link GameObjectMatcher} for selecting exits. + */ + @NotNull + private final GameObjectMatcher exitGameObjectMatcher; + + /** + * The {@link PathManager} for converting relative exit paths. + */ + @NotNull + private final PathManager pathManager; + + /** + * The {@link EnterMap} instance for entering maps. + */ + @NotNull + private final EnterMap<G, A, R> enterMap; + + /** + * The {@link JDialog} instance.} + */ + @NotNull + private final JDialog dialog; + + /** + * The list model containing the search results. + */ + @NotNull + private final DefaultListModel listModel = new DefaultListModel(); + + /** + * The {@link JList} showing the matching maps. + */ + @NotNull + private final JList list = new JList(listModel); + + /** + * The {@link MapListCellRenderer} for {@link #list}. + */ + @NotNull + private final MapListCellRenderer mapListCellRenderer; + + /** + * Creates a new instance. + * @param parent the parent component for this dialog + * @param mapView the map view for this dialog + * @param exitGameObjectMatcher the game object matcher for selecting exits + * @param pathManager the path manager for converting relative exit paths + * @param enterMap the enter map instance to use + * @param faceObjectProviders the face object providers for looking up + * faces + */ + public GoExitDialog(@NotNull final Component parent, @NotNull final MapView<G, A, R> mapView, @NotNull final GameObjectMatcher exitGameObjectMatcher, @NotNull final PathManager pathManager, @NotNull final EnterMap<G, A, R> enterMap, @NotNull final FaceObjectProviders faceObjectProviders) { + this.mapView = mapView; + this.exitGameObjectMatcher = exitGameObjectMatcher; + this.pathManager = pathManager; + this.enterMap = enterMap; + SwingUtils.addAction(list, ACTION_BUILDER.createAction(false, "goExitApply", this)); + list.setFocusable(false); + final Component scrollPane = new JScrollPane(list, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + mapListCellRenderer = new MapListCellRenderer(pathManager, faceObjectProviders); + list.setCellRenderer(mapListCellRenderer); + list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + final MouseListener mouseListener = new MouseListener() { + + @Override + public void mouseClicked(final MouseEvent e) { + // ignore + } + + @Override + public void mousePressed(final MouseEvent e) { + if (e.getClickCount() > 1) { + goExitApply(); + } + } + + @Override + public void mouseReleased(final MouseEvent e) { + // ignore + } + + @Override + public void mouseEntered(final MouseEvent e) { + // ignore + } + + @Override + public void mouseExited(final MouseEvent e) { + // ignore + } + + }; + list.addMouseListener(mouseListener); + list.setFocusable(true); + + final JPanel panel = new JPanel(new BorderLayout()); + panel.add(scrollPane, BorderLayout.CENTER); + final JOptionPane optionPane = new JOptionPane(panel, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null, EMPTY_BUTTON_ARRAY, list); + dialog = optionPane.createDialog(parent, ActionBuilderUtils.getString(ACTION_BUILDER, "goExitTitle")); + dialog.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); + dialog.setResizable(true); + dialog.setSize(500, 250); + dialog.setLocationRelativeTo(parent); + } + + /** + * Opens the dialog. + */ + public void showDialog() { + final MapControl<G, A, R> mapControl = mapView.getMapControl(); + final MapModel<G, A, R> mapModel = mapControl.getMapModel(); + final Collection<G> exits = new TreeSet<G>(mapListCellRenderer); + for (final Iterable<G> mapSquare : mapModel) { + for (final G gameObject : mapSquare) { + if (exitGameObjectMatcher.isMatching(gameObject)) { + try { + MapLocation.newAbsoluteMapLocation(gameObject, true, pathManager); + exits.add(gameObject); + } catch (final NoExitPathException ignored) { + // ignore + } + } + } + } + for (final G exit : exits) { + listModel.addElement(exit); + } + + list.setSelectedIndex(0); + list.ensureIndexIsVisible(0); + dialog.setVisible(true); + } + + /** + * Action method for apply. + */ + @ActionMethod + public void goExitApply() { + if (goExit()) { + dialog.dispose(); + } + } + + /** + * Action method for cancel. + */ + @ActionMethod + public void goExitCancel() { + dialog.dispose(); + } + + /** + * Action method for scroll up. + */ + @ActionMethod + public void goExitScrollUp() { + final int index = list.getMinSelectionIndex(); + final int newIndex = index > 0 ? index - 1 : listModel.size() - 1; + list.setSelectedIndex(newIndex); + list.ensureIndexIsVisible(newIndex); + } + + /** + * Action method for scroll down. + */ + @ActionMethod + public void goExitScrollDown() { + final int index = list.getMaxSelectionIndex() + 1; + final int newIndex = index < listModel.size() ? index : 0; + list.setSelectedIndex(newIndex); + list.ensureIndexIsVisible(newIndex); + } + + /** + * Action method for scroll page up. + */ + @ActionMethod + public void goExitScrollPageUp() { + final int index = list.getMinSelectionIndex(); + final int firstIndex = list.getFirstVisibleIndex(); + final int newIndex; + if (firstIndex == -1) { + newIndex = -1; + } else if (index == -1) { + newIndex = firstIndex; + } else if (index > firstIndex) { + newIndex = firstIndex; + } else { + newIndex = Math.max(firstIndex - (list.getLastVisibleIndex() - firstIndex), 0); + } + list.setSelectedIndex(newIndex); + list.ensureIndexIsVisible(newIndex); + } + + /** + * Action method for scroll page down. + */ + @ActionMethod + public void goExitScrollPageDown() { + final int index = list.getMaxSelectionIndex(); + final int lastIndex = list.getLastVisibleIndex(); + final int newIndex; + if (lastIndex == -1) { + newIndex = -1; + } else if (index == -1) { + newIndex = lastIndex; + } else if (index < lastIndex) { + newIndex = lastIndex; + } else { + newIndex = Math.min(lastIndex + (lastIndex - list.getFirstVisibleIndex()), listModel.size() - 1); + } + list.setSelectedIndex(newIndex); + list.ensureIndexIsVisible(newIndex); + } + + /** + * Action method for scroll top. + */ + @ActionMethod + public void goExitScrollTop() { + final int newIndex = 0; + list.setSelectedIndex(newIndex); + list.ensureIndexIsVisible(newIndex); + } + + /** + * Action method for scroll bottom. + */ + @ActionMethod + public void goExitScrollBottom() { + final int newIndex = listModel.size() - 1; + list.setSelectedIndex(newIndex); + list.ensureIndexIsVisible(newIndex); + } + + /** + * Action method for select up. + */ + @ActionMethod + public void goExitSelectUp() { + final int index = list.getMinSelectionIndex(); + if (index != 0) { + final int newIndex = index > 0 ? index - 1 : listModel.size() - 1; + list.addSelectionInterval(newIndex, newIndex); + list.ensureIndexIsVisible(newIndex); + } + } + + /** + * Action method for select down. + */ + @ActionMethod + public void goExitSelectDown() { + final int index = list.getMaxSelectionIndex(); + if (index + 1 < listModel.size()) { + final int newIndex = index + 1; + list.addSelectionInterval(newIndex, newIndex); + list.ensureIndexIsVisible(newIndex); + } + } + + /** + * Opens the selected maps. + * @return whether at least one map was opened + */ + private boolean goExit() { + final Object selectedValue = list.getSelectedValue(); + if (selectedValue == null) { + return false; + } + @SuppressWarnings("unchecked") final GameObject<G, A, R> exit = (GameObject<G, A, R>) selectedValue; + return enterMap.enterExit(mapView, exit, true); + } + +} // class GoExitDialog Property changes on: trunk/src/app/net/sf/gridarta/gui/dialog/goexit/GoExitDialog.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gui/dialog/goexit/GoExitDialogManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/goexit/GoExitDialogManager.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/dialog/goexit/GoExitDialogManager.java 2011-09-21 19:04:54 UTC (rev 8986) @@ -0,0 +1,123 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.dialog.goexit; + +import java.awt.Window; +import net.sf.gridarta.gui.map.mapactions.EnterMap; +import net.sf.gridarta.gui.map.mapview.MapView; +import net.sf.gridarta.gui.map.mapview.MapViewManager; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.face.FaceObjectProviders; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.io.PathManager; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.match.GameObjectMatcher; +import net.sf.japi.swing.action.ActionMethod; +import org.jetbrains.annotations.NotNull; + +/** + * Manager for {@link GoExitDialog} instances. + * @author Andreas Kirschbaum + */ +public class GoExitDialogManager<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { + + /** + * The parent {@link Window} for go map dialogs. + */ + @NotNull + private final Window parent; + + /** + * The map manager to use. + */ + @NotNull + private final MapManager<G, A, R> mapManager; + + /** + * The {@link MapViewManager} instance. + */ + @NotNull + private final MapViewManager<G, A, R> mapViewManager; + + /** + * The {@link GameObjectMatcher} for selecting exits. + */ + @NotNull + private final GameObjectMatcher exitGameObjectMatcher; + + /** + * The {@link PathManager} for converting relative exit paths. + */ + @NotNull + private final PathManager pathManager; + + /** + * The {@link EnterMap} instance to use. + */ + @NotNull + private final EnterMap<G, A, R> enterMap; + + /** + * The {@link FaceObjectProviders} for looking up faces. + */ + @NotNull + private final FaceObjectProviders faceObjectProviders; + + /** + * Creates a new instance. + * @param parent the parent window for go map dialogs + * @param mapManager the map manager to use + * @param mapViewManager the map view manager instance + * @param exitGameObjectMatcher the game object matcher for selecting exits + * @param pathManager the path manager for converting relative exit paths + * @param enterMap the enter map instance to use + * @param faceObjectProviders the face object providers for looking up + * faces + */ + public GoExitDialogManager(@NotNull final Window parent, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final GameObjectMatcher exitGameObjectMatcher, @NotNull final PathManager pathManager, @NotNull final EnterMap<G, A, R> enterMap, @NotNull final FaceObjectProviders faceObjectProviders) { + this.parent = parent; + this.mapManager = mapManager; + this.mapViewManager = mapViewManager; + this.exitGameObjectMatcher = exitGameObjectMatcher; + this.pathManager = pathManager; + this.enterMap = enterMap; + this.faceObjectProviders = faceObjectProviders; + } + + /** + * Action method to open the "go exit" dialog. + */ + @ActionMethod + public void goExit() { + final MapControl<G, A, R> mapControl = mapManager.getCurrentMap(); + if (mapControl == null) { + return; + } + + final MapView<G, A, R> mapView = mapViewManager.getActiveMapView(); + if (mapView == null) { + return; + } + new GoExitDialog<G, A, R>(parent, mapView, exitGameObjectMatcher, pathManager, enterMap, faceObjectProviders).showDialog(); + } + +} // class GoExitDialogManager Property changes on: trunk/src/app/net/sf/gridarta/gui/dialog/goexit/GoExitDialogManager.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gui/dialog/goexit/MapListCellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/goexit/MapListCellRenderer.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/dialog/goexit/MapListCellRenderer.java 2011-09-21 19:04:54 UTC (rev 8986) @@ -0,0 +1,157 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.dialog.goexit; + +import java.awt.Component; +import java.awt.Point; +import java.util.Comparator; +import javax.swing.DefaultListCellRenderer; +import javax.swing.JList; +import net.sf.gridarta.gui.map.mapactions.MapLocation; +import net.sf.gridarta.gui.map.mapactions.NoExitPathException; +import net.sf.gridarta.gui.panel.connectionview.CellRenderer; +import net.sf.gridarta.model.face.FaceObjectProviders; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.io.PathManager; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * A {@link CellRenderer} for the locked items view. + * @author Andreas Kirschbaum + */ +public class MapListCellRenderer extends DefaultListCellRenderer implements Comparator<GameObject<?, ?, ?>> { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The {@link PathManager} for converting relative exit paths. + */ + @NotNull + private final PathManager pathManager; + + /** + * The {@link FaceObjectProviders} for looking up faces. + */ + @NotNull + private final FaceObjectProviders faceObjectProviders; + + /** + * Creates a new instance. + * @param pathManager the path manager for converting relative exit paths + * @param faceObjectProviders the face object providers for looking up + * faces + */ + public MapListCellRenderer(@NotNull final PathManager pathManager, @NotNull final FaceObjectProviders faceObjectProviders) { + this.pathManager = pathManager; + this.faceObjectProviders = faceObjectProviders; + } + + /** + * {@inheritDoc} + */ + @Override + public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + + final GameObject<?, ?, ?> gameObject = (GameObject<?, ?, ?>) value; + final MapLocation mapLocation = getMapLocation(gameObject); + setIcon(faceObjectProviders.getFace(gameObject)); + final StringBuilder sb = new StringBuilder(); + sb.append(gameObject.getBestName()); + sb.append(" ["); + if (mapLocation == null) { + sb.append("?"); + } else { + sb.append(mapLocation.getMapPath()); + sb.append("@"); + final Point mapCoordinate = mapLocation.getMapCoordinate(); + sb.append(mapCoordinate.x); + sb.append("/"); + sb.append(mapCoordinate.y); + } + sb.append("]"); + setText(sb.toString()); + return this; + } + + /** + * Returns the {@link MapLocation} for a {@link GameObject}. + * @param gameObject the game object + * @return the map location or <code>null</code> if unknown + */ + @Nullable + private MapLocation getMapLocation(@NotNull final GameObject<?, ?, ?> gameObject) { + try { + return MapLocation.newAbsoluteMapLocation(gameObject, true, pathManager); + } catch (final NoExitPathException ignored) { + return null; + } + } + + /** + * {@inheritDoc} + */ + @Override + public int compare(final GameObject<?, ?, ?> o1, final GameObject<?, ?, ?> o2) { + final String name1 = o1.getBestName(); + final String name2 = o2.getBestName(); + final int cmp1 = name1.compareToIgnoreCase(name2); + if (cmp1 != 0) { + return cmp1; + } + + final MapLocation mapLocation1 = getMapLocation(o1); + final MapLocation mapLocation2 = getMapLocation(o2); + if (mapLocation1 == null) { + if (mapLocation2 != null) { + return -1; + } + } else if (mapLocation2 == null) { + return +1; + } else { + final int cmp2 = mapLocation1.compareTo(mapLocation2); + if (cmp2 != 0) { + return cmp2; + } + } + + final String faceObjName1 = o1.getFaceObjName(); + final String faceObjName2 = o2.getFaceObjName(); + if (faceObjName1 == null) { + if (faceObjName2 != null) { + return -1; + } + } else if (faceObjName2 == null) { + return +1; + } else { + final int cmp3 = faceObjName1.compareTo(faceObjName2); + if (cmp3 != 0) { + return cmp3; + } + } + + return 0; + } + +} Property changes on: trunk/src/app/net/sf/gridarta/gui/dialog/goexit/MapListCellRenderer.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gui/map/mapactions/EnterMap.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapactions/EnterMap.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/map/mapactions/EnterMap.java 2011-09-21 19:04:54 UTC (rev 8986) @@ -0,0 +1,271 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.map.mapactions; + +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.Rectangle; +import java.io.File; +import java.io.IOException; +import javax.swing.JOptionPane; +import javax.swing.JScrollPane; +import net.sf.gridarta.gui.map.mapview.MapView; +import net.sf.gridarta.gui.map.mapview.MapViewsManager; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.direction.Direction; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmanager.FileControl; +import net.sf.gridarta.model.mappathnormalizer.IOErrorException; +import net.sf.gridarta.model.mappathnormalizer.InvalidPathException; +import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; +import net.sf.gridarta.model.mappathnormalizer.RelativePathOnUnsavedMapException; +import net.sf.gridarta.model.mappathnormalizer.SameMapException; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Helper class for entering maps. + * @author Andreas Kirschbaum + */ +public class EnterMap<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { + + /** + * Action Builder to create Actions. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The component for showing dialog boxes. + */ + @NotNull + private final Component parent; + + /** + * Maps map relative direction to map window direction. + */ + @NotNull + private final Direction[] directionMap; + + /** + * The {@link MapPathNormalizer} to use. + */ + @NotNull + private final MapPathNormalizer mapPathNormalizer; + + /** + * The {@link FileControl}. + */ + @NotNull + private final FileControl<G, A, R> fileControl; + + /** + * The {@link MapViewsManager}. + */ + @NotNull + private final MapViewsManager<G, A, R> mapViewsManager; + + /** + * Creates a new instance. + * @param parent the component for showing dialog boxes + * @param directionMap maps relative direction to map window direction + * @param mapPathNormalizer the map path normalizer to use + * @param fileControl the file control + * @param mapViewsManager the map views + */ + public EnterMap(@NotNull final Component parent, @NotNull final Direction[] directionMap, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final FileControl<G, A, R> fileControl, @NotNull final MapViewsManager<G, A, R> mapViewsManager) { + this.parent = parent; + this.directionMap = directionMap.clone(); + this.mapPathNormalizer = mapPathNormalizer; + this.fileControl = fileControl; + this.mapViewsManager = mapViewsManager; + } + + /** + * Enters a map wanted. + * @param mapView the map view to leave + * @param path path to map that should be loaded + * @param direction the direction to go + * @param destinationPoint the desired destination point on the map (pass + * 0|0 if unknown, and note that the point gets modified) + * @return whether the destination map has been entered + */ + public boolean enterMap(@NotNull final MapView<G, A, R> mapView, @NotNull final String path, @NotNull final Direction direction, @Nullable final Point destinationPoint) { + final File canonicalNewFile; + try { + canonicalNewFile = mapPathNormalizer.normalizeMapPath(mapView.getMapControl().getMapModel(), path); + } catch (final InvalidPathException ex) { + ACTION_BUILDER.showMessageDialog(parent, "enterExitInvalidPath", ex.getFile().getAbsolutePath()); + return false; + } catch (final IOErrorException ex) { + ACTION_BUILDER.showMessageDialog(parent, "enterTileIOException", ex.getFile().getAbsolutePath()); + return false; + } catch (final RelativePathOnUnsavedMapException ex) { + ACTION_BUILDER.showMessageDialog(parent, "enterExitNotSaved", ex.getMessage()); + return false; + } catch (final SameMapException ignored) { + // path points to the same map + if (destinationPoint != null) { + showLocation(mapView, destinationPoint); + } + return true; + } + return enterMap(mapView, canonicalNewFile, destinationPoint, direction); + } + + /** + * Enters a map. + * @param mapView the current map view; may be closed it + * non-<code>null</code> + * @param mapFile the map file to enter + * @param destinationPoint the desired destination point on the map or + * <code>null</code> for default + * @param direction the direction to go + * @return whether the destination map has been entered + */ + public boolean enterMap(@Nullable final MapView<G, A, R> mapView, @NotNull final File mapFile, @Nullable final Point destinationPoint, @NotNull final Direction direction) { + final MapView<G, A, R> newMapView; + try { + newMapView = mapViewsManager.openMapFileWithView(mapFile, null, destinationPoint); + } catch (final IOException ex) { + fileControl.reportLoadError(mapFile, ex.getMessage()); + return false; + } + + if (destinationPoint != null) { + showLocation(newMapView, destinationPoint); + } else if (mapView != null) { + newMapView.getMapViewBasic().getScrollPane().getViewport().setViewPosition(calculateNewViewPosition(mapView.getMapViewBasic().getScrollPane(), newMapView.getMapViewBasic().getScrollPane(), direction)); + } + + if (mapView != null && ACTION_BUILDER.showOnetimeConfirmDialog(parent, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, "enterExitClose") == JOptionPane.YES_OPTION) { + // only close current map if a new file was opened and user wants to close it + mapViewsManager.closeMapView(mapView); + } + + return true; + } + + /** + * Scrolls a map view to make a give tile visible. + * @param mapView the map view + * @param point the square + */ + public void showLocation(@NotNull final MapView<G, A, R> mapView, @NotNull final Point point) { + final Point point2 = point.x == -1 && point.y == -1 ? mapView.getMapControl().getMapModel().getMapArchObject().getEnter() : point; + if (!mapView.getMapControl().getMapModel().getMapArchObject().isPointValid(point2)) { + ACTION_BUILDER.showMessageDialog(parent, "enterExitOutside"); + return; + } + + mapView.getMapViewBasic().getMapCursor().setLocation(point2); + } + + /** + * Opens the map an exit game object points to. + * @param mapView the map view to leave + * @param exit the game object + * @param allowRandomMapParameters whether exit paths may point to random + * maps + * @return whether the destination map could be opened + */ + public boolean enterExit(@NotNull final MapView<G, A, R> mapView, @NotNull final GameObject<G, A, R> exit, final boolean allowRandomMapParameters) { + final MapLocation mapLocation; + try { + mapLocation = new MapLocation(exit, allowRandomMapParameters); + } catch (final NoExitPathException ex) { + ACTION_BUILDER.showMessageDialog(parent, "enterExitRandomDestination", ex.getMessage()); + return false; + } + + return enterMap(mapView, mapLocation.getMapPath(), Direction.NORTH, mapLocation.getMapCoordinate()); + } + + /** + * Calculate the view position for the new viewport. + * @param oldMapView the old map view + * @param newMapView the new map view + * @param direction the direction to scroll + * @return the new view position + * @noinspection TypeMayBeWeakened + */ + @NotNull + private Point calculateNewViewPosition(@NotNull final JScrollPane oldMapView, @NotNull final JScrollPane newMapView, @NotNull final Direction direction) { + final Dimension newViewSize = newMapView.getViewport().getViewSize(); + final Rectangle oldViewRectangle = oldMapView.getViewport().getViewRect(); + + final Rectangle scrollTo; + switch (directionMap[direction.ordinal()]) { + case SOUTH: + scrollTo = new Rectangle(oldViewRectangle.x, 0, oldViewRectangle.width, oldViewRectangle.height); + break; + + case NORTH: + scrollTo = new Rectangle(oldViewRectangle.x, newViewSize.height - oldViewRectangle.height, oldViewRectangle.width, oldViewRectangle.height); + break; + + case EAST: + scrollTo = new Rectangle(0, oldViewRectangle.y, oldViewRectangle.width, oldViewRectangle.height); + break; + + case WEST: + scrollTo = new Rectangle(newViewSize.width - oldViewRectangle.width, oldViewRectangle.y, oldViewRectangle.width, oldViewRectangle.height); + break; + + case NORTH_EAST: + scrollTo = new Rectangle(0, newViewSize.height - oldViewRectangle.height, oldViewRectangle.width, oldViewRectangle.height); + break; + + case SOUTH_EAST: + scrollTo = new Rectangle(0, 0, oldViewRectangle.width, oldViewRectangle.height); + break; + + case SOUTH_WEST: + scrollTo = new Rectangle(newViewSize.width - oldViewRectangle.width, 0, oldViewRectangle.width, oldViewRectangle.height); + break; + + case NORTH_WEST: + scrollTo = new Rectangle(newViewSize.width - oldViewRectangle.width, newViewSize.height - oldViewRectangle.height, oldViewRectangle.width, oldViewRectangle.height); + break; + + default: + throw new AssertionError(); + } + + if (scrollTo.x + scrollTo.width > newViewSize.width) { + scrollTo.x = newViewSize.width - scrollTo.width; + } + if (scrollTo.x < 0) { + scrollTo.x = 0; + } + if (scrollTo.y + scrollTo.height > newViewSize.height) { + scrollTo.y = newViewSize.height - scrollTo.height; + } + if (scrollTo.y < 0) { + scrollTo.y = 0; + } + return scrollTo.getLocation(); + } + +} // class EnterMap Property changes on: trunk/src/app/net/sf/gridarta/gui/map/mapactions/EnterMap.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java 2011-09-21 18:56:25 UTC (rev 8985) +++ trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java 2011-09-21 19:04:54 UTC (rev 8986) @@ -19,18 +19,12 @@ package net.sf.gridarta.gui.map.mapactions; -import java.awt.Component; -import java.awt.Dimension; import java.awt.Point; -import java.awt.Rectangle; import java.io.File; -import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import javax.swing.Action; import javax.swing.JFrame; -import javax.swing.JOptionPane; -import javax.swing.JScrollPane; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gui.dialog.mapproperties.MapPropertiesDialogFactory; import net.sf.gridarta.gui.dialog.shrinkmapsize.ShrinkMapSizeDialogManager; @@ -49,15 +43,9 @@ import net.sf.gridarta.model.mapcursor.MapCursor; import net.sf.gridarta.model.mapcursor.MapCursorEvent; import net.sf.gridarta.model.mapcursor.MapCursorListener; -import net.sf.gridarta.model.mapmanager.FileControl; import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmanager.MapManagerListener; import net.sf.gridarta.model.mapmodel.MapModel; -import net.sf.gridarta.model.mappathnormalizer.IOErrorException; -import net.sf.gridarta.model.mappathnormalizer.InvalidPathException; -import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; -import net.sf.gridarta.model.mappathnormalizer.RelativePathOnUnsavedMapException; -import net.sf.gridarta.model.mappathnormalizer.SameMapException; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.mapviewsettings.MapViewSettingsListener; import net.sf.gridarta.utils.ActionUtils; @@ -172,12 +160,6 @@ } /** - * The component for showing dialog boxes. - */ - @NotNull - private final Component parent; - - /** * The parent frame for help windows. */ @NotNull @@ -202,16 +184,16 @@ private final SelectedSquareModel<G, A, R> selectedSquareModel; /** - * The {@link ShrinkMapSizeDialogManager} instance. + * The {@link EnterMap} instance to use. */ @NotNull - private final ShrinkMapSizeDialogManager<G, A, R> shrinkMapSizeDialogManager; + private final EnterMap<G, A, R> enterMap; /** - * Maps map relative direction to map window direction. + * The {@link ShrinkMapSizeDialogManager} instance. */ @NotNull - private final Direction[] directionMap; + private final ShrinkMapSizeDialogManager<G, A, R> shrinkMapSizeDialogManager; /** * Whether exit paths may point to random maps. @@ -231,24 +213,12 @@ private final MapViewSettings mapViewSettings; /** - * The {@link MapPathNormalizer} to use. - */ - @NotNull - private final MapPathNormalizer mapPathNormalizer; - - /** * The {@link MapViewsManager}. */ @NotNull private final MapViewsManager<G, A, R> mapViewsManager; /** - * The {@link FileControl}. - */ - @NotNull - private final FileControl<G, A, R> fileControl; - - /** * The current map view, or <code>null</code> if no map view is active. */ @Nullable @@ -409,36 +379,30 @@ /** * Create a new instance. - * @param parent the component for showing dialog boxes * @param helpParent the parent frame for help windows * @param mapManager the map manager * @param mapViewManager the map view manager * @param exitMatcher the exit matcher for selecting exit game objects * @param mapFileFilter the Swing file filter to use * @param selectedSquareModel the selected square model to use - * @param directionMap maps relative direction to map window direction * @param allowRandomMapParameters whether exit paths may point to random * maps * @param mapPropertiesDialogFactory the map properties dialog factory to * use * @param mapViewSettings the map view settings instance to use - * @param mapPathNormalizer the map path normalizer to use * @param mapViewsManager the map views - * @param fileControl the file control + * @param enterMap the enter map instance to use */ - public MapActions(@NotNull final Component parent, @NotNull final JFrame helpParent, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewManager<G, A, R> mapViewManager, final ExitMatcher<G, A, R> exitMatcher, final FileFilter mapFileFilter, @NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, @NotNull final Direction[] directionMap, final boolean allowRandomMapParameters, @NotNull final MapPropertiesDialogFactory<G, A, R> mapPropertiesDialogFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final MapPathNormalizer mapPathNormalizer, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final FileControl<G, A, R> fileControl) { - this.parent = parent; + public MapActions(@NotNull final JFrame helpParent, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewManager<G, A, R> mapViewManager, final ExitMatcher<G, A, R> exitMatcher, final FileFilter mapFileFilter, @NotNull final SelectedSquareModel<G, A, R> selectedSquareModel, final boolean allowRandomMapParameters, @NotNull final MapPropertiesDialogFactory<G, A, R> mapPropertiesDialogFactory, @NotNull final MapViewSettings mapViewSettings, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final EnterMap<G, A, R> enterMap) { this.helpParent = helpParent; this.exitMatcher = exitMatcher; this.mapFileFilter = mapFileFilter; this.selectedSquareModel = selectedSquareModel; - this.directionMap = directionMap.clone(); + this.enterMap = enterMap; this.allowRandomMapParameters = allowRandomMapParameters; this.mapPropertiesDialogFactory = mapPropertiesDialogFactory; this.mapViewSettings = mapViewSettings; - this.mapPathNormalizer = mapPathNormalizer; this.mapViewsManager = mapViewsManager; - this.fileControl = fileControl; shrinkMapSizeDialogManager = new ShrinkMapSizeDialogManager<G, A, R>(mapViewManager); mapViewSettings.addMapViewSettingsListener(mapViewSettingsListener); @@ -724,96 +688,16 @@ } /** - * Enter a map wanted. - * @param mapView the map view to leave - * @param path path to map that should be loaded - * @param direction the direction to go - * @param destinationPoint the desired destination point on the map (pass - * 0|0 if unknown, and note that the point gets modified) - * @return whether the destination map has been entered - */ - private boolean enterMap(@NotNull final MapView<G, A, R> mapView, @NotNull final String path, @NotNull final Direction direction, @Nullable final Point destinationPoint) { - final File canonicalNewFile; - try { - canonicalNewFile = mapPathNormalizer.normalizeMapPath(mapView.getMapControl().getMapModel(), path); - } catch (final InvalidPathException ex) { - ACTION_BUILDER.showMessageDialog(parent, "enterExitInvalidPath", ex.getFile().getAbsolutePath()); - return false; - } catch (final IOErrorException ex) { - ACTION_BUILDER.showMessageDialog(parent, "enterTileIOException", ex.getFile().getAbsolutePath()); - return false; - } catch (final RelativePathOnUnsavedMapException ex) { - ACTION_BUILDER.showMessageDialog(parent, "enterExitNotSaved", ex.getMessage()); - return false; - } catch (final SameMapException ignored) { - // path points to the same map - if (destinationPoint != null) { - showLocation(mapView, destinationPoint); - } - return true; - } - return enterMap(mapView, canonicalNewFile, destinationPoint, direction); - } - - /** * Enters a map. * @param mapFile the map file to enter * @param destinationPoint the desired destination point on the map or * <code>null</code> for default */ public void enterMap(@NotNull final File mapFile, @Nullable final Point destinationPoint) { - enterMap(currentMapView, mapFile, destinationPoint, Direction.NORTH); + enterMap.enterMap(currentMapView, mapFile, destinationPoint, Direction.NORTH); } /** - * Enters a map. - * @param mapView the current map view; may be closed it - * non-<code>null</code> - * @param mapFile the map file to enter - * @param destinationPoint the desired destination point on the map or - * <code>null</code> for default - * @param direction the direction to go - * @return whether the destination map has been entered - */ - private boolean enterMap(@Nullable final MapView<G, A, R> mapView, @NotNull final File mapFile, @Nullable final Point destinationPoint, @NotNull final Direction direction) { - final MapView<G, A, R> newMapView; - try { - newMapView = mapViewsManager.openMapFileWithView(mapFile, null, destinationPoint); - } catch (final IOException ex) { - fileControl.reportLoadError(mapFile, ex.getMessage()); - return false; - } - - if (destinationPoint != null) { - showLocation(newMapView, destinationPoint); - } else if (mapView != null) { - newMapView.getMapViewBasic().getScrollPane().getViewport().setViewPosition(calculateNewViewPosition(mapView.getMapViewBasic().getScrollPane(), newMapView.getMapViewBasic().getScrollPane(), direction)); - } - - if (mapView != null && ACTION_BUILDER.showOnetimeConfirmDialog(parent, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, "enterExitClose") == JOptionPane.YES_OPTION) { - // only close current map if a new file was opened and user wants to close it - mapViewsManager.closeMapView(mapView); - } - - return true; - } - - /** - * Scrolls a map view to make a give tile visible. - * @param mapView the map view - * @param point the square - */ - private void showLocation(@NotNull final MapView<G, A, R> mapView, @NotNull final Point point) { - final Point point2 = point.x == -1 && point.y == -1 ? mapView.ge... [truncated message content] |
From: <aki...@us...> - 2011-09-21 19:09:57
|
Revision: 8987 http://gridarta.svn.sourceforge.net/gridarta/?rev=8987&view=rev Author: akirschbaum Date: 2011-09-21 19:09:50 +0000 (Wed, 21 Sep 2011) Log Message: ----------- Do not index backup files (*~). Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/index/MapsIndexer.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-09-21 19:04:54 UTC (rev 8986) +++ trunk/atrinik/ChangeLog 2011-09-21 19:09:50 UTC (rev 8987) @@ -1,5 +1,7 @@ 2011-09-21 Andreas Kirschbaum + * Do not index backup files (*~). + * Implement Map|Go To Exit... which opens a dialog listing all exits out of the current map. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2011-09-21 19:04:54 UTC (rev 8986) +++ trunk/crossfire/ChangeLog 2011-09-21 19:09:50 UTC (rev 8987) @@ -1,5 +1,7 @@ 2011-09-21 Andreas Kirschbaum + * Do not index backup files (*~). + * Implement Map|Go To Exit... which opens a dialog listing all exits out of the current map. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2011-09-21 19:04:54 UTC (rev 8986) +++ trunk/daimonin/ChangeLog 2011-09-21 19:09:50 UTC (rev 8987) @@ -1,5 +1,7 @@ 2011-09-21 Andreas Kirschbaum + * Do not index backup files (*~). + * Implement Map|Go To Exit... which opens a dialog listing all exits out of the current map. Modified: trunk/model/src/app/net/sf/gridarta/model/index/MapsIndexer.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/index/MapsIndexer.java 2011-09-21 19:04:54 UTC (rev 8986) +++ trunk/model/src/app/net/sf/gridarta/model/index/MapsIndexer.java 2011-09-21 19:09:50 UTC (rev 8987) @@ -466,7 +466,7 @@ } for (final File file : files) { - if (file.isFile()) { + if (file.isFile() && !file.getName().endsWith("~")) { mapsIndex.add(file, file.lastModified()); } else if (file.isDirectory() && !file.getName().equalsIgnoreCase(".svn") && !file.getName().equalsIgnoreCase(".dedit")) { scanMapsDirectoryInt(file, mapPath + "/" + file.getName()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-09-22 08:15:54
|
Revision: 8990 http://gridarta.svn.sourceforge.net/gridarta/?rev=8990&view=rev Author: akirschbaum Date: 2011-09-22 08:15:47 +0000 (Thu, 22 Sep 2011) Log Message: ----------- Replace in/out parameter with return value. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResources.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2011-09-22 07:53:40 UTC (rev 8989) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2011-09-22 08:15:47 UTC (rev 8990) @@ -21,6 +21,7 @@ import java.io.File; import java.io.IOException; +import java.util.ArrayList; import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; @@ -125,10 +126,13 @@ /** * {@inheritDoc} */ + @NotNull @Override - protected void readCollectedInt(@NotNull final GlobalSettings globalSettings, @NotNull final ErrorView errorView, @NotNull final List<GameObject> invObjects) { + protected List<GameObject> readCollectedInt(@NotNull final GlobalSettings globalSettings, @NotNull final ErrorView errorView) { + final List<GameObject> invObjects = new ArrayList<GameObject>(); faceObjectProviders.setNormal(new CollectedResourcesReader(globalSettings.getCollectedDirectory(), archetypeSet, archetypeParser, faceObjects, animationObjects).read(errorView, invObjects)); loadArtifacts(errorView, invObjects, globalSettings.getCollectedDirectory()); + return invObjects; } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-09-22 07:53:40 UTC (rev 8989) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-09-22 08:15:47 UTC (rev 8990) @@ -21,6 +21,7 @@ import java.io.File; import java.io.IOException; +import java.util.ArrayList; import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; @@ -131,9 +132,12 @@ /** * {@inheritDoc} */ + @NotNull @Override - protected void readCollectedInt(@NotNull final GlobalSettings globalSettings, @NotNull final ErrorView errorView, @NotNull final List<GameObject> invObjects) { + protected List<GameObject> readCollectedInt(@NotNull final GlobalSettings globalSettings, @NotNull final ErrorView errorView) { + final List<GameObject> invObjects = new ArrayList<GameObject>(); faceObjectProviders.setNormal(new CollectedResourcesReader(globalSettings.getConfigurationDirectory(), globalSettings.getCollectedDirectory(), archetypeSet, archetypeParser, faceObjects, animationObjects, smoothFaces).read(errorView, invObjects)); + return invObjects; } /** Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2011-09-22 07:53:40 UTC (rev 8989) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2011-09-22 08:15:47 UTC (rev 8990) @@ -21,6 +21,7 @@ import java.io.File; import java.io.IOException; +import java.util.ArrayList; import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; @@ -125,10 +126,13 @@ /** * {@inheritDoc} */ + @NotNull @Override - protected void readCollectedInt(@NotNull final GlobalSettings globalSettings, @NotNull final ErrorView errorView, @NotNull final List<GameObject> invObjects) { + protected List<GameObject> readCollectedInt(@NotNull final GlobalSettings globalSettings, @NotNull final ErrorView errorView) { + final List<GameObject> invObjects = new ArrayList<GameObject>(); faceObjectProviders.setNormal(new CollectedResourcesReader(globalSettings.getCollectedDirectory(), archetypeSet, archetypeParser, faceObjects, animationObjects).read(errorView, invObjects)); loadArtifacts(errorView, invObjects, globalSettings.getCollectedDirectory(), globalSettings.getMapsDirectory()); + return invObjects; } /** Modified: trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResources.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResources.java 2011-09-22 07:53:40 UTC (rev 8989) +++ trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResources.java 2011-09-22 08:15:47 UTC (rev 8990) @@ -114,8 +114,7 @@ if (loaded) { throw new IllegalStateException(); } - final List<G> invObjects = new ArrayList<G>(); - readCollectedInt(globalSettings, errorView, invObjects); + final List<G> invObjects = readCollectedInt(globalSettings, errorView); finishRead(invObjects); loadedFromFiles = false; loaded = true; @@ -157,9 +156,10 @@ * Reads the resources from a collection. * @param globalSettings the global settings to read from * @param errorView the error view for reporting problems - * @param invObjects all read archetypes + * @return all read archetypes */ - protected abstract void readCollectedInt(@NotNull final GlobalSettings globalSettings, @NotNull final ErrorView errorView, @NotNull final List<G> invObjects); + @NotNull + protected abstract List<G> readCollectedInt(@NotNull final GlobalSettings globalSettings, @NotNull final ErrorView errorView); /** * Writes the resources in collected form. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-09-22 08:41:59
|
Revision: 8991 http://gridarta.svn.sourceforge.net/gridarta/?rev=8991&view=rev Author: akirschbaum Date: 2011-09-22 08:41:52 +0000 (Thu, 22 Sep 2011) Log Message: ----------- Remove "Exits" panel from main window. It is redundant with Map|Go To Exit... Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Removed Paths: ------------- trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsControl.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsView.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-09-22 08:15:47 UTC (rev 8990) +++ trunk/atrinik/ChangeLog 2011-09-22 08:41:52 UTC (rev 8991) @@ -1,3 +1,8 @@ +2011-09-22 Andreas Kirschbaum + + * Remove "Exits" panel from main window. It is redundant with + Map|Go To Exit... + 2011-09-21 Andreas Kirschbaum * Do not index backup files (*~). Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2011-09-22 08:15:47 UTC (rev 8990) +++ trunk/crossfire/ChangeLog 2011-09-22 08:41:52 UTC (rev 8991) @@ -1,3 +1,8 @@ +2011-09-22 Andreas Kirschbaum + + * Remove "Exits" panel from main window. It is redundant with + Map|Go To Exit... + 2011-09-21 Andreas Kirschbaum * Do not index backup files (*~). Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2011-09-22 08:15:47 UTC (rev 8990) +++ trunk/daimonin/ChangeLog 2011-09-22 08:41:52 UTC (rev 8991) @@ -1,3 +1,8 @@ +2011-09-22 Andreas Kirschbaum + + * Remove "Exits" panel from main window. It is redundant with + Map|Go To Exit... + 2011-09-21 Andreas Kirschbaum * Do not index backup files (*~). Deleted: trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsControl.java 2011-09-22 08:15:47 UTC (rev 8990) +++ trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsControl.java 2011-09-22 08:41:52 UTC (rev 8991) @@ -1,84 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2011 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.panel.connectionview; - -import java.io.File; -import net.sf.gridarta.gui.delayedmapmodel.DelayedMapModelListenerManager; -import net.sf.gridarta.gui.map.mapactions.MapActions; -import net.sf.gridarta.gui.map.mapactions.MapLocation; -import net.sf.gridarta.gui.map.mapview.MapViewManager; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.io.PathManager; -import net.sf.gridarta.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.match.GameObjectMatcher; -import net.sf.gridarta.model.settings.GlobalSettings; -import org.jetbrains.annotations.NotNull; - -/** - * The controller of the "Exits" panel. - * @author Andreas Kirschbaum - */ -public class ExitsControl<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends Control<MapLocation, G, A, R> { - - /** - * The {@link GlobalSettings} instance. - */ - @NotNull - private final GlobalSettings globalSettings; - - /** - * The {@link MapActions} instance for entering maps. - */ - @NotNull - private final MapActions<G, A, R> mapActions; - - /** - * Create a new instance. - * @param mapViewManager the map view manager - * @param delayedMapModelListenerManager the delayed map model listener - * manager to use - * @param exitGameObjectMatcher the game object matcher for selecting exits - * @param pathManager the path manager for converting relative exit paths - * @param globalSettings the global settings instance - * @param mapActions the map actions instance for entering maps - */ - public ExitsControl(@NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final DelayedMapModelListenerManager<G, A, R> delayedMapModelListenerManager, @NotNull final GameObjectMatcher exitGameObjectMatcher, @NotNull final PathManager pathManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapActions<G, A, R> mapActions) { - super(new ExitsView<G, A, R>(mapViewManager, delayedMapModelListenerManager, exitGameObjectMatcher, pathManager)); - this.globalSettings = globalSettings; - this.mapActions = mapActions; - } - - /** - * {@inheritDoc} - */ - @Override - protected void doubleClick(@NotNull final Connection<MapLocation> connection) { - final MapLocation mapLocation = connection.getKey(); - final String mapPath = mapLocation.getMapPath(); - if (!mapPath.startsWith("/")) { - return; - } - - final File mapFile = new File(globalSettings.getMapsDirectory().getAbsolutePath(), mapPath.substring(1)); - mapActions.enterMap(mapFile, mapLocation.getMapCoordinate()); - } - -} // class ExitsControl Deleted: trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsView.java 2011-09-22 08:15:47 UTC (rev 8990) +++ trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ExitsView.java 2011-09-22 08:41:52 UTC (rev 8991) @@ -1,157 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2011 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.panel.connectionview; - -import java.awt.Point; -import java.util.Comparator; -import net.sf.gridarta.gui.delayedmapmodel.DelayedMapModelListenerManager; -import net.sf.gridarta.gui.map.mapactions.MapLocation; -import net.sf.gridarta.gui.map.mapactions.NoExitPathException; -import net.sf.gridarta.gui.map.mapview.MapViewManager; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.baseobject.BaseObject; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.io.PathManager; -import net.sf.gridarta.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.match.GameObjectMatcher; -import org.jetbrains.annotations.NotNull; - -/** - * The view part of the "Exits" panel. - * @author Andreas Kirschbaum - */ -public class ExitsView<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends View<MapLocation, G, A, R> { - - /** - * The serial version UID. - */ - private static final long serialVersionUID = 1L; - - /** - * A {@link Comparator} that compares {@link MapLocation} instances by map - * path and map coordinate. - */ - @NotNull - private static final Comparator<MapLocation> mapLocationComparator = new Comparator<MapLocation>() { - - @Override - public int compare(@NotNull final MapLocation o1, @NotNull final MapLocation o2) { - final int cmp = o1.getMapPath().compareTo(o2.getMapPath()); - if (cmp != 0) { - return cmp; - } - - final Point p1 = o1.getMapCoordinate(); - final Point p2 = o2.getMapCoordinate(); - if (p1.x < p2.x) { - return -1; - } - if (p1.x > p2.x) { - return +1; - } - if (p1.y < p2.y) { - return -1; - } - if (p1.y > p2.y) { - return +1; - } - - return 0; - } - - }; - - /** - * The {@link GameObjectMatcher} for selecting exits. - */ - @NotNull - private final GameObjectMatcher exitGameObjectMatcher; - - /** - * The {@link PathManager} for converting relative exit paths. - */ - @NotNull - private final PathManager pathManager; - - /** - * Creates a new instance. - * @param mapViewManager the map view manager - * @param delayedMapModelListenerManager the delayed map model listener - * manager to use - * @param exitGameObjectMatcher the game object matcher for selecting exits - * @param pathManager the path manager for converting relative exit paths - */ - public ExitsView(@NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final DelayedMapModelListenerManager<G, A, R> delayedMapModelListenerManager, @NotNull final GameObjectMatcher exitGameObjectMatcher, @NotNull final PathManager pathManager) { - super(mapLocationComparator, new ExitsCellRenderer(), mapViewManager, delayedMapModelListenerManager); - this.exitGameObjectMatcher = exitGameObjectMatcher; - this.pathManager = pathManager; - } - - /** - * {@inheritDoc} - */ - @Override - protected void scanGameObjectForConnections(@NotNull final G gameObject) { - if (!exitGameObjectMatcher.isMatching(gameObject)) { - return; - } - - final MapLocation mapLocation; - try { - mapLocation = MapLocation.newAbsoluteMapLocation(gameObject, true, pathManager); - } catch (final NoExitPathException ignored) { - return; - } - addConnection(mapLocation, gameObject); - } - - /** - * A {@link CellRenderer} for the locked items view. - * @author Andreas Kirschbaum - */ - private static class ExitsCellRenderer extends CellRenderer<MapLocation> { - - /** - * The serial version UID. - */ - private static final long serialVersionUID = 1L; - - /** - * {@inheritDoc} - */ - @NotNull - @Override - protected String formatKey(@NotNull final MapLocation key) { - final Point mapCoordinate = key.getMapCoordinate(); - return key.getMapPath() + "@" + mapCoordinate.x + "/" + mapCoordinate.y; - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override - protected String formatValue(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { - return gameObject.getBestName(); - } - - } - -} // class ExitsView Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2011-09-22 08:15:47 UTC (rev 8990) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2011-09-22 08:41:52 UTC (rev 8991) @@ -91,7 +91,6 @@ import net.sf.gridarta.gui.panel.archetypechooser.ArchetypeChooserControl; import net.sf.gridarta.gui.panel.connectionview.ConnectionControl; import net.sf.gridarta.gui.panel.connectionview.Control; -import net.sf.gridarta.gui.panel.connectionview.ExitsControl; import net.sf.gridarta.gui.panel.connectionview.LockedItemsControl; import net.sf.gridarta.gui.panel.connectionview.MonsterControl; import net.sf.gridarta.gui.panel.gameobjectattributes.ArchTab; @@ -499,7 +498,6 @@ final Control<?, G, A, R> lockedItemsControl = new LockedItemsControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, lockedItemsTypeNumbers); final EnterMap<G, A, R> enterMap = new EnterMap<G, A, R>(mainViewFrame, directionMap, mapPathNormalizer, fileControl, mapViewsManager); final MapActions<G, A, R> mapActions = new MapActions<G, A, R>(mainViewFrame, mapManager, mapViewManager, exitMatcher, GuiFileFilters.mapFileFilter, selectedSquareModel, allowRandomMapParameters, mapPropertiesDialogFactory, mapViewSettings, mapViewsManager, enterMap); - final Control<?, G, A, R> exitsControl = new ExitsControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, exitGameObjectMatcher, pathManager, globalSettings, mapActions); final GameObjectAttributesModel<G, A, R> gameObjectAttributesModel = new GameObjectAttributesModel<G, A, R>(); final GameObjectAttributesControl<G, A, R> gameObjectAttributesControl = new GameObjectAttributesControl<G, A, R>(gameObjectAttributesModel, gameObjectAttributesDialogFactory, objectChooser, mapManager, selectedSquareModel, selectedSquareView, gameObjectFactory); final PluginParameterViewFactory<G, A, R> pluginParameterViewFactory = new PluginParameterViewFactory<G, A, R>(archetypeSet, gameObjectAttributesModel, objectChooser, mapManager, faceObjectProviders); @@ -594,9 +592,8 @@ mainView.addTab(new Tab("monsters", new MonsterControl<G, A, R>(mapViewManager, delayedMapModelListenerManager, monsterMatcher).getView(), Location.BOTTOM, false, 4, false)); mainView.addTab(new Tab("connections", new ConnectionControl<G, A, R>(mapViewManager, delayedMapModelListenerManager).getView(), Location.BOTTOM, false, 5, false)); mainView.addTab(new Tab("lockedItems", lockedItemsControl.getView(), Location.BOTTOM, false, 6, false)); - mainView.addTab(new Tab("exits", exitsControl.getView(), Location.BOTTOM, false, 7, false)); - mainView.addTab(new WarningsTab<G, A, R>("warnings", errorListView, Location.BOTTOM, false, 8, false)); - mainView.addTab(new GameObjectTextEditorTab<G, A, R>("textEditor", new GameObjectTextEditor(archetypeTypeSet), Location.RIGHT, true, 9, false, selectedSquareModel, mapManager)); + mainView.addTab(new WarningsTab<G, A, R>("warnings", errorListView, Location.BOTTOM, false, 7, false)); + mainView.addTab(new GameObjectTextEditorTab<G, A, R>("textEditor", new GameObjectTextEditor(archetypeTypeSet), Location.RIGHT, true, 8, false, selectedSquareModel, mapManager)); new ArchetypeValidator(animationObjects, faceObjects, errorView).validate(archetypeSet); new AnimationValidator(faceObjects, errorView).validate(animationObjects); Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2011-09-22 08:15:47 UTC (rev 8990) +++ trunk/src/app/net/sf/gridarta/messages.properties 2011-09-22 08:41:52 UTC (rev 8991) @@ -1647,9 +1647,6 @@ tabButton.lockedItems.title1=Locked Items tabButton.lockedItems.title2={0}: Locked Items tabButton.lockedItems.shortdescription=Display the locked items of the current map. -tabButton.exits.title1=Exits -tabButton.exits.title2={0}: Exits -tabButton.exits.shortdescription=Display the exits from the current map. tabButton.textEditor.title1=Text Editor tabButton.textEditor.title2={0}: Text Editor tabButton.textEditor.shortdescription=Display the game object text editor for the selected game object. Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2011-09-22 08:15:47 UTC (rev 8990) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2011-09-22 08:41:52 UTC (rev 8991) @@ -1412,9 +1412,6 @@ tabButton.lockedItems.title1=Verriegelte Objekte tabButton.lockedItems.title2={0}: Verriegelte Objekte tabButton.lockedItems.shortdescription=Zeigt verriegelte T\u00fcren und Schl\u00fcssel in der aktuellen Karte. -tabButton.exits.title1=Ausg\xE4nge -tabButton.exits.title2={0}: Ausga\xE4nge -tabButton.exits.shortdescription=Zeigt Ausg\xE4nge aus der aktuellen Karte. tabButton.textEditor.title1=Text Editor tabButton.textEditor.title2={0}: Text Editor tabButton.textEditor.shortdescription=Zeigt den Objekt-Text des ausgew\u00e4hlten Objekts an. Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2011-09-22 08:15:47 UTC (rev 8990) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2011-09-22 08:41:52 UTC (rev 8991) @@ -1401,9 +1401,6 @@ tabButton.lockedItems.title1=Objets verrouill\u00e9s tabButton.lockedItems.title2={0} : Objets verrouill\u00e9s #tabButton.lockedItems.shortdescription= -#tabButton.exits.title1= -#tabButton.exits.title2= -#tabButton.exits.shortdescription= #tabButton.textEditor.title1= #tabButton.textEditor.title2= #tabButton.textEditor.shortdescription= Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2011-09-22 08:15:47 UTC (rev 8990) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2011-09-22 08:41:52 UTC (rev 8991) @@ -1400,9 +1400,6 @@ #tabButton.lockedItems.title1= #tabButton.lockedItems.title2= #tabButton.lockedItems.shortdescription= -#tabButton.exits.title1= -#tabButton.exits.title2= -#tabButton.exits.shortdescription= #tabButton.textEditor.title1= #tabButton.textEditor.title2= #tabButton.textEditor.shortdescription= This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-15 15:42:49
|
Revision: 8993 http://gridarta.svn.sourceforge.net/gridarta/?rev=8993&view=rev Author: akirschbaum Date: 2011-10-15 15:42:42 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Move MatchCriteria and implementations into model module. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/select/ trunk/model/src/app/net/sf/gridarta/model/select/ArchetypeNameMatchCriteria.java trunk/model/src/app/net/sf/gridarta/model/select/MatchCriteria.java trunk/model/src/app/net/sf/gridarta/model/select/ObjectNameMatchCriteria.java trunk/src/app/net/sf/gridarta/model/ Removed Paths: ------------- trunk/src/app/net/sf/gridarta/gui/dialog/replace/ArchetypeNameMatchCriteria.java trunk/src/app/net/sf/gridarta/gui/dialog/replace/MatchCriteria.java trunk/src/app/net/sf/gridarta/gui/dialog/replace/ObjectNameMatchCriteria.java Copied: trunk/model/src/app/net/sf/gridarta/model/select/ArchetypeNameMatchCriteria.java (from rev 8991, trunk/src/app/net/sf/gridarta/gui/dialog/replace/ArchetypeNameMatchCriteria.java) =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/select/ArchetypeNameMatchCriteria.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/select/ArchetypeNameMatchCriteria.java 2011-10-15 15:42:42 UTC (rev 8993) @@ -0,0 +1,57 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 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.model.select; + +import java.util.regex.Pattern; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.japi.util.filter.file.GlobFileFilter; +import org.jetbrains.annotations.NotNull; + +/** + * A {@link MatchCriteria} that matches by archetype name. + * @author Andreas Kirschbaum + */ +public class ArchetypeNameMatchCriteria<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements MatchCriteria<G, A, R> { + + /** + * The archetype name to match. + */ + @NotNull + private final Pattern archetypeName; + + /** + * Creates a new instance. + * @param archetypeName the archetype name to match + */ + public ArchetypeNameMatchCriteria(@NotNull final String archetypeName) { + this.archetypeName = Pattern.compile(GlobFileFilter.createPatternForGlob(archetypeName), Pattern.DOTALL | Pattern.CASE_INSENSITIVE); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean matches(@NotNull final G gameObject) { + return archetypeName.matcher(gameObject.getArchetype().getArchetypeName()).matches(); + } + +} // class ArchetypeNameMatchCriteria Copied: trunk/model/src/app/net/sf/gridarta/model/select/MatchCriteria.java (from rev 8991, trunk/src/app/net/sf/gridarta/gui/dialog/replace/MatchCriteria.java) =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/select/MatchCriteria.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/select/MatchCriteria.java 2011-10-15 15:42:42 UTC (rev 8993) @@ -0,0 +1,40 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 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.model.select; + +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import org.jetbrains.annotations.NotNull; + +/** + * Criteria for game object matchers. + * @author Andreas Kirschbaum + */ +public interface MatchCriteria<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { + + /** + * Whether a {@link GameObject} matches this criteria. + * @param gameObject the game object to check + * @return whether the game object matches + */ + boolean matches(@NotNull G gameObject); + +} // interface MatchCriteria Copied: trunk/model/src/app/net/sf/gridarta/model/select/ObjectNameMatchCriteria.java (from rev 8991, trunk/src/app/net/sf/gridarta/gui/dialog/replace/ObjectNameMatchCriteria.java) =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/select/ObjectNameMatchCriteria.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/select/ObjectNameMatchCriteria.java 2011-10-15 15:42:42 UTC (rev 8993) @@ -0,0 +1,57 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 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.model.select; + +import java.util.regex.Pattern; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.japi.util.filter.file.GlobFileFilter; +import org.jetbrains.annotations.NotNull; + +/** + * A {@link MatchCriteria} that matches by object name. + * @author Andreas Kirschbaum + */ +public class ObjectNameMatchCriteria<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements MatchCriteria<G, A, R> { + + /** + * The object name to match. + */ + @NotNull + private final Pattern objectName; + + /** + * Creates a new instance. + * @param objectName the object name to match + */ + public ObjectNameMatchCriteria(@NotNull final String objectName) { + this.objectName = Pattern.compile(GlobFileFilter.createPatternForGlob(objectName), Pattern.DOTALL | Pattern.CASE_INSENSITIVE); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean matches(@NotNull final G gameObject) { + return objectName.matcher(gameObject.getBestName()).matches(); + } + +} Deleted: trunk/src/app/net/sf/gridarta/gui/dialog/replace/ArchetypeNameMatchCriteria.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/replace/ArchetypeNameMatchCriteria.java 2011-10-15 15:31:43 UTC (rev 8992) +++ trunk/src/app/net/sf/gridarta/gui/dialog/replace/ArchetypeNameMatchCriteria.java 2011-10-15 15:42:42 UTC (rev 8993) @@ -1,57 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2011 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.dialog.replace; - -import java.util.regex.Pattern; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.maparchobject.MapArchObject; -import net.sf.japi.util.filter.file.GlobFileFilter; -import org.jetbrains.annotations.NotNull; - -/** - * A {@link MatchCriteria} that matches by archetype name. - * @author Andreas Kirschbaum - */ -public class ArchetypeNameMatchCriteria<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements MatchCriteria<G, A, R> { - - /** - * The archetype name to match. - */ - @NotNull - private final Pattern archetypeName; - - /** - * Creates a new instance. - * @param archetypeName the archetype name to match - */ - public ArchetypeNameMatchCriteria(@NotNull final String archetypeName) { - this.archetypeName = Pattern.compile(GlobFileFilter.createPatternForGlob(archetypeName), Pattern.DOTALL | Pattern.CASE_INSENSITIVE); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean matches(@NotNull final G gameObject) { - return archetypeName.matcher(gameObject.getArchetype().getArchetypeName()).matches(); - } - -} // class ArchetypeNameMatchCriteria Deleted: trunk/src/app/net/sf/gridarta/gui/dialog/replace/MatchCriteria.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/replace/MatchCriteria.java 2011-10-15 15:31:43 UTC (rev 8992) +++ trunk/src/app/net/sf/gridarta/gui/dialog/replace/MatchCriteria.java 2011-10-15 15:42:42 UTC (rev 8993) @@ -1,40 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2011 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.dialog.replace; - -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; - -/** - * Criteria for game object matchers. - * @author Andreas Kirschbaum - */ -public interface MatchCriteria<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { - - /** - * Whether a {@link GameObject} matches this criteria. - * @param gameObject the game object to check - * @return whether the game object matches - */ - boolean matches(@NotNull G gameObject); - -} // interface MatchCriteria Deleted: trunk/src/app/net/sf/gridarta/gui/dialog/replace/ObjectNameMatchCriteria.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/replace/ObjectNameMatchCriteria.java 2011-10-15 15:31:43 UTC (rev 8992) +++ trunk/src/app/net/sf/gridarta/gui/dialog/replace/ObjectNameMatchCriteria.java 2011-10-15 15:42:42 UTC (rev 8993) @@ -1,57 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2011 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.dialog.replace; - -import java.util.regex.Pattern; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.maparchobject.MapArchObject; -import net.sf.japi.util.filter.file.GlobFileFilter; -import org.jetbrains.annotations.NotNull; - -/** - * A {@link MatchCriteria} that matches by object name. - * @author Andreas Kirschbaum - */ -public class ObjectNameMatchCriteria<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements MatchCriteria<G, A, R> { - - /** - * The object name to match. - */ - @NotNull - private final Pattern objectName; - - /** - * Creates a new instance. - * @param objectName the object name to match - */ - public ObjectNameMatchCriteria(@NotNull final String objectName) { - this.objectName = Pattern.compile(GlobFileFilter.createPatternForGlob(objectName), Pattern.DOTALL | Pattern.CASE_INSENSITIVE); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean matches(@NotNull final G gameObject) { - return objectName.matcher(gameObject.getBestName()).matches(); - } - -} Modified: trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java 2011-10-15 15:31:43 UTC (rev 8992) +++ trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java 2011-10-15 15:42:42 UTC (rev 8993) @@ -57,6 +57,9 @@ import net.sf.gridarta.model.mapmodel.InsertionModeSet; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mapmodel.MapSquare; +import net.sf.gridarta.model.select.ArchetypeNameMatchCriteria; +import net.sf.gridarta.model.select.MatchCriteria; +import net.sf.gridarta.model.select.ObjectNameMatchCriteria; import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.RandomUtils; import net.sf.japi.swing.action.ActionBuilder; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-15 16:25:36
|
Revision: 8996 http://gridarta.svn.sourceforge.net/gridarta/?rev=8996&view=rev Author: akirschbaum Date: 2011-10-15 16:25:29 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Fix unchecked warning. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java trunk/model/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java 2011-10-15 16:18:02 UTC (rev 8995) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java 2011-10-15 16:25:29 UTC (rev 8996) @@ -133,7 +133,7 @@ * {@inheritDoc} */ @Override - public boolean isEqual(@NotNull final GameObject gameObject) { + public boolean isEqual(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { return super.isEqual(gameObject) && gameObject.getLoreText().equals(getLoreText()); } Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2011-10-15 16:18:02 UTC (rev 8995) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2011-10-15 16:25:29 UTC (rev 8996) @@ -848,11 +848,11 @@ * {@inheritDoc} */ @Override - public boolean isEqual(@NotNull final T gameObject) { + public boolean isEqual(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { if (!(gameObject instanceof AbstractBaseObject)) { return false; } - final AbstractBaseObject<G, A, R, T> abstractBaseObject = (AbstractBaseObject<G, A, R, T>) gameObject; + final AbstractBaseObject<?, ?, ?, ?> abstractBaseObject = (AbstractBaseObject<?, ?, ?, ?>) gameObject; if (!hasSameContents(abstractBaseObject)) { return false; } Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2011-10-15 16:18:02 UTC (rev 8995) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2011-10-15 16:25:29 UTC (rev 8996) @@ -516,7 +516,7 @@ * @param gameObject the other game object * @return <code>true</code> if this object equals the other object */ - boolean isEqual(@NotNull T gameObject); + boolean isEqual(@NotNull BaseObject<?, ?, ?, ?> gameObject); /** * Returns the direction of this Archetype or GameObject. Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2011-10-15 16:18:02 UTC (rev 8995) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2011-10-15 16:25:29 UTC (rev 8996) @@ -624,7 +624,7 @@ * @param gameObjectContainer the other game object container * @return <code>true</code> if this object equals the other object */ - public boolean hasSameContents(@NotNull final GameObjectContainer<G, A, R> gameObjectContainer) { + public boolean hasSameContents(@NotNull final GameObjectContainer<?, ?, ?> gameObjectContainer) { if (gameObjectContainer.contents.size() != contents.size()) { return false; } Modified: trunk/model/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2011-10-15 16:18:02 UTC (rev 8995) +++ trunk/model/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2011-10-15 16:25:29 UTC (rev 8996) @@ -22,6 +22,7 @@ import javax.swing.ImageIcon; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; @@ -202,7 +203,7 @@ * {@inheritDoc} */ @Override - public boolean isEqual(@NotNull final G gameObject) { + public boolean isEqual(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { return super.isEqual(gameObject); // ignore "scriptArchData" // ignore "transFace" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-15 16:59:08
|
Revision: 9003 http://gridarta.svn.sourceforge.net/gridarta/?rev=9003&view=rev Author: akirschbaum Date: 2011-10-15 16:59:01 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Suppress warnings. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ArchTab.java trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java Modified: trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java 2011-10-15 16:55:11 UTC (rev 9002) +++ trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java 2011-10-15 16:59:01 UTC (rev 9003) @@ -180,6 +180,7 @@ */ @NotNull private String generateFaceName(@NotNull final String name) { + //noinspection VariableNotUsedInsideIf if (imageSet != null) { // we have to snip out the image set information here from // the 'name', and the ".png": (e.g. blocked.base.111.png -> blocked.111) Modified: trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java 2011-10-15 16:55:11 UTC (rev 9002) +++ trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java 2011-10-15 16:59:01 UTC (rev 9003) @@ -352,6 +352,7 @@ line3.add(Box.createVerticalStrut(5)); replaceWithBox = new JComboBox(new String[] { ActionBuilderUtils.getString(ACTION_BUILDER, "replaceByObject"), ActionBuilderUtils.getString(ACTION_BUILDER, "replaceByCopyBuffer"), ActionBuilderUtils.getString(ACTION_BUILDER, "replaceByPickmap"), ActionBuilderUtils.getString(ACTION_BUILDER, "replaceByNothing") }); replaceWithBox.setToolTipText(ActionBuilderUtils.getString(ACTION_BUILDER, "replaceBy.shortdescription")); + //noinspection VariableNotUsedInsideIf if (replaceArch == null) { replaceWithBox.setSelectedIndex(REPLACE_WITH_NOTHING); } else { Modified: trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ArchTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ArchTab.java 2011-10-15 16:55:11 UTC (rev 9002) +++ trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ArchTab.java 2011-10-15 16:59:01 UTC (rev 9003) @@ -269,6 +269,7 @@ */ @Override protected final void refresh(@Nullable final G gameObject) { + //noinspection VariableNotUsedInsideIf setTabSeverity(gameObject == null ? Severity.DEFAULT : Severity.MODIFIED); // archNameField Modified: trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java 2011-10-15 16:55:11 UTC (rev 9002) +++ trunk/src/app/net/sf/gridarta/gui/utils/DirectionLayout.java 2011-10-15 16:59:01 UTC (rev 9003) @@ -382,6 +382,7 @@ final int innerWidth = size.width - padding.left - padding.right; final int innerHeight = size.height - padding.top - padding.bottom; int rows = 0; + //noinspection VariableNotUsedInsideIf if (cNW != null) { rows++; } @@ -394,6 +395,7 @@ if (cS != null || cE != null) { rows++; } + //noinspection VariableNotUsedInsideIf if (cSE != null) { rows++; } Modified: trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java 2011-10-15 16:55:11 UTC (rev 9002) +++ trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java 2011-10-15 16:59:01 UTC (rev 9003) @@ -197,6 +197,7 @@ if (actionListeners.size() != 2) { actionListeners.clear(); } + //noinspection VariableNotUsedInsideIf if (this.defaultDividerLocation != null) { addHierarchyListener(hierarchyListener); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-15 17:02:37
|
Revision: 9004 http://gridarta.svn.sourceforge.net/gridarta/?rev=9004&view=rev Author: akirschbaum Date: 2011-10-15 17:02:30 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Fix typos. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java trunk/plugin/src/app/net/sf/gridarta/plugin/Plugin.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2011-10-15 16:59:01 UTC (rev 9003) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2011-10-15 17:02:30 UTC (rev 9004) @@ -197,7 +197,7 @@ /** * Returns whether this archetype type allows any inventory game objects, * regardless whether these types have "inv" specifications. - * @return whether this archetype type allows any inveotry game objects + * @return whether this archetype type allows any inventory game objects */ public boolean isAllowsAllInv() { return allowsAllInv; Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/Plugin.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/Plugin.java 2011-10-15 16:59:01 UTC (rev 9003) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/Plugin.java 2011-10-15 17:02:30 UTC (rev 9004) @@ -58,7 +58,7 @@ private static final Category log = Logger.getLogger(Plugin.class); /** - * The plugin plugin's executable code. + * The executable code. */ @NotNull private String code = ""; @@ -70,7 +70,7 @@ private final List<PluginParameter<G, A, R>> parameters = new ArrayList<PluginParameter<G, A, R>>(); /** - * The plugin plugin's name. + * The plugin name. */ @NotNull private final String name; Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-10-15 16:59:01 UTC (rev 9003) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-10-15 17:02:30 UTC (rev 9004) @@ -610,7 +610,7 @@ * @param oldIconWidth the width of the icon before rotation in pixel * @param oldIconHeight the height of the icon before rotation in pixel * @param newIconWidth the width of the icon after rotation in pixel - * @param newIconHeight the height of the icon atfer rotation in pixel + * @param newIconHeight the height of the icon after rotation in pixel */ private void paintScaledIcon(@NotNull final Graphics2D g, @NotNull final Icon icon, final int x, final int y, final int zoom, final int alpha, final double rotate, final int oldIconWidth, final int oldIconHeight, final int newIconWidth, final int newIconHeight) { if (zoom <= 0 || zoom == 100) { @@ -638,7 +638,7 @@ * @param oldIconWidth the width of the icon before rotation in pixel * @param oldIconHeight the height of the icon before rotation in pixel * @param newIconWidth the width of the icon after rotation in pixel - * @param newIconHeight the height of the icon atfer rotation in pixel + * @param newIconHeight the height of the icon after rotation in pixel */ private void paintAlphaIcon(@NotNull final Graphics2D g, @NotNull final Icon icon, final int x, final int y, final int alpha, final double rotate, final int oldIconWidth, final int oldIconHeight, final int newIconWidth, final int newIconHeight) { if (alpha <= 0 || alpha >= 255) { @@ -664,7 +664,7 @@ * @param oldIconWidth the width of the icon before rotation in pixel * @param oldIconHeight the height of the icon before rotation in pixel * @param newIconWidth the width of the icon after rotation in pixel - * @param newIconHeight the height of the icon atfer rotation in pixel + * @param newIconHeight the height of the icon after rotation in pixel */ private void paintRotatedIcon(@NotNull final Graphics2D g, @NotNull final Icon icon, final int x, final int y, final double rotate, final int oldIconWidth, final int oldIconHeight, final int newIconWidth, final int newIconHeight) { if (rotate < 0.001) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-15 17:03:49
|
Revision: 9005 http://gridarta.svn.sourceforge.net/gridarta/?rev=9005&view=rev Author: akirschbaum Date: 2011-10-15 17:03:43 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Suppress warnings. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java trunk/src/app/net/sf/gridarta/gui/panel/tools/DeletionTool.java Modified: trunk/model/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java 2011-10-15 17:02:30 UTC (rev 9004) +++ trunk/model/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java 2011-10-15 17:03:43 UTC (rev 9005) @@ -329,6 +329,7 @@ * linking * @throws IOException in case of I/O problems reading from * <var>reader</var>. + * @noinspection IfStatementWithIdenticalBranches */ private static void readInsideList(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final TreasureTreeNode parentNode, @NotNull final BufferedReader reader, @NotNull final List<TreasureTreeNode> needLink) throws IOException { TreasureTreeNode node = null; Modified: trunk/src/app/net/sf/gridarta/gui/panel/tools/DeletionTool.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/tools/DeletionTool.java 2011-10-15 17:02:30 UTC (rev 9004) +++ trunk/src/app/net/sf/gridarta/gui/panel/tools/DeletionTool.java 2011-10-15 17:03:43 UTC (rev 9005) @@ -235,6 +235,7 @@ * Delete an arch. * @param mapLoc position to delete topmost arch at * @param mapControl map control of map to delete arch from + * @noinspection IfStatementWithIdenticalBranches */ private void deleteArch(final Point mapLoc, final MapControl<G, A, R> mapControl) { if (mapControl.isPickmap() && pickmapSettings.isLocked()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-15 17:23:14
|
Revision: 9009 http://gridarta.svn.sourceforge.net/gridarta/?rev=9009&view=rev Author: akirschbaum Date: 2011-10-15 17:23:07 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Suppress warnings. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectText.java trunk/model/src/app/net/sf/gridarta/model/maparchobject/AbstractMapArchObject.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java 2011-10-15 17:21:33 UTC (rev 9008) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java 2011-10-15 17:23:07 UTC (rev 9009) @@ -595,6 +595,7 @@ @Override public MapArchObject clone() { final MapArchObject clone = super.clone(); + //noinspection CloneCallsConstructors clone.loreText = new StringBuilder(loreText.toString()); return clone; } Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2011-10-15 17:21:33 UTC (rev 9008) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2011-10-15 17:23:07 UTC (rev 9009) @@ -701,6 +701,7 @@ // clone.archetype = archetype; // will NOT be cloned: archetypes are unique clone.gameObjectText = gameObjectText.clone(); if (msgText != null) { + //noinspection CloneCallsConstructors clone.msgText = new StringBuilder(msgText); } clone.multi = null; Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectText.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectText.java 2011-10-15 17:21:33 UTC (rev 9008) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectText.java 2011-10-15 17:23:07 UTC (rev 9009) @@ -107,6 +107,7 @@ } catch (final CloneNotSupportedException ex) { throw new AssertionError(ex); } + //noinspection CloneCallsConstructors clone.objectText = new StringBuilder(objectText); clone.attributeCache = new HashMap<String, String>(attributeCache); return clone; Modified: trunk/model/src/app/net/sf/gridarta/model/maparchobject/AbstractMapArchObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/maparchobject/AbstractMapArchObject.java 2011-10-15 17:21:33 UTC (rev 9008) +++ trunk/model/src/app/net/sf/gridarta/model/maparchobject/AbstractMapArchObject.java 2011-10-15 17:23:07 UTC (rev 9009) @@ -667,6 +667,7 @@ } catch (final CloneNotSupportedException ex) { throw new AssertionError(ex); } + //noinspection CloneCallsConstructors clone.msgText = new StringBuilder(msgText.toString()); clone.tilePaths = tilePaths.clone(); return clone.getThis(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-15 17:26:49
|
Revision: 9010 http://gridarta.svn.sourceforge.net/gridarta/?rev=9010&view=rev Author: akirschbaum Date: 2011-10-15 17:26:43 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Add explicit clone() methods. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewAction.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuAction.java trunk/src/app/net/sf/gridarta/gui/panel/tools/ToolSelector.java trunk/utils/src/app/net/sf/gridarta/utils/AlphaImageFilter.java Modified: trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewAction.java 2011-10-15 17:23:07 UTC (rev 9009) +++ trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewAction.java 2011-10-15 17:26:43 UTC (rev 9010) @@ -120,4 +120,12 @@ return checkBoxMenuItem; } + /** + * {@inheritDoc} + */ + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + } // class ViewAction Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuAction.java 2011-10-15 17:23:07 UTC (rev 9009) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuAction.java 2011-10-15 17:26:43 UTC (rev 9010) @@ -111,4 +111,12 @@ } } + /** + * {@inheritDoc} + */ + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + } Modified: trunk/src/app/net/sf/gridarta/gui/panel/tools/ToolSelector.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/tools/ToolSelector.java 2011-10-15 17:23:07 UTC (rev 9009) +++ trunk/src/app/net/sf/gridarta/gui/panel/tools/ToolSelector.java 2011-10-15 17:26:43 UTC (rev 9010) @@ -260,6 +260,14 @@ setSelectedTool(tool); } + /** + * {@inheritDoc} + */ + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + } // class SelectionAction } // class ToolSelector Modified: trunk/utils/src/app/net/sf/gridarta/utils/AlphaImageFilter.java =================================================================== --- trunk/utils/src/app/net/sf/gridarta/utils/AlphaImageFilter.java 2011-10-15 17:23:07 UTC (rev 9009) +++ trunk/utils/src/app/net/sf/gridarta/utils/AlphaImageFilter.java 2011-10-15 17:26:43 UTC (rev 9010) @@ -36,4 +36,12 @@ return rgb >>> 24 == 0 ? rgb : rgb & 0x00FFFFFF | 0x80000000; } + /** + * {@inheritDoc} + */ + @Override + public Object clone() { + return super.clone(); + } + } // class AlphaImageFilter This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-15 19:07:05
|
Revision: 9018 http://gridarta.svn.sourceforge.net/gridarta/?rev=9018&view=rev Author: akirschbaum Date: 2011-10-15 19:06:58 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Move MapViewBasic.getSelection() to MapGrid. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/mapgrid/MapGrid.java trunk/src/app/net/sf/gridarta/gui/map/mapview/AbstractMapViewBasic.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java trunk/src/app/net/sf/gridarta/gui/panel/tools/SelectionTool.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java Modified: trunk/model/src/app/net/sf/gridarta/model/mapgrid/MapGrid.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapgrid/MapGrid.java 2011-10-15 18:46:00 UTC (rev 9017) +++ trunk/model/src/app/net/sf/gridarta/model/mapgrid/MapGrid.java 2011-10-15 19:06:58 UTC (rev 9018) @@ -21,6 +21,8 @@ import java.awt.Point; import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.List; import net.sf.gridarta.utils.EventListenerList2; import net.sf.gridarta.utils.Size2D; import org.jetbrains.annotations.NotNull; @@ -810,4 +812,25 @@ } } + /** + * Returns the selection. + * @return the selection + */ + @NotNull + public Point[] getSelection() { + final List<Point> selection = new ArrayList<Point>(); + calculateCachedSelectedRec(); + final Rectangle selectedRec = cachedSelectedRec; + if (selectedRec != null) { + for (int x = selectedRec.x; x < selectedRec.x + selectedRec.width; x++) { + for (int y = selectedRec.y; y < selectedRec.y + selectedRec.height; y++) { + if ((gridFlags[x][y] & GRID_FLAG_SELECTION) > 0) { + selection.add(new Point(x, y)); + } + } + } + } + return selection.toArray(new Point[selection.size()]); + } + } // class MapGrid Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/AbstractMapViewBasic.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/AbstractMapViewBasic.java 2011-10-15 18:46:00 UTC (rev 9017) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/AbstractMapViewBasic.java 2011-10-15 19:06:58 UTC (rev 9018) @@ -90,27 +90,6 @@ */ @NotNull @Override - public Point[] getSelection() { - final List<Point> selection = new ArrayList<Point>(); - final Point pos = new Point(); - final Rectangle selectedRec = mapGrid.getSelectedRec(); - if (selectedRec != null) { - for (pos.x = selectedRec.x; pos.x < selectedRec.x + selectedRec.width; pos.x++) { - for (pos.y = selectedRec.y; pos.y < selectedRec.y + selectedRec.height; pos.y++) { - if ((mapGrid.getFlags(pos) & MapGrid.GRID_FLAG_SELECTION) > 0) { - selection.add((Point) pos.clone()); - } - } - } - } - return selection.toArray(new Point[selection.size()]); - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override public List<MapSquare<G, A, R>> getSelectedSquares() { final List<MapSquare<G, A, R>> selection = new ArrayList<MapSquare<G, A, R>>(); final Point pos = new Point(); Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java 2011-10-15 18:46:00 UTC (rev 9017) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java 2011-10-15 19:06:58 UTC (rev 9018) @@ -19,7 +19,6 @@ package net.sf.gridarta.gui.map.mapview; -import java.awt.Point; import java.util.List; import javax.swing.JScrollPane; import net.sf.gridarta.gui.map.renderer.MapRenderer; @@ -53,13 +52,6 @@ MapCursor getMapCursor(); /** - * Returns the selection. - * @return the selection - */ - @NotNull - Point[] getSelection(); - - /** * Returns the selected squares. * @return the selected squares; the list may be modified by the caller */ Modified: trunk/src/app/net/sf/gridarta/gui/panel/tools/SelectionTool.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/tools/SelectionTool.java 2011-10-15 18:46:00 UTC (rev 9017) +++ trunk/src/app/net/sf/gridarta/gui/panel/tools/SelectionTool.java 2011-10-15 19:06:58 UTC (rev 9018) @@ -204,7 +204,7 @@ throw new AssertionError(); } final MapView<G, A, R> mapView = e.getMapView(); - FillUtils.fill(mapView.getMapControl().getMapModel(), mapView.getMapViewBasic().getSelection(), insertionMode, objectChooser.getSelections(), -1, false); + FillUtils.fill(mapView.getMapControl().getMapModel(), mapView.getMapViewBasic().getMapGrid().getSelection(), insertionMode, objectChooser.getSelections(), -1, false); } } Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2011-10-15 18:46:00 UTC (rev 9017) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2011-10-15 19:06:58 UTC (rev 9018) @@ -1553,7 +1553,7 @@ * @param insertionMode the insertion mode to use */ private void fill(@NotNull final MapView<G, A, R> mapView, @NotNull final InsertionMode<G, A, R> insertionMode) { - FillUtils.fill(mapView.getMapControl().getMapModel(), mapView.getMapViewBasic().getSelection(), insertionMode, objectChooser.getSelections(), -1, false); + FillUtils.fill(mapView.getMapControl().getMapModel(), mapView.getMapViewBasic().getMapGrid().getSelection(), insertionMode, objectChooser.getSelections(), -1, false); } /** @@ -1568,7 +1568,7 @@ final int fillDensity = randomFillDialog.getFillDensity(); final boolean noAdjacent = randomFillDialog.isRandomFillSkipAdjacentSquares(); - final Point[] selection = mapView.getMapViewBasic().getSelection(); + final Point[] selection = mapView.getMapViewBasic().getMapGrid().getSelection(); FillUtils.fill(mapView.getMapControl().getMapModel(), selection, insertionMode, objectChooser.getSelections(), fillDensity, noAdjacent); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-15 19:24:44
|
Revision: 9020 http://gridarta.svn.sourceforge.net/gridarta/?rev=9020&view=rev Author: akirschbaum Date: 2011-10-15 19:24:37 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Remove some calls to MapGrid.getSelection(). Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java trunk/model/src/test/net/sf/gridarta/model/floodfill/FillUtilsTest.java trunk/src/app/net/sf/gridarta/gui/panel/tools/SelectionTool.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java Modified: trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java 2011-10-15 19:12:01 UTC (rev 9019) +++ trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java 2011-10-15 19:24:37 UTC (rev 9020) @@ -58,8 +58,8 @@ * @param noAdjacent whether squares are skipped if an adjacent squares is * not free */ - public static <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void fill(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Point[] selection, @NotNull final InsertionMode<G, A, R> insertionMode, @NotNull final List<? extends BaseObject<G, A, R, ?>> gameObjects, final int density, final boolean noAdjacent) { - if (selection.length <= 0) { + public static <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void fill(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Collection<MapSquare<G, A, R>> selection, @NotNull final InsertionMode<G, A, R> insertionMode, @NotNull final List<? extends BaseObject<G, A, R, ?>> gameObjects, final int density, final boolean noAdjacent) { + if (selection.isEmpty()) { return; } @@ -79,7 +79,7 @@ mapModel.beginTransaction("Fill"); // TODO; I18N/L10N try { - for (final Point p : selection) { + for (final MapSquare<G, A, R> mapSquare : selection) { if (density != -1 && density != 100 && density < RandomUtils.rnd.nextInt(100) + 1) { continue; } @@ -88,11 +88,11 @@ final Archetype<G, A, R> archetype = gameObject.getArchetype(); final int w = archetype.getSizeX(); final int h = archetype.getSizeY(); - if (containsArchetype(mapModel, archetypeNames, p, w, h)) { + if (containsArchetype(mapModel, archetypeNames, mapSquare, w, h)) { continue; } } - mapModel.insertBaseObject(gameObject, p, false, false, insertionMode); + mapModel.insertBaseObject(gameObject, new Point(mapSquare.getMapX(), mapSquare.getMapY()), false, false, insertionMode); } } finally { mapModel.endTransaction(); @@ -104,17 +104,17 @@ * archetype. * @param mapModel the map model to check * @param archetypeNames the archetype names to check for - * @param p the top left corner of the area to check + * @param topLeftMapSquare the top left corner of the area to check * @param w the width of the area to check * @param h the height of the area to check * @return whether a similar game object was found */ - private static <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> boolean containsArchetype(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Collection<String> archetypeNames, @NotNull final Point p, final int w, final int h) { + private static <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> boolean containsArchetype(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Collection<String> archetypeNames, @NotNull final MapSquare<G, A, R> topLeftMapSquare, final int w, final int h) { final Point pos = new Point(); for (int dy = -1; dy < h + 1; dy++) { - pos.y = p.y + dy; + pos.y = topLeftMapSquare.getMapY() + dy; for (int dx = -1; dx < w + 1; dx++) { - pos.x = p.x + dx; + pos.x = topLeftMapSquare.getMapX() + dx; final MapSquare<G, A, R> mapSquare; try { mapSquare = mapModel.getMapSquare(pos); Modified: trunk/model/src/test/net/sf/gridarta/model/floodfill/FillUtilsTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/floodfill/FillUtilsTest.java 2011-10-15 19:12:01 UTC (rev 9019) +++ trunk/model/src/test/net/sf/gridarta/model/floodfill/FillUtilsTest.java 2011-10-15 19:24:37 UTC (rev 9020) @@ -21,6 +21,7 @@ import java.awt.Point; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import net.sf.gridarta.model.archetype.DuplicateArchetypeException; import net.sf.gridarta.model.archetype.TestArchetype; @@ -29,6 +30,7 @@ import net.sf.gridarta.model.maparchobject.TestMapArchObject; import net.sf.gridarta.model.mapmodel.CannotInsertGameObjectException; import net.sf.gridarta.model.mapmodel.MapModel; +import net.sf.gridarta.model.mapmodel.MapSquare; import net.sf.gridarta.model.mapmodel.TestMapModelCreator; import net.sf.gridarta.model.mapmodel.TestMapModelHelper; import org.junit.Assert; @@ -41,7 +43,7 @@ public class FillUtilsTest { /** - * Checks that {@link FillUtils#fill(MapModel, Point[], + * Checks that {@link FillUtils#fill(MapModel, Collection, * net.sf.gridarta.model.mapmodel.InsertionMode, List, int, boolean)} works * correctly when skipping adjacent squares. * @throws DuplicateArchetypeException if the test fails @@ -69,7 +71,8 @@ mapModel.beginTransaction("TEST"); mapModelHelper.insertArchetype(mapModel, new Point(0, 2), head, false); - final Point[] selection = { new Point(2, 0), }; + final Collection<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> selection = new ArrayList<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>>(); + selection.add(mapModel.getMapSquare(new Point(2, 0))); final List<TestGameObject> gameObjects = new ArrayList<TestGameObject>(); gameObjects.add(mapModelCreator.getGameObjectFactory().createGameObject(head)); Modified: trunk/src/app/net/sf/gridarta/gui/panel/tools/SelectionTool.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/tools/SelectionTool.java 2011-10-15 19:12:01 UTC (rev 9019) +++ trunk/src/app/net/sf/gridarta/gui/panel/tools/SelectionTool.java 2011-10-15 19:24:37 UTC (rev 9020) @@ -204,7 +204,7 @@ throw new AssertionError(); } final MapView<G, A, R> mapView = e.getMapView(); - FillUtils.fill(mapView.getMapControl().getMapModel(), mapView.getMapViewBasic().getMapGrid().getSelection(), insertionMode, objectChooser.getSelections(), -1, false); + FillUtils.fill(mapView.getMapControl().getMapModel(), mapView.getMapViewBasic().getSelectedSquares(), insertionMode, objectChooser.getSelections(), -1, false); } } Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2011-10-15 19:12:01 UTC (rev 9019) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2011-10-15 19:24:37 UTC (rev 9020) @@ -1553,7 +1553,7 @@ * @param insertionMode the insertion mode to use */ private void fill(@NotNull final MapView<G, A, R> mapView, @NotNull final InsertionMode<G, A, R> insertionMode) { - FillUtils.fill(mapView.getMapControl().getMapModel(), mapView.getMapViewBasic().getMapGrid().getSelection(), insertionMode, objectChooser.getSelections(), -1, false); + FillUtils.fill(mapView.getMapControl().getMapModel(), mapView.getMapViewBasic().getSelectedSquares(), insertionMode, objectChooser.getSelections(), -1, false); } /** @@ -1568,8 +1568,7 @@ final int fillDensity = randomFillDialog.getFillDensity(); final boolean noAdjacent = randomFillDialog.isRandomFillSkipAdjacentSquares(); - final Point[] selection = mapView.getMapViewBasic().getMapGrid().getSelection(); - FillUtils.fill(mapView.getMapControl().getMapModel(), selection, insertionMode, objectChooser.getSelections(), fillDensity, noAdjacent); + FillUtils.fill(mapView.getMapControl().getMapModel(), mapView.getMapViewBasic().getSelectedSquares(), insertionMode, objectChooser.getSelections(), fillDensity, noAdjacent); } } // class MainActions This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-15 22:05:29
|
Revision: 9038 http://gridarta.svn.sourceforge.net/gridarta/?rev=9038&view=rev Author: akirschbaum Date: 2011-10-15 22:05:22 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Split MapGrid.select() into select() and selectArea(). Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursor.java trunk/model/src/app/net/sf/gridarta/model/mapgrid/MapGrid.java trunk/model/src/test/net/sf/gridarta/model/mapgrid/MapGridTest.java trunk/src/app/net/sf/gridarta/gui/misc/ShiftProcessor.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/Control.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/test/net/sf/gridarta/gui/copybuffer/CopyBufferTest.java Modified: trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursor.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursor.java 2011-10-15 21:57:17 UTC (rev 9037) +++ trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursor.java 2011-10-15 22:05:22 UTC (rev 9038) @@ -283,7 +283,7 @@ mapGrid.beginTransaction(); try { dragRelease(); - mapGrid.select(dragStart, pos, selectionMode); + mapGrid.selectArea(dragStart, pos, selectionMode); } finally { mapGrid.endTransaction(); } Modified: trunk/model/src/app/net/sf/gridarta/model/mapgrid/MapGrid.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapgrid/MapGrid.java 2011-10-15 21:57:17 UTC (rev 9037) +++ trunk/model/src/app/net/sf/gridarta/model/mapgrid/MapGrid.java 2011-10-15 22:05:22 UTC (rev 9038) @@ -33,11 +33,11 @@ * errors. This class provides methods to modify these flags. Normally a map * cursor is used to access them. Selection flags are not changed directly. * First pre-selection flags have to be set with {@link #preSelect(Point, - * Point)}, then {@link #select(Point, Point, SelectionMode)} will change the - * selection flags according to {@link SelectionMode}. This allows visualisation - * of the dragging process when selecting an area. <p/> Every change of the grid - * size or flags fires a {@link MapGridEvent} and informs all registered {@link - * MapGridListener MapGridListeners}. + * Point)}, then {@link #selectArea(Point, Point, SelectionMode)} will change + * the selection flags according to {@link SelectionMode}. This allows + * visualisation of the dragging process when selecting an area. <p/> Every + * change of the grid size or flags fires a {@link MapGridEvent} and informs all + * registered {@link MapGridListener MapGridListeners}. * @author <a href="mailto:dlv...@gm...">Daniel Viegas</a> * @author Andreas Kirschbaum */ @@ -394,16 +394,24 @@ } /** - * All squares in the rectangle defined by dragStart and pos that are - * preselected get selected. - * @param dragStart the first corner of rectangle - * @param pos the opposite corner of rectangle - * @param selectionMode the method how to handle already selected squares + * Selects or deselects a single square. + * @param pos the square + * @param selectionMode the selection mode */ - public void select(@NotNull final Point dragStart, @NotNull final Point pos, @NotNull final SelectionMode selectionMode) { + public void select(@NotNull final Point pos, @NotNull final SelectionMode selectionMode) { + selectArea(pos, pos, selectionMode); + } + + /** + * Selects or deselects all squares in an area. + * @param pos1 the first corner of rectangle + * @param pos2 the opposite corner of rectangle + * @param selectionMode the selection mode + */ + public void selectArea(@NotNull final Point pos1, @NotNull final Point pos2, @NotNull final SelectionMode selectionMode) { beginTransaction(); try { - calculateRec(dragStart, pos); + calculateRec(pos1, pos2); switch (selectionMode) { case ADD: setFlags(cornerMin.x, cornerMin.y, cornerMax.x, cornerMax.y, GRID_FLAG_SELECTION); Modified: trunk/model/src/test/net/sf/gridarta/model/mapgrid/MapGridTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapgrid/MapGridTest.java 2011-10-15 21:57:17 UTC (rev 9037) +++ trunk/model/src/test/net/sf/gridarta/model/mapgrid/MapGridTest.java 2011-10-15 22:05:22 UTC (rev 9038) @@ -38,28 +38,28 @@ final MapGrid mapGrid = new MapGrid(new Size2D(4, 3)); checkSelectionBorder(mapGrid, "0000" + "0000" + "0000"); - mapGrid.select(new Point(1, 1), new Point(1, 1), SelectionMode.ADD); + mapGrid.select(new Point(1, 1), SelectionMode.ADD); checkSelectionBorder(mapGrid, "0000" + "0f00" + "0000"); - mapGrid.select(new Point(2, 1), new Point(2, 1), SelectionMode.ADD); + mapGrid.select(new Point(2, 1), SelectionMode.ADD); checkSelectionBorder(mapGrid, "0000" + "0d70" + "0000"); - mapGrid.select(new Point(3, 1), new Point(3, 1), SelectionMode.ADD); + mapGrid.select(new Point(3, 1), SelectionMode.ADD); checkSelectionBorder(mapGrid, "0000" + "0d57" + "0000"); - mapGrid.select(new Point(3, 1), new Point(3, 1), SelectionMode.SUB); + mapGrid.select(new Point(3, 1), SelectionMode.SUB); checkSelectionBorder(mapGrid, "0000" + "0d70" + "0000"); - mapGrid.select(new Point(0, 0), new Point(3, 2), SelectionMode.FLIP); + mapGrid.selectArea(new Point(0, 0), new Point(3, 2), SelectionMode.FLIP); checkSelectionBorder(mapGrid, "9553" + "a00a" + "c556"); - mapGrid.select(new Point(1, 1), new Point(1, 1), SelectionMode.FLIP); + mapGrid.select(new Point(1, 1), SelectionMode.FLIP); checkSelectionBorder(mapGrid, "9153" + "820a" + "c456"); - mapGrid.select(new Point(1, 1), new Point(1, 1), SelectionMode.SUB); + mapGrid.select(new Point(1, 1), SelectionMode.SUB); checkSelectionBorder(mapGrid, "9553" + "a00a" + "c556"); - mapGrid.select(new Point(0, 0), new Point(3, 2), SelectionMode.ADD); + mapGrid.selectArea(new Point(0, 0), new Point(3, 2), SelectionMode.ADD); checkSelectionBorder(mapGrid, "9113" + "8002" + "c446"); mapGrid.resize(new Size2D(2, 1)); @@ -68,7 +68,7 @@ mapGrid.resize(new Size2D(3, 4)); checkSelectionBorder(mapGrid, "d700" + "0000" + "0000"); - mapGrid.select(new Point(0, 0), new Point(2, 3), SelectionMode.ADD); + mapGrid.selectArea(new Point(0, 0), new Point(2, 3), SelectionMode.ADD); checkSelectionBorder(mapGrid, "913" + "802" + "802" + "c46"); mapGrid.resize(new Size2D(4, 3)); Modified: trunk/src/app/net/sf/gridarta/gui/misc/ShiftProcessor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/ShiftProcessor.java 2011-10-15 21:57:17 UTC (rev 9037) +++ trunk/src/app/net/sf/gridarta/gui/misc/ShiftProcessor.java 2011-10-15 22:05:22 UTC (rev 9038) @@ -282,7 +282,7 @@ assert mapGrid != null; final boolean thisSelection = (mapGrid.getFlags(pos) & MapGrid.GRID_FLAG_SELECTION) > 0; assert mapGrid != null; - mapGrid.select(prevPos, prevPos, thisSelection ? SelectionMode.ADD : SelectionMode.SUB); + mapGrid.select(prevPos, thisSelection ? SelectionMode.ADD : SelectionMode.SUB); gameObjectsToInsert.clear(); if (thisSelection) { if (isStart) { @@ -331,7 +331,7 @@ } assert startGameObjects.isEmpty(); assert mapGrid != null; - mapGrid.select(prevPos, prevPos, startSelection ? SelectionMode.ADD : SelectionMode.SUB); + mapGrid.select(prevPos, startSelection ? SelectionMode.ADD : SelectionMode.SUB); } /** Modified: trunk/src/app/net/sf/gridarta/gui/panel/connectionview/Control.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/connectionview/Control.java 2011-10-15 21:57:17 UTC (rev 9037) +++ trunk/src/app/net/sf/gridarta/gui/panel/connectionview/Control.java 2011-10-15 22:05:22 UTC (rev 9038) @@ -115,7 +115,7 @@ for (final GameObject<?, ?, ?> object : connection) { final BaseObject<?, ?, ?, ?> topObject = object.getTopContainer(); point.setLocation(topObject.getMapX(), topObject.getMapY()); - mapGrid.select(point, point, SelectionMode.ADD); + mapGrid.select(point, SelectionMode.ADD); } } } Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2011-10-15 21:57:17 UTC (rev 9037) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2011-10-15 22:05:22 UTC (rev 9038) @@ -1350,7 +1350,7 @@ for (final MapSquare<G, A, R> mapSquare : newSelection.keySet()) { point.x = mapSquare.getMapX(); point.y = mapSquare.getMapY(); - mapGrid.select(point, point, SelectionMode.ADD); + mapGrid.select(point, SelectionMode.ADD); } } finally { mapGrid.endTransaction(); @@ -1389,7 +1389,7 @@ for (int dx = -1; dx <= 1; dx++) { point.x = mapSquare.getMapX() + dx; if (mapArchObject.isPointValid(point)) { - mapGrid.select(point, point, SelectionMode.ADD); + mapGrid.select(point, SelectionMode.ADD); } } } @@ -1444,7 +1444,7 @@ for (final MapSquare<G, A, R> mapSquare : mapSquaresToShrink.keySet()) { point.x = mapSquare.getMapX(); point.y = mapSquare.getMapY(); - mapGrid.select(point, point, SelectionMode.SUB); + mapGrid.select(point, SelectionMode.SUB); } } finally { mapGrid.endTransaction(); Modified: trunk/src/test/net/sf/gridarta/gui/copybuffer/CopyBufferTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/copybuffer/CopyBufferTest.java 2011-10-15 21:57:17 UTC (rev 9037) +++ trunk/src/test/net/sf/gridarta/gui/copybuffer/CopyBufferTest.java 2011-10-15 22:05:22 UTC (rev 9038) @@ -77,7 +77,7 @@ // select + cut final CopyBuffer<TestGameObject, TestMapArchObject, TestArchetype> copyBuffer = TestMapControlCreatorUtils.newCopyBuffer(testMapControlCreator); final MapView<TestGameObject, TestMapArchObject, TestArchetype> mapView = TestMapControlCreatorUtils.newMapView(mapControl); - mapView.getMapGrid().select(new Point(1, 1), new Point(1, 1), SelectionMode.ADD); + mapView.getMapGrid().select(new Point(1, 1), SelectionMode.ADD); copyBuffer.cut(mapView, new Rectangle(1, 1, 1, 1)); TestMapModelHelper.checkMapContents(mapModel, "||", "||", "||"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-15 23:50:10
|
Revision: 9042 http://gridarta.svn.sourceforge.net/gridarta/?rev=9042&view=rev Author: akirschbaum Date: 2011-10-15 23:50:03 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Merge duplicated code. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquare.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/BlockedSpawnPointChecker.java trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ErrorListView.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/MapSquareSelection.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareActions.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareControl.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -228,8 +228,9 @@ if (mapViewSettings.isSmoothing()) { final MapArchObject mapArchObject = mapModel.getMapArchObject(); final Point point = new Point(); - for (point.x = mapSquare.getMapX() - 1; point.x <= mapSquare.getMapX() + 1; point.x++) { - for (point.y = mapSquare.getMapY() - 1; point.y <= mapSquare.getMapY() + 1; point.y++) { + for (int dx = -1; dx <= 1; dx++) { + for (int dy = -1; dy <= dy + 1; dy++) { + mapSquare.getLocation(point, dx, dy); if (mapArchObject.isPointValid(point)) { toRepaint.add(mapModel.getMapSquare(point)); } @@ -400,10 +401,9 @@ * @param square the square to paint */ private void paintSquare(@NotNull final MapSquare<GameObject, MapArchObject, Archetype> square) { - final int x = square.getMapX(); - final int y = square.getMapY(); - updateSquare(new Point(x, y)); - repaint(0L, borderOffset.x + x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + y * IGUIConstants.SQUARE_HEIGHT, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT); + final Point pos = square.getLocation(); + updateSquare(pos); + repaint(0L, borderOffset.x + pos.x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + pos.y * IGUIConstants.SQUARE_HEIGHT, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT); } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -312,12 +312,12 @@ if (filterControl.canShow(node) && mapViewSettings.isEditType(node)) { paintGameObject(g, x, y, node); if (node.getAttributeInt(GameObject.SMOOTHLEVEL, true) > 0) { - smoothingRenderer.paintSmooth(g, square.getMapX(), square.getMapY(), node.getAttributeInt(GameObject.SMOOTHLEVEL, true), layer, false, borderOffsetX, borderOffsetY); + smoothingRenderer.paintSmooth(g, square.getLocation(), node.getAttributeInt(GameObject.SMOOTHLEVEL, true), layer, false, borderOffsetX, borderOffsetY); } } } if (layer > -1) { - smoothingRenderer.paintSmooth(g, square.getMapX(), square.getMapY(), 1, layer + 1, true, borderOffsetX, borderOffsetY); + smoothingRenderer.paintSmooth(g, square.getLocation(), 1, layer + 1, true, borderOffsetX, borderOffsetY); } } else { for (final GameObject node : square) { Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -166,11 +166,11 @@ } graphics.drawImage(img.getImage(), point.x * IGUIConstants.SQUARE_WIDTH, point.y * IGUIConstants.SQUARE_HEIGHT, point.x * IGUIConstants.SQUARE_WIDTH + IGUIConstants.SQUARE_WIDTH, point.y * IGUIConstants.SQUARE_HEIGHT + IGUIConstants.SQUARE_HEIGHT, offset.x, offset.y, offset.x + IGUIConstants.SQUARE_WIDTH, offset.y + IGUIConstants.SQUARE_HEIGHT, this); if (node.getAttributeInt(GameObject.SMOOTHLEVEL, true) > 0) { - smoothingRenderer.paintSmooth(graphics, point.x, point.y, node.getAttributeInt(GameObject.SMOOTHLEVEL, true), layer, false, 0, 0); + smoothingRenderer.paintSmooth(graphics, point, node.getAttributeInt(GameObject.SMOOTHLEVEL, true), layer, false, 0, 0); } } if (layer > -1) { - smoothingRenderer.paintSmooth(graphics, point.x, point.y, 1, layer + 1, true, 0, 0); + smoothingRenderer.paintSmooth(graphics, point, 1, layer + 1, true, 0, 0); } } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -103,8 +103,7 @@ * limit smoothlevel, at a given layer. This operation may be recursive, if * all layer above current are to be drawn too. * @param graphics where to draw (graphics) - * @param x the x-coordinate of the map square to draw, in map coordinates - * @param y the y-coordinate of the map square to draw, in map coordinates + * @param pos the coordinate of the map square to draw, in map coordinates * @param level the limit smoothlevel (smooth levels above this are drawn) * @param firstLayer the layer (map z coordinate) to draw; note that * invisible objects are supposed to not use a layer, to stay coherent with @@ -113,16 +112,16 @@ * @param borderOffsetX the border x offset * @param borderOffsetY the border y offset */ - public void paintSmooth(@NotNull final Graphics graphics, final int x, final int y, final int level, final int firstLayer, final boolean allLayers, final int borderOffsetX, final int borderOffsetY) { + public void paintSmooth(@NotNull final Graphics graphics, @NotNull final Point pos, final int level, final int firstLayer, final boolean allLayers, final int borderOffsetX, final int borderOffsetY) { int layer = firstLayer; while (true) { final MapArchObject mapArchObject = mapModel.getMapArchObject(); boolean foundLayer = false; final Point where = new Point(); for (int deltaX = -1; deltaX <= 1; deltaX++) { - where.x = x + deltaX; + where.x = pos.x + deltaX; for (int deltaY = -1; deltaY <= 1; deltaY++) { - where.y = y + deltaY; + where.y = pos.y + deltaY; //false warning: cannot annotate with @Nullable //noinspection AssignmentToNull layerNode[deltaX + 1][deltaY + 1] = null; @@ -211,10 +210,10 @@ */ final ImageIcon img = faceObjectProviders.getDisplayIcon(smoothFace); if (weight > 0) { - drawImage(graphics, x, y, borderOffsetX, borderOffsetY, IGUIConstants.SQUARE_WIDTH * weight, 0, img); + drawImage(graphics, pos, borderOffsetX, borderOffsetY, IGUIConstants.SQUARE_WIDTH * weight, 0, img); } if (weightC > 0) { - drawImage(graphics, x, y, borderOffsetX, borderOffsetY, IGUIConstants.SQUARE_WIDTH * weightC, IGUIConstants.SQUARE_HEIGHT, img); + drawImage(graphics, pos, borderOffsetX, borderOffsetY, IGUIConstants.SQUARE_WIDTH * weightC, IGUIConstants.SQUARE_HEIGHT, img); } } /*while there's some smooth to do*/ @@ -226,8 +225,8 @@ } } - private void drawImage(@NotNull final Graphics graphics, final int x, final int y, final int borderOffsetX, final int borderOffsetY, final int srcX, final int srcY, @NotNull final ImageIcon img) { - graphics.drawImage(img.getImage(), borderOffsetX + x * IGUIConstants.SQUARE_WIDTH, borderOffsetY + y * IGUIConstants.SQUARE_HEIGHT, borderOffsetX + x * IGUIConstants.SQUARE_WIDTH + IGUIConstants.SQUARE_WIDTH, borderOffsetY + y * IGUIConstants.SQUARE_HEIGHT + IGUIConstants.SQUARE_HEIGHT, srcX, srcY, srcX + IGUIConstants.SQUARE_WIDTH, srcY + IGUIConstants.SQUARE_HEIGHT, null); + private void drawImage(@NotNull final Graphics graphics, @NotNull final Point pos, final int borderOffsetX, final int borderOffsetY, final int srcX, final int srcY, @NotNull final ImageIcon img) { + graphics.drawImage(img.getImage(), borderOffsetX + pos.x * IGUIConstants.SQUARE_WIDTH, borderOffsetY + pos.y * IGUIConstants.SQUARE_HEIGHT, borderOffsetX + pos.x * IGUIConstants.SQUARE_WIDTH + IGUIConstants.SQUARE_WIDTH, borderOffsetY + pos.y * IGUIConstants.SQUARE_HEIGHT + IGUIConstants.SQUARE_HEIGHT, srcX, srcY, srcX + IGUIConstants.SQUARE_WIDTH, srcY + IGUIConstants.SQUARE_HEIGHT, null); } } // class SmoothingRenderer Modified: trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -92,7 +92,7 @@ continue; } } - mapModel.insertBaseObject(gameObject, new Point(mapSquare.getMapX(), mapSquare.getMapY()), false, false, insertionMode); + mapModel.insertBaseObject(gameObject, mapSquare.getLocation(), false, false, insertionMode); } } finally { mapModel.endTransaction(); @@ -112,9 +112,8 @@ private static <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> boolean containsArchetype(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Collection<String> archetypeNames, @NotNull final MapSquare<G, A, R> topLeftMapSquare, final int w, final int h) { final Point pos = new Point(); for (int dy = -1; dy < h + 1; dy++) { - pos.y = topLeftMapSquare.getMapY() + dy; for (int dx = -1; dx < w + 1; dx++) { - pos.x = topLeftMapSquare.getMapX() + dx; + topLeftMapSquare.getLocation(pos, dx, dy); final MapSquare<G, A, R> mapSquare; try { mapSquare = mapModel.getMapSquare(pos); Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -671,7 +671,7 @@ gameObject.remove(); if (join) { - autojoinLists.joinDelete(this, new Point(mapSquare.getMapX(), mapSquare.getMapY()), gameObject.getArchetype()); + autojoinLists.joinDelete(this, mapSquare.getLocation(), gameObject.getArchetype()); } } } Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquare.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquare.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquare.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -19,6 +19,7 @@ package net.sf.gridarta.model.mapmodel; +import java.awt.Point; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.baseobject.GameObjectContainer; import net.sf.gridarta.model.gameobject.GameObject; @@ -97,6 +98,35 @@ } /** + * Returns the coordinate on the map. + * @return the coordinate on the map + */ + @NotNull + public Point getLocation() { + return new Point(mapX, mapY); + } + + /** + * Returns the coordinate on the map. + * @param pos returns the coordinate on the map + */ + public void getLocation(@NotNull final Point pos) { + pos.x = mapX; + pos.y = mapY; + } + + /** + * Returns the coordinate with an offset on the map. + * @param pos returns the coordinate on the map + * @param dx the x offset to add to the coordinate + * @param dy the y offset to add to the coordinate + */ + public void getLocation(@NotNull final Point pos, final int dx, final int dy) { + pos.x = mapX + dx; + pos.y = mapY + dy; + } + + /** * {@inheritDoc} */ @Override Modified: trunk/model/src/app/net/sf/gridarta/model/validation/checks/BlockedSpawnPointChecker.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/checks/BlockedSpawnPointChecker.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/model/src/app/net/sf/gridarta/model/validation/checks/BlockedSpawnPointChecker.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -95,8 +95,7 @@ final Point pos = new Point(); for (final MapSquare<G, A, R> mapSquare : mapModel) { for (final G gameObject : mapSquare) { - pos.x = mapSquare.getMapX(); - pos.y = mapSquare.getMapY(); + mapSquare.getLocation(pos); checkSpawnPoint(gameObject, pos, blocked, errorCollector); for (final G invObject : gameObject.recursive()) { checkSpawnPoint(invObject, pos, blocked, errorCollector); Modified: trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -153,11 +153,11 @@ mapModel2.beginTransaction("Cut / Clear"); // TODO: I18N/L10N try { final Collection<G> gameObjectsToDelete = new HashSet<G>(); + final Point pos = new Point(); for (final MapSquare<G, A, R> square : mapView.getSelectedSquares()) { - final int posX = square.getMapX() - selectedRec.x; - final int posY = square.getMapY() - selectedRec.y; + square.getLocation(pos, -selectedRec.x, -selectedRec.y); for (final G gameObject : square) { - copyMode.process(mapModel, gameObject, mapViewSettings.isEditType(gameObject), gameObjectsToDelete, posX, posY, gameObjectFactory, insertionModeSet); + copyMode.process(mapModel, gameObject, mapViewSettings.isEditType(gameObject), gameObjectsToDelete, pos, gameObjectFactory, insertionModeSet); } } @@ -184,7 +184,8 @@ try { final Point pos = new Point(); for (final MapSquare<G, A, R> square : mapModel) { - pos.setLocation(startLocation.x + square.getMapX(), startLocation.y + square.getMapY()); + square.getLocation(pos); + pos.translate(startLocation.x, startLocation.y); if (mapArchObject.isPointValid(pos)) { for (final BaseObject<G, A, R, ?> gameObject : square) { if (!gameObject.isMulti()) { @@ -195,8 +196,8 @@ } for (final MapSquare<G, A, R> square : mapModel) { - pos.setLocation(startLocation); - pos.translate(square.getMapX(), square.getMapY()); + square.getLocation(pos); + pos.translate(startLocation.x, startLocation.y); if (mapArchObject.isPointValid(pos)) { for (final BaseObject<G, A, R, ?> gameObject : square) { if (gameObject.isMulti()) { Modified: trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -50,7 +50,7 @@ /** {@inheritDoc} */ @Override - public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void process(@NotNull final MapModel<G, A, R> mapModel, @NotNull final G gameObject, final boolean isEditType, @NotNull final Collection<G> gameObjectsToDelete, final int posX, final int posY, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { + public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void process(@NotNull final MapModel<G, A, R> mapModel, @NotNull final G gameObject, final boolean isEditType, @NotNull final Collection<G> gameObjectsToDelete, @NotNull final Point pos, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { if (isEditType) { gameObjectsToDelete.add(gameObject.getHead()); } @@ -71,11 +71,11 @@ /** {@inheritDoc} */ @Override - public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void process(@NotNull final MapModel<G, A, R> mapModel, @NotNull final G gameObject, final boolean isEditType, @NotNull final Collection<G> gameObjectsToDelete, final int posX, final int posY, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { + public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void process(@NotNull final MapModel<G, A, R> mapModel, @NotNull final G gameObject, final boolean isEditType, @NotNull final Collection<G> gameObjectsToDelete, @NotNull final Point pos, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { if (isEditType) { if (gameObject.isHead() && !gameObject.isInContainer()) { final G clone = gameObjectFactory.cloneGameObject(gameObject); - mapModel.addGameObjectToMap(clone, new Point(posX, posY), insertionModeSet.getTopmostInsertionMode()); + mapModel.addGameObjectToMap(clone, pos, insertionModeSet.getTopmostInsertionMode()); } if (gameObject.getArchetype().getMultiX() >= 0 && gameObject.getArchetype().getMultiY() >= 0) { gameObjectsToDelete.add(gameObject.getHead()); @@ -98,10 +98,10 @@ /** {@inheritDoc} */ @Override - public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void process(@NotNull final MapModel<G, A, R> mapModel, @NotNull final G gameObject, final boolean isEditType, @NotNull final Collection<G> gameObjectsToDelete, final int posX, final int posY, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { + public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void process(@NotNull final MapModel<G, A, R> mapModel, @NotNull final G gameObject, final boolean isEditType, @NotNull final Collection<G> gameObjectsToDelete, @NotNull final Point pos, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { if (isEditType && gameObject.isHead() && !gameObject.isInContainer()) { final G clone = gameObjectFactory.cloneGameObject(gameObject); - mapModel.addGameObjectToMap(clone, new Point(posX, posY), insertionModeSet.getTopmostInsertionMode()); + mapModel.addGameObjectToMap(clone, pos, insertionModeSet.getTopmostInsertionMode()); } } @@ -122,11 +122,10 @@ * @param isEditType whether the game object matches the active edit type * @param gameObjectsToDelete a collection for game objects to delete after * the operation has finished - * @param posX the current map x-position - * @param posY the current map y-position + * @param pos the current map position * @param gameObjectFactory the game object factory to use * @param insertionModeSet the insertion mode set to use */ - public abstract <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void process(@NotNull final MapModel<G, A, R> mapModel, @NotNull final G gameObject, final boolean isEditType, @NotNull final Collection<G> gameObjectsToDelete, final int posX, final int posY, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final InsertionModeSet<G, A, R> insertionModeSet); + public abstract <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void process(@NotNull final MapModel<G, A, R> mapModel, @NotNull final G gameObject, final boolean isEditType, @NotNull final Collection<G> gameObjectsToDelete, @NotNull final Point pos, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final InsertionModeSet<G, A, R> insertionModeSet); } // enum CopyMode Modified: trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -822,7 +822,7 @@ throw new IllegalArgumentException(); } mapModel = mapSquare.getMapModel(); - mapPos = new Point(mapSquare.getMapX(), mapSquare.getMapY()); + mapPos = mapSquare.getLocation(); mapModel.addMapModelListener(mapModelListener); mapManager.addMapManagerListener(mapManagerListener); Modified: trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -22,7 +22,6 @@ import java.awt.Component; import java.awt.Container; import java.awt.FlowLayout; -import java.awt.Point; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.ArrayList; @@ -512,9 +511,9 @@ } // insert replacement object if (randomArch.isMulti()) { - mapModel.insertBaseObject(randomArch, new Point(square.getMapX(), square.getMapY()), false, false, insertionModeSet.getTopmostInsertionMode()); + mapModel.insertBaseObject(randomArch, square.getLocation(), false, false, insertionModeSet.getTopmostInsertionMode()); } else { - mapModel.insertArchToMap(randomArch, prevArch, new Point(square.getMapX(), square.getMapY()), false); + mapModel.insertArchToMap(randomArch, prevArch, square.getLocation(), false); } } replaceCount++; Modified: trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ErrorListView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ErrorListView.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ErrorListView.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -344,7 +344,7 @@ final Iterator<MapSquare<G, A, R>> mapSquareIterator = error.getMapSquares().iterator(); if (mapSquareIterator.hasNext()) { final MapSquare<G, A, R> mapSquare = mapSquareIterator.next(); - setMapCursorLocation(mapSquare == null ? null : new Point(mapSquare.getMapX(), mapSquare.getMapY())); + setMapCursorLocation(mapSquare == null ? null : mapSquare.getLocation()); } } errorMsg.setCaretPosition(0); Modified: trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesControl.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesControl.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -23,7 +23,6 @@ import java.awt.Component; import java.awt.Container; import java.awt.GridLayout; -import java.awt.Point; import java.io.File; import java.util.Collection; import java.util.HashSet; @@ -605,7 +604,7 @@ final MapModel<G, A, R> mapModel = mapSquare.getMapModel(); mapModel.beginTransaction("Add to environment"); // TODO; I18N/L10N try { - final G insertedGameObject = mapModel.insertArchToMap(baseObject, prevGameObject, new Point(mapSquare.getMapX(), mapSquare.getMapY()), true); + final G insertedGameObject = mapModel.insertArchToMap(baseObject, prevGameObject, mapSquare.getLocation(), true); if (insertedGameObject != null) { mapModel.removeGameObject(prevGameObject, true); insertedGameObject.addLast(prevGameObject); Modified: trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/MapSquareSelection.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/MapSquareSelection.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/MapSquareSelection.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -19,7 +19,6 @@ package net.sf.gridarta.gui.panel.selectedsquare; -import java.awt.Point; import net.sf.gridarta.gui.map.mapview.MapView; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; @@ -120,7 +119,7 @@ return false; } - return !mapView.getMapControl().getMapModel().getMapArchObject().isPointValid(new Point(currentMapSquare.getMapX(), currentMapSquare.getMapY())) && setMapSquare(null, null, 0); + return !mapView.getMapControl().getMapModel().getMapArchObject().isPointValid(currentMapSquare.getLocation()) && setMapSquare(null, null, 0); } /** Modified: trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareActions.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareActions.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -195,7 +195,7 @@ } final MapModel<G, A, R> mapModel = mapSquare.getMapModel(); - final Point pos = new Point(mapSquare.getMapX(), mapSquare.getMapY()); + final Point pos = mapSquare.getLocation(); if (!envGameObject.isInContainer() && gameObject.getArchetype().isMulti() && !mapModel.isMultiArchFittingToMap(gameObject.getArchetype(), pos, true)) { return false; } Modified: trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareControl.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareControl.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -19,7 +19,6 @@ package net.sf.gridarta.gui.panel.selectedsquare; -import java.awt.Point; import java.awt.event.InputEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -198,7 +197,7 @@ final MapModel<G, A, R> mapModel = mapControl.getMapModel(); mapModel.beginTransaction("Insert"); // TODO; I18N/L10N try { - final G insertedGameObject = mapModel.insertArchToMap(baseObject, prevGameObject, new Point(mapSquare.getMapX(), mapSquare.getMapY()), true); + final G insertedGameObject = mapModel.insertArchToMap(baseObject, prevGameObject, mapSquare.getLocation(), true); if (insertedGameObject != null) { selectedSquareView.setSelectedGameObject(insertedGameObject); } Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2011-10-15 23:21:40 UTC (rev 9041) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2011-10-15 23:50:03 UTC (rev 9042) @@ -1326,10 +1326,9 @@ final Map<MapSquare<G, A, R>, Void> tmp = new IdentityHashMap<MapSquare<G, A, R>, Void>(); for (final MapSquare<G, A, R> mapSquare : todo.keySet()) { for (int dy = -1; dy <= 1; dy++) { - point.y = mapSquare.getMapY() + dy; for (int dx = -1; dx <= 1; dx++) { if (dx != 0 || dy != 0) { - point.x = mapSquare.getMapX() + dx; + mapSquare.getLocation(point, dx, dy); if (mapArchObject.isPointValid(point)) { final MapSquare<G, A, R> newMapSquare = mapModel.getMapSquare(point); if (newMapSquare.isEmpty() && !newSelection.containsKey(newMapSquare)) { @@ -1348,8 +1347,7 @@ try { mapGrid.unSelect(); for (final MapSquare<G, A, R> mapSquare : newSelection.keySet()) { - point.x = mapSquare.getMapX(); - point.y = mapSquare.getMapY(); + mapSquare.getLocation(point); mapGrid.select(point, SelectionMode.ADD); } } finally { @@ -1385,9 +1383,8 @@ try { for (final MapSquare<G, A, R> mapSquare : selectedSquares) { for (int dy = -1; dy <= 1; dy++) { - point.y = mapSquare.getMapY() + dy; for (int dx = -1; dx <= 1; dx++) { - point.x = mapSquare.getMapX() + dx; + mapSquare.getLocation(point, dx, dy); if (mapArchObject.isPointValid(point)) { mapGrid.select(point, SelectionMode.ADD); } @@ -1429,10 +1426,9 @@ for (final MapSquare<G, A, R> mapSquare : selectedSquares) { LOOP: for (int dy = -1; dy <= 1; dy++) { - point.y = mapSquare.getMapY() + dy; for (int dx = -1; dx <= 1; dx++) { if (dx != 0 || dy != 0) { - point.x = mapSquare.getMapX() + dx; + mapSquare.getLocation(point, dx, dy); if (mapArchObject.isPointValid(point) && (mapGrid.getFlags(point) & MapGrid.GRID_FLAG_SELECTION) == 0) { mapSquaresToShrink.put(mapSquare, null); break LOOP; @@ -1442,8 +1438,7 @@ } } for (final MapSquare<G, A, R> mapSquare : mapSquaresToShrink.keySet()) { - point.x = mapSquare.getMapX(); - point.y = mapSquare.getMapY(); + mapSquare.getLocation(point); mapGrid.select(point, SelectionMode.SUB); } } finally { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-16 08:06:06
|
Revision: 9048 http://gridarta.svn.sourceforge.net/gridarta/?rev=9048&view=rev Author: akirschbaum Date: 2011-10-16 08:05:59 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Whitespace changes. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/validation/errors/MapDifficultyError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/SquareValidationError.java trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewFactory.java trunk/src/test/net/sf/gridarta/gui/map/mapview/TestMapViewFactory.java trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java Modified: trunk/model/src/app/net/sf/gridarta/model/validation/errors/MapDifficultyError.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/errors/MapDifficultyError.java 2011-10-16 00:16:28 UTC (rev 9047) +++ trunk/model/src/app/net/sf/gridarta/model/validation/errors/MapDifficultyError.java 2011-10-16 08:05:59 UTC (rev 9048) @@ -64,7 +64,7 @@ */ @Override public String getParameter(final int id) { - switch(id){ + switch (id) { default: return null; } Modified: trunk/model/src/app/net/sf/gridarta/model/validation/errors/SquareValidationError.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/errors/SquareValidationError.java 2011-10-16 00:16:28 UTC (rev 9047) +++ trunk/model/src/app/net/sf/gridarta/model/validation/errors/SquareValidationError.java 2011-10-16 08:05:59 UTC (rev 9048) @@ -50,7 +50,7 @@ */ @Override public String getParameter(final int id) { - switch(id){ + switch (id) { default: return null; } Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewFactory.java 2011-10-16 00:16:28 UTC (rev 9047) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewFactory.java 2011-10-16 08:05:59 UTC (rev 9048) @@ -88,7 +88,7 @@ @NotNull @Override public MapView<G, A, R> newMapView(@NotNull final MapControl<G, A, R> mapControl, @Nullable final Point viewPosition, final int viewCounter) { - final MapModel<G,A,R> mapModel = mapControl.getMapModel(); + final MapModel<G, A, R> mapModel = mapControl.getMapModel(); final MapGrid mapGrid = new MapGrid(mapModel.getMapArchObject().getMapSize()); final AbstractMapRenderer<G, A, R> renderer = mapControl.isPickmap() ? rendererFactory.newPickmapRenderer(mapModel, mapGrid) : rendererFactory.newMapRenderer(mapModel, mapGrid); renderer.setFocusable(true); Modified: trunk/src/test/net/sf/gridarta/gui/map/mapview/TestMapViewFactory.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/map/mapview/TestMapViewFactory.java 2011-10-16 00:16:28 UTC (rev 9047) +++ trunk/src/test/net/sf/gridarta/gui/map/mapview/TestMapViewFactory.java 2011-10-16 08:05:59 UTC (rev 9048) @@ -42,7 +42,7 @@ @NotNull @Override public MapView<TestGameObject, TestMapArchObject, TestArchetype> newMapView(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl, @Nullable final Point viewPosition, final int viewCounter) { - final MapModel<TestGameObject,TestMapArchObject,TestArchetype> mapModel = mapControl.getMapModel(); + final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapControl.getMapModel(); final MapGrid mapGrid = new MapGrid(mapModel.getMapArchObject().getMapSize()); return new TestMapView(mapControl, mapGrid, new MapCursor(mapGrid)); } Modified: trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java 2011-10-16 00:16:28 UTC (rev 9047) +++ trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java 2011-10-16 08:05:59 UTC (rev 9048) @@ -62,7 +62,7 @@ */ @NotNull public static MapView<TestGameObject, TestMapArchObject, TestArchetype> newMapView(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl) { - final MapModel<TestGameObject,TestMapArchObject,TestArchetype> mapModel = mapControl.getMapModel(); + final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapControl.getMapModel(); final MapGrid mapGrid = new MapGrid(mapModel.getMapArchObject().getMapSize()); return new TestMapView(mapControl, mapGrid, new MapCursor(mapGrid)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-16 09:34:41
|
Revision: 9049 http://gridarta.svn.sourceforge.net/gridarta/?rev=9049&view=rev Author: akirschbaum Date: 2011-10-16 09:34:34 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Merge duplicated code. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/SavedSquares.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ErrorListView.java Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2011-10-16 08:05:59 UTC (rev 9048) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2011-10-16 09:34:34 UTC (rev 9049) @@ -19,6 +19,7 @@ package net.sf.gridarta.model.baseobject; +import java.awt.Point; import javax.swing.ImageIcon; import net.sf.gridarta.model.anim.AnimationObject; import net.sf.gridarta.model.anim.AnimationObjects; @@ -555,6 +556,14 @@ * {@inheritDoc} */ @Override + public Point getMapLocation() { + return new Point(mapX, mapY); + } + + /** + * {@inheritDoc} + */ + @Override public void setMapX(final int mapX) { this.mapX = mapX; } Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2011-10-16 08:05:59 UTC (rev 9048) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2011-10-16 09:34:34 UTC (rev 9049) @@ -19,6 +19,7 @@ package net.sf.gridarta.model.baseobject; +import java.awt.Point; import java.io.Serializable; import javax.swing.ImageIcon; import net.sf.gridarta.model.archetype.Archetype; @@ -362,6 +363,15 @@ int getMapY(); /** + * Returns the coordinate of this GameObject on its map. This method only + * guarantees a reasonable value for GameObjects that are directly bound to + * a map. Implementations may also return reasonable values for GameObjects + * inside containers, but they are not required to do so. + * @return the coordinate on map + */ + Point getMapLocation(); + + /** * Sets the X coordinate of this GameObject on its map. * @param mapX the x coordinate * @warning Only use this method during the load process. Modified: trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2011-10-16 08:05:59 UTC (rev 9048) +++ trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2011-10-16 09:34:34 UTC (rev 9049) @@ -19,6 +19,7 @@ package net.sf.gridarta.model.io; +import java.awt.Point; import java.io.BufferedReader; import java.io.IOException; import java.util.ArrayList; @@ -281,12 +282,11 @@ } // do insertion for all non-head parts of the multi - final int posX = gameObject.getMapX(); - final int posY = gameObject.getMapY(); + final Point pos = gameObject.getMapLocation(); for (R oldPart = archetype.getMultiNext(); oldPart != null; oldPart = oldPart.getMultiNext()) { final G tailGameObject = gameObjectFactory.createGameObjectPart(oldPart, gameObject); - tailGameObject.setMapX(posX + oldPart.getMultiX()); - tailGameObject.setMapY(posY + oldPart.getMultiY()); + tailGameObject.setMapX(pos.x + oldPart.getMultiX()); + tailGameObject.setMapY(pos.y + oldPart.getMultiY()); objects.add(tailGameObject); } } Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/SavedSquares.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/SavedSquares.java 2011-10-16 08:05:59 UTC (rev 9048) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/SavedSquares.java 2011-10-16 09:34:34 UTC (rev 9049) @@ -212,11 +212,10 @@ for (final Iterable<G> square : col) { if (square != null) { for (final GameObject<G, A, R> gameObject : square) { - final int mapX = gameObject.getMapX(); - final int mapY = gameObject.getMapY(); + final Point map = gameObject.getMapLocation(); for (G tailGameObject = gameObject.getMultiNext(); tailGameObject != null; tailGameObject = tailGameObject.getMultiNext()) { - point2.x = mapX + tailGameObject.getArchetype().getMultiX(); - point2.y = mapY + tailGameObject.getArchetype().getMultiY(); + point2.x = map.x + tailGameObject.getArchetype().getMultiX(); + point2.y = map.y + tailGameObject.getArchetype().getMultiY(); final GameObjectContainer<G, A, R> mapSquare = mapModel.getMapSquare(point2); mapSquare.addLast(tailGameObject); } Modified: trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ErrorListView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ErrorListView.java 2011-10-16 08:05:59 UTC (rev 9048) +++ trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ErrorListView.java 2011-10-16 09:34:34 UTC (rev 9049) @@ -338,7 +338,7 @@ if (gameObjectIterator.hasNext()) { final G gameObject = gameObjectIterator.next(); final BaseObject<G, A, R, ?> topContainer = gameObject.getTopContainer(); - setMapCursorLocation(new Point(topContainer.getMapX(), topContainer.getMapY())); + setMapCursorLocation(topContainer.getMapLocation()); selectedSquareView.setSelectedGameObject(gameObject); } else { final Iterator<MapSquare<G, A, R>> mapSquareIterator = error.getMapSquares().iterator(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-16 09:36:06
|
Revision: 9050 http://gridarta.svn.sourceforge.net/gridarta/?rev=9050&view=rev Author: akirschbaum Date: 2011-10-16 09:35:59 +0000 (Sun, 16 Oct 2011) Log Message: ----------- Rename function names. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquare.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/BlockedSpawnPointChecker.java trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ErrorListView.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/MapSquareSelection.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareActions.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2011-10-16 09:34:34 UTC (rev 9049) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2011-10-16 09:35:59 UTC (rev 9050) @@ -230,7 +230,7 @@ final Point point = new Point(); for (int dx = -1; dx <= 1; dx++) { for (int dy = -1; dy <= dy + 1; dy++) { - mapSquare.getLocation(point, dx, dy); + mapSquare.getMapLocation(point, dx, dy); if (mapArchObject.isPointValid(point)) { toRepaint.add(mapModel.getMapSquare(point)); } @@ -401,7 +401,7 @@ * @param square the square to paint */ private void paintSquare(@NotNull final MapSquare<GameObject, MapArchObject, Archetype> square) { - final Point pos = square.getLocation(); + final Point pos = square.getMapLocation(); updateSquare(pos); repaint(0L, borderOffset.x + pos.x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + pos.y * IGUIConstants.SQUARE_HEIGHT, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2011-10-16 09:34:34 UTC (rev 9049) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2011-10-16 09:35:59 UTC (rev 9050) @@ -312,12 +312,12 @@ if (filterControl.canShow(node) && mapViewSettings.isEditType(node)) { paintGameObject(g, x, y, node); if (node.getAttributeInt(GameObject.SMOOTHLEVEL, true) > 0) { - smoothingRenderer.paintSmooth(g, square.getLocation(), node.getAttributeInt(GameObject.SMOOTHLEVEL, true), layer, false, borderOffsetX, borderOffsetY); + smoothingRenderer.paintSmooth(g, square.getMapLocation(), node.getAttributeInt(GameObject.SMOOTHLEVEL, true), layer, false, borderOffsetX, borderOffsetY); } } } if (layer > -1) { - smoothingRenderer.paintSmooth(g, square.getLocation(), 1, layer + 1, true, borderOffsetX, borderOffsetY); + smoothingRenderer.paintSmooth(g, square.getMapLocation(), 1, layer + 1, true, borderOffsetX, borderOffsetY); } } else { for (final GameObject node : square) { Modified: trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java 2011-10-16 09:34:34 UTC (rev 9049) +++ trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java 2011-10-16 09:35:59 UTC (rev 9050) @@ -92,7 +92,7 @@ continue; } } - mapModel.insertBaseObject(gameObject, mapSquare.getLocation(), false, false, insertionMode); + mapModel.insertBaseObject(gameObject, mapSquare.getMapLocation(), false, false, insertionMode); } } finally { mapModel.endTransaction(); @@ -113,7 +113,7 @@ final Point pos = new Point(); for (int dy = -1; dy < h + 1; dy++) { for (int dx = -1; dx < w + 1; dx++) { - topLeftMapSquare.getLocation(pos, dx, dy); + topLeftMapSquare.getMapLocation(pos, dx, dy); final MapSquare<G, A, R> mapSquare; try { mapSquare = mapModel.getMapSquare(pos); Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2011-10-16 09:34:34 UTC (rev 9049) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2011-10-16 09:35:59 UTC (rev 9050) @@ -671,7 +671,7 @@ gameObject.remove(); if (join) { - autojoinLists.joinDelete(this, mapSquare.getLocation(), gameObject.getArchetype()); + autojoinLists.joinDelete(this, mapSquare.getMapLocation(), gameObject.getArchetype()); } } } Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquare.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquare.java 2011-10-16 09:34:34 UTC (rev 9049) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquare.java 2011-10-16 09:35:59 UTC (rev 9050) @@ -102,7 +102,7 @@ * @return the coordinate on the map */ @NotNull - public Point getLocation() { + public Point getMapLocation() { return new Point(mapX, mapY); } @@ -110,7 +110,7 @@ * Returns the coordinate on the map. * @param pos returns the coordinate on the map */ - public void getLocation(@NotNull final Point pos) { + public void getMapLocation(@NotNull final Point pos) { pos.x = mapX; pos.y = mapY; } @@ -121,7 +121,7 @@ * @param dx the x offset to add to the coordinate * @param dy the y offset to add to the coordinate */ - public void getLocation(@NotNull final Point pos, final int dx, final int dy) { + public void getMapLocation(@NotNull final Point pos, final int dx, final int dy) { pos.x = mapX + dx; pos.y = mapY + dy; } Modified: trunk/model/src/app/net/sf/gridarta/model/validation/checks/BlockedSpawnPointChecker.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/checks/BlockedSpawnPointChecker.java 2011-10-16 09:34:34 UTC (rev 9049) +++ trunk/model/src/app/net/sf/gridarta/model/validation/checks/BlockedSpawnPointChecker.java 2011-10-16 09:35:59 UTC (rev 9050) @@ -95,7 +95,7 @@ final Point pos = new Point(); for (final MapSquare<G, A, R> mapSquare : mapModel) { for (final G gameObject : mapSquare) { - mapSquare.getLocation(pos); + mapSquare.getMapLocation(pos); checkSpawnPoint(gameObject, pos, blocked, errorCollector); for (final G invObject : gameObject.recursive()) { checkSpawnPoint(invObject, pos, blocked, errorCollector); Modified: trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java 2011-10-16 09:34:34 UTC (rev 9049) +++ trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java 2011-10-16 09:35:59 UTC (rev 9050) @@ -155,7 +155,7 @@ final Collection<G> gameObjectsToDelete = new HashSet<G>(); final Point pos = new Point(); for (final MapSquare<G, A, R> square : mapView.getSelectedSquares()) { - square.getLocation(pos, -selectedRec.x, -selectedRec.y); + square.getMapLocation(pos, -selectedRec.x, -selectedRec.y); for (final G gameObject : square) { copyMode.process(mapModel, gameObject, mapViewSettings.isEditType(gameObject), gameObjectsToDelete, pos, gameObjectFactory, insertionModeSet); } @@ -184,7 +184,7 @@ try { final Point pos = new Point(); for (final MapSquare<G, A, R> square : mapModel) { - square.getLocation(pos); + square.getMapLocation(pos); pos.translate(startLocation.x, startLocation.y); if (mapArchObject.isPointValid(pos)) { for (final BaseObject<G, A, R, ?> gameObject : square) { @@ -196,7 +196,7 @@ } for (final MapSquare<G, A, R> square : mapModel) { - square.getLocation(pos); + square.getMapLocation(pos); pos.translate(startLocation.x, startLocation.y); if (mapArchObject.isPointValid(pos)) { for (final BaseObject<G, A, R, ?> gameObject : square) { Modified: trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java 2011-10-16 09:34:34 UTC (rev 9049) +++ trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java 2011-10-16 09:35:59 UTC (rev 9050) @@ -822,7 +822,7 @@ throw new IllegalArgumentException(); } mapModel = mapSquare.getMapModel(); - mapPos = mapSquare.getLocation(); + mapPos = mapSquare.getMapLocation(); mapModel.addMapModelListener(mapModelListener); mapManager.addMapManagerListener(mapManagerListener); Modified: trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java 2011-10-16 09:34:34 UTC (rev 9049) +++ trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java 2011-10-16 09:35:59 UTC (rev 9050) @@ -511,9 +511,9 @@ } // insert replacement object if (randomArch.isMulti()) { - mapModel.insertBaseObject(randomArch, square.getLocation(), false, false, insertionModeSet.getTopmostInsertionMode()); + mapModel.insertBaseObject(randomArch, square.getMapLocation(), false, false, insertionModeSet.getTopmostInsertionMode()); } else { - mapModel.insertArchToMap(randomArch, prevArch, square.getLocation(), false); + mapModel.insertArchToMap(randomArch, prevArch, square.getMapLocation(), false); } } replaceCount++; Modified: trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ErrorListView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ErrorListView.java 2011-10-16 09:34:34 UTC (rev 9049) +++ trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ErrorListView.java 2011-10-16 09:35:59 UTC (rev 9050) @@ -344,7 +344,7 @@ final Iterator<MapSquare<G, A, R>> mapSquareIterator = error.getMapSquares().iterator(); if (mapSquareIterator.hasNext()) { final MapSquare<G, A, R> mapSquare = mapSquareIterator.next(); - setMapCursorLocation(mapSquare == null ? null : mapSquare.getLocation()); + setMapCursorLocation(mapSquare == null ? null : mapSquare.getMapLocation()); } } errorMsg.setCaretPosition(0); Modified: trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesControl.java 2011-10-16 09:34:34 UTC (rev 9049) +++ trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesControl.java 2011-10-16 09:35:59 UTC (rev 9050) @@ -604,7 +604,7 @@ final MapModel<G, A, R> mapModel = mapSquare.getMapModel(); mapModel.beginTransaction("Add to environment"); // TODO; I18N/L10N try { - final G insertedGameObject = mapModel.insertArchToMap(baseObject, prevGameObject, mapSquare.getLocation(), true); + final G insertedGameObject = mapModel.insertArchToMap(baseObject, prevGameObject, mapSquare.getMapLocation(), true); if (insertedGameObject != null) { mapModel.removeGameObject(prevGameObject, true); insertedGameObject.addLast(prevGameObject); Modified: trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/MapSquareSelection.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/MapSquareSelection.java 2011-10-16 09:34:34 UTC (rev 9049) +++ trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/MapSquareSelection.java 2011-10-16 09:35:59 UTC (rev 9050) @@ -115,7 +115,7 @@ */ public boolean validateMapSquare() { final MapSquare<G, A, R> currentMapSquare = mapSquare; // copy for concurrency reasons - return currentMapSquare != null && !mapView.getMapControl().getMapModel().getMapArchObject().isPointValid(currentMapSquare.getLocation()) && setMapSquare(null, null, 0); + return currentMapSquare != null && !mapView.getMapControl().getMapModel().getMapArchObject().isPointValid(currentMapSquare.getMapLocation()) && setMapSquare(null, null, 0); } /** Modified: trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareActions.java 2011-10-16 09:34:34 UTC (rev 9049) +++ trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareActions.java 2011-10-16 09:35:59 UTC (rev 9050) @@ -195,7 +195,7 @@ } final MapModel<G, A, R> mapModel = mapSquare.getMapModel(); - final Point pos = mapSquare.getLocation(); + final Point pos = mapSquare.getMapLocation(); if (!envGameObject.isInContainer() && gameObject.getArchetype().isMulti() && !mapModel.isMultiArchFittingToMap(gameObject.getArchetype(), pos, true)) { return false; } Modified: trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareView.java 2011-10-16 09:34:34 UTC (rev 9049) +++ trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareView.java 2011-10-16 09:35:59 UTC (rev 9050) @@ -728,7 +728,7 @@ final MapModel<G, A, R> mapModel = mapControl.getMapModel(); mapModel.beginTransaction("Insert"); // TODO; I18N/L10N try { - final G insertedGameObject = mapModel.insertArchToMap(baseObject, prevGameObject, mapSquare.getLocation(), true); + final G insertedGameObject = mapModel.insertArchToMap(baseObject, prevGameObject, mapSquare.getMapLocation(), true); if (insertedGameObject != null) { setSelectedGameObject(insertedGameObject); } Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2011-10-16 09:34:34 UTC (rev 9049) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2011-10-16 09:35:59 UTC (rev 9050) @@ -1328,7 +1328,7 @@ for (int dy = -1; dy <= 1; dy++) { for (int dx = -1; dx <= 1; dx++) { if (dx != 0 || dy != 0) { - mapSquare.getLocation(point, dx, dy); + mapSquare.getMapLocation(point, dx, dy); if (mapArchObject.isPointValid(point)) { final MapSquare<G, A, R> newMapSquare = mapModel.getMapSquare(point); if (newMapSquare.isEmpty() && !newSelection.containsKey(newMapSquare)) { @@ -1347,7 +1347,7 @@ try { mapGrid.unSelect(); for (final MapSquare<G, A, R> mapSquare : newSelection.keySet()) { - mapSquare.getLocation(point); + mapSquare.getMapLocation(point); mapGrid.select(point, SelectionMode.ADD); } } finally { @@ -1384,7 +1384,7 @@ for (final MapSquare<G, A, R> mapSquare : selectedSquares) { for (int dy = -1; dy <= 1; dy++) { for (int dx = -1; dx <= 1; dx++) { - mapSquare.getLocation(point, dx, dy); + mapSquare.getMapLocation(point, dx, dy); if (mapArchObject.isPointValid(point)) { mapGrid.select(point, SelectionMode.ADD); } @@ -1428,7 +1428,7 @@ for (int dy = -1; dy <= 1; dy++) { for (int dx = -1; dx <= 1; dx++) { if (dx != 0 || dy != 0) { - mapSquare.getLocation(point, dx, dy); + mapSquare.getMapLocation(point, dx, dy); if (mapArchObject.isPointValid(point) && (mapGrid.getFlags(point) & MapGrid.GRID_FLAG_SELECTION) == 0) { mapSquaresToShrink.put(mapSquare, null); break LOOP; @@ -1438,7 +1438,7 @@ } } for (final MapSquare<G, A, R> mapSquare : mapSquaresToShrink.keySet()) { - mapSquare.getLocation(point); + mapSquare.getMapLocation(point); mapGrid.select(point, SelectionMode.SUB); } } finally { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-18 07:57:00
|
Revision: 9057 http://gridarta.svn.sourceforge.net/gridarta/?rev=9057&view=rev Author: akirschbaum Date: 2011-10-18 07:56:53 +0000 (Tue, 18 Oct 2011) Log Message: ----------- Extract MpaModel.nextPoint() from MapActions. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapModel.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2011-10-18 07:33:28 UTC (rev 9056) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2011-10-18 07:56:53 UTC (rev 9057) @@ -1045,6 +1045,34 @@ } /** + * {@inheritDoc} + */ + @Override + public void nextPoint(final Point point, final int direction) { + final Size2D mapSize = mapArchObject.getMapSize(); + if (direction > 0) { + point.x++; + if (point.x >= mapSize.getWidth()) { + point.x = 0; + point.y++; + if (point.y >= mapSize.getHeight()) { + point.y = 0; + } + } + } else { + point.x--; + final int mapHeight = mapSize.getHeight(); + if (point.x < 0) { + point.x = mapSize.getWidth() - 1; + point.y--; + if (point.y < 0) { + point.y = mapSize.getHeight() - 1; + } + } + } + } + + /** * Marks the map as being modified. */ private void setModified() { Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapModel.java 2011-10-18 07:33:28 UTC (rev 9056) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapModel.java 2011-10-18 07:56:53 UTC (rev 9057) @@ -427,4 +427,11 @@ */ void facesReloaded(); + /** + * Moves the given point forward or backward one map square. + * @param point the point to start with and modify + * @param direction the direction (<code>-1</code> or <code>+1</code>) + */ + void nextPoint(Point point, int direction); + } // interface MapModel Modified: trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java 2011-10-18 07:33:28 UTC (rev 9056) +++ trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java 2011-10-18 07:56:53 UTC (rev 9057) @@ -582,26 +582,7 @@ final Point point = new Point(xStart, yStart); final G currentExit = exitMatcher.getValidExit(mapModel, point); for (int i = width * height; i > 0; i--) { - if (direction > 0) { - point.x++; - if (point.x >= width) { - point.x = 0; - point.y++; - if (point.y >= height) { - point.y = 0; - } - } - } else { - point.x--; - if (point.x < 0) { - point.x = width - 1; - point.y--; - if (point.y < 0) { - point.y = height - 1; - } - } - } - + mapModel.nextPoint(point, direction); final G exit = exitMatcher.getValidExit(mapModel, point); if (exit != null && exit != currentExit) { mapView.setCursorLocation(point); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-18 16:44:30
|
Revision: 9059 http://gridarta.svn.sourceforge.net/gridarta/?rev=9059&view=rev Author: akirschbaum Date: 2011-10-18 16:44:23 +0000 (Tue, 18 Oct 2011) Log Message: ----------- Fix Next Exit not finding all exits. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/map/mapview/AbstractMapView.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-10-18 07:58:17 UTC (rev 9058) +++ trunk/atrinik/ChangeLog 2011-10-18 16:44:23 UTC (rev 9059) @@ -1,3 +1,7 @@ +2011-10-18 Andreas Kirschbaum + + * Fix Next Exit not finding all exits. + 2011-09-22 Andreas Kirschbaum * Remove "Exits" panel from main window. It is redundant with Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2011-10-18 07:58:17 UTC (rev 9058) +++ trunk/crossfire/ChangeLog 2011-10-18 16:44:23 UTC (rev 9059) @@ -1,3 +1,7 @@ +2011-10-18 Andreas Kirschbaum + + * Fix Next Exit not finding all exits. + 2011-09-22 Andreas Kirschbaum * Remove "Exits" panel from main window. It is redundant with Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2011-10-18 07:58:17 UTC (rev 9058) +++ trunk/daimonin/ChangeLog 2011-10-18 16:44:23 UTC (rev 9059) @@ -1,3 +1,7 @@ +2011-10-18 Andreas Kirschbaum + + * Fix Next Exit not finding all exits. + 2011-09-22 Andreas Kirschbaum * Remove "Exits" panel from main window. It is redundant with Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/AbstractMapView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/AbstractMapView.java 2011-10-18 07:58:17 UTC (rev 9058) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/AbstractMapView.java 2011-10-18 16:44:23 UTC (rev 9059) @@ -152,8 +152,8 @@ } else if (point.x < 0) { point.x = 0; } - if (point.x >= mapSize.getHeight()) { - point.x = mapSize.getHeight() - 1; + if (point.y >= mapSize.getHeight()) { + point.y = mapSize.getHeight() - 1; } else if (point.y < 0) { point.y = 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-19 06:39:05
|
Revision: 9067 http://gridarta.svn.sourceforge.net/gridarta/?rev=9067&view=rev Author: akirschbaum Date: 2011-10-19 06:38:58 +0000 (Wed, 19 Oct 2011) Log Message: ----------- Merge duplicated code. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/exitconnector/ExitMatcher.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquareIterator.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/TopLevelGameObjectIterator.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/MapSquareIteratorTest.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TopLevelGameObjectIteratorTest.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java Modified: trunk/model/src/app/net/sf/gridarta/model/exitconnector/ExitMatcher.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/exitconnector/ExitMatcher.java 2011-10-19 06:14:11 UTC (rev 9066) +++ trunk/model/src/app/net/sf/gridarta/model/exitconnector/ExitMatcher.java 2011-10-19 06:38:58 UTC (rev 9067) @@ -33,9 +33,14 @@ * Selects valid exit game objects from maps. * @author Andreas Kirschbaum */ -public class ExitMatcher<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { +public class ExitMatcher<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements GameObjectMatcher { /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** * The matcher for selecting exit objects. */ @NotNull @@ -144,8 +149,16 @@ * @param gameObject the exit game object * @return whether the game object has "slaying" set */ - private boolean isExit(@NotNull final GameObject<G, A, R> gameObject) { + private boolean isExit(@NotNull final GameObject<?, ?, ?> gameObject) { return exitMatcher.isMatching(gameObject); } + /** + * {@inheritDoc} + */ + @Override + public boolean isMatching(@NotNull final GameObject<?, ?, ?> gameObject) { + return isExit(gameObject); + } + } // class ExitMatcher Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2011-10-19 06:14:11 UTC (rev 9066) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2011-10-19 06:38:58 UTC (rev 9067) @@ -263,7 +263,7 @@ */ @Override public Iterator<MapSquare<G, A, R>> iterator() { - return new MapSquareIterator<G, A, R>(this, null, 1); + return new MapSquareIterator<G, A, R>(this, null, 1, false); } /** Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquareIterator.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquareIterator.java 2011-10-19 06:14:11 UTC (rev 9066) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquareIterator.java 2011-10-19 06:38:58 UTC (rev 9067) @@ -76,8 +76,10 @@ * @param start the starting point or <code>null</code> for default * @param direction the direction to iterate: <code>+1</code> for forward, * <code>-1</code> for backward + * @param skipFirst whether to skip the first map square and return it at + * the end */ - public MapSquareIterator(@NotNull final MapModel<G, A, R> mapModel, @Nullable final Point start, final int direction) { + public MapSquareIterator(@NotNull final MapModel<G, A, R> mapModel, @Nullable final Point start, final int direction, final boolean skipFirst) { if (direction != -1 && direction != +1) { throw new IllegalArgumentException(); } @@ -94,6 +96,9 @@ point = mapWidth * mapHeight - 1; } remainingMapSquares = mapWidth * mapHeight; + if (skipFirst) { + nextMapSquare(); + } } /** @@ -123,13 +128,20 @@ remainingMapSquares--; final MapSquare<G, A, R> square = mapModel.getMapSquare(new Point(point % mapWidth, point / mapWidth)); + nextMapSquare(); + return square; + } + + /** + * Updates {@link #point} to the next map square. + */ + private void nextMapSquare() { point += direction; if (point < 0) { point += mapWidth * mapHeight; } else if (point >= mapWidth * mapHeight) { point -= mapWidth * mapHeight; } - return square; } } // class MapSquareIterator Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/TopLevelGameObjectIterator.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/TopLevelGameObjectIterator.java 2011-10-19 06:14:11 UTC (rev 9066) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/TopLevelGameObjectIterator.java 2011-10-19 06:38:58 UTC (rev 9067) @@ -61,9 +61,11 @@ * @param start the starting point or <code>null</code> for default * @param direction the direction to iterate: <code>+1</code> for forward, * <code>-1</code> for backward + * @param skipFirst whether to skip the first map square and return it at + * the end */ - public TopLevelGameObjectIterator(@NotNull final MapModel<G, A, R> mapModel, @Nullable final Point start, final int direction) { - mapSquareIterator = new MapSquareIterator<G, A, R>(mapModel, start, direction); + public TopLevelGameObjectIterator(@NotNull final MapModel<G, A, R> mapModel, @Nullable final Point start, final int direction, final boolean skipFirst) { + mapSquareIterator = new MapSquareIterator<G, A, R>(mapModel, start, direction, skipFirst); findNext(); } Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/MapSquareIteratorTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/MapSquareIteratorTest.java 2011-10-19 06:14:11 UTC (rev 9066) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/MapSquareIteratorTest.java 2011-10-19 06:38:58 UTC (rev 9067) @@ -40,7 +40,7 @@ public void testIteratorForward() { final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapModelCreator.newMapModel(3, 2); - final Iterator<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> it = new MapSquareIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, null, +1); + final Iterator<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> it = new MapSquareIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, null, +1, false); Assert.assertTrue(it.hasNext()); Assert.assertSame(mapModel.getMapSquare(new Point(0, 0)), it.next()); Assert.assertTrue(it.hasNext()); @@ -63,7 +63,7 @@ public void testIteratorBackward() { final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapModelCreator.newMapModel(3, 2); - final Iterator<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> it = new MapSquareIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, null, -1); + final Iterator<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> it = new MapSquareIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, null, -1, false); Assert.assertTrue(it.hasNext()); Assert.assertSame(mapModel.getMapSquare(new Point(2, 1)), it.next()); Assert.assertTrue(it.hasNext()); @@ -86,7 +86,7 @@ public void testIteratorForwardStart() { final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapModelCreator.newMapModel(3, 2); - final Iterator<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> it = new MapSquareIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, new Point(0, 1), +1); + final Iterator<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> it = new MapSquareIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, new Point(0, 1), +1, false); Assert.assertTrue(it.hasNext()); Assert.assertSame(mapModel.getMapSquare(new Point(0, 1)), it.next()); Assert.assertTrue(it.hasNext()); @@ -109,7 +109,7 @@ public void testIteratorBackwardStart() { final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapModelCreator.newMapModel(3, 2); - final Iterator<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> it = new MapSquareIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, new Point(0, 1), -1); + final Iterator<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> it = new MapSquareIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, new Point(0, 1), -1, false); Assert.assertTrue(it.hasNext()); Assert.assertSame(mapModel.getMapSquare(new Point(0, 1)), it.next()); Assert.assertTrue(it.hasNext()); @@ -126,13 +126,61 @@ } /** + * Checks that the forward iterator returns all map squares when skip is + * enabled. + */ + @Test + public void testIteratorForwardStartSkip() { + final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); + final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapModelCreator.newMapModel(3, 2); + final Iterator<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> it = new MapSquareIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, new Point(0, 1), +1, true); + Assert.assertTrue(it.hasNext()); + Assert.assertSame(mapModel.getMapSquare(new Point(1, 1)), it.next()); + Assert.assertTrue(it.hasNext()); + Assert.assertSame(mapModel.getMapSquare(new Point(2, 1)), it.next()); + Assert.assertTrue(it.hasNext()); + Assert.assertSame(mapModel.getMapSquare(new Point(0, 0)), it.next()); + Assert.assertTrue(it.hasNext()); + Assert.assertSame(mapModel.getMapSquare(new Point(1, 0)), it.next()); + Assert.assertTrue(it.hasNext()); + Assert.assertSame(mapModel.getMapSquare(new Point(2, 0)), it.next()); + Assert.assertTrue(it.hasNext()); + Assert.assertSame(mapModel.getMapSquare(new Point(0, 1)), it.next()); + Assert.assertFalse(it.hasNext()); + } + + /** + * Checks that the backward iterator returns all map squares when skip is + * enabled. + */ + @Test + public void testIteratorBackwardStartSkip() { + final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); + final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapModelCreator.newMapModel(3, 2); + final Iterator<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> it = new MapSquareIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, new Point(0, 1), -1, true); + Assert.assertTrue(it.hasNext()); + Assert.assertSame(mapModel.getMapSquare(new Point(2, 0)), it.next()); + Assert.assertTrue(it.hasNext()); + Assert.assertSame(mapModel.getMapSquare(new Point(1, 0)), it.next()); + Assert.assertTrue(it.hasNext()); + Assert.assertSame(mapModel.getMapSquare(new Point(0, 0)), it.next()); + Assert.assertTrue(it.hasNext()); + Assert.assertSame(mapModel.getMapSquare(new Point(2, 1)), it.next()); + Assert.assertTrue(it.hasNext()); + Assert.assertSame(mapModel.getMapSquare(new Point(1, 1)), it.next()); + Assert.assertTrue(it.hasNext()); + Assert.assertSame(mapModel.getMapSquare(new Point(0, 1)), it.next()); + Assert.assertFalse(it.hasNext()); + } + + /** * Checks that invalid directions are rejected. */ @Test(expected = IllegalArgumentException.class) public void testIteratorDirection0() { final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapModelCreator.newMapModel(3, 2); - final Iterator<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> it = new MapSquareIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, null, 0); + final Iterator<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> it = new MapSquareIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, null, 0, false); } /** @@ -142,7 +190,7 @@ public void testIteratorDirection2() { final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapModelCreator.newMapModel(3, 2); - final Iterator<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> it = new MapSquareIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, null, 2); + final Iterator<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> it = new MapSquareIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, null, 2, false); } } Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/TopLevelGameObjectIteratorTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/TopLevelGameObjectIteratorTest.java 2011-10-19 06:14:11 UTC (rev 9066) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/TopLevelGameObjectIteratorTest.java 2011-10-19 06:38:58 UTC (rev 9067) @@ -41,7 +41,7 @@ public void testIteratorForwardEmpty() { final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapModelCreator.newMapModel(3, 2); - final Iterator<TestGameObject> it = new TopLevelGameObjectIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, new Point(1, 1), +1); + final Iterator<TestGameObject> it = new TopLevelGameObjectIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, new Point(1, 1), +1, false); Assert.assertFalse(it.hasNext()); } @@ -52,7 +52,7 @@ public void testIteratorBackwardEmpty() { final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapModelCreator.newMapModel(3, 2); - final Iterator<TestGameObject> it = new TopLevelGameObjectIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, new Point(1, 1), -1); + final Iterator<TestGameObject> it = new TopLevelGameObjectIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, new Point(1, 1), -1, false); Assert.assertFalse(it.hasNext()); } @@ -62,7 +62,7 @@ @Test public void testIteratorForward() { final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = createMap(); - final Iterator<TestGameObject> it = new TopLevelGameObjectIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, new Point(1, 1), +1); + final Iterator<TestGameObject> it = new TopLevelGameObjectIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, new Point(1, 1), +1, false); Assert.assertTrue(it.hasNext()); Assert.assertEquals("n4", it.next().getBestName()); Assert.assertTrue(it.hasNext()); @@ -82,7 +82,7 @@ @Test public void testIteratorBackward() { final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = createMap(); - final Iterator<TestGameObject> it = new TopLevelGameObjectIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, new Point(1, 1), -1); + final Iterator<TestGameObject> it = new TopLevelGameObjectIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, new Point(1, 1), -1, false); Assert.assertTrue(it.hasNext()); Assert.assertEquals("n4", it.next().getBestName()); Assert.assertTrue(it.hasNext()); @@ -97,6 +97,46 @@ } /** + * Checks the forward iterator with skipped first element. + */ + @Test + public void testIteratorForwardSkip() { + final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = createMap(); + final Iterator<TestGameObject> it = new TopLevelGameObjectIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, new Point(1, 1), +1, true); + Assert.assertTrue(it.hasNext()); + Assert.assertEquals("n5", it.next().getBestName()); + Assert.assertTrue(it.hasNext()); + Assert.assertEquals("n1", it.next().getBestName()); + Assert.assertTrue(it.hasNext()); + Assert.assertEquals("n2", it.next().getBestName()); + Assert.assertTrue(it.hasNext()); + Assert.assertEquals("n3", it.next().getBestName()); + Assert.assertTrue(it.hasNext()); + Assert.assertEquals("n4", it.next().getBestName()); + Assert.assertFalse(it.hasNext()); + } + + /** + * Checks the backward iterator with skipped first element. + */ + @Test + public void testIteratorBackwardSkip() { + final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = createMap(); + final Iterator<TestGameObject> it = new TopLevelGameObjectIterator<TestGameObject, TestMapArchObject, TestArchetype>(mapModel, new Point(1, 1), -1, true); + Assert.assertTrue(it.hasNext()); + Assert.assertEquals("n3", it.next().getBestName()); + Assert.assertTrue(it.hasNext()); + Assert.assertEquals("n1", it.next().getBestName()); + Assert.assertTrue(it.hasNext()); + Assert.assertEquals("n2", it.next().getBestName()); + Assert.assertTrue(it.hasNext()); + Assert.assertEquals("n5", it.next().getBestName()); + Assert.assertTrue(it.hasNext()); + Assert.assertEquals("n4", it.next().getBestName()); + Assert.assertFalse(it.hasNext()); + } + + /** * Creates a new {@link MapModel} instance filled with game objects. * @return the new map model instance */ Modified: trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java 2011-10-19 06:14:11 UTC (rev 9066) +++ trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java 2011-10-19 06:38:58 UTC (rev 9067) @@ -23,6 +23,7 @@ import java.io.File; import java.util.ArrayList; import java.util.Collection; +import java.util.Iterator; import javax.swing.Action; import javax.swing.JFrame; import javax.swing.filechooser.FileFilter; @@ -44,8 +45,10 @@ import net.sf.gridarta.model.mapcursor.MapCursorListener; import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmanager.MapManagerListener; +import net.sf.gridarta.model.mapmodel.FilterGameObjectIterator; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mapmodel.MapSquare; +import net.sf.gridarta.model.mapmodel.TopLevelGameObjectIterator; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.mapviewsettings.MapViewSettingsListener; import net.sf.gridarta.utils.ActionUtils; @@ -571,13 +574,11 @@ /** * Selects an exit square. * @param mapView the map view to operate on - * @param xStart the x-coordinate to start searching - * @param yStart the y-coordinate to start searching * @param direction the direction to search */ - private void selectExit(@NotNull final MapView<G, A, R> mapView, final int xStart, final int yStart, final int direction) { - final MapModel<G, A, R> mapModel = mapView.getMapControl().getMapModel(); - final ExitIterator<G, A, R> exitIterator = new ExitIterator<G, A, R>(exitMatcher, mapModel, xStart, yStart, direction); + private void selectExit(@NotNull final MapView<G, A, R> mapView, final int direction) { + final TopLevelGameObjectIterator<G, A, R> gameObjectIterator = new TopLevelGameObjectIterator<G, A, R>(mapView.getMapControl().getMapModel(), mapView.getMapCursor().getLocation(), direction, true); + final Iterator<G> exitIterator = new FilterGameObjectIterator<G, A, R>(gameObjectIterator, exitMatcher); if (exitIterator.hasNext()) { final G exit = exitIterator.next(); final MapSquare<G, A, R> mapSquare = exit.getMapSquare(); @@ -852,12 +853,7 @@ } if (performAction) { - final Point cursorLocation = mapView.getMapCursor().getLocation(); - if (cursorLocation == null) { - selectExit(mapView, -1, 0, 1); - } else { - selectExit(mapView, cursorLocation.x, cursorLocation.y, 1); - } + selectExit(mapView, 1); } return true; @@ -875,13 +871,7 @@ } if (performAction) { - final Point cursorLocation = mapView.getMapCursor().getLocation(); - if (cursorLocation == null) { - final Size2D mapSize = mapView.getMapControl().getMapModel().getMapArchObject().getMapSize(); - selectExit(mapView, mapSize.getWidth(), mapSize.getHeight() - 1, -1); - } else { - selectExit(mapView, cursorLocation.x, cursorLocation.y, -1); - } + selectExit(mapView, -1); } return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-10-23 21:18:10
|
Revision: 9070 http://gridarta.svn.sourceforge.net/gridarta/?rev=9070&view=rev Author: akirschbaum Date: 2011-10-23 21:18:03 +0000 (Sun, 23 Oct 2011) Log Message: ----------- Remove MapCursorEvent. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursor.java trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursorListener.java trunk/model/src/test/net/sf/gridarta/model/mapcursor/MapCursorTest.java trunk/src/app/net/sf/gridarta/gui/exitconnector/ExitConnectorController.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapCursorTracker.java trunk/src/app/net/sf/gridarta/gui/mapcursor/MapCursorActions.java trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java trunk/src/app/net/sf/gridarta/gui/panel/objectchooser/DefaultObjectChooser.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java Removed Paths: ------------- trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursorEvent.java Modified: trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursor.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursor.java 2011-10-23 21:15:06 UTC (rev 9069) +++ trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursor.java 2011-10-23 21:18:03 UTC (rev 9070) @@ -36,7 +36,7 @@ * a {@link MapGrid} which will change it flags depending on MapCursor * movement/selection. <p/> There are three different states for MapCursor: <ul> * <li>Deactivated</li> <li>On the map</li> <li>Dragging</li> </ul> When - * coordinates or state of MapCursor changes a {@link MapCursorEvent} is fired. + * coordinates or state of MapCursor changes an event is fired. * @author <a href="mailto:dlv...@gm...">Daniel Viegas</a> */ public class MapCursor { @@ -390,9 +390,8 @@ * Inform all registered listeners that the MapCursor's mode has changed. */ private void fireMapCursorChangedModeEvent() { - final MapCursorEvent e = new MapCursorEvent(this); for (final MapCursorListener listener : listenerList.getListeners()) { - listener.mapCursorChangedMode(e); + listener.mapCursorChangedMode(); } } @@ -401,9 +400,8 @@ * changed. */ private void fireMapCursorChangedPosEvent() { - final MapCursorEvent e = new MapCursorEvent(this); for (final MapCursorListener listener : listenerList.getListeners()) { - listener.mapCursorChangedPos(e); + listener.mapCursorChangedPos(getLocation()); } } Deleted: trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursorEvent.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursorEvent.java 2011-10-23 21:15:06 UTC (rev 9069) +++ trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursorEvent.java 2011-10-23 21:18:03 UTC (rev 9070) @@ -1,54 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 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.model.mapcursor; - -import java.util.EventObject; -import org.jetbrains.annotations.NotNull; - -/** - * This Event is created by {@link MapCursor}. - * @author <a href="mailto:dlv...@gm...">Daniel Viegas</a> - */ -public class MapCursorEvent extends EventObject { - - /** - * The serial version UID. - */ - private static final long serialVersionUID = 1L; - - /** - * Constructs a MapCursorEvent. - * @param source The object on which the Event initially occurred. - * @throws IllegalArgumentException if source is null. - */ - public MapCursorEvent(@NotNull final MapCursor source) { - super(source); - } - - /** - * {@inheritDoc} - */ - @Override - @NotNull - public MapCursor getSource() { - return (MapCursor) super.getSource(); - } - -} // class MapCursorEvent Modified: trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursorListener.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursorListener.java 2011-10-23 21:15:06 UTC (rev 9069) +++ trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursorListener.java 2011-10-23 21:18:03 UTC (rev 9070) @@ -19,11 +19,12 @@ package net.sf.gridarta.model.mapcursor; +import java.awt.Point; import java.util.EventListener; -import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** - * Interface for listeners listening to {@link MapCursorEvent MapCursorEvents}. + * Interface for listeners listening to {@link MapCursor} related events. * @author <a href="mailto:dlv...@gm...">Daniel Viegas</a> */ public interface MapCursorListener extends EventListener { @@ -31,15 +32,15 @@ /** * This event handler is called when {@link MapCursor} has moved, appeared * or disappeared. - * @param e MapCursorEvent + * @param location the new location or <code>null</code> if the cursor + * disappeared */ - void mapCursorChangedPos(@NotNull MapCursorEvent e); + void mapCursorChangedPos(@Nullable Point location); /** * This event handler is called when {@link MapCursor} changes mode (drag, * select). - * @param e MapCursorEvent */ - void mapCursorChangedMode(@NotNull MapCursorEvent e); + void mapCursorChangedMode(); } // interface MapCursorListener Modified: trunk/model/src/test/net/sf/gridarta/model/mapcursor/MapCursorTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapcursor/MapCursorTest.java 2011-10-23 21:15:06 UTC (rev 9069) +++ trunk/model/src/test/net/sf/gridarta/model/mapcursor/MapCursorTest.java 2011-10-23 21:18:03 UTC (rev 9070) @@ -27,6 +27,7 @@ import net.sf.gridarta.model.mapgrid.SelectionMode; import net.sf.gridarta.utils.Size2D; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.junit.Assert; import org.junit.Test; @@ -473,12 +474,12 @@ private static class TestMapCursorListener implements MapCursorListener { /** - * The number of calls to {@link #mapCursorChangedPos(MapCursorEvent)}. + * The number of calls to {@link #mapCursorChangedPos(Point)}. */ private int changedPosCounter = 0; /** - * The number of calls to {@link #mapCursorChangedMode(MapCursorEvent)}. + * The number of calls to {@link #mapCursorChangedMode()}. */ private int changedModeCounter = 0; @@ -486,7 +487,7 @@ * {@inheritDoc} */ @Override - public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { + public void mapCursorChangedPos(@Nullable final Point location) { changedPosCounter++; } @@ -494,7 +495,7 @@ * {@inheritDoc} */ @Override - public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { + public void mapCursorChangedMode() { changedModeCounter++; } Modified: trunk/src/app/net/sf/gridarta/gui/exitconnector/ExitConnectorController.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/exitconnector/ExitConnectorController.java 2011-10-23 21:15:06 UTC (rev 9069) +++ trunk/src/app/net/sf/gridarta/gui/exitconnector/ExitConnectorController.java 2011-10-23 21:18:03 UTC (rev 9070) @@ -31,7 +31,6 @@ import net.sf.gridarta.model.exitconnector.ExitLocation; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.mapcursor.MapCursorEvent; import net.sf.gridarta.model.mapcursor.MapCursorListener; import net.sf.gridarta.utils.ActionUtils; import net.sf.japi.swing.action.ActionBuilder; @@ -149,13 +148,13 @@ /** {@inheritDoc} */ @Override - public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { + public void mapCursorChangedPos(@Nullable final Point location) { // ignore } /** {@inheritDoc} */ @Override - public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { + public void mapCursorChangedMode() { refreshActions(); } Modified: trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java 2011-10-23 21:15:06 UTC (rev 9069) +++ trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java 2011-10-23 21:18:03 UTC (rev 9070) @@ -41,7 +41,6 @@ import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.maparchobject.MapArchObjectListener; import net.sf.gridarta.model.mapcontrol.MapControl; -import net.sf.gridarta.model.mapcursor.MapCursorEvent; import net.sf.gridarta.model.mapcursor.MapCursorListener; import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmanager.MapManagerListener; @@ -350,13 +349,13 @@ /** {@inheritDoc} */ @Override - public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { + public void mapCursorChangedPos(@Nullable final Point location) { updateActions(); } /** {@inheritDoc} */ @Override - public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { + public void mapCursorChangedMode() { // ignore } Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/MapCursorTracker.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/MapCursorTracker.java 2011-10-23 21:15:06 UTC (rev 9069) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/MapCursorTracker.java 2011-10-23 21:18:03 UTC (rev 9070) @@ -28,7 +28,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcursor.MapCursor; -import net.sf.gridarta.model.mapcursor.MapCursorEvent; import net.sf.gridarta.model.mapcursor.MapCursorListener; import net.sf.gridarta.utils.CommonConstants; import org.jetbrains.annotations.NotNull; @@ -68,13 +67,13 @@ /** {@inheritDoc} */ @Override - public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { + public void mapCursorChangedPos(@Nullable final Point location) { ensureVisibleMapCursor(); } /** {@inheritDoc} */ @Override - public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { + public void mapCursorChangedMode() { // Ignore mode change events } Modified: trunk/src/app/net/sf/gridarta/gui/mapcursor/MapCursorActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapcursor/MapCursorActions.java 2011-10-23 21:15:06 UTC (rev 9069) +++ trunk/src/app/net/sf/gridarta/gui/mapcursor/MapCursorActions.java 2011-10-23 21:18:03 UTC (rev 9070) @@ -35,7 +35,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcursor.MapCursor; -import net.sf.gridarta.model.mapcursor.MapCursorEvent; import net.sf.gridarta.model.mapcursor.MapCursorListener; import net.sf.gridarta.model.mapgrid.SelectionMode; import net.sf.gridarta.utils.ActionUtils; @@ -191,13 +190,13 @@ /** {@inheritDoc} */ @Override - public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { + public void mapCursorChangedPos(@Nullable final Point location) { // ignore } /** {@inheritDoc} */ @Override - public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { + public void mapCursorChangedMode() { refreshActions(); } Modified: trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java 2011-10-23 21:15:06 UTC (rev 9069) +++ trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java 2011-10-23 21:18:03 UTC (rev 9070) @@ -46,7 +46,6 @@ import net.sf.gridarta.model.mapcontrol.MapControl; import net.sf.gridarta.model.mapcontrol.MapControlListener; import net.sf.gridarta.model.mapcursor.MapCursor; -import net.sf.gridarta.model.mapcursor.MapCursorEvent; import net.sf.gridarta.model.mapcursor.MapCursorListener; import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmanager.MapManagerListener; @@ -134,14 +133,14 @@ /** {@inheritDoc} */ @Override - public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { - mapCursorChanged(e.getSource()); + public void mapCursorChangedPos(@Nullable final Point location) { + mapCursorChanged(mapView == null ? null : mapView.getMapCursor()); } /** {@inheritDoc} */ @Override - public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { - mapCursorChanged(e.getSource()); + public void mapCursorChangedMode() { + mapCursorChanged(mapView == null ? null : mapView.getMapCursor()); } }; Modified: trunk/src/app/net/sf/gridarta/gui/panel/objectchooser/DefaultObjectChooser.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/objectchooser/DefaultObjectChooser.java 2011-10-23 21:15:06 UTC (rev 9069) +++ trunk/src/app/net/sf/gridarta/gui/panel/objectchooser/DefaultObjectChooser.java 2011-10-23 21:18:03 UTC (rev 9070) @@ -46,7 +46,6 @@ import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; import net.sf.gridarta.model.mapcursor.MapCursor; -import net.sf.gridarta.model.mapcursor.MapCursorEvent; import net.sf.gridarta.model.mapcursor.MapCursorListener; import net.sf.gridarta.model.mapmodel.MapModel; import org.jetbrains.annotations.NotNull; @@ -133,14 +132,14 @@ /** {@inheritDoc} */ @Override - public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { - updatePickmapInfo(e.getSource()); + public void mapCursorChangedPos(@Nullable final Point location) { + updatePickmapInfo(activePickmapView == null ? null : activePickmapView.getMapCursor()); } /** {@inheritDoc} */ @Override - public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { - updatePickmapInfo(e.getSource()); + public void mapCursorChangedMode() { + updatePickmapInfo(activePickmapView == null ? null : activePickmapView.getMapCursor()); } }; Modified: trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareView.java 2011-10-23 21:15:06 UTC (rev 9069) +++ trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareView.java 2011-10-23 21:18:03 UTC (rev 9070) @@ -63,7 +63,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; -import net.sf.gridarta.model.mapcursor.MapCursorEvent; import net.sf.gridarta.model.mapcursor.MapCursorListener; import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmanager.MapManagerListener; @@ -347,7 +346,7 @@ /** {@inheritDoc} */ @Override - public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { + public void mapCursorChangedPos(@Nullable final Point location) { final MapView<G, A, R> mapView = selectedSquareModel.getCurrentMapView(); if (mapView == null) { return; @@ -355,15 +354,14 @@ final MapControl<G, A, R> mapControl = mapView.getMapControl(); - final Point cursorPos = e.getSource().getLocation(); - if (cursorPos == null || !mapControl.getMapModel().getMapArchObject().isPointValid(cursorPos)) { + if (location == null || !mapControl.getMapModel().getMapArchObject().isPointValid(location)) { if (selectedSquareModel.setSelectedMapSquare(null, null, 0)) { refresh(); } return; } - final MapSquare<G, A, R> mapSquare = mapControl.getMapModel().getMapSquare(cursorPos); + final MapSquare<G, A, R> mapSquare = mapControl.getMapModel().getMapSquare(location); if (selectedSquareModel.setSelectedMapSquare(mapSquare, null, 0)) { refresh(); } @@ -371,7 +369,7 @@ /** {@inheritDoc} */ @Override - public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { + public void mapCursorChangedMode() { // ignore } Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2011-10-23 21:15:06 UTC (rev 9069) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2011-10-23 21:18:03 UTC (rev 9070) @@ -47,7 +47,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; -import net.sf.gridarta.model.mapcursor.MapCursorEvent; import net.sf.gridarta.model.mapcursor.MapCursorListener; import net.sf.gridarta.model.mapgrid.MapGrid; import net.sf.gridarta.model.mapgrid.MapGridEvent; @@ -391,13 +390,13 @@ /** {@inheritDoc} */ @Override - public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { + public void mapCursorChangedPos(@Nullable final Point location) { // ignore } /** {@inheritDoc} */ @Override - public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { + public void mapCursorChangedMode() { refreshMenus(); // cursor may have been activated or deactivated } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |