From: <chr...@us...> - 2006-05-22 00:23:15
|
Revision: 6 Author: christianhujer Date: 2006-05-21 17:20:53 -0700 (Sun, 21 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=6&view=rev Log Message: ----------- Adding project frame. Added Paths: ----------- trunk/COPYING trunk/CREDITS trunk/FAQ trunk/INSTALL trunk/LICENSE trunk/NEWS trunk/README trunk/build.xml trunk/lib/ trunk/lib/LICENSE-Pack200Task.jar trunk/lib/LICENSE-antmeat.jar trunk/lib/LICENSE-java2html.jar trunk/lib/LICENSE-svnClientAdapter.jar trunk/lib/LICENSE-svnant.jar trunk/lib/Pack200Task.jar trunk/lib/antmeat.jar trunk/lib/java2html.jar trunk/lib/svnClientAdapter.jar trunk/lib/svnant.jar trunk/src/ trunk/src/app/ trunk/src/app/net/ trunk/src/app/net/sf/ trunk/src/app/net/sf/gridarta/ trunk/src/doc/ trunk/src/doc/.htaccess trunk/src/doc/cleanupXhtml11.xslt trunk/src/doc/dtd/ trunk/src/doc/dtd/catalogForAnt.xml trunk/src/doc/dtd/xhtml-applet-1.mod trunk/src/doc/dtd/xhtml-arch-1.mod trunk/src/doc/dtd/xhtml-attribs-1.mod trunk/src/doc/dtd/xhtml-base-1.mod trunk/src/doc/dtd/xhtml-basic-form-1.mod trunk/src/doc/dtd/xhtml-basic-table-1.mod trunk/src/doc/dtd/xhtml-bdo-1.mod trunk/src/doc/dtd/xhtml-blkphras-1.mod trunk/src/doc/dtd/xhtml-blkpres-1.mod trunk/src/doc/dtd/xhtml-blkstruct-1.mod trunk/src/doc/dtd/xhtml-charent-1.mod trunk/src/doc/dtd/xhtml-csismap-1.mod trunk/src/doc/dtd/xhtml-datatypes-1.mod trunk/src/doc/dtd/xhtml-edit-1.mod trunk/src/doc/dtd/xhtml-events-1.mod trunk/src/doc/dtd/xhtml-form-1.mod trunk/src/doc/dtd/xhtml-frames-1.mod trunk/src/doc/dtd/xhtml-framework-1.mod trunk/src/doc/dtd/xhtml-hypertext-1.mod trunk/src/doc/dtd/xhtml-iframe-1.mod trunk/src/doc/dtd/xhtml-image-1.mod trunk/src/doc/dtd/xhtml-inlphras-1.mod trunk/src/doc/dtd/xhtml-inlpres-1.mod trunk/src/doc/dtd/xhtml-inlstruct-1.mod trunk/src/doc/dtd/xhtml-inlstyle-1.mod trunk/src/doc/dtd/xhtml-lat1.ent trunk/src/doc/dtd/xhtml-legacy-1.mod trunk/src/doc/dtd/xhtml-link-1.mod trunk/src/doc/dtd/xhtml-list-1.mod trunk/src/doc/dtd/xhtml-meta-1.mod trunk/src/doc/dtd/xhtml-nameident-1.mod trunk/src/doc/dtd/xhtml-notations-1.mod trunk/src/doc/dtd/xhtml-object-1.mod trunk/src/doc/dtd/xhtml-param-1.mod trunk/src/doc/dtd/xhtml-pres-1.mod trunk/src/doc/dtd/xhtml-qname-1.mod trunk/src/doc/dtd/xhtml-ruby-1.mod trunk/src/doc/dtd/xhtml-script-1.mod trunk/src/doc/dtd/xhtml-special.ent trunk/src/doc/dtd/xhtml-ssismap-1.mod trunk/src/doc/dtd/xhtml-struct-1.mod trunk/src/doc/dtd/xhtml-style-1.mod trunk/src/doc/dtd/xhtml-symbol.ent trunk/src/doc/dtd/xhtml-table-1.mod trunk/src/doc/dtd/xhtml-target-1.mod trunk/src/doc/dtd/xhtml-text-1.mod trunk/src/doc/dtd/xhtml-xinclude10-1.mod trunk/src/doc/dtd/xhtml11-flat.dtd trunk/src/doc/dtd/xhtml11-model-1.mod trunk/src/doc/dtd/xhtml11.dtd trunk/src/doc/dtd/xhtml11_xinclude10-model-1.mod trunk/src/doc/dtd/xhtml11_xinclude10.dtd trunk/src/doc/start.xhtml trunk/src/doc/status404.xhtml trunk/src/doc/transform.xslt trunk/src/doc/xhtml2html.xslt trunk/src/test/ trunk/src/test/net/ trunk/src/test/net/sf/ trunk/src/test/net/sf/gridarta/ Added: trunk/COPYING =================================================================== --- trunk/COPYING (rev 0) +++ trunk/COPYING 2006-05-22 00:20:53 UTC (rev 6) @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + 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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Property changes on: trunk/COPYING ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/CREDITS =================================================================== --- trunk/CREDITS (rev 0) +++ trunk/CREDITS 2006-05-22 00:20:53 UTC (rev 6) @@ -0,0 +1,27 @@ +The following people have contributed to Gridarta: + +* Pasi Keränen + He created Gridder, out of which Michhael Tönnis created CFJavaEditor. + +* Michael Tönnis <in...@da...> + He created CFJavaEditor and DaimoninEditor. + +* Andreas Vogel <av...@us...> + He did a lot of work adding new features to CFJavaEditor + +* Christian Hujer <ch...@ri...> + He maintained DaimoninEditor from 2005-2006, creator of Gridarta. + +* Daniel Viegas <der...@us...> + Added many new features. + +* Andreas Kirschbaum <aki...@us...> + Added many new features. + + +Gridarta wouldn't exist without the following projects: + +* Gridder, a simple 2D grid based game map editor. http://www.gamedev.net/hosted/javanerd/gridder.asp +* Crossfire, a 2D MMORPG. http://crossfire.real-time.com/ +* Daimonin, a 2D MMORPG, branch of Crossfire. http://www.daimonin.net/ +* JAPI, a library for improved Java software development. http://japi.sourceforge.net/ Property changes on: trunk/CREDITS ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/FAQ =================================================================== --- trunk/FAQ (rev 0) +++ trunk/FAQ 2006-05-22 00:20:53 UTC (rev 6) @@ -0,0 +1,4 @@ +FAQ +--- + +No faq yet. Property changes on: trunk/FAQ ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/INSTALL =================================================================== --- trunk/INSTALL (rev 0) +++ trunk/INSTALL 2006-05-22 00:20:53 UTC (rev 6) @@ -0,0 +1,27 @@ +BUILDING / INSTALLING GRIDARTA +============================== + + +Gridarta is a map editor for 2D MMORPGs, mainly Angelion, Crossfire, Crossfire+ +and Daimonin. + + +Build Requirements +------------------ +* Java 5.0 or newer +* Ant 1.6.5 or newer + + +Runtime Requirements +-------------------- +* Java 5.0 or newer + + +Howto Build +----------- +Change to the project root directory and run "ant". +To find out options about building Gridarta, run "ant -projecthelp". + +Howto Run +--------- +java -jar Gridarta.jar Property changes on: trunk/INSTALL ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/LICENSE =================================================================== --- trunk/LICENSE (rev 0) +++ trunk/LICENSE 2006-05-22 00:20:53 UTC (rev 6) @@ -0,0 +1,8 @@ +GRIDARTA LICENSE INFORMATION +------------------------ + +GRIDARTA is licensed under GPL. See file COPYING. + +GRIDARTA uses some third part libraries. These libraries are contained in the +lib/ directory and have their own licenses. See the corresponding +LICENSE-*-files in the lib/ directory for the licenses of third party libraries. Property changes on: trunk/LICENSE ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/NEWS =================================================================== --- trunk/NEWS (rev 0) +++ trunk/NEWS 2006-05-22 00:20:53 UTC (rev 6) @@ -0,0 +1,4 @@ +NEWS +---- + +Currently no news. Property changes on: trunk/NEWS ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/README =================================================================== --- trunk/README (rev 0) +++ trunk/README 2006-05-22 00:20:53 UTC (rev 6) @@ -0,0 +1,127 @@ +GRIDARTA README +=============== + +This file contains some important information about Gridarta. You should read it +first. + + +TABLE OF CONTENTS +----------------- +* project description +* project website +* system requirements +* file structure +* build / installation (see file INSTALL) +* maintainers / credits (see file CREDITS) +* project news (see file NEWS) +* mailing lists +* license information (see file LICENSE) + + +PROJECT DESCRIPTION +------------------- +Gridarta is a map editor for 2D MMORPGs. +The current target applications are: +* Angelion http://angelion.sric.com/ +* Crossfire http://crossfire.real-time.com/ +* Crossfire+ http://crossfire.schmorp.de/ +* Daimonin http://www.daimonin.net/ + + +PROJECT WEBSITE +--------------- +Project homepage: http://gridarta.sourceforge.net/ +Project website: http://sourceforge.net/projects/gridarta/ + + +SYSTEM REQUIREMENTS +------------------- +Java 5.0 + Previous versions of Java will not work. Gridarta uses Generics, autoboxing, + static imports, foreach loops, assertions and varargs quite a lot. + +Ant 1.6.5 + Previous versions of Ant might work but are not tested. + + +FILE STRUCTURE +-------------- +build.xml + The build file to build the project with Ant. + +COPYING + Gridarta license conditions. Note: applies to Gridarta only, not third party + libraries. + +CREDITS + List of project contributors. + +dest/ (generated) + The directory containing generated files. + +developer.proprties (optional) + Optional file for changing default settings of the Ant build. You won't + need to tweak this file for normal building. But if you want to set or + override properties for build.xml, this is the place to put them. + +dist/ (generated) + Generated directory containing distribution archives. + +lib/ + Directory containing third part libraries used to build Gridarta. Please note + that these third party libraries have their own license conditions. The + licenses of the third party libraries are included in the lib/ directory. + +LICENSE + File with license information. + +project.properties + File with automatically changed settings for Ant. + +src/ + Source files. + +src/app/ + Core Gridarta library sources. + +src/doc/ + Documentation source files (website). + +src/test/ + Unit test suite for automated unit testing of Gridarta. + + +BUILD / INSTALLATION +-------------------- +See the file INSTALL. + + +MAINTAINERS / CREDITS +--------------------- +See the file CREDITS + + +PROJECT NEWS +------------ +See the file NEWS + + +MAILING LISTS +------------- +Gridarta mailing lists are the usual sourceforge hosted sourceforge project +mailing lists. The current mailing lists are: +* gri...@li... + News for gridarta users (low traffic) +* gri...@li... + discussion amongst gridarta users (medium traffic) +* gri...@li... + gridarta developer talk list (medium traffic) +* gri...@li... + svn commit digest list (high traffic) +To find out how to subscribe or to read archives, go to: + http://sourceforge.net/mail/?group_id=166996 + + +LICENSE INFORMATION +------------------- +See the file LICENSE Property changes on: trunk/README ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/build.xml =================================================================== --- trunk/build.xml (rev 0) +++ trunk/build.xml 2006-05-22 00:20:53 UTC (rev 6) @@ -0,0 +1,540 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE project [ + <!ENTITY catalogForAnt SYSTEM "src/doc/dtd/catalogForAnt.xml"> +]> +<project default="compile"> + + <description> + Build file for Gridarta - 2D MMORPG Map Editor. + </description> + + <property file="developer.properties" /> + <property file="project.properties" /> + <property name="build.source.encoding" value="utf-8" /> + <property name="build.source.version" value="1.5" /> + <property name="build.target.version" value="${build.source.version}" /> + <property name="debug" value="false" /> + <property name="javac.args" value="-Xlint:all,-path,-unchecked,-fallthrough,-serial" /> + <property name="user.javadoc.link" value="http://java.sun.com/j2se/1.5.0/docs/api/" /> + <property name="user.javadoc.javasrc" value="${user.javadoc.javahome}/src" /> + <property name="user.svn.javahl" value="false" /> + <property name="svn.baseUrl" value="https://svn.sourceforge.net/svnroot/gridarta" /> + + <condition property="svnCreateBranch" value="true"> + <equals arg1="${project.version.patch}" arg2="0" /> + </condition> + <condition property="svn.branch.sourceUrl" value="${svn.baseUrl}/trunk"> + <equals arg1="${project.version.patch}" arg2="0" /> + </condition> + <condition property="svn.branch.targetUrl" value="${svn.baseUrl}/branches/${project.version.major}.${project.version.minor}"> + <equals arg1="${project.version.patch}" arg2="0" /> + </condition> + <condition property="svn.branch.message" value="Creating branch for version ${project.version.major}.${project.version.minor}"> + <equals arg1="${project.version.patch}" arg2="0" /> + </condition> + <property name="svn.tag.sourceUrl" value="${svn.baseUrl}/branches/${project.version.major}.${project.version.minor}" /> + <property name="svn.tag.targetUrl" value="${svn.baseUrl}/tags/${project.version.major}.${project.version.minor}.${project.version.patch}" /> + <property name="svn.tag.message" value="Creating release tag for version ${project.version.major}.${project.version.minor}.${project.version.patch}" /> + + <taskdef name="megaxslt" classpath="lib/megaxslt.jar" classname="com.hujer.ant.tasks.megaxslt.MegaXsltTask" /> + <taskdef name="rgzip" classpath="lib/megaxslt.jar" classname="com.hujer.ant.tasks.rgzip.RGZipTask" /> + <taskdef name="pack200" classpath="lib/Pack200Task.jar" classname="com.sun.tools.apache.ant.pack200.Pack200Task" /> + <taskdef name="freshmeat" classpath="lib/antmeat.jar" classname="de.frewert.ant.freshmeat.Announcement"> + <classpath> + <pathelement path="lib/xmlrpc-2.0.1.jar" /> + <pathelement path="lib/commons-codec-1.3.jar" /> + </classpath> + </taskdef> + <taskdef name="svn" classpath="lib/svnant.jar" classname="org.tigris.subversion.svnant.SvnTask"> + <classpath> + <pathelement path="lib/svnClientAdapter.jar" /> + <pathelement path="lib/jakarta-regexp-1.3.jar" /> + </classpath> + </taskdef> + + &catalogForAnt; + + <target + name = "update" + if = "dev.autoupdate" + > + <svn javahl="${user.svn.javahl}"> + <update dir="."/> + </svn> + </target> + + <target + name = "init" + depends = "update" + > + </target> + + <target + name = "clean" + description = "Removes all generated files." + > + <delete dir="dest" /> + <delete dir="dist" /> + <subant target="clean"> + <fileset dir="src/doc/guide" includes="**/build.xml" /> + </subant> + </target> + + <target + name = "guideProjects" + description = "builds all guide projects." + > + <subant> + <fileset dir="src/doc/guide" includes="**/build.xml" /> + </subant> + </target> + + <target + name = "compile" + depends = "init" + description = "Compiles the Gridarta sources." + > + <mkdir dir="dest/app" /> + <javac + srcdir = "src/app" + destdir = "dest/app" + encoding = "${build.source.encoding}" + source = "${build.source.version}" + target = "${build.target.version}" + debug = "${debug}" + excludes = "test/**/*.java" + > + <classpath> + <fileset dir="lib" includes="annotations.jar" /> + </classpath> + <compilerarg line="${javac.args}" /> + </javac> + <copy todir="dest/app"> + <fileset dir="src/app" includes="**/*.properties" /> + </copy> + </target> + + <target + name = "doc" + depends = "editorialDoc, apiDoc" + description = "Creates project documentation." + /> + + <target + name = "java2html" + description = "Converts documentation java sources to XHTML." + > + <taskdef name="java2html" classpath="lib/java2html.jar" classname="de.java2html.anttasks.Java2HtmlTask" /> + <java2html + srcdir = "src/doc" + destdir = "src/doc" + includes = "**/*.java" + outputformat = "xhtml11" + tabs = "4" + style = "eclipse" + addlineanchors = "true" + includedocumentfooter = "true" + includedocumentheader = "true" + lineanchorprefix = "line" + showdefaulttitle = "true" + showfilename = "true" + showlinenumbers = "true" + showtableborder = "true" + /> + </target> + + <target + name = "editorialDoc" + description = "Creates the editorial part of the project documentation." + depends = "java2html" + > + <mkdir dir="dest/doc" /> + <megaxslt + srcdir="src/doc" + destdir="dest/doc" + includes="**/*.xhtml" + validatesource="true" + validatedest="true" + ending="xhtml" + > + <xmlcatalog refid="commonDTDs" /> + <transformation stylesheet="src/doc/transform.xslt" /> + <transformation stylesheet="src/doc/cleanupXhtml11.xslt" /> + </megaxslt> + <megaxslt + srcdir="dest/doc" + destdir="dest/doc" + includes="**/*.xhtml" + validatesource="true" + validatedest="false" + ending="html" + converttocanonical="true" + > + <xmlcatalog refid="commonDTDs" /> + <transformation stylesheet="src/doc/xhtml2html.xslt" /> + </megaxslt> + <copy + todir="dest/doc" + > + <fileset dir="src/doc"> + <include name="**/.htaccess" /> + <include name="**/*.html" /> + <include name="dtd/**/*.mod" /> + <include name="dtd/**/*.dtd" /> + <include name="dtd/**/*.xml" /> + <include name="**/*.css" /> + <include name="**/*.png" /> + <exclude name="**/.xvpics/*.png" /> + </fileset> + </copy> + </target> + + <target + name = "apiDoc" + depends = "init" + description = "Creates public javadoc documentation." + > + <mkdir dir="dest/doc/api/${project.version}" /> + <copy todir="dest/doc/api/${project.version}" file="src/doc/api/public/copyright.html" /> + <copy todir="dest/doc/api/${project.version}" file="src/doc/api/public/.htaccess" /> + <javadoc + destdir = "dest/doc/api/${project.version}" + access = "protected" + author = "yes" + version = "yes" + locale = "en_US" + use = "yes" + splitindex = "yes" + windowtitle = "Gridarta API documentation" + doctitle = "Gridarta<br />Yet another Java API<br />API Documentation" + header = "Gridarta ${project.version}<br />Yet another Java API<br />API Documentation" + footer = "Gridarta<br />Yet another Java API<br />API Documentation" + bottom = "<div style="text-align:center;">© 2005-2006 The Gridarta Developers. All rights reserved. See <a href="{@docRoot}/copyright.html">copyright</a></div>" + serialwarn = "yes" + charset = "${build.source.encoding}" + docencoding = "${build.source.encoding}" + source = "${build.source.version}" + encoding = "${build.source.encoding}" + linksource = "yes" + overview = "src/app/overview.html" + link = "${user.javadoc.link}" + > + <classpath> + <fileset dir="lib" includes="annotations.jar" /> + </classpath> + <sourcepath> + <pathelement path="${user.javadoc.javasrc}" /> + <pathelement path="src/app" /> + </sourcepath> + <packageset + dir="src/app" + defaultexcludes="yes" + > + <include name="**" /> + </packageset> + <tag enabled="true" name="retval" description="Return Values:" scope="methods" /> + <tag enabled="true" name="pre" description="Preconditions:" scope="methods,constructors" /> + <tag enabled="true" name="post" description="Postconditions:" scope="methods" /> + <tag enabled="true" name="note" description="Notes:" /> + <tag enabled="true" name="warning" description="Warnings:" /> + <tag enabled="true" name="todo" description="Todo:" /> + <tag enabled="true" name="fixme" description="Fixme:" /> + <tag enabled="true" name="xxx" description="XXX:" /> + <tag enabled="false" name="used" description="Manually marked as used." /> + </javadoc> + </target> + + <target + name = "dist" + description = "Packs distribution archives." + depends = "distSrc, distLib, distDoc" + /> + + <target + name = "distSrc" + description = "Packs source distribution archives." + > + <mkdir dir="dist" /> + <property name="distSrc" value="dist/gridarta-${project.version}.src" /> + <parallel> + <tar tarfile="${distSrc}.tar"> + <tarfileset dir="." prefix="gridarta-${project.version}"> + <include name="src/**" /> + <include name="build.xml" /> + </tarfileset> + </tar> + <zip destfile="${distSrc}.zip"> + <zipfileset dir="." prefix="gridarta-${project.version}"> + <include name="src/**" /> + <include name="build.xml" /> + </zipfileset> + </zip> + <jar destfile="${distSrc}.jar"> + <zipfileset dir="." prefix="gridarta-${project.version}"> + <include name="src/**" /> + <include name="build.xml" /> + </zipfileset> + </jar> + </parallel> + <parallel> + <gzip src="${distSrc}.tar" destfile="${distSrc}.tar.gz" /> + <bzip2 src="${distSrc}.tar" destfile="${distSrc}.tar.bz2" /> + </parallel> + <delete file="${distSrc}.tar" /> + </target> + + <target + name = "distLib" + description = "Packs library distribution archives." + depends = "compile" + > + <mkdir dir="dist" /> + <property name="distLib" value="dist/gridarta-${project.version}.lib" /> + <jar destfile="${distLib}.jar"> + <zipfileset dir="dest/app"/> + <zipfileset src="lib/annotations.jar"/> + <manifest> + <attribute name="Implementation-Title" value="Gridarta" /> + <attribute name="Implementation-Vendor" value="The Gridarta Developers" /> + <attribute name="Implementation-Version" value="${project.version}" /> + <attribute name="Implementation-URL" value="http://sourceforge.net/projets/gridarta/" /> + </manifest> + </jar> + <pack200 + src="${distLib}.jar" + destfile="${distLib}.pack.gz" + gzipoutput="true" + stripdebug="true" + effort="9" + keepfileorder="false" + modificationtime="latest" + deflatehint="false" + /> + </target> + + <target + name = "distDoc" + description = "Packs documentation archives." + depends = "apiDoc" + > + <mkdir dir="dist" /> + <property name="distDoc" value="dist/gridarta-${project.version}.doc" /> + <parallel> + <tar tarfile="${distDoc}.tar"> + <tarfileset dir="dest/doc" prefix="gridarta-${project.version}"> + <include name="api/${project.version}/**" /> + </tarfileset> + </tar> + <zip destfile="${distDoc}.zip"> + <zipfileset dir="dest/doc" prefix="gridarta-${project.version}"> + <include name="api/${project.version}/**" /> + </zipfileset> + </zip> + <jar destfile="${distDoc}.jar"> + <zipfileset dir="dest/doc" prefix="gridarta-${project.version}"> + <include name="api/${project.version}/**" /> + </zipfileset> + </jar> + </parallel> + <parallel> + <gzip src="${distDoc}.tar" destfile="${distDoc}.tar.gz" /> + <bzip2 src="${distDoc}.tar" destfile="${distDoc}.tar.bz2" /> + </parallel> + <delete file="${distDoc}.tar" /> + </target> + + <target + name = "checkDevMail" + description = "checks whether the developer defined his / her email address" + unless = "developer.email" + > + <fail message="You must define the property developer.email with your email address in the file developer.properties." /> + </target> + + <target + name = "checkDevSmtp" + description = "checks whether the developer defined his / her smtp host" + unless = "user.mail.smtp.host" + > + <fail message="You must define the property user.mail.smtp.host with your smtp host address in the file developer.properties." /> + </target> + + <target + name = "releaseDist" + description = "uploads distribution archives to sourceforge." + if = "developer.email" + depends = "checkDevMail, dist" + > + <touch file="src/doc/api/start.xhtml" millis="0" /> + <megaxslt + srcdir="src/doc/api" + destdir="src/doc/api" + includes="start.xhtml" + validatesource="true" + validatedest="true" + ending="xhtml" + converttocanonical="true" + checktimestamps="true" + > + <xmlcatalog refid="commonDTDs" /> + <parameter name="project.version" value="${project.version}" /> + <transformation stylesheet="src/doc/api/release.xslt" /> + </megaxslt> + <svn javahl="${user.svn.javahl}"> + <commit file="src/doc/api/start.xhtml" message="Updating API link to include ${project.version}." /> + </svn> + <exec executable="rsync"> + <arg line="-auzv -e ssh dest/doc/api/ ${user.rsync.username}@${user.rsync.host}:${user.rsync.dir}/htdocs/api/" /> + </exec> + <sshexec + host="${user.rsync.host}" + username="${user.rsync.username}" + keyfile="${user.ssh.keyfile}" + command="rm ${user.rsync.dir}/htdocs/api/latest ; ln -s ${project.version} ${user.rsync.dir}/htdocs/api/latest" + /> + <ftp + server = "upload.sourceforge.net" + userid = "anonymous" + password = "${developer.email}" + remotedir = "incoming" + action = "put" + > + <fileset dir="dist" /> + </ftp> + <antcall target="svnCreateBranch" /> + <antcall target="svnCreateTag" /> + <antcall target="uploadDoc" /> + </target> + + <target + name = "uploadDoc" + description = "uploads the latest editorial documentation." + depends = "editorialDoc" + > + <exec executable="rsync"> + <arg line="-auzv --exclude=api/*/ -e ssh dest/doc/ ${user.rsync.username}@${user.rsync.host}:${user.rsync.dir}/htdocs/" /> + </exec> + </target> + + <target + name = "announce" + description = "announce new version on freshmeat.net" + > + <echo>Announcing. Press return to start announcing this release at FreshMeat.</echo> + <input/> + <freshmeat + username = "${user.freshmeat.username}" + password = "${user.freshmeat.password}" + > + <printlicenses/> + <printreleasefoci/> + <publish + projectname = "gridarta" + branchname = "Default" + version = "${project.version}" + focus = "${project.focus}" + > + <changes file="LatestNews" /> + <urlblock + homepage = "http://gridarta.sourceforge.net/" + cvs = "http://svn.sourceforge.net/viewcvs.cgi/gridarta/" + mailinglist = "http://sourceforge.net/mailarchive/forum.php?forum=gridarta-users" + tgz = "http://prdownloads.sourceforge.net/gridarta/gridarta-${project.version}.src.tar.gz?download" + bz2 = "http://prdownloads.sourceforge.net/gridarta/gridarta-${project.version}.src.tar.bz2?download" + zip = "http://prdownloads.sourceforge.net/gridarta/gridarta-${project.version}.src.zip?download" + /> + </publish> + </freshmeat> + </target> + + <target + name = "release" + description = "Releases a new version of Gridarta." + > + <antcall target="clean" /> + <antcall target="releaseDist" /> + <echo>I've uploaded the distribution archives to sourceforge. +Press return when you're done configuring the new file releases on sourceforge. +I will then announce the release at FreshMeat.</echo> + <input/> + <antcall target="announce" /> + </target> + + <target + name = "svnCreateBranch" + description = "Creates a release branch for a new major or minor revision. This target shouldn't be invoked directly." + if = "svnCreateBranch" + > + <svn javahl="${user.svn.javahl}"> + <copy srcUrl="${svn.branch.sourceUrl}" desturl="${svn.branch.targetUrl}" message="${svn.branch.message}" /> + </svn> + </target> + + <target + name = "svnCreateTag" + description = "Creates a release tag for a new patch revision. This target shouldn't be invoked directly." + > + <svn javahl="${user.svn.javahl}"> + <copy srcUrl="${svn.tag.sourceUrl}" desturl="${svn.tag.targetUrl}" message="${svn.tag.message}" /> + </svn> + </target> + + <target + name = "checkstyle" + description = "Runs checkstyle to stylecheck the source code" + > + <taskdef + resource = "checkstyletask.properties" + classpath = "lib/checkstyle.jar" + > + <classpath> + <pathelement path="lib/antlr.jar" /> + <pathelement path="lib/commons-beanutils-core.jar" /> + </classpath> + </taskdef> + <checkstyle + config = "src/checkstyle.xml" + failOnViolation = "false" + > + <formatter type="xml" tofile="dest/doc/checkstyle_report.xml" /> + <formatter type="plain" tofile="dest/doc/checkstyle_report.txt" /> + <formatter type="plain" /> + <fileset dir="src/app" includes="**/*.java" /> + <fileset dir="src" includes="test/**/*.java" /> + </checkstyle> + <style + in = "dest/doc/checkstyle_report.xml" + out = "dest/doc/checkstyle_report.html" + style = "src/doc/checkstyle.xslt" + /> + </target> + + <target + name = "mailCheckstyle" + description = "Mails checkstyle results to the mailing list" + depends = "checkstyle, checkDevMail, checkDevSmtp" + > + <mail + from = "${developer.email}" + tolist = "gri...@li..." + mailhost = "${user.mail.smtp.host}" + subject = "Checkstyle violation(s) in Gridarta" + files = "checkstyle_report.html" + /> + </target> + + <target + name = "changelog" + description = "Updates the changelog" + > + <exec executable="svn" output="src/doc/changelog.xml"> + <arg line="log -v --xml" /> + </exec> + <style + in = "src/doc/changelog.xml" + out = "src/doc/changelog.xhtml" + style = "src/doc/changelog.xslt" + /> + </target> + +</project> Property changes on: trunk/build.xml ___________________________________________________________________ Name: svn:mime-type + text/xml Name: svn:eol-style + LF Added: trunk/lib/LICENSE-Pack200Task.jar =================================================================== --- trunk/lib/LICENSE-Pack200Task.jar (rev 0) +++ trunk/lib/LICENSE-Pack200Task.jar 2006-05-22 00:20:53 UTC (rev 6) @@ -0,0 +1,471 @@ +SUN PUBLIC LICENSE Version 1.0 + +1. Definitions. + + 1.0.1. "Commercial Use" means distribution or otherwise making the + Covered Code available to a third party. + + 1.1. "Contributor" means each entity that creates or contributes to + the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original Code, + prior Modifications used by a Contributor, and the Modifications made + by that particular Contributor. + + 1.3. "Covered Code" means the Original Code or Modifications or the + combination of the Original Code and Modifications, in each case + including portions thereof and corresponding documentation released + with the source code. + + 1.4. "Electronic Distribution Mechanism" means a mechanism generally + accepted in the software development community for the electronic + transfer of data. + + 1.5. "Executable" means Covered Code in any form other than Source + Code. + + 1.6. "Initial Developer" means the individual or entity identified as + the Initial Developer in the Source Code notice required by Exhibit A. + + 1.7. "Larger Work" means a work which combines Covered Code or + portions thereof with code not governed by the terms of this License. + + 1.8. "License" means this document. + + 1.8.1. "Licensable" means having the right to grant, to the maximum + extent possible, whether at the time of the initial grant or + subsequently acquired, any and all of the rights conveyed herein. + + 1.9. "Modifications" means any addition to or deletion from the + substance or structure of either the Original Code or any previous + Modifications. When Covered Code is released as a series of files, a + Modification is: + + A. Any addition to or deletion from the contents of a file containing + Original Code or previous Modifications. + + B. Any new file that contains any part of the Original Code or + previous Modifications. + + 1.10. "Original Code" means Source Code of computer software code + which is described in the Source Code notice required by Exhibit A as + Original Code, and which, at the time of its release under this + License is not already Covered Code governed by this License. + + 1.10.1. "Patent Claims" means any patent claim(s), now owned or + hereafter acquired, including without limitation, method, process, and + apparatus claims, in any patent Licensable by grantor. + + 1.11. "Source Code" means the preferred form of the Covered Code for + making modifications to it, including all modules it contains, plus + any associated documentation, interface definition files, scripts used + to control compilation and installation of an Executable, or source + code differential comparisons against either the Original Code or + another well known, available Covered Code of the Contributor's + choice. The Source Code can be in a compressed or archival form, + provided the appropriate decompression or de-archiving software is + widely available for no charge. + + 1.12. "You" (or "Your") means an individual or a legal entity + exercising rights under, and complying with all of the terms of, this + License or a future version of this License issued under Section 6.1. + For legal entities, "You" includes any entity which controls, is + controlled by, or is under common control with You. For purposes of + this definition, "control" means (a) the power, direct or indirect, to + cause the direction or management of such entity, whether by contract + or otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + +2. Source Code License. + +2.1 The Initial Developer Grant. + + The Initial Developer hereby grants You a world-wide, royalty-free, + non-exclusive license, subject to third party intellectual property + claims: + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Initial Developer to use, reproduce, modify, + display, perform, sublicense and distribute the Original Code (or + portions thereof) with or without Modifications, and/or as part of a + Larger Work; and + + (b) under Patent Claims infringed by the making, using or selling of + Original Code, to make, have made, use, practice, sell, and offer for + sale, and/or otherwise dispose of the Original Code (or portions + thereof). + + (c) the licenses granted in this Section 2.1(a) and (b) are effective + on the date Initial Developer first distributes Original Code under + the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is + granted: 1) for code that You delete from the Original Code; 2) + separate from the Original Code; or 3) for infringements caused by: + i) the modification of the Original Code or ii) the combination of the + Original Code with other software or devices. + +2.2. Contributor Grant. + + Subject to third party intellectual property claims, each Contributor + hereby grants You a world-wide, royalty-free, non-exclusive license + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Contributor, to use, reproduce, modify, + display, perform, sublicense and distribute the Modifications created + by such Contributor (or portions thereof) either on an unmodified + basis, with other Modifications, as Covered Code and/or as part of a + Larger Work; and + + (b) under Patent Claims infringed by the making, using, or selling of + Modifications made by that Contributor either alone and/or in + combination with its Contributor Version (or portions of such + combination), to make, use, sell, offer for sale, have made, and/or + otherwise dispose of: 1) Modifications made by that Contributor (or + portions thereof); and 2) the combination of Modifications made by + that Contributor with its Contributor Version (or portions of such + combination). + + (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective + on the date Contributor first makes Commercial Use of the Covered + Code. + + (d) notwithstanding Section 2.2(b) above, no patent license is + granted: 1) for any code that Contributor has deleted from the + Contributor Version; 2) separate from the Contributor Version; 3) for + infringements caused by: i) third party modifications of Contributor + Version or ii) the combination of Modifications made by that + Contributor with other software (except as part of the Contributor + Version) or other devices; or 4) under Patent Claims infringed by + Covered Code in the absence of Modifications made by that Contributor. + +3. Distribution Obligations. + +3.1. Application of License. + + The Modifications which You create or to which You contribute are + governed by the terms of this License, including without limitation + Section 2.2. The Source Code version of Covered Code may be + distributed only under the terms of this License or a future version + of this License released under Section 6.1, and You must include a + copy of this License with every copy of the Source Code You + distribute. You may not offer or impose any terms on any Source Code + version that alters or restricts the applicable version of this + License or the recipients' rights hereunder. However, You may include + an additional document offering the additional rights described in + Section 3.5. + +3.2. Availability of Source Code. + + Any Modification which You create or to which You contribute must be + made available in Source Code form under the terms of this License + either on the same media as an Executable version or via an accepted + Electronic Distribution Mechanism to anyone to whom you made an + Executable version available; and if made available via Electronic + Distribution Mechanism, must remain available for at least twelve (12) + months after the date it initially became available, or at least six + (6) months after a subsequent version of that particular Modification + has been made available to such recipients. You are responsible for + ensuring that the Source Code version remains available even if the + Electronic Distribution Mechanism is maintained by a third party. + +3.3. Description of Modifications. + + You must cause all Covered Code to which You contribute to contain a + file documenting the changes You made to create that Covered Code and + the date of any change. You must include a prominent statement that + the Modification is derived, directly or indirectly, from Original + Code provided by the Initial Developer and including the name of the + Initial Developer in (a) the Source Code, and (b) in any notice in an + Executable version or related documentation in which You descr... [truncated message content] |
From: <chr...@us...> - 2006-05-25 21:16:48
|
Revision: 16 Author: christianhujer Date: 2006-05-25 14:16:38 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=16&view=rev Log Message: ----------- Updated README, added MAINTAINERS Modified Paths: -------------- trunk/README Added Paths: ----------- trunk/MAINTAINERS Added: trunk/MAINTAINERS =================================================================== --- trunk/MAINTAINERS (rev 0) +++ trunk/MAINTAINERS 2006-05-25 21:16:38 UTC (rev 16) @@ -0,0 +1,6 @@ +The current maintainers of Gridarta are: + +* Christian Hujer <ch...@ri...> +* Daniel Viegas <der...@us...> +* Andreas Kirschbaum <aki...@us...> +* Anja Heim <z0...@us...> Property changes on: trunk/MAINTAINERS ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/README =================================================================== --- trunk/README 2006-05-25 20:57:05 UTC (rev 15) +++ trunk/README 2006-05-25 21:16:38 UTC (rev 16) @@ -53,8 +53,14 @@ libraries. CREDITS - List of project contributors. + List of project contributors. See also MAINTAINERS. +crossfire/ + Legacy directory containing the old Crossfire Map Editor. + +daimonin/ + Legacy directory containing the old Daimonin Map Editor. + dest/ (generated) The directory containing generated files. @@ -66,6 +72,9 @@ dist/ (generated) Generated directory containing distribution archives. +INSTALL + Description of how to build and install Gridarta. + lib/ Directory containing third part libraries used to build Gridarta. Please note that these third party libraries have their own license conditions. The @@ -74,9 +83,18 @@ LICENSE File with license information. +MAINTAINERS + List of current project maintainers. See also CREDITS. + +NEWS + Project News. + project.properties File with automatically changed settings for Ant. +README + This file + src/ Source files. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-30 19:26:46
|
Revision: 84 Author: christianhujer Date: 2006-05-30 12:26:14 -0700 (Tue, 30 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=84&view=rev Log Message: ----------- Improved documentation: robots exclusion copyright automatic date fixed all css warnings added css validator link Modified Paths: -------------- trunk/build.xml trunk/src/doc/dev/codeStyle.xhtml trunk/src/doc/dev/start.xhtml trunk/src/doc/history.xhtml trunk/src/doc/news/2006-05-27_1.xhtml trunk/src/doc/news/start.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 Added Paths: ----------- trunk/src/doc/copyright.xhtml trunk/src/doc/robots.txt Property Changed: ---------------- trunk/src/doc/dev/codeStyle.xhtml trunk/src/doc/dev/start.xhtml trunk/src/doc/history.xhtml trunk/src/doc/news/2006-05-27_1.xhtml trunk/src/doc/news/start.xhtml trunk/src/doc/start.xhtml trunk/src/doc/status404.xhtml trunk/src/doc/subversion.xhtml Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2006-05-30 06:59:46 UTC (rev 83) +++ trunk/build.xml 2006-05-30 19:26:14 UTC (rev 84) @@ -184,6 +184,7 @@ <include name="dtd/**/*.xml" /> <include name="**/*.css" /> <include name="**/*.png" /> + <include name="robots.txt" /> <exclude name="**/.xvpics/*.png" /> </fileset> </copy> Added: trunk/src/doc/copyright.xhtml =================================================================== --- trunk/src/doc/copyright.xhtml (rev 0) +++ trunk/src/doc/copyright.xhtml 2006-05-30 19:26:14 UTC (rev 84) @@ -0,0 +1,15 @@ +<?xml version="1.1" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//JAPI//DTD XHTML 1.1 + XInclude 1.0//EN" "dtd/xhtml11_xinclude10.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <meta name="Date" content="$Date$" /> + <title>Gridarta Copyright</title> + </head> + <body> + <p> + Gridarta is licensed under GPL version 2 or newer. + </p> + <pre><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../COPYING"/></pre> + </body> +</html> Property changes on: trunk/src/doc/copyright.xhtml ___________________________________________________________________ Name: svn:mime-type + text/html Name: svn:keywords + Date Name: svn:eol-style + LF Modified: trunk/src/doc/dev/codeStyle.xhtml =================================================================== --- trunk/src/doc/dev/codeStyle.xhtml 2006-05-30 06:59:46 UTC (rev 83) +++ trunk/src/doc/dev/codeStyle.xhtml 2006-05-30 19:26:14 UTC (rev 84) @@ -3,6 +3,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <meta name="Date" content="$Date$" /> <title>Gridarta Development Documentation: Code Conventions</title> </head> <body> @@ -18,6 +19,7 @@ <ul> <li>Imports are sorted alphabetically by package, within a package alphabetically by class.</li> <li>The *-form of import is not allowed.</li> + <li>Use inline comments rarely. If you have to use inline comments to explain what code does, something is wrong with the code.</li> </ul> </body> </html> Property changes on: trunk/src/doc/dev/codeStyle.xhtml ___________________________________________________________________ Name: svn:keywords + Date Modified: trunk/src/doc/dev/start.xhtml =================================================================== --- trunk/src/doc/dev/start.xhtml 2006-05-30 06:59:46 UTC (rev 83) +++ trunk/src/doc/dev/start.xhtml 2006-05-30 19:26:14 UTC (rev 84) @@ -3,6 +3,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <meta name="Date" content="$Date$" /> <title>Gridarta Development Documentation</title> </head> <body> Property changes on: trunk/src/doc/dev/start.xhtml ___________________________________________________________________ Name: svn:keywords + Date Modified: trunk/src/doc/history.xhtml =================================================================== --- trunk/src/doc/history.xhtml 2006-05-30 06:59:46 UTC (rev 83) +++ trunk/src/doc/history.xhtml 2006-05-30 19:26:14 UTC (rev 84) @@ -3,6 +3,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <meta name="Date" content="$Date$" /> <title>History of Gridarta</title> </head> <body> Property changes on: trunk/src/doc/history.xhtml ___________________________________________________________________ Name: svn:keywords + Date Modified: trunk/src/doc/news/2006-05-27_1.xhtml =================================================================== --- trunk/src/doc/news/2006-05-27_1.xhtml 2006-05-30 06:59:46 UTC (rev 83) +++ trunk/src/doc/news/2006-05-27_1.xhtml 2006-05-30 19:26:14 UTC (rev 84) @@ -3,6 +3,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <meta name="Date" content="$Date$" /> <title>Project Gridarta Started</title> </head> <body> Property changes on: trunk/src/doc/news/2006-05-27_1.xhtml ___________________________________________________________________ Name: svn:keywords + Date Modified: trunk/src/doc/news/start.xhtml =================================================================== --- trunk/src/doc/news/start.xhtml 2006-05-30 06:59:46 UTC (rev 83) +++ trunk/src/doc/news/start.xhtml 2006-05-30 19:26:14 UTC (rev 84) @@ -3,6 +3,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <meta name="Date" content="$Date$" /> <title>Gridarta Project News</title> </head> <body> Property changes on: trunk/src/doc/news/start.xhtml ___________________________________________________________________ Name: svn:keywords + Date Added: trunk/src/doc/robots.txt =================================================================== --- trunk/src/doc/robots.txt (rev 0) +++ trunk/src/doc/robots.txt 2006-05-30 19:26:14 UTC (rev 84) @@ -0,0 +1,4 @@ +User-Agent: W3C-checklink +Disallow: http://validator.w3.org/check?uri=referer +Disallow: http://jigsaw.w3.org/css-validator/check/referer +Disallow: /dev/changelog Property changes on: trunk/src/doc/robots.txt ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/src/doc/sitestyle.css =================================================================== --- trunk/src/doc/sitestyle.css 2006-05-30 06:59:46 UTC (rev 83) +++ trunk/src/doc/sitestyle.css 2006-05-30 19:26:14 UTC (rev 84) @@ -1,17 +1,16 @@ -html { +html, body { background-color: white; + color:#11111A; } body { margin: auto auto; padding-left: 6%; padding-right: 6%; - background-color: white; - /*background-image: url(http://www.w3.org/Icons/logo-WMVS.png);*/ + /*background-image: url(http://www.w3.org/Icons/logo-WMVS.png); background-attachment: fixed; background-position: 0 0; - background-repeat: no-repeat; - color: #11111A; + background-repeat: no-repeat;*/ font-family: Helvetica, "Trebuchet MS", Arial, sans-serif; font-size: 1em; /* setting base font to user's prefered size */ line-height: 130%; @@ -19,6 +18,7 @@ div.header { background-color: #eee; + color:inherit; height:45px; text-align:center; } @@ -30,6 +30,7 @@ div.content { background-color: white; + color:inherit; border-bottom: 0; border-left: 1px solid #eee; border-right: 1px solid #eee; @@ -43,6 +44,7 @@ background-repeat: no-repeat; background-attachment: scroll; background-position: right; + color:inherit; height:45px; padding-top: 10px; padding-bottom: 0; @@ -68,11 +70,13 @@ margin-left: 222px; font-family: "Bitstream Vera Sans Mono", monospace; color: #888; + background-color:inherit; line-height: 120%; } p.copyright a { color: #88f; + background-color:inherit; text-decoration: none; } @@ -92,6 +96,7 @@ fieldset.screenshot { padding: .5em; background: white; + color:inherit; border: 1px dotted #aaaa77; margin-left: 20px; margin-right: 20px; @@ -99,8 +104,8 @@ } fieldset.screenshot legend { + background-color: #aaaa77; color: #fff; - background-color: #aaaa77; font-size: smaller; padding: .1ex .5ex; border-right: 1px solid gray; @@ -116,21 +121,21 @@ td.java, td.java-ln {vertical-align:top;} tt.java, tt.java-ln, pre.java, pre.java-ln {line-height:1em; margin-bottom:0em;} td.java-ln { text-align:right; } -tt.java-ln, pre.java-ln { color:#888888 } -/* Background */ span.java0 { color:#ffffff; } -/* Line numbers */ span.java1 { color:#808080; } -/* Multi-line comments */ span.java2 { color:#3f7f5f; } -/* Single-line comments */ span.java3 { color:#3f7f5f; } -/* Keywords */ span.java4 { color:#7f0055; font-weight:bold; } -/* Strings */ span.java5 { color:#2a00ff; } -/* Character constants */ span.java6 { color:#990000; } -/* Numeric constants */ span.java7 { color:#990000; } -/* Parenthesis */ span.java8 { color:#000000; } -/* Primitive Types */ span.java9 { color:#7f0055; font-weight:bold; } -/* Others */ span.java10 { color:#000000; } -/* Javadoc keywords */ span.java11 { color:#7f9fbf; } -/* Javadoc HTML tags */ span.java12 { color:#7f7f9f; } -/* Javadoc links */ span.java13 { color:#3f3fbf; } -/* Javadoc others */ span.java14 { color:#3f5fbf; } -/* Undefined */ span.java15 { color:#ff6100; } -/* Annotation */ span.java16 { color:#646464; } + tt.java-ln, pre.java-ln { background-color:inherit; color:#888888; } +/* Background */ span.java0 { background-color:inherit; color:#ffffff; } +/* Line numbers */ span.java1 { background-color:inherit; color:#808080; } +/* Multi-line comments */ span.java2 { background-color:inherit; color:#3f7f5f; } +/* Single-line comments */ span.java3 { background-color:inherit; color:#3f7f5f; } +/* Keywords */ span.java4 { background-color:inherit; color:#7f0055; font-weight:bold; } +/* Strings */ span.java5 { background-color:inherit; color:#2a00ff; } +/* Character constants */ span.java6 { background-color:inherit; color:#990000; } +/* Numeric constants */ span.java7 { background-color:inherit; color:#990000; } +/* Parenthesis */ span.java8 { background-color:inherit; color:#000000; } +/* Primitive Types */ span.java9 { background-color:inherit; color:#7f0055; font-weight:bold; } +/* Others */ span.java10 { background-color:inherit; color:#000000; } +/* Javadoc keywords */ span.java11 { background-color:inherit; color:#7f9fbf; } +/* Javadoc HTML tags */ span.java12 { background-color:inherit; color:#7f7f9f; } +/* Javadoc links */ span.java13 { background-color:inherit; color:#3f3fbf; } +/* Javadoc others */ span.java14 { background-color:inherit; color:#3f5fbf; } +/* Undefined */ span.java15 { background-color:inherit; color:#ff6100; } +/* Annotation */ span.java16 { background-color:inherit; color:#646464; } Modified: trunk/src/doc/start.xhtml =================================================================== --- trunk/src/doc/start.xhtml 2006-05-30 06:59:46 UTC (rev 83) +++ trunk/src/doc/start.xhtml 2006-05-30 19:26:14 UTC (rev 84) @@ -4,7 +4,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> - <meta name="Date" content="$Date: 2006-04-18 03:01:25 +0200 (Die, 18 Apr 2006) $" /> + <meta name="Date" content="$Date$" /> <meta name="keywords" content="Gridarta, Map Editor, MMORPG, Angelion, Crossfire, Daimonin" /> <meta name="description" content="Gridarta is a Map Editor for 2D MMORPGs, namely Angelion, Crossfire, and Daimonin." /> <link rel="alternate" type="application/rss+xml" title="Project news releases" href="http://sourceforge.net/export/rss2_projnews.php?group_id=166996" /> Property changes on: trunk/src/doc/start.xhtml ___________________________________________________________________ Name: svn:keywords + Date Modified: trunk/src/doc/status404.xhtml =================================================================== --- trunk/src/doc/status404.xhtml 2006-05-30 06:59:46 UTC (rev 83) +++ trunk/src/doc/status404.xhtml 2006-05-30 19:26:14 UTC (rev 84) @@ -3,6 +3,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <meta name="Date" content="$Date$" /> <title>File Not Found</title> </head> <body> Property changes on: trunk/src/doc/status404.xhtml ___________________________________________________________________ Name: svn:keywords + Date Modified: trunk/src/doc/subversion.xhtml =================================================================== --- trunk/src/doc/subversion.xhtml 2006-05-30 06:59:46 UTC (rev 83) +++ trunk/src/doc/subversion.xhtml 2006-05-30 19:26:14 UTC (rev 84) @@ -4,7 +4,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> - <meta name="Date" content="$Date: 2006-04-03 23:00:14 +0200 (Mon, 03 Apr 2006) $" /> + <meta name="Date" content="$Date$" /> <title>Gridarta Subversion Developer Access</title> </head> <body> Property changes on: trunk/src/doc/subversion.xhtml ___________________________________________________________________ Name: svn:keywords + Date Modified: trunk/src/doc/transform.xslt =================================================================== --- trunk/src/doc/transform.xslt 2006-05-30 06:59:46 UTC (rev 83) +++ trunk/src/doc/transform.xslt 2006-05-30 19:26:14 UTC (rev 84) @@ -62,6 +62,8 @@ <a href="http://sourceforge.net/"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=166996&type=1" alt="SourceForge.net Logo" width="88" height="31" class="now" /></a> <a href="http://sourceforge.net/donate/index.php?group_id=166996"><img src="http://sourceforge.net/images/project-support.jpg" width="88" height="32" alt="Support This Project" class="now" /></a> <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml11" alt="Valid XHTML 1.1" height="31" width="88" class="now" /></a> + <a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="http://jigsaw.w3.org/css-validator/images/vcss" width="88" height="31" alt="Valid CSS!" /></a> + <!--<a href="http://www.jetbrains.com/idea/"><img src="http://www.jetbrains.com/idea/opensource/img/banners/idea88x31_blue.gif" alt="The best Java IDE" width="88" height="31" /></a>--> Feedback: <a href="mailto:ch...@ri...">webmaster</a> <xsl:if test="/html:html/html:head/html:meta[@name='Date']"> <br /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-03 14:37:46
|
Revision: 112 Author: christianhujer Date: 2006-06-03 07:37:30 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=112&view=rev Log Message: ----------- Fixed problems with spaces in changelog and some other bugs. Modified Paths: -------------- trunk/build.xml trunk/src/doc/.htaccess trunk/src/doc/cleanupXhtml11.xslt trunk/src/doc/dev/changelog.xslt trunk/src/doc/transform.xslt trunk/src/doc/xhtml2html.xslt Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2006-06-03 12:38:34 UTC (rev 111) +++ trunk/build.xml 2006-06-03 14:37:30 UTC (rev 112) @@ -532,11 +532,19 @@ <exec executable="svn" output="src/doc/dev/changelog.xml"> <arg line="log -v --xml" /> </exec> - <style - in = "src/doc/dev/changelog.xml" - out = "src/doc/dev/changelog.xhtml" - style = "src/doc/dev/changelog.xslt" - /> + <megaxslt + srcdir="src/doc/dev" + destdir="src/doc/dev" + includes="changelog.xml" + validatesource="false" + validatedest="false" + ending="xhtml" + converttocanonical="true" + transformerFactoryImplementationClassName="net.sf.saxon.TransformerFactoryImpl" + > + <xmlcatalog refid="commonDTDs" /> + <transformation stylesheet="src/doc/dev/changelog.xslt" /> + </megaxslt> </target> </project> Modified: trunk/src/doc/.htaccess =================================================================== --- trunk/src/doc/.htaccess 2006-06-03 12:38:34 UTC (rev 111) +++ trunk/src/doc/.htaccess 2006-06-03 14:37:30 UTC (rev 112) @@ -5,5 +5,5 @@ AddType text/html;charset=UTF-8 .html AddType application/xhtml+xml;charset=UTF-8;qs=0.999 .xhtml AddHandler server-parsed .html -AddHandler server-pasrsed .xhtml +AddHandler server-parsed .xhtml ErrorDocument 404 /status404 Modified: trunk/src/doc/cleanupXhtml11.xslt =================================================================== --- trunk/src/doc/cleanupXhtml11.xslt 2006-06-03 12:38:34 UTC (rev 111) +++ trunk/src/doc/cleanupXhtml11.xslt 2006-06-03 14:37:30 UTC (rev 112) @@ -12,8 +12,9 @@ --> <xsl:transform - version="1.0" + version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:helper="java:com.hujer.xpath.Helper" > @@ -28,9 +29,9 @@ cdata-section-elements="html:script html:style" /> - <xsl:strip-space + <!--xsl:strip-space elements="html:body html:head html:html html:title html:h1 html:h2 html:h3 html:h4 html:h5 html:h6 html:address html:blockquote html:div html:p html:pre html:dl html:dt html:dd html:ol html:ul html:li html:applet html:form html:fieldset html:caption html:table html:td html:th html:tr html:col html:colgroup html:tbody html:thead html:tfoot html:object html:frameset html:param html:img html:frame html:noframes html:iframe html:meta html:link html:input html:select html:optgroup html:option html:button html:label html:legend" - /> + /--> <xsl:template match="html:head/@profile"/> <xsl:template match="html:html/@version"/> @@ -79,7 +80,7 @@ <!--<xsl:template match="@xmlns:*"/>--> <xsl:template match="text()"> - <xsl:value-of select="helper:normalize(., preceding::node()[1], following::node()[1], parent::node())"/> + <xsl:value-of select="helper:normalize(xs:string(.), preceding-sibling::node()[1], following-sibling::node()[1], parent::node())"/> <!--xsl:choose> <xsl:when test=". = ' '"><xsl:text> </xsl:text></xsl:when> <xsl:otherwise> Modified: trunk/src/doc/dev/changelog.xslt =================================================================== --- trunk/src/doc/dev/changelog.xslt 2006-06-03 12:38:34 UTC (rev 111) +++ trunk/src/doc/dev/changelog.xslt 2006-06-03 14:37:30 UTC (rev 112) @@ -1,11 +1,16 @@ <?xml version="1.0" encoding="utf-8"?> <xsl:transform - version="1.0" + 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" - exclude-result-prefixes="xi xsl" + 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 @@ -100,7 +105,7 @@ <xsl:template match="path"> <li> <xsl:value-of select="@action" /><xsl:text> </xsl:text> - <code><a href="http://svn.sourceforge.net/viewcvs.cgi/gridarta{.}"><xsl:value-of select="." /></a></code> + <code><a href="http://svn.sourceforge.net/viewcvs.cgi/gridarta/{URI:relativize(File:toURI(File:new(System:getProperty('user.dir'))),File:toURI(File:new(substring(., 2))))}"><xsl:value-of select="." /></a></code> </li> </xsl:template> </xsl:transform> Modified: trunk/src/doc/transform.xslt =================================================================== --- trunk/src/doc/transform.xslt 2006-06-03 12:38:34 UTC (rev 111) +++ trunk/src/doc/transform.xslt 2006-06-03 14:37:30 UTC (rev 112) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <xsl:transform - version="1.0" + 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" Modified: trunk/src/doc/xhtml2html.xslt =================================================================== --- trunk/src/doc/xhtml2html.xslt 2006-06-03 12:38:34 UTC (rev 111) +++ trunk/src/doc/xhtml2html.xslt 2006-06-03 14:37:30 UTC (rev 112) @@ -1,7 +1,7 @@ <?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 $ --> <xsl:transform - version="1.0" + 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" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-04 18:14:14
|
Revision: 310 http://svn.sourceforge.net/gridarta/?rev=310&view=rev Author: akirschbaum Date: 2006-09-04 11:14:06 -0700 (Mon, 04 Sep 2006) Log Message: ----------- Fix typo in comment. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapTileList.java trunk/daimonin/src/daieditor/CMapTileList.java Modified: trunk/crossfire/src/cfeditor/CMapTileList.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapTileList.java 2006-09-04 17:32:02 UTC (rev 309) +++ trunk/crossfire/src/cfeditor/CMapTileList.java 2006-09-04 18:14:06 UTC (rev 310) @@ -362,7 +362,7 @@ } /** - * Add Inventory Objects to an arch in the MapTileList recursively. + * Add inventory objects to an arch in the MapTileList recursively. * @param node the arch where the inventory gets added * @param x map location of 'node' as strings * @param y map location of 'node' as strings Modified: trunk/daimonin/src/daieditor/CMapTileList.java =================================================================== --- trunk/daimonin/src/daieditor/CMapTileList.java 2006-09-04 17:32:02 UTC (rev 309) +++ trunk/daimonin/src/daieditor/CMapTileList.java 2006-09-04 18:14:06 UTC (rev 310) @@ -373,7 +373,7 @@ } /** - * Add Inventory Objects to an arch in the MapTileList recursively. + * Add inventory objects to an arch in the MapTileList recursively. * @param node the arch where the inventory gets added * @param selArch selected ArchObject * @return <code>-1</code> if <var>selArch</var> was found, else <var>listCounter</var> of the arch This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-09 18:07:56
|
Revision: 311 http://svn.sourceforge.net/gridarta/?rev=311&view=rev Author: akirschbaum Date: 2006-09-09 11:07:45 -0700 (Sat, 09 Sep 2006) Log Message: ----------- Fix typo in comment. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/CMapArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-09-04 18:14:06 UTC (rev 310) +++ trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-09-09 18:07:45 UTC (rev 311) @@ -283,7 +283,7 @@ final ArchObject invnew; if (arch.isDefaultArch()) { - // create a new copy of a defautl arch + // create a new copy of a default arch invnew = mainControl.getArchObjectStack().newArchObjectInstance(arch.getNodeNr()); } else { // create clone from a pickmap Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-04 18:14:06 UTC (rev 310) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-09 18:07:45 UTC (rev 311) @@ -596,7 +596,7 @@ if (newarch != null && newarch.isDefaultArch()) { archnr = newarch.getNodeNr(); } - // create a new copy of a defautl arch + // create a new copy of a default arch invnew = mainControl.getArchObjectStack().newArchObjectInstance(archnr); } else { // create clone from a pickmap Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-09-04 18:14:06 UTC (rev 310) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-09-09 18:07:45 UTC (rev 311) @@ -336,7 +336,7 @@ if (newarch != null && newarch.isDefaultArch()) { archname = newarch.getArchName(); } - // create a new copy of a defautl arch + // create a new copy of a default arch invnew = mainControl.getArchObjectStack().getArch(archname).createArch(); } else { // create clone from a pickmap This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-09 18:13:55
|
Revision: 312 http://svn.sourceforge.net/gridarta/?rev=312&view=rev Author: christianhujer Date: 2006-09-09 11:13:24 -0700 (Sat, 09 Sep 2006) Log Message: ----------- MapArchObject unification. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/crossfire/src/cfeditor/map/MapArchObject.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/MapViewIFrame.java trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java trunk/daimonin/src/daieditor/map/MapArchObject.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/src/app/net/sf/gridarta/Size2D.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java trunk/src/app/net/sf/gridarta/map/MapArchObject.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-09 18:07:45 UTC (rev 311) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-09 18:13:24 UTC (rev 312) @@ -733,7 +733,7 @@ */ public MapControl newLevel(final List<ArchObject> objects, final MapArchObject maparch, final boolean show, final Point initial) { // Create a new level control and set the level view from that - CMainStatusbar.getInstance().setText(" Creating new map " + maparch.getMapName()); + CMainStatusbar.getInstance().setText(" Creating new map " + maparch.getMapDisplayName()); final MapControl map = new MapControl(this, objects, maparch, false, initial); if (show) { Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-09 18:07:45 UTC (rev 311) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-09 18:13:24 UTC (rev 312) @@ -900,12 +900,12 @@ * @return the map name */ public String getMapName() { - return mapArch.getMapName(); + return mapArch.getMapDisplayName(); } /** ??? */ public String getMapNameWithoutMusic() { - return mapArch.getMapNameWithoutMusic(); + return mapArch.getMapDisplayName(); } /** Modified: trunk/crossfire/src/cfeditor/map/MapArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-09-09 18:07:45 UTC (rev 311) +++ trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-09-09 18:13:24 UTC (rev 312) @@ -29,6 +29,8 @@ import java.io.BufferedWriter; import java.io.IOException; import net.sf.gridarta.Size2D; +import net.sf.gridarta.map.AbstractMapArchObject; +import org.jetbrains.annotations.NotNull; /** * MapArchObject contains the specific meta data about a map that is stored in @@ -37,47 +39,20 @@ * ordinary ArchObject, but that's just no longer appropriate. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> */ -public final class MapArchObject { +public final class MapArchObject extends AbstractMapArchObject { // tags which appear in the map header - private static final String TAG_START_TEXT = "msg"; - - private static final String TAG_END_TEXT = "endmsg"; - private static final String TAG_START_LORE = "maplore"; private static final String TAG_END_LORE = "endmaplore"; - // map name to display if a map has none - private static final String DEFAULT_MAP_NAME = "<untitled>"; - public static final int MAX_TILE = IGUIConstants.DIRECTIONS; - public static final int TILE_NORTH = IGUIConstants.NORTH; - - public static final int TILE_EAST = IGUIConstants.EAST; - - public static final int TILE_SOUTH = IGUIConstants.SOUTH; - - public static final int TILE_WEST = IGUIConstants.WEST; - - public static final int TILE_TOP = IGUIConstants.TOP; - - public static final int TILE_BOTTOM = IGUIConstants.BOTTOM; - // map attributes: private final StringBuffer msgText = new StringBuffer(""); // map-msg text buffer private final StringBuffer loreText = new StringBuffer(""); // lore text buffer - /** - * Map size. - */ - private Size2D mapSize = new Size2D(1, 1); - - /** Default enter coordinates (usage not recommended). */ - private int enterX, enterY; - /** Number of seconds that need to elapse before this map will be reset. */ private int resetTimeout; @@ -148,42 +123,6 @@ /** The maximum price the shop will trade for. */ private int shopmax; - /** No magic spells. */ - private boolean noMagic; - - /** No prayers. */ - private boolean noPriest; - - /** No harmful spells allowed. */ - private boolean noHarm; - - /** No summoning allowed. */ - private boolean noSummon; - - /** Check map reset status after re-login. */ - private boolean fixedLogin; - - /** Permanent death with revivable corpses. */ - private boolean permDeath; - - /** Permament death with corpses temporarily available. */ - private boolean ultraDeath; - - /** Permanent death with instant character deletion. */ - private boolean ultimateDeath; - - /** Player vs Player combat allowed. */ - private boolean pvp; - - /** Map name (this is the name that appears in the game). */ - private String name; - - /** - * Name of the map file. - * @todo check whether this is redundant. - */ - private String filename; - /** The region the map is in. */ private String region = ""; @@ -198,8 +137,6 @@ * All fields will be set to reasonable default values. */ public MapArchObject() { - enterX = 0; - enterY = 0; resetTimeout = 0; swapTime = 0; difficulty = 0; @@ -207,8 +144,6 @@ for (int i = 0; i < MAX_TILE; i++) { tilePaths[i] = ""; } - name = DEFAULT_MAP_NAME; // map creation enforces setting a real map name - filename = IGUIConstants.DEF_MAPFNAME; // default map file name fixedReset = false; unique = false; @@ -217,98 +152,27 @@ nosmooth = false; // iso flags - noMagic = false; - noPriest = false; - noSummon = false; - fixedLogin = false; - permDeath = false; - ultraDeath = false; - ultimateDeath = false; - pvp = false; } /** - * Get the map name without the background music that is attached to the - * map name. (This is for Daimonin only.) - * @return map name without attached music string + * {@inheritDoc} + * @note Crossfire currently doesn't store additional information in a map name. */ - public String getMapNameWithoutMusic() { - return name; + public String getMapDisplayName() { + return getMapName(); } /** - * Set map size. - * @param mapSize new map size - */ - public void setMapSize(final Size2D mapSize) { - if (mapSize == null) { - throw new IllegalArgumentException("No map size set"); - } - - this.mapSize = mapSize; - } - - /** * Ensure that the map size is at least the given size. * @param width the new minimum map width * @param height the new minimum map height */ public void ensureMapSize(final int width, final int height) { + Size2D mapSize = getMapSize(); mapSize = new Size2D(Math.max(mapSize.getWidth(), width), Math.max(mapSize.getHeight(), height)); + setMapSize(mapSize); } - public Size2D getMapSize() { - return mapSize; - } - - /** - * Get the map name. - * @return map name - */ - public String getMapName() { - return name; - } - - /** - * Set the map name. - * @param name new map name - */ - public void setMapName(final String name) { - this.name = name; - } - - /** - * Get the map filename. - * @return map filename - */ - public String getFileName() { - return filename; - } - - /** - * Set the map filename. - * @param filename new map filename - */ - public void setFileName(final String filename) { - this.filename = filename; - } - - public int getEnterX() { - return enterX; - } - - public void setEnterX(final int enterX) { - this.enterX = enterX; - } - - public int getEnterY() { - return enterY; - } - - public void setEnterY(final int enterY) { - this.enterY = enterY; - } - public int getResetTimeout() { return resetTimeout; } @@ -485,78 +349,6 @@ sky = t; } - public boolean isNoMagic() { - return noMagic; - } - - public void setNoMagic(final boolean noMagic) { - this.noMagic = noMagic; - } - - public boolean isNoPriest() { - return noPriest; - } - - public void setNoPriest(final boolean noPriest) { - this.noPriest = noPriest; - } - - public boolean isNoSummon() { - return noSummon; - } - - public void setNoSummon(final boolean noSummon) { - this.noSummon = noSummon; - } - - public boolean isNoHarm() { - return noHarm; - } - - public void setNoHarm(final boolean noHarm) { - this.noHarm = noHarm; - } - - public boolean isFixedLogin() { - return fixedLogin; - } - - public void setFixedLogin(final boolean fixedLogin) { - this.fixedLogin = fixedLogin; - } - - public boolean isPermDeath() { - return permDeath; - } - - public void setPermDeath(final boolean permDeath) { - this.permDeath = permDeath; - } - - public boolean isUltraDeath() { - return ultraDeath; - } - - public void setUltraDeath(final boolean ultraDeath) { - this.ultraDeath = ultraDeath; - } - - public boolean isUltimateDeath() { - return ultimateDeath; - } - - public void setUltimateDeath(final boolean ultimateDeath) { - this.ultimateDeath = ultimateDeath; - } - - public boolean isPvp() { - return pvp; - } - - public void setPvp(final boolean pvp) { - this.pvp = pvp; - } - /** * Append 'text' to the map text. * @param text string to add @@ -608,7 +400,7 @@ * otherwise false */ public boolean parseMapArch(final BufferedReader reader, final String fname) { - filename = fname; // store file name + setFileName(fname); String line2; // input line, includes leading and trailing white space boolean loreflag = false; // flag for lore-text boolean archflag = false; // flag for arch<->end @@ -653,7 +445,7 @@ } else if (line.equalsIgnoreCase("end")) { endReached = true; } else if (line.startsWith("name")) { - name = line.substring(line.indexOf(" ") + 1).trim(); + setMapName(line.substring(line.indexOf(" ") + 1).trim()); } else if (line.startsWith("region")) { region = line.substring(line.indexOf(" ") + 1).trim(); } else if (line.startsWith("width") || line.startsWith("x ")) { @@ -661,9 +453,9 @@ } else if (line.startsWith("height") || line.startsWith("y ")) { height = getLineValue(line); } else if (line.startsWith("enter_x") || line.startsWith("hp")) { - enterX = getLineValue(line); + setEnterX(getLineValue(line)); } else if (line.startsWith("enter_y") || line.startsWith("sp")) { - enterY = getLineValue(line); + setEnterY(getLineValue(line)); } else if (line.startsWith("reset_timeout") || line.startsWith("weight")) { resetTimeout = getLineValue(line); } else if (line.startsWith("swap_time") || line.startsWith("value")) { @@ -738,7 +530,7 @@ return false; } - mapSize = new Size2D(Math.max(1, width), Math.max(1, height)); + setMapSize(new Size2D(Math.max(1, width), Math.max(1, height))); return archflag; } @@ -781,8 +573,8 @@ int i; stream.append("arch map\n"); - if (name.length() > 0 && !name.equals(DEFAULT_MAP_NAME)) { - stream.append("name " + name + "\n"); + if (getMapName().length() > 0) { + stream.append("name " + getMapName() + "\n"); } if (swapTime > 0) { stream.append("swap_time " + swapTime + "\n"); @@ -817,13 +609,13 @@ if (darkness > 0) { stream.append("darkness " + darkness + "\n"); } - stream.append("width " + mapSize.getWidth() + "\n"); - stream.append("height " + mapSize.getHeight() + "\n"); - if (enterX > 0) { - stream.append("enter_x " + enterX + "\n"); + stream.append("width " + getMapSize().getWidth() + "\n"); + stream.append("height " + getMapSize().getHeight() + "\n"); + if (getEnterX() > 0) { + stream.append("enter_x " + getEnterX() + "\n"); } - if (enterY > 0) { - stream.append("enter_y " + enterY + "\n"); + if (getEnterY() > 0) { + stream.append("enter_y " + getEnterY() + "\n"); } if (msgText.length() > 0 && msgText.toString().trim().length() > 0) { stream.append(TAG_START_TEXT + "\n"); Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-09-09 18:07:45 UTC (rev 311) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-09-09 18:13:24 UTC (rev 312) @@ -476,10 +476,10 @@ showTiles = show; if (show) { /*Do the tile maps loading :)*/ - final String north = mapModel.getMapArchObject().getTilePath(MapArchObject.TILE_NORTH); - final String west = mapModel.getMapArchObject().getTilePath(MapArchObject.TILE_WEST); - final String east = mapModel.getMapArchObject().getTilePath(MapArchObject.TILE_EAST); - final String south = mapModel.getMapArchObject().getTilePath(MapArchObject.TILE_SOUTH); + final String north = mapModel.getMapArchObject().getTilePath(IGUIConstants.NORTH); + final String west = mapModel.getMapArchObject().getTilePath(IGUIConstants.WEST); + final String east = mapModel.getMapArchObject().getTilePath(IGUIConstants.EAST); + final String south = mapModel.getMapArchObject().getTilePath(IGUIConstants.SOUTH); /*tileModel = new DefaultMapModel[8]; CMapFileDecode loader; MapControl tmp; Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-09-09 18:07:45 UTC (rev 311) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-09-09 18:13:24 UTC (rev 312) @@ -1009,7 +1009,7 @@ } if (!forced && level.isLevelChanged()) { - final int result = ACTION_FACTORY.showConfirmDialog(mainView, YES_NO_CANCEL_OPTION, WARNING_MESSAGE, "confirmSaveChanges", level.getMapArch().getMapNameWithoutMusic()); + final int result = ACTION_FACTORY.showConfirmDialog(mainView, YES_NO_CANCEL_OPTION, WARNING_MESSAGE, "confirmSaveChanges", level.getMapArch().getMapDisplayName()); if (result == YES_OPTION) { if (level.isPlainSaveEnabled()) { level.save(); @@ -1225,7 +1225,7 @@ newMap.setActiveEditType(tileEdit); // map is loaded with current view settings if (view) { refreshMenusAndToolbars(); - addRecent(currentMap.getMapArch().getMapNameWithoutMusic(), file.toString()); + addRecent(currentMap.getMapArch().getMapDisplayName(), file.toString()); } return newMap; } catch (final FileNotFoundException e) { Modified: trunk/daimonin/src/daieditor/MapViewIFrame.java =================================================================== --- trunk/daimonin/src/daieditor/MapViewIFrame.java 2006-09-09 18:07:45 UTC (rev 311) +++ trunk/daimonin/src/daieditor/MapViewIFrame.java 2006-09-09 18:13:24 UTC (rev 312) @@ -74,7 +74,7 @@ */ public MapViewIFrame(final CMainControl mainControl, final MapControl mapControl, final int number) { // set title - super(mapControl.getMapFileName() + " [ " + mapControl.getMapArch().getMapNameWithoutMusic() + " ] ("+ number + ')', true, true, true, true); + super(mapControl.getMapFileName() + " [ " + mapControl.getMapArch().getMapDisplayName() + " ] ("+ number + ')', true, true, true, true); this.mapControl = mapControl; this.mainControl = mainControl; viewNumber = number; @@ -109,7 +109,7 @@ } final StringBuilder strTitle = new StringBuilder(); - strTitle.append(mapControl.getMapFileName()).append(" [ ").append(mapControl.getMapArch().getMapNameWithoutMusic()).append(" ] ("); + strTitle.append(mapControl.getMapFileName()).append(" [ ").append(mapControl.getMapArch().getMapDisplayName()).append(" ] ("); strTitle.append(viewNumber).append(')'); if (view.isChanged()) { Modified: trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-09-09 18:07:45 UTC (rev 311) +++ trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-09-09 18:13:24 UTC (rev 312) @@ -274,7 +274,7 @@ mapPanel.add(new JLabel(ACTION_FACTORY.getString("mapName")), labelGbc); mapName.setColumns(16); - mapName.setText(mapControl.getMapArch().getMapNameWithoutMusic()); + mapName.setText(mapControl.getMapArch().getMapDisplayName()); mapPanel.add(mapName, gbc); mapPanel.add(new JLabel(ACTION_FACTORY.getString("mapSound")), labelGbc); @@ -497,7 +497,7 @@ final MapArchObject map = mapControl.getMapModel().getMapArchObject(); // map arch object mapDescription.setText(mapArch.getText()); - mapName.setText(mapControl.getMapArch().getMapNameWithoutMusic()); + mapName.setText(mapControl.getMapArch().getMapDisplayName()); mapSound.setText(mapControl.getMapArch().getBackgroundMusic()); levelWidthField.setText(Integer.toString(map.getMapSize().getWidth())); levelHeightField.setText(Integer.toString(map.getMapSize().getHeight())); @@ -541,7 +541,7 @@ */ public static void showDialog(final CMainView mainView, final CMainControl mainControl, final MapControl level) { final MapPropertiesDialog pane = new MapPropertiesDialog(mainControl, level); - final JDialog dialog = pane.createDialog(mainView, ACTION_FACTORY.format("mapTitle", level.getMapArch().getMapNameWithoutMusic(), level.getMapFileName())); + final JDialog dialog = pane.createDialog(mainView, ACTION_FACTORY.format("mapTitle", level.getMapArch().getMapDisplayName(), level.getMapFileName())); dialog.getRootPane().setDefaultButton(pane.okButton); dialog.setResizable(true); dialog.setModal(false); Modified: trunk/daimonin/src/daieditor/map/MapArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-09-09 18:07:45 UTC (rev 311) +++ trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-09-09 18:13:24 UTC (rev 312) @@ -30,6 +30,7 @@ import java.io.IOException; import java.io.Serializable; import net.sf.gridarta.Size2D; +import net.sf.gridarta.map.AbstractMapArchObject; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -45,28 +46,14 @@ * @todo This class should be changed so map attributes are reflected in a more * generic way like arch attributes. */ -public final class MapArchObject implements Serializable { +public final class MapArchObject extends AbstractMapArchObject implements Serializable { /** Serial Version. */ private static final long serialVersionUID = 1L; - // tags which appear in the map header - private static final String TAG_START_TEXT = "msg"; - - private static final String TAG_END_TEXT = "endmsg"; - // map attributes: private final StringBuffer msgText = new StringBuffer(); // map-msg text buffer - /** - * Map size. - * @fixme this is redundant with {@link DefaultMapModel}. - m */ - @NotNull private Size2D mapSize = new Size2D(1, 1); - - /** Default enter coordinates (usage not recommended). */ - private int enterX, enterY; - /** Number of seconds that need to elapse before this map will be reset. */ private int resetTimeout; @@ -128,16 +115,7 @@ /** Player vs Player combat allowed. */ private boolean pvp; - /** Map name (this is the name that appears in the game). */ - private String name; - /** - * Name of the map file. - * @todo check whether this is redundant. - */ - private String filename; - - /** * The map tile paths used for map tiling. * 0 = north, 1 = east, 2 = south, 3 = west. * 4 = northeast, 5 = southeast, 6 = southwest, 7 = northwest @@ -164,18 +142,15 @@ for (int i = 0; i < 8; i++) { tilePaths[i] = ""; } - name = "<untitled>"; // map creation enforces setting a real map name - filename = DEF_MAPFNAME; // default map file name } /** - * Get the map name without the background music that is attached to the - * map name. - * @return map name without attached music string + * {@inheritDoc} + * @note Daimonin stores background music information in the map name. */ - public String getMapNameWithoutMusic() { - final int t = name.indexOf("§"); - return t > 0 ? name.substring(0, t) : name; + public String getMapDisplayName() { + final int t = getMapName().indexOf("§"); + return t > 0 ? getMapName().substring(0, t) : getMapName(); } /** @@ -183,71 +158,11 @@ * @return background music or <code>null</code> if no background music */ public String getBackgroundMusic() { - final int t1 = name.indexOf("§"); - final int t2 = name.indexOf("|"); - return t1 > 0 && t2 > t1 ? name.substring(t1 + 1, t2) : null; + final int t1 = getMapName().indexOf("§"); + final int t2 = getMapName().indexOf("|"); + return t1 > 0 && t2 > t1 ? getMapName().substring(t1 + 1, t2) : null; } - /** - * Set map size. - * @param mapSize new map size - */ - public void setMapSize(@NotNull final Size2D mapSize) { - this.mapSize = mapSize; - } - - @NotNull public Size2D getMapSize() { - return mapSize; - } - - /** - * Get the map name. - * @return map name - */ - public String getMapName() { - return name; - } - - /** - * Set the map name. - * @param name new map name - */ - public void setMapName(final String name) { - this.name = name; - } - - /** - * Get the map filename. - * @return map filename - */ - public String getFileName() { - return filename; - } - - /** - * Set the map filename. - * @param filename new map filename - */ - public void setFileName(final String filename) { - this.filename = filename; - } - - public int getEnterX() { - return enterX; - } - - public void setEnterX(final int enterX) { - this.enterX = enterX; - } - - public int getEnterY() { - return enterY; - } - - public void setEnterY(final int enterY) { - this.enterY = enterY; - } - public int getResetTimeout() { return resetTimeout; } @@ -421,7 +336,7 @@ * @throws IOException in case of I/O problems */ public boolean parseMapArch(@NotNull final BufferedReader reader, @NotNull final String fname) throws IOException { - filename = fname; // store file name + setFileName(fname); boolean archflag = false; // flag for arch<->end int width = 0; int height = 0; @@ -451,15 +366,15 @@ } else if ("end".equalsIgnoreCase(line)) { endReached = true; } else if (line.startsWith("name")) { - name = line.substring(line.indexOf(" ") + 1).trim(); + setMapName(line.substring(line.indexOf(" ") + 1).trim()); } else if (line.startsWith("width ")) { width = getLineValue(line); } else if (line.startsWith("height ")) { height = getLineValue(line); } else if (line.startsWith("enter_x ")) { - enterX = getLineValue(line); + setEnterX(getLineValue(line)); } else if (line.startsWith("enter_y ")) { - enterY = getLineValue(line); + setEnterY(getLineValue(line)); } else if (line.startsWith("reset_timeout ")) { resetTimeout = getLineValue(line); } else if (line.startsWith("swap_time ")) { @@ -549,7 +464,7 @@ } } - mapSize = new Size2D(Math.max(1, width), Math.max(1, height)); + setMapSize(new Size2D(Math.max(1, width), Math.max(1, height))); return archflag; } @@ -579,8 +494,8 @@ public void writeMapArch(@NotNull final BufferedWriter stream) throws IOException { stream.append("arch map\n"); - if (name.length() > 0) { - stream.append("name " + name + '\n'); + if (getMapName().length() > 0) { + stream.append("name " + getMapName() + '\n'); } // maptext @@ -588,13 +503,13 @@ stream.append(msgText.toString().trim() + '\n'); stream.append(TAG_END_TEXT + '\n'); - stream.append("width " + mapSize.getWidth() + '\n'); - stream.append("height " + mapSize.getHeight() + '\n'); - if (enterX > 0) { - stream.append("enter_x " + enterX + '\n'); + stream.append("width " + getMapSize().getWidth() + '\n'); + stream.append("height " + getMapSize().getHeight() + '\n'); + if (getEnterX() > 0) { + stream.append("enter_x " + getEnterX() + '\n'); } - if (enterY > 0) { - stream.append("enter_y " + enterY + '\n'); + if (getEnterY() > 0) { + stream.append("enter_y " + getEnterY() + '\n'); } if (resetTimeout > 0) { Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2006-09-09 18:07:45 UTC (rev 311) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2006-09-09 18:13:24 UTC (rev 312) @@ -328,7 +328,7 @@ public void setMapFileName(final String fname) { if (mapViewFrame != null) { - final String title = fname + " [ " + mapArch.getMapNameWithoutMusic() + " ]"; + final String title = fname + " [ " + mapArch.getMapDisplayName() + " ]"; assert mapViewFrame != null; mapViewFrame.setTitle(title); } Modified: trunk/src/app/net/sf/gridarta/Size2D.java =================================================================== --- trunk/src/app/net/sf/gridarta/Size2D.java 2006-09-09 18:07:45 UTC (rev 311) +++ trunk/src/app/net/sf/gridarta/Size2D.java 2006-09-09 18:13:24 UTC (rev 312) @@ -30,6 +30,9 @@ /** Serial Version. */ private static final long serialVersionUID = 1L; + /** Zero size object. */ + public static final Size2D ZERO = new Size2D(0, 0); + /** * The width of the area. * It is always greater than zero. Added: trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java (rev 0) +++ trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java 2006-09-09 18:13:24 UTC (rev 312) @@ -0,0 +1,78 @@ +package net.sf.gridarta.map; + +import org.jetbrains.annotations.NotNull; +import net.sf.gridarta.Size2D; +import net.sf.gridarta.CommonConstants; + +/** + * Base implementation of {@link MapArchObject} that covers similarities between Crossfire maps and Daimonin maps. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public abstract class AbstractMapArchObject implements MapArchObject { + + /** The size of the map reflected by this MapArchObject. */ + private Size2D mapSize = Size2D.ZERO; + + /** The name of this map. */ + private String mapName = "<unnamed>"; + + /** The filename of this map. */ + private String fileName = "<new map>"; + + /** The x coordinate for entering the map. */ + private int enterX; + + /** The y coordinate for entering the map. */ + private int enterY; + + /** {@inheritDoc} */ + @NotNull public final Size2D getMapSize() { + return mapSize; + } + + /** {@inheritDoc} */ + public final void setMapSize(@NotNull final Size2D mapSize) { + this.mapSize = mapSize; + } + + /** {@inheritDoc} */ + @NotNull public final String getMapName() { + return mapName; + } + + /** {@inheritDoc} */ + public final void setMapName(@NotNull final String name) { + this.mapName = name; + } + + /** {@inheritDoc} */ + public final String getFileName() { + return fileName; + } + + /** {@inheritDoc} */ + public final void setFileName(final String fileName) { + this.fileName = fileName; + } + + /** {@inheritDoc} */ + public final int getEnterX() { + return enterX; + } + + /** {@inheritDoc} */ + public final void setEnterX(final int enterX) { + this.enterX = enterX; + } + + /** {@inheritDoc} */ + public final int getEnterY() { + return enterY; + } + + /** {@inheritDoc} */ + public final void setEnterY(final int enterY) { + this.enterY = enterY; + } + +} // class AbstractMapArchObject Property changes on: trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/map/MapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapArchObject.java (rev 0) +++ trunk/src/app/net/sf/gridarta/map/MapArchObject.java 2006-09-09 18:13:24 UTC (rev 312) @@ -0,0 +1,91 @@ +package net.sf.gridarta.map; + +import org.jetbrains.annotations.NotNull; +import net.sf.gridarta.Size2D; + +/** + * Interface for MapArchObjects. + * <h4>Enter coordinates</h4> + * Enter coordinates ({@link #getEnterX()}, {@link #setEnterX(int)}, {@link #getEnterY()}, {@link #setEnterY(int)}) determines where a player enters this map from another map when using an exit. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public interface MapArchObject { + + /** String which starts the message section. */ + String TAG_START_TEXT = "msg"; + + /** String which ends the message section. */ + String TAG_END_TEXT = "endmsg"; + + /** + * Get the map name as seen by the player. + * For games encode additional information in the map name, e.g. the background music, which should be hidden from the user. + * This method returns the map name without such additional information. + * @return map name as it should be shown to the user + */ + String getMapDisplayName(); + + /** + * Set map size. + * @param mapSize new map size + * @xxx this does not change the size of the underlying MapModel. We eventually should change that so a map size isn't stored twice. + */ + void setMapSize(@NotNull Size2D mapSize); + + /** + * Get the map size. + * @return size of the map reflected by this MapArchObject + */ + @NotNull Size2D getMapSize(); + + /** + * Get the map name. + * @return map name + */ + @NotNull String getMapName(); + + /** + * Set the map name. + * @param name new map name + */ + void setMapName(@NotNull String name); + + /** + * Get the map filename. + * @return map filename + * @deprecated the filename isn't really an attribute of the MapArchObject. Only use MapControl for this. + */ + String getFileName(); + + /** + * Set the map fileName. + * @param fileName new map fileName + * @deprecated the fileName isn't really an attribute of the MapArchObject. Only use MapControl for this. + */ + void setFileName(String fileName); + + /** + * Get enter x coordinate. + * @return enter x coordinate. + */ + int getEnterX(); + + /** + * Set enter x coordinate. + * @param enterX new enter x coordinate + */ + void setEnterX(int enterX); + + /** + * Get enter y coordinate. + * @return enter y coordinate. + */ + int getEnterY(); + + /** + * Set enter y coordinate. + * @param enterY new enter y coordinate + */ + void setEnterY(int enterY); + +} // interface MapArchObject Property changes on: trunk/src/app/net/sf/gridarta/map/MapArchObject.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-10 18:33:17
|
Revision: 316 http://svn.sourceforge.net/gridarta/?rev=316&view=rev Author: christianhujer Date: 2006-09-10 11:32:58 -0700 (Sun, 10 Sep 2006) Log Message: ----------- More MapArchObject unification. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/MapArchObject.java trunk/daimonin/src/daieditor/map/MapArchObject.java trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java trunk/src/app/net/sf/gridarta/map/MapArchObject.java Modified: trunk/crossfire/src/cfeditor/map/MapArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-09-10 16:21:15 UTC (rev 315) +++ trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-09-10 18:32:58 UTC (rev 316) @@ -30,7 +30,6 @@ import java.io.IOException; import net.sf.gridarta.Size2D; import net.sf.gridarta.map.AbstractMapArchObject; -import org.jetbrains.annotations.NotNull; /** * MapArchObject contains the specific meta data about a map that is stored in @@ -39,7 +38,7 @@ * ordinary ArchObject, but that's just no longer appropriate. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> */ -public final class MapArchObject extends AbstractMapArchObject { +@SuppressWarnings({"HardcodedLineSeparator"}) public final class MapArchObject extends AbstractMapArchObject { // tags which appear in the map header private static final String TAG_START_LORE = "maplore"; @@ -53,34 +52,6 @@ private final StringBuffer loreText = new StringBuffer(""); // lore text buffer - /** Number of seconds that need to elapse before this map will be reset. */ - private int resetTimeout; - - /** - * Number of ticks that must elapse after tha map has not been used before - * it gets swapped out. - */ - private int swapTime; - - /** - * Map difficulty. If zero, server calculates something. - */ - private int difficulty; - - /** - * If nonzero, the map reset time will not be updated when someone enters / - * exits the map. - */ - private boolean fixedReset; - - /** - * Light / darkness of map (overall). Zero means fully bright. - */ - private int darkness; - - /** If set, this entire map is unique. */ - private boolean unique; - /** If set, this entire map is a template map. */ private boolean template; @@ -137,21 +108,12 @@ * All fields will be set to reasonable default values. */ public MapArchObject() { - resetTimeout = 0; - swapTime = 0; - difficulty = 0; - darkness = 0; for (int i = 0; i < MAX_TILE; i++) { tilePaths[i] = ""; } - - fixedReset = false; - unique = false; template = false; outdoor = false; nosmooth = false; - - // iso flags } /** @@ -173,54 +135,6 @@ setMapSize(mapSize); } - public int getResetTimeout() { - return resetTimeout; - } - - public void setResetTimeout(final int resetTimeout) { - this.resetTimeout = resetTimeout; - } - - public int getSwapTime() { - return swapTime; - } - - public void setSwapTime(final int swapTime) { - this.swapTime = swapTime; - } - - public int getDifficulty() { - return difficulty; - } - - public void setDifficulty(final int difficulty) { - this.difficulty = difficulty; - } - - public boolean isFixedReset() { - return fixedReset; - } - - public void setFixedReset(final boolean fixedReset) { - this.fixedReset = fixedReset; - } - - public int getDarkness() { - return darkness; - } - - public void setDarkness(final int darkness) { - this.darkness = darkness; - } - - public boolean isUnique() { - return unique; - } - - public void setUnique(final boolean unique) { - this.unique = unique; - } - public boolean isTemplate() { return template; } @@ -457,20 +371,20 @@ } else if (line.startsWith("enter_y") || line.startsWith("sp")) { setEnterY(getLineValue(line)); } else if (line.startsWith("reset_timeout") || line.startsWith("weight")) { - resetTimeout = getLineValue(line); + setResetTimeout(getLineValue(line)); } else if (line.startsWith("swap_time") || line.startsWith("value")) { - swapTime = getLineValue(line); + setSwapTime(getLineValue(line)); } else if (line.startsWith("difficulty") || line.startsWith("level")) { - difficulty = getLineValue(line); + setDifficulty(getLineValue(line)); } else if (line.startsWith("darkness") || line.startsWith("invisible")) { - darkness = getLineValue(line); + setDarkness(getLineValue(line)); } else if (line.startsWith("fixed_resettime") || line.startsWith("stand_still")) { if (getLineValue(line) != 0) { - fixedReset = true; + setFixedReset(true); } } else if (line.startsWith("unique")) { if (getLineValue(line) != 0) { - unique = true; + setUnique(true); } } else if (line.startsWith("template")) { if (getLineValue(line) != 0) { @@ -574,60 +488,60 @@ stream.append("arch map\n"); if (getMapName().length() > 0) { - stream.append("name " + getMapName() + "\n"); + stream.append("name ").append(getMapName()).append("\n"); } - if (swapTime > 0) { - stream.append("swap_time " + swapTime + "\n"); + if (getSwapTime() > 0) { + stream.append("swap_time ").append(String.valueOf(getSwapTime())).append("\n"); } - if (resetTimeout > 0) { - stream.append("reset_timeout " + resetTimeout + "\n"); + if (getResetTimeout() > 0) { + stream.append("reset_timeout ").append(String.valueOf(getResetTimeout())).append("\n"); } - if (fixedReset) { + if (isFixedReset()) { stream.append("fixed_resettime 1\n"); } - if (difficulty > 0) { - stream.append("difficulty " + difficulty + "\n"); + if (getDifficulty() > 0) { + stream.append("difficulty ").append(String.valueOf(getDifficulty())).append("\n"); } if (region.length() > 0) { - stream.append("region " + region + "\n"); + stream.append("region ").append(region).append("\n"); } if (shopitems.length() > 0) { - stream.append("shopitems " + shopitems + "\n"); + stream.append("shopitems ").append(shopitems).append("\n"); } if (shopgreed != 0) { - stream.append("shopgreed " + shopgreed + "\n"); + stream.append("shopgreed ").append(String.valueOf(shopgreed)).append("\n"); } if (shopmin != 0) { - stream.append("shopmin " + shopmin + "\n"); + stream.append("shopmin ").append(String.valueOf(shopmin)).append("\n"); } if (shopmax != 0) { - stream.append("shopmax " + shopmax + "\n"); + stream.append("shopmax ").append(String.valueOf(shopmax)).append("\n"); } if (shoprace.length() > 0) { - stream.append("shoprace " + shoprace + "\n"); + stream.append("shoprace ").append(shoprace).append("\n"); } - if (darkness > 0) { - stream.append("darkness " + darkness + "\n"); + if (getDarkness() > 0) { + stream.append("darkness ").append(String.valueOf(getDarkness())).append("\n"); } - stream.append("width " + getMapSize().getWidth() + "\n"); - stream.append("height " + getMapSize().getHeight() + "\n"); + stream.append("width ").append(String.valueOf(getMapSize().getWidth())).append("\n"); + stream.append("height ").append(String.valueOf(getMapSize().getHeight())).append("\n"); if (getEnterX() > 0) { - stream.append("enter_x " + getEnterX() + "\n"); + stream.append("enter_x ").append(String.valueOf(getEnterX())).append("\n"); } if (getEnterY() > 0) { - stream.append("enter_y " + getEnterY() + "\n"); + stream.append("enter_y ").append(String.valueOf(getEnterY())).append("\n"); } if (msgText.length() > 0 && msgText.toString().trim().length() > 0) { stream.append(TAG_START_TEXT + "\n"); - stream.append(msgText.toString().trim() + "\n"); + stream.append(msgText.toString().trim()).append("\n"); stream.append(TAG_END_TEXT + "\n"); } if (loreText.length() > 0 && loreText.toString().trim().length() > 0) { stream.append(TAG_START_LORE + "\n"); - stream.append(loreText.toString().trim() + "\n"); + stream.append(loreText.toString().trim()).append("\n"); stream.append(TAG_END_LORE + "\n"); } - if (unique) { + if (isUnique()) { stream.append("unique 1\n"); } if (template) { @@ -637,26 +551,26 @@ stream.append("outdoor 1\n"); } if (temp != 0) { - stream.append("temp " + temp + "\n"); + stream.append("temp ").append(String.valueOf(temp)).append("\n"); } if (pressure != 0) { - stream.append("pressure " + pressure + "\n"); + stream.append("pressure ").append(String.valueOf(pressure)).append("\n"); } if (humid != 0) { - stream.append("humid " + humid + "\n"); + stream.append("humid ").append(String.valueOf(humid)).append("\n"); } if (windspeed != 0) { - stream.append("windspeed " + windspeed + "\n"); + stream.append("windspeed ").append(String.valueOf(windspeed)).append("\n"); } if (winddir != 0) { - stream.append("winddir " + winddir + "\n"); + stream.append("winddir ").append(String.valueOf(winddir)).append("\n"); } if (sky != 0) { - stream.append("sky " + sky + "\n"); + stream.append("sky ").append(String.valueOf(sky)).append("\n"); } for (i = 0; i < MAX_TILE; i++) { if (tilePaths[i].length() > 0) { - stream.append("tile_path_" + (i + 1) + " " + tilePaths[i] + "\n"); + stream.append("tile_path_").append(String.valueOf(i + 1)).append(" ").append(tilePaths[i]).append("\n"); } } if (nosmooth) { Modified: trunk/daimonin/src/daieditor/map/MapArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-09-10 16:21:15 UTC (rev 315) +++ trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-09-10 18:32:58 UTC (rev 316) @@ -24,7 +24,6 @@ package daieditor.map; -import static daieditor.IGUIConstants.DEF_MAPFNAME; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; @@ -46,7 +45,7 @@ * @todo This class should be changed so map attributes are reflected in a more * generic way like arch attributes. */ -public final class MapArchObject extends AbstractMapArchObject implements Serializable { +@SuppressWarnings({"HardcodedLineSeparator"}) public final class MapArchObject extends AbstractMapArchObject implements Serializable { /** Serial Version. */ private static final long serialVersionUID = 1L; @@ -54,34 +53,6 @@ // map attributes: private final StringBuffer msgText = new StringBuffer(); // map-msg text buffer - /** Number of seconds that need to elapse before this map will be reset. */ - private int resetTimeout; - - /** - * Number of ticks that must elapse after tha map has not been used before - * it gets swapped out. - */ - private int swapTime; - - /** - * Map difficulty. If zero, server calculates something. - */ - private int difficulty; - - /** - * If nonzero, the map reset time will not be updated when someone enters / - * exits the map. - */ - private boolean fixedReset; - - /** - * Light / darkness of map (overall). Zero means fully bright. - */ - private int darkness = -1; - - /** If set, this entire map is unique. */ - private boolean unique; - /** If set, this is an outdoor map. */ private boolean outdoor; @@ -163,54 +134,6 @@ return t1 > 0 && t2 > t1 ? getMapName().substring(t1 + 1, t2) : null; } - public int getResetTimeout() { - return resetTimeout; - } - - public void setResetTimeout(final int resetTimeout) { - this.resetTimeout = resetTimeout; - } - - public int getSwapTime() { - return swapTime; - } - - public void setSwapTime(final int swapTime) { - this.swapTime = swapTime; - } - - public int getDifficulty() { - return difficulty; - } - - public void setDifficulty(final int difficulty) { - this.difficulty = difficulty < 1 ? 1 : difficulty; - } - - public boolean isFixedReset() { - return fixedReset; - } - - public void setFixedReset(final boolean fixedReset) { - this.fixedReset = fixedReset; - } - - public int getDarkness() { - return darkness; - } - - public void setDarkness(final int darkness) { - this.darkness = darkness; - } - - public boolean isUnique() { - return unique; - } - - public void setUnique(final boolean unique) { - this.unique = unique; - } - public boolean isOutdoor() { return outdoor; } @@ -376,20 +299,20 @@ } else if (line.startsWith("enter_y ")) { setEnterY(getLineValue(line)); } else if (line.startsWith("reset_timeout ")) { - resetTimeout = getLineValue(line); + setResetTimeout(getLineValue(line)); } else if (line.startsWith("swap_time ")) { - swapTime = getLineValue(line); + setSwapTime(getLineValue(line)); } else if (line.startsWith("difficulty ")) { setDifficulty(getLineValue(line)); } else if (line.startsWith("darkness ")) { - darkness = getLineValue(line); + setDarkness(getLineValue(line)); } else if (line.startsWith("fixed_resettime ")) { if (getLineValue(line) != 0) { - fixedReset = true; + setFixedReset(true); } } else if (line.startsWith("unique ")) { if (getLineValue(line) != 0) { - unique = true; + setUnique(true); } } else if (line.startsWith("outdoor ")) { if (getLineValue(line) != 0) { @@ -495,39 +418,39 @@ stream.append("arch map\n"); if (getMapName().length() > 0) { - stream.append("name " + getMapName() + '\n'); + stream.append("name ").append(getMapName()).append('\n'); } // maptext stream.append(TAG_START_TEXT + '\n'); - stream.append(msgText.toString().trim() + '\n'); + stream.append(msgText.toString().trim()).append('\n'); stream.append(TAG_END_TEXT + '\n'); - stream.append("width " + getMapSize().getWidth() + '\n'); - stream.append("height " + getMapSize().getHeight() + '\n'); + stream.append("width ").append(String.valueOf(getMapSize().getWidth())).append('\n'); + stream.append("height ").append(String.valueOf(getMapSize().getHeight())).append('\n'); if (getEnterX() > 0) { - stream.append("enter_x " + getEnterX() + '\n'); + stream.append("enter_x ").append(String.valueOf(getEnterX())).append('\n'); } if (getEnterY() > 0) { - stream.append("enter_y " + getEnterY() + '\n'); + stream.append("enter_y ").append(String.valueOf(getEnterY())).append('\n'); } - if (resetTimeout > 0) { - stream.append("resetTimeout " + resetTimeout + '\n'); + if (getResetTimeout() > 0) { + stream.append("resetTimeout ").append(String.valueOf(getResetTimeout())).append('\n'); } - if (swapTime > 0) { - stream.append("swap_time " + swapTime + '\n'); + if (getSwapTime() > 0) { + stream.append("swap_time ").append(String.valueOf(getSwapTime())).append('\n'); } - if (difficulty > 0) { - stream.append("difficulty " + difficulty + '\n'); + if (getDifficulty() > 0) { + stream.append("difficulty ").append(String.valueOf(getDifficulty())).append('\n'); } - if (darkness >= 0) { - stream.append("darkness " + darkness + '\n'); + if (getDarkness() >= 0) { + stream.append("darkness ").append(String.valueOf(getDarkness())).append('\n'); } - if (fixedReset) { + if (isFixedReset()) { stream.append("fixed_resettime 1\n"); } - if (unique) { + if (isUnique()) { stream.append("unique 1\n"); } if (outdoor) { Modified: trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java 2006-09-10 16:21:15 UTC (rev 315) +++ trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java 2006-09-10 18:32:58 UTC (rev 316) @@ -10,13 +10,13 @@ public abstract class AbstractMapArchObject implements MapArchObject { /** The size of the map reflected by this MapArchObject. */ - private Size2D mapSize = Size2D.ONE; + @NotNull private Size2D mapSize = Size2D.ONE; /** The name of this map. */ - private String mapName = "<unnamed>"; + @NotNull private String mapName = "<unnamed>"; /** The filename of this map. */ - private String fileName = "<new map>"; + @NotNull private String fileName = "<new map>"; /** The x coordinate for entering the map. */ private int enterX; @@ -24,6 +24,40 @@ /** The y coordinate for entering the map. */ private int enterY; + /** Number of seconds that need to elapse before this map will be reset. */ + private int resetTimeout; + + /** + * Number of ticks that must elapse after tha map has not been used before + * it gets swapped out. + */ + private int swapTime; + + /** + * Map difficulty. If zero, server calculates something. + */ + private int difficulty; + + /** + * If nonzero, the map reset time will not be updated when someone enters / + * exits the map. + */ + private boolean fixedReset; + + /** + * Light / darkness of map (overall). Zero means fully bright. + */ + private int darkness; + + /** If set, this entire map is unique. */ + private boolean unique; + + /** + * Create an AbstractMapArchObject. + */ + protected AbstractMapArchObject() { + } + /** {@inheritDoc} */ @NotNull public final Size2D getMapSize() { return mapSize; @@ -45,12 +79,12 @@ } /** {@inheritDoc} */ - public final String getFileName() { + @NotNull public final String getFileName() { return fileName; } /** {@inheritDoc} */ - public final void setFileName(final String fileName) { + public final void setFileName(@NotNull final String fileName) { this.fileName = fileName; } @@ -74,4 +108,64 @@ this.enterY = enterY; } + /** {@inheritDoc} */ + public int getResetTimeout() { + return resetTimeout; + } + + /** {@inheritDoc} */ + public void setResetTimeout(final int resetTimeout) { + this.resetTimeout = resetTimeout; + } + + /** {@inheritDoc} */ + public int getSwapTime() { + return swapTime; + } + + /** {@inheritDoc} */ + public void setSwapTime(final int swapTime) { + this.swapTime = swapTime; + } + + /** {@inheritDoc} */ + public int getDifficulty() { + return difficulty; + } + + /** {@inheritDoc} */ + public void setDifficulty(final int difficulty) { + this.difficulty = difficulty < 1 ? 1 : difficulty; + } + + /** {@inheritDoc} */ + public boolean isFixedReset() { + return fixedReset; + } + + /** {@inheritDoc} */ + public void setFixedReset(final boolean fixedReset) { + this.fixedReset = fixedReset; + } + + /** {@inheritDoc} */ + public int getDarkness() { + return darkness; + } + + /** {@inheritDoc} */ + public void setDarkness(final int darkness) { + this.darkness = darkness; + } + + /** {@inheritDoc} */ + public boolean isUnique() { + return unique; + } + + /** {@inheritDoc} */ + public void setUnique(final boolean unique) { + this.unique = unique; + } + } // class AbstractMapArchObject Modified: trunk/src/app/net/sf/gridarta/map/MapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapArchObject.java 2006-09-10 16:21:15 UTC (rev 315) +++ trunk/src/app/net/sf/gridarta/map/MapArchObject.java 2006-09-10 18:32:58 UTC (rev 316) @@ -54,15 +54,16 @@ * Get the map filename. * @return map filename * @deprecated the filename isn't really an attribute of the MapArchObject. Only use MapControl for this. + * @todo if this remains here, think whether the fileName is really not null or whether a nullable filename makes more sense. */ - String getFileName(); + @NotNull String getFileName(); /** * Set the map fileName. * @param fileName new map fileName * @deprecated the fileName isn't really an attribute of the MapArchObject. Only use MapControl for this. */ - void setFileName(String fileName); + void setFileName(@NotNull String fileName); /** * Get enter x coordinate. @@ -88,4 +89,77 @@ */ void setEnterY(int enterY); + /** + * Get the reset timeout (in seconds). + * @return reset timeout (in seconds). + */ + int getResetTimeout(); + + /** + * Set the reset timeout (in seconds). + * @param resetTimeout new reset timeout (in seconds) + */ + void setResetTimeout(int resetTimeout); + + /** + * Get the swap time (in ticks). + * @return swap time (in ticks). + */ + int getSwapTime(); + + /** + * Set the swap time (in ticks). + * @param swapTime (in ticks) + */ + void setSwapTime(int swapTime); + + /** + * Get the map's difficulty. + * @return map's difficulty. + */ + int getDifficulty(); + + /** + * Set the map's difficulty. + * @param difficulty new difficulty for this map + */ + void setDifficulty(int difficulty); + + /** + * Get whether this map uses a fixed reset. + * @return whether this map uses a fixed reset. + */ + boolean isFixedReset(); + + /** + * Set whether this map uses a fixed reset. + * @param fixedReset whether this map should use a fixed reset + */ + void setFixedReset(boolean fixedReset); + + /** + * Get the light / darkness of this map. + * (0 means fully bright) + * @return light / darkness of this map + */ + int getDarkness(); + + /** + * Set the light / darkness of this map. + * @param darkness new light / darkness of this map + */ + void setDarkness(int darkness); + + /** + * Get whether this map is unique. + * @return whether this map is unique + */ + boolean isUnique(); + + /** + * Set whether this map is unique. + * @param unique whether this map should be unique + */ + void setUnique(boolean unique); + } // interface MapArchObject This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-10 22:09:00
|
Revision: 320 http://svn.sourceforge.net/gridarta/?rev=320&view=rev Author: christianhujer Date: 2006-09-10 15:08:50 -0700 (Sun, 10 Sep 2006) Log Message: ----------- Sorted imports. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-10 21:58:29 UTC (rev 319) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-10 22:08:50 UTC (rev 320) @@ -40,8 +40,8 @@ import java.util.List; import net.sf.gridarta.Size2D; import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; /** * The level model that represents a level. Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-09-10 21:58:29 UTC (rev 319) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-09-10 22:08:50 UTC (rev 320) @@ -36,14 +36,12 @@ import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; -import java.io.IOException; -import java.io.ObjectInputStream; import javax.swing.event.EventListenerList; import net.sf.gridarta.Size2D; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; -import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * The level model that represents a level. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-10 22:22:09
|
Revision: 321 http://svn.sourceforge.net/gridarta/?rev=321&view=rev Author: christianhujer Date: 2006-09-10 15:21:43 -0700 (Sun, 10 Sep 2006) Log Message: ----------- Unified UndoStack (well it's not used, but any unification helps ;-) Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/map/MapControl.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/CUndoStack.java trunk/src/app/net/sf/gridarta/MainControl.java trunk/src/app/net/sf/gridarta/map/MapControl.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/CUndoStack.java trunk/daimonin/src/daieditor/CUndoStack.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-10 22:08:50 UTC (rev 320) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-10 22:21:43 UTC (rev 321) @@ -55,6 +55,8 @@ import javax.swing.filechooser.FileFilter; import cfeditor.GridderException; import net.sf.gridarta.Size2D; +import net.sf.gridarta.MainControl; +import net.sf.gridarta.CUndoStack; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.util.filter.file.EndingFileFilter; @@ -67,7 +69,7 @@ * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> */ -public final class CMainControl extends JFrame { +public final class CMainControl extends JFrame implements MainControl { /** ActionFactory. */ private static final ActionFactory ACTION_FACTORY = getFactory("cfeditor"); Deleted: trunk/crossfire/src/cfeditor/CUndoStack.java =================================================================== --- trunk/crossfire/src/cfeditor/CUndoStack.java 2006-09-10 22:08:50 UTC (rev 320) +++ trunk/crossfire/src/cfeditor/CUndoStack.java 2006-09-10 22:21:43 UTC (rev 321) @@ -1,197 +0,0 @@ -/* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package cfeditor; - -import cfeditor.map.MapControl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.WeakHashMap; -import net.sf.gridarta.Undoable; - -/** - * The undo/redo stack that is used when undoing/redoing operations. - * Every operation should add itself to the stack using the add() method. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - */ -public final class CUndoStack { - - /** The controller of the undo stack model. */ - private static CMainControl mainControl; - - /** The shared hashtable that maps levels to undo stacks. */ - private static final Map<MapControl, CUndoStack> hashFromLevelToStack = new WeakHashMap<MapControl, CUndoStack>(); - - /** The undo stack. Contains all undoable operations. */ - private final List<Undoable> undoStack = new ArrayList<Undoable>(); - - /** The redo stack. Contains all redoable operations. */ - private final List<Undoable> redoStack = new ArrayList<Undoable>(); - - /** The maximum size of the stacks. */ - private int maxStackSize = 10; - - /** - * Returns the undo stack for the given level controller. - * @param mapControl the level whose undo/redo stack is to be returned - * @return the undo/redo stack for the given level - */ - public static CUndoStack getInstance(final MapControl mapControl) { - if (hashFromLevelToStack.containsKey(mapControl)) { - return hashFromLevelToStack.get(mapControl); - } - - final CUndoStack instance = new CUndoStack(); - hashFromLevelToStack.put(mapControl, instance); - return instance; - } - - /** - * Sets the main controller of all undo/redo stack models. - * @param mainControl the controller of all undo/redo stacks - */ - public static void setMainControl(final CMainControl mainControl) { - CUndoStack.mainControl = mainControl; - } - - /** Constructs an undo/redo stack. */ - private CUndoStack() { - } - - /** - * Returns the maximum stack size. - * @return the maximum stack size - */ - int getMaxStackSize() { - return maxStackSize; - } - - /** - * Sets the maximum stack size. - * @param size the new maximum stack size - */ - void setMaxStackSize(final int size) { - maxStackSize = size; - } - - /** - * Adds a new undoable/redoable operation to the undo/redo stack. - * @param undoOp the new operation to be added to the stack - */ - public void add(final Undoable undoOp) { - undoStack.add(undoOp); - redoStack.clear(); - if (undoStack.size() > maxStackSize) { - undoStack.remove(0); - } - - if (mainControl != null) { - mainControl.refreshMenusAndToolbars(); - } - } - - /** - * Returns whether the last operation in the undo stack can be undone. - * @return <code>true</code> if the last operation in the undo stack can be - * undone, <code>false</code> if not - */ - public boolean canUndo() { - if (undoStack.size() > 0) { - final Undoable op = undoStack.get(undoStack.size() - 1); - return op.isUndoable(); - } - - return false; - } - - /** - * Returns the name of the last operation in the undo stack. - * @return the name of the last operation in the undo stack - */ - public String getUndoName() { - if (canUndo()) { - final Undoable op = undoStack.get(undoStack.size() - 1); - return op.getName(); - } - - return ""; - } - - /** Undoes the last operation in the undo stack. */ - public void undo() { - if (canUndo()) { - final Undoable op = undoStack.get(undoStack.size() - 1); - undoStack.remove(op); - op.undo(); - redoStack.add(op); - - if (mainControl != null) { - mainControl.refreshMenusAndToolbars(); - } - } - } - - /** - * Returns whether the last operation in the redo stack can be redone. - * @return <code>true</code> if the last operation in the redo stack can be - * redone, <code>false</code> if not - */ - public boolean canRedo() { - if (redoStack.size() > 0) { - final Undoable op = redoStack.get(redoStack.size() - 1); - return op.isRedoable(); - } - - return false; - } - - /** - * Returns the name of the last operation in the redo stack. - * @return the name of the last operation in the redo stack - */ - public String getRedoName() { - if (canRedo()) { - final Undoable op = redoStack.get(redoStack.size() - 1); - return op.getName(); - } - - return ""; - } - - /** Redoes the last operation in the redo stack. */ - public void redo() { - if (canRedo()) { - final Undoable op = redoStack.get(redoStack.size() - 1); - redoStack.remove(op); - op.redo(); - undoStack.add(op); - - if (mainControl != null) { - mainControl.refreshMenusAndToolbars(); - } - } - } - -} // class CUndoStack Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-09-10 22:08:50 UTC (rev 320) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-09-10 22:21:43 UTC (rev 321) @@ -28,7 +28,7 @@ import cfeditor.CMainStatusbar; import cfeditor.CMapViewBasic; import cfeditor.MapViewIFrame; -import cfeditor.CUndoStack; +import net.sf.gridarta.CUndoStack; import cfeditor.IGUIConstants; import cfeditor.GridderException; import cfeditor.arch.ArchObject; @@ -46,7 +46,7 @@ * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> */ -public final class MapControl { +public final class MapControl implements net.sf.gridarta.map.MapControl { /** * The main controller of this subcontroller. Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-09-10 22:08:50 UTC (rev 320) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-09-10 22:21:43 UTC (rev 321) @@ -114,6 +114,8 @@ import static javax.swing.KeyStroke.getKeyStroke; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gui.HideFileFilterProxy; +import net.sf.gridarta.MainControl; +import net.sf.gridarta.CUndoStack; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.ActionMethod; @@ -134,7 +136,7 @@ * @author <a href="mailto:ch...@ri...">Christian.Hujer</a> * @fixme I'm 2200 lines long, therefor I suck. */ -public final class CMainControl implements ThrowableHandler, MapModelListener { +public final class CMainControl implements ThrowableHandler, MapModelListener, MainControl { /** ActionFactory. */ private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); Deleted: trunk/daimonin/src/daieditor/CUndoStack.java =================================================================== --- trunk/daimonin/src/daieditor/CUndoStack.java 2006-09-10 22:08:50 UTC (rev 320) +++ trunk/daimonin/src/daieditor/CUndoStack.java 2006-09-10 22:21:43 UTC (rev 321) @@ -1,197 +0,0 @@ -/* - * Daimonin Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package daieditor; - -import daieditor.map.MapControl; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.WeakHashMap; -import net.sf.gridarta.Undoable; - -/** - * The undo/redo stack that is used when undoing/redoing operations. - * Every operation should add itself to the stack using the add() method. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - */ -public final class CUndoStack { - - /** The controller of the undo stack model. */ - private static CMainControl mainControl; - - /** The shared hashtable that maps levels to undo stacks. */ - private static final Map<MapControl, CUndoStack> hashFromLevelToStack = new WeakHashMap<MapControl, CUndoStack>(); - - /** The undo stack. Contains all undoable operations. */ - private final List<Undoable> undoStack = new ArrayList<Undoable>(); - - /** The redo stack. Contains all redoable operations. */ - private final List<Undoable> redoStack = new ArrayList<Undoable>(); - - /** The maximum size of the stacks. */ - private int maxStackSize = 10; - - /** - * Returns the undo stack for the given level controller. - * @param mapControl the level whose undo/redo stack is to be returned - * @return the undo/redo stack for the given level - */ - public static CUndoStack getInstance(final MapControl mapControl) { - if (hashFromLevelToStack.containsKey(mapControl)) { - return hashFromLevelToStack.get(mapControl); - } - - final CUndoStack instance = new CUndoStack(); - hashFromLevelToStack.put(mapControl, instance); - return instance; - } - - /** - * Sets the main controller of all undo/redo stack models. - * @param mainControl the controller of all undo/redo stacks - */ - public static void setMainControl(final CMainControl mainControl) { - CUndoStack.mainControl = mainControl; - } - - /** Constructs an undo/redo stack. */ - private CUndoStack() { - } - - /** - * Returns the maximum stack size. - * @return the maximum stack size - */ - int getMaxStackSize() { - return maxStackSize; - } - - /** - * Sets the maximum stack size. - * @param size the new maximum stack size - */ - void setMaxStackSize(final int size) { - maxStackSize = size; - } - - /** - * Adds a new undoable/redoable operation to the undo/redo stack. - * @param undoOp the new operation to be added to the stack - */ - public void add(final Undoable undoOp) { - undoStack.add(undoOp); - redoStack.clear(); - if (undoStack.size() > maxStackSize) { - undoStack.remove(0); - } - - if (mainControl != null) { - mainControl.refreshMenusAndToolbars(); - } - } - - /** - * Returns whether the last operation in the undo stack can be undone. - * @return <code>true</code> if the last operation in the undo stack can be - * undone, <code>false</code> if not - */ - public boolean canUndo() { - if (undoStack.size() > 0) { - final Undoable op = undoStack.get(undoStack.size() - 1); - return op.isUndoable(); - } - - return false; - } - - /** - * Returns the name of the last operation in the undo stack. - * @return the name of the last operation in the undo stack - */ - public String getUndoName() { - if (canUndo()) { - final Undoable op = undoStack.get(undoStack.size() - 1); - return op.getName(); - } - - return ""; - } - - /** Undoes the last operation in the undo stack. */ - public void undo() { - if (canUndo()) { - final Undoable op = undoStack.get(undoStack.size() - 1); - undoStack.remove(op); - op.undo(); - redoStack.add(op); - - if (mainControl != null) { - mainControl.refreshMenusAndToolbars(); - } - } - } - - /** - * Returns whether the last operation in the redo stack can be redone. - * @return <code>true</code> if the last operation in the redo stack can be - * redone, <code>false</code> if not - */ - public boolean canRedo() { - if (redoStack.size() > 0) { - final Undoable op = redoStack.get(redoStack.size() - 1); - return op.isRedoable(); - } - - return false; - } - - /** - * Returns the name of the last operation in the redo stack. - * @return the name of the last operation in the redo stack - */ - public String getRedoName() { - if (canRedo()) { - final Undoable op = redoStack.get(redoStack.size() - 1); - return op.getName(); - } - - return ""; - } - - /** Redoes the last operation in the redo stack. */ - public void redo() { - if (canRedo()) { - final Undoable op = redoStack.get(redoStack.size() - 1); - redoStack.remove(op); - op.redo(); - undoStack.add(op); - - if (mainControl != null) { - mainControl.refreshMenusAndToolbars(); - } - } - } - -} // class CUndoStack Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2006-09-10 22:08:50 UTC (rev 320) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2006-09-10 22:21:43 UTC (rev 321) @@ -27,7 +27,6 @@ import daieditor.CMainControl; import daieditor.MapViewIFrame; import daieditor.CPickmapPanel; -import daieditor.CUndoStack; import daieditor.CopyBuffer; import daieditor.IGUIConstants; import daieditor.arch.ArchObject; @@ -47,6 +46,7 @@ import javax.imageio.ImageIO; import javax.swing.ImageIcon; import net.sf.gridarta.Size2D; +import net.sf.gridarta.CUndoStack; import net.sf.gridarta.gui.map.MapCursor; import net.sf.gridarta.gui.map.MapGrid; import net.sf.japi.swing.ActionFactory; @@ -59,7 +59,7 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public final class MapControl implements MapModelListener { +public final class MapControl implements MapModelListener, net.sf.gridarta.map.MapControl { /** * The main controller of this subcontroller. Copied: trunk/src/app/net/sf/gridarta/CUndoStack.java (from rev 320, trunk/crossfire/src/cfeditor/CUndoStack.java) =================================================================== --- trunk/src/app/net/sf/gridarta/CUndoStack.java (rev 0) +++ trunk/src/app/net/sf/gridarta/CUndoStack.java 2006-09-10 22:21:43 UTC (rev 321) @@ -0,0 +1,196 @@ +/* + * Crossfire Java Editor. + * Copyright (C) 2000 Michael Toennies + * Copyright (C) 2001 Andreas Vogl + * + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package net.sf.gridarta; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.WeakHashMap; +import net.sf.gridarta.map.MapControl; + +/** + * The undo/redo stack that is used when undoing/redoing operations. + * Every operation should add itself to the stack using the add() method. + * @author <a href="mailto:mic...@no...">Michael Toennies</a> + */ +public final class CUndoStack { + + /** The controller of the undo stack model. */ + private static MainControl mainControl; + + /** The shared hashtable that maps levels to undo stacks. */ + private static final Map<MapControl, CUndoStack> hashFromLevelToStack = new WeakHashMap<MapControl, CUndoStack>(); + + /** The undo stack. Contains all undoable operations. */ + private final List<Undoable> undoStack = new ArrayList<Undoable>(); + + /** The redo stack. Contains all redoable operations. */ + private final List<Undoable> redoStack = new ArrayList<Undoable>(); + + /** The maximum size of the stacks. */ + private int maxStackSize = 10; + + /** + * Returns the undo stack for the given level controller. + * @param mapControl the level whose undo/redo stack is to be returned + * @return the undo/redo stack for the given level + */ + public static CUndoStack getInstance(final MapControl mapControl) { + if (hashFromLevelToStack.containsKey(mapControl)) { + return hashFromLevelToStack.get(mapControl); + } + + final CUndoStack instance = new CUndoStack(); + hashFromLevelToStack.put(mapControl, instance); + return instance; + } + + /** + * Sets the main controller of all undo/redo stack models. + * @param mainControl the controller of all undo/redo stacks + */ + public static void setMainControl(final MainControl mainControl) { + CUndoStack.mainControl = mainControl; + } + + /** Constructs an undo/redo stack. */ + private CUndoStack() { + } + + /** + * Returns the maximum stack size. + * @return the maximum stack size + */ + int getMaxStackSize() { + return maxStackSize; + } + + /** + * Sets the maximum stack size. + * @param size the new maximum stack size + */ + void setMaxStackSize(final int size) { + maxStackSize = size; + } + + /** + * Adds a new undoable/redoable operation to the undo/redo stack. + * @param undoOp the new operation to be added to the stack + */ + public void add(final Undoable undoOp) { + undoStack.add(undoOp); + redoStack.clear(); + if (undoStack.size() > maxStackSize) { + undoStack.remove(0); + } + + if (mainControl != null) { + mainControl.refreshMenusAndToolbars(); + } + } + + /** + * Returns whether the last operation in the undo stack can be undone. + * @return <code>true</code> if the last operation in the undo stack can be + * undone, <code>false</code> if not + */ + public boolean canUndo() { + if (undoStack.size() > 0) { + final Undoable op = undoStack.get(undoStack.size() - 1); + return op.isUndoable(); + } + + return false; + } + + /** + * Returns the name of the last operation in the undo stack. + * @return the name of the last operation in the undo stack + */ + public String getUndoName() { + if (canUndo()) { + final Undoable op = undoStack.get(undoStack.size() - 1); + return op.getName(); + } + + return ""; + } + + /** Undoes the last operation in the undo stack. */ + public void undo() { + if (canUndo()) { + final Undoable op = undoStack.get(undoStack.size() - 1); + undoStack.remove(op); + op.undo(); + redoStack.add(op); + + if (mainControl != null) { + mainControl.refreshMenusAndToolbars(); + } + } + } + + /** + * Returns whether the last operation in the redo stack can be redone. + * @return <code>true</code> if the last operation in the redo stack can be + * redone, <code>false</code> if not + */ + public boolean canRedo() { + if (redoStack.size() > 0) { + final Undoable op = redoStack.get(redoStack.size() - 1); + return op.isRedoable(); + } + + return false; + } + + /** + * Returns the name of the last operation in the redo stack. + * @return the name of the last operation in the redo stack + */ + public String getRedoName() { + if (canRedo()) { + final Undoable op = redoStack.get(redoStack.size() - 1); + return op.getName(); + } + + return ""; + } + + /** Redoes the last operation in the redo stack. */ + public void redo() { + if (canRedo()) { + final Undoable op = redoStack.get(redoStack.size() - 1); + redoStack.remove(op); + op.redo(); + undoStack.add(op); + + if (mainControl != null) { + mainControl.refreshMenusAndToolbars(); + } + } + } + +} // class CUndoStack Property changes on: trunk/src/app/net/sf/gridarta/CUndoStack.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/MainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/MainControl.java (rev 0) +++ trunk/src/app/net/sf/gridarta/MainControl.java 2006-09-10 22:21:43 UTC (rev 321) @@ -0,0 +1,17 @@ +package net.sf.gridarta; + +/** + * This interface is only for unification. + * It should become obsolete after a while. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @deprecated don't intentionally use this for other than unification purposes. + */ +@Deprecated public interface MainControl { + + /** + * Refresh menus and toolbars. + * @deprecated This method is bullshit for being a severe violation of MVC and therefore MUST be removed some day. Do not use it for other than unification purposes. + */ + void refreshMenusAndToolbars(); + +} // interface MainControl Property changes on: trunk/src/app/net/sf/gridarta/MainControl.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/map/MapControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapControl.java (rev 0) +++ trunk/src/app/net/sf/gridarta/map/MapControl.java 2006-09-10 22:21:43 UTC (rev 321) @@ -0,0 +1,9 @@ +package net.sf.gridarta.map; + +/** + * Currently nothing more than a marker interface for unification. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public interface MapControl { + +} // interface MapControl Property changes on: trunk/src/app/net/sf/gridarta/map/MapControl.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-10 22:49:36
|
Revision: 322 http://svn.sourceforge.net/gridarta/?rev=322&view=rev Author: christianhujer Date: 2006-09-10 15:49:14 -0700 (Sun, 10 Sep 2006) Log Message: ----------- Some Script editor unification. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/textedit/scripteditor/CFPythonPopup.java trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/textedit/scripteditor/CFPythonPopup.java trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditControl.java trunk/src/app/net/sf/gridarta/MainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-10 22:21:43 UTC (rev 321) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-10 22:49:14 UTC (rev 322) @@ -519,6 +519,7 @@ return strMapDir; } + /** {@inheritDoc} */ public String getArchDefaultFolder() { return strArchDir; } @@ -553,11 +554,7 @@ mainView.showArchPanelQuickObject(arch); } - /** - * set bold font to the given component - * @param comp component - * @return same component from parameter (but now with accurate font) - */ + /** {@inheritDoc} */ public JComponent setBoldFont(final JComponent comp) { if (boldFont != null) { comp.setFont(boldFont); Modified: trunk/crossfire/src/cfeditor/textedit/scripteditor/CFPythonPopup.java =================================================================== --- trunk/crossfire/src/cfeditor/textedit/scripteditor/CFPythonPopup.java 2006-09-10 22:21:43 UTC (rev 321) +++ trunk/crossfire/src/cfeditor/textedit/scripteditor/CFPythonPopup.java 2006-09-10 22:49:14 UTC (rev 322) @@ -108,51 +108,43 @@ * Load the list of CFPython commands from the datafile. */ public static void loadCommandlist() { - CFileReader reader = null; // file reader final List<String> cmdList = new ArrayList<String>(); // temporare list to store commands - + final String baseDir = IGUIConstants.CONFIG_DIR; try { - String isoArchDefFolder = ""; - - final String baseDir = IGUIConstants.CONFIG_DIR; - reader = new CFileReader(baseDir, IGUIConstants.PYTHONMENU_FILE); - - // read file into the cmdList vector: - String line; - while ((line = reader.getReader().readLine()) != null) { - line = line.trim(); - if (line.length() > 0 && !line.startsWith("#")) { - // ATM, the descriptive info about method headers is cut out - // (TODO: parse and show the full info in a statusbar) - final int k = line.indexOf("("); - if (k > 0) { - line = line.substring(0, k) + "()"; - } else { - System.err.println("Parse error in " + IGUIConstants.PYTHONMENU_FILE + ":"); - System.err.println(" \"" + line + "\" missing '()'"); - line += "()"; // that line is probably garbage, but will work + final CFileReader reader = new CFileReader(baseDir, IGUIConstants.PYTHONMENU_FILE); + try { + // read file into the cmdList vector: + for (String line; (line = reader.getReader().readLine()) != null;) { + line = line.trim(); + if (line.length() > 0 && !line.startsWith("#")) { + // ATM, the descriptive info about method headers is cut out + // (TODO: parse and show the full info in a statusbar) + final int k = line.indexOf("("); + if (k > 0) { + line = line.substring(0, k) + "()"; + } else { + System.err.println("Parse error in " + IGUIConstants.PYTHONMENU_FILE + ":"); + System.err.println(" \"" + line + "\" missing '()'"); + line += "()"; // that line is probably garbage, but will work + } + cmdList.add(line); } - cmdList.add(line); } - } - sort(cmdList, CASE_INSENSITIVE_ORDER); + sort(cmdList, CASE_INSENSITIVE_ORDER); - // now create the 'menuEntries' array - if (cmdList.size() > 0) { - menuEntries = cmdList.toArray(new String[cmdList.size()]); + // now create the 'menuEntries' array + if (cmdList.size() > 0) { + menuEntries = cmdList.toArray(new String[cmdList.size()]); + } + } finally { + reader.close(); } - - // close file reader - reader.close(); } catch (final FileNotFoundException e) { System.err.println("File '" + IGUIConstants.PYTHONMENU_FILE + "' not found."); - return; } catch (final EOFException e) { - // end of file/spell struct reached - reader.close(); + // expected exception, do not handle: end of file/spell struct reached } catch (final IOException e) { System.err.println("Cannot read file '" + IGUIConstants.PYTHONMENU_FILE + "'!"); - return; } } @@ -171,7 +163,7 @@ public final void setCaretPosition(final int pos) { caretPos = pos; getMenu().requestFocus(); - control.registerActivePopup(this); + ScriptEditControl.registerActivePopup(this); } public final CFPythonPopupMenu getMenu() { @@ -225,11 +217,8 @@ */ private static final long serialVersionUID = 1L; - final JComboBox comboBox; - public CFPythonPopupMenu(final JComboBox box) { super(box); - this.comboBox = box; //this.addMouseListener(new ListenerMenuClick()); setPreferredSize(new Dimension(220, 200)); } Modified: trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java =================================================================== --- trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java 2006-09-10 22:21:43 UTC (rev 321) +++ trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java 2006-09-10 22:49:14 UTC (rev 322) @@ -37,6 +37,7 @@ import javax.swing.filechooser.FileFilter; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; +import net.sf.gridarta.MainControl; /** * ScriptEditControl - Manages events and dataflow for the script editor entity. @@ -59,14 +60,14 @@ // default directory to store new scripts in. also used as starting dir for 'open' command private static String defaultScriptDir; - private final CMainControl mainControl; // cfeditor main control (is null in stand-alone configuration!) + private final MainControl mainControl; // cfeditor main control (is null in stand-alone configuration!) private final ScriptEditView view; // view (window with textareas) private final List<String> opened; // open tabs, contains absolute filenames (or "<>") in order left to right /** Constructor is private, instance is created by calling 'init()' */ - private ScriptEditControl(final CMainControl mainControl) { + private ScriptEditControl(final MainControl mainControl) { opened = new ArrayList<String>(); // start with empty vector this.mainControl = mainControl; view = new ScriptEditView(this); // initialize window @@ -111,7 +112,7 @@ * @return instance of cfeditor main control (is null for stand-alone * configuration!) */ - final CMainControl getMainControl() { + final MainControl getMainControl() { return mainControl; } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-09-10 22:21:43 UTC (rev 321) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-09-10 22:49:14 UTC (rev 322) @@ -98,6 +98,7 @@ import javax.swing.AbstractAction; import javax.swing.ImageIcon; import javax.swing.JFileChooser; +import javax.swing.JComponent; import static javax.swing.JOptionPane.CANCEL_OPTION; import static javax.swing.JOptionPane.CLOSED_OPTION; import static javax.swing.JOptionPane.ERROR_MESSAGE; @@ -754,10 +755,19 @@ return strMapDir; } + /** {@inheritDoc} */ public String getArchDefaultFolder() { return strArchDir; } + /** + * {@inheritDoc} + * This implementation does nothing. + */ + public JComponent setBoldFont(final JComponent comp) { + return comp; + } + public String getScriptDefaultFolder() { return strScriptDir; } Modified: trunk/daimonin/src/daieditor/textedit/scripteditor/CFPythonPopup.java =================================================================== --- trunk/daimonin/src/daieditor/textedit/scripteditor/CFPythonPopup.java 2006-09-10 22:21:43 UTC (rev 321) +++ trunk/daimonin/src/daieditor/textedit/scripteditor/CFPythonPopup.java 2006-09-10 22:49:14 UTC (rev 322) @@ -109,40 +109,41 @@ * Load the list of CFPython commands from the datafile. */ public static void loadCommandlist() { - CFileReader reader = null; // file reader final List<String> cmdList = new ArrayList<String>(); // temporare list to store commands - try { - final String isoArchDefFolder = ScriptEditControl.isStandAlone() ? - userNodeForPackage(CMainControl.class).get(ResourceFileManager.ARCH_DIR_KEY, ResourceFileManager.DEFAULT_ARCH_DIR) : - control.getMainControl().getArchDefaultFolder(); + final String isoArchDefFolder = ScriptEditControl.isStandAlone() ? + userNodeForPackage(CMainControl.class).get(ResourceFileManager.ARCH_DIR_KEY, ResourceFileManager.DEFAULT_ARCH_DIR) : + control.getMainControl().getArchDefaultFolder(); - final String baseDir = isoArchDefFolder + File.separator + IGUIConstants.CONFIG_DIR; - reader = new CFileReader(baseDir, IGUIConstants.PYTHONMENU_FILE); - - // read file into the cmdList vector: - String line; - while ((line = reader.readLine()) != null) { - line = line.trim(); - if (line.length() > 0 && !line.startsWith("#")) { - // ATM, the descriptive info about method headers is cut out - // (TODO: parse and show the full info in a statusbar) - final int k = line.indexOf("("); - if (k > 0) { - line = line.substring(0, k) + "()"; - } else { - System.err.println("Parse error in " + IGUIConstants.PYTHONMENU_FILE + ":"); - System.err.println(" \"" + line + "\" missing '()'"); - line += "()"; // that line is probably garbage, but will work + final String baseDir = isoArchDefFolder + File.separator + IGUIConstants.CONFIG_DIR; + try { + final CFileReader reader = new CFileReader(baseDir, IGUIConstants.PYTHONMENU_FILE); + try { + // read file into the cmdList vector: + for (String line; (line = reader.readLine()) != null;) { + line = line.trim(); + if (line.length() > 0 && !line.startsWith("#")) { + // ATM, the descriptive info about method headers is cut out + // (TODO: parse and show the full info in a statusbar) + final int k = line.indexOf("("); + if (k > 0) { + line = line.substring(0, k) + "()"; + } else { + System.err.println("Parse error in " + IGUIConstants.PYTHONMENU_FILE + ":"); + System.err.println(" \"" + line + "\" missing '()'"); + line += "()"; // that line is probably garbage, but will work + } + cmdList.add(line); } - cmdList.add(line); } - } - sort(cmdList, CASE_INSENSITIVE_ORDER); + sort(cmdList, CASE_INSENSITIVE_ORDER); - // now create the 'menuEntries' array - if (cmdList.size() > 0) { - menuEntries = cmdList.toArray(new String[cmdList.size()]); + // now create the 'menuEntries' array + if (cmdList.size() > 0) { + menuEntries = cmdList.toArray(new String[cmdList.size()]); + } + } finally { + reader.close(); } } catch (final FileNotFoundException e) { System.err.println("File '" + IGUIConstants.PYTHONMENU_FILE + "' not found."); @@ -150,12 +151,6 @@ // expected exception, do not handle: end of file/spell struct reached } catch (final IOException e) { System.err.println("Cannot read file '" + IGUIConstants.PYTHONMENU_FILE + "'!"); - } finally { - try { - reader.close(); - } catch (final Exception e) { /* ignore */ } finally { - reader = null; - } } } Modified: trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditControl.java =================================================================== --- trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditControl.java 2006-09-10 22:21:43 UTC (rev 321) +++ trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditControl.java 2006-09-10 22:49:14 UTC (rev 322) @@ -35,6 +35,7 @@ import javax.swing.filechooser.FileFilter; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; +import net.sf.gridarta.MainControl; /** * ScriptEditControl - Manages events and dataflow for the script editor entity. @@ -57,14 +58,14 @@ // default directory to store new scripts in. also used as starting dir for 'open' command private static String defaultScriptDir; - private final CMainControl mainControl; // daieditor main control (is null in stand-alone configuration!) + private final MainControl mainControl; // daieditor main control (is null in stand-alone configuration!) private final ScriptEditView view; // view (window with textareas) private final List<String> opened; // open tabs, contains absolute filenames (or "<>") in order left to right /** Constructor is private, instance is created by calling 'init()' */ - private ScriptEditControl(final CMainControl mainControl) { + private ScriptEditControl(final MainControl mainControl) { opened = new ArrayList<String>(); // start with empty vector this.mainControl = mainControl; view = new ScriptEditView(this); // initialize window @@ -109,7 +110,7 @@ * @return instance of daieditor main control (is null for stand-alone * configuration!) */ - final CMainControl getMainControl() { + final MainControl getMainControl() { return mainControl; } Modified: trunk/src/app/net/sf/gridarta/MainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/MainControl.java 2006-09-10 22:21:43 UTC (rev 321) +++ trunk/src/app/net/sf/gridarta/MainControl.java 2006-09-10 22:49:14 UTC (rev 322) @@ -1,5 +1,7 @@ package net.sf.gridarta; +import javax.swing.JComponent; + /** * This interface is only for unification. * It should become obsolete after a while. @@ -14,4 +16,17 @@ */ void refreshMenusAndToolbars(); + /** + * Get the default folder of arches. + * @return default folder of arches. + */ + String getArchDefaultFolder(); + + /** + * Set bold font to the given component. + * @param comp component + * @return same component from parameter (but now with accurate font) + */ + JComponent setBoldFont(JComponent comp); + } // interface MainControl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-12 16:48:55
|
Revision: 323 http://svn.sourceforge.net/gridarta/?rev=323&view=rev Author: akirschbaum Date: 2006-09-12 09:48:43 -0700 (Tue, 12 Sep 2006) Log Message: ----------- Use isPointValid() where possible. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-10 22:49:14 UTC (rev 322) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-12 16:48:43 UTC (rev 323) @@ -327,7 +327,7 @@ for (int c = 0; c <= count; c++) { final int mapx = xx + mainControl.getArchObjectStack().getArch(archnr + c).getMultiRefX(); final int mapy = yy + mainControl.getArchObjectStack().getArch(archnr + c).getMultiRefY(); - if (mapx < 0 || mapy < 0 || mapx >= mapSize.getWidth()|| mapy >= mapSize.getHeight()) { + if (!isPointValid(mapx, mapy)) { // outside map return false; } @@ -688,7 +688,7 @@ * @return the specified arch, or null if not found */ @Nullable public ArchObject getMapArch(final int id, final Point pos) { - if (mapGrid == null || pos.x < 0 || pos.x >= mapSize.getWidth() || pos.y < 0 || pos.y >= mapSize.getHeight()) { + if (mapGrid == null || !isPointValid(pos)) { return null; } @@ -937,7 +937,7 @@ @Nullable public ArchObject getExit() { final Point hspot = mapControl.getMapView().getHighlightStart(); // selected spot - if (hspot.x < 0 || hspot.y < 0) { + if (!isPointValid(hspot)) { return null; // out of map } @@ -1102,7 +1102,7 @@ * @return whether a match was found */ public boolean filterSquare(final Filter filter, final FilterConfig config, final int x, final int y) { - if (x < 0 || y < 0 || x >= mapSize.getWidth() || y >= mapSize.getHeight()) { + if (!isPointValid(x, y)) { return false; } Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-09-10 22:49:14 UTC (rev 322) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-09-12 16:48:43 UTC (rev 323) @@ -221,14 +221,14 @@ final ArchObject head = mainControl.getArchObjectStack().getArch(archname); final Point mapH = new Point(head.getMultiRefX(), head.getMultiRefY()); mapH.translate(pos.x, pos.y); - if (mapH.x < 0 || mapH.y < 0 || mapH.x >= mapSize.getWidth() || mapH.y >= mapSize.getHeight()) { + if (!isPointValid(mapH)) { return false; } for (final ArchObject tail : head.getTailList()) { final Point mapT = new Point(tail.getMultiRefX(), tail.getMultiRefY()); mapT.translate(pos.x, pos.y); // outside map - if (mapT.x < 0 || mapT.y < 0 || mapT.x >= mapSize.getWidth() || mapT.y >= mapSize.getHeight()) { + if (!isPointValid(mapT)) { return false; } @@ -364,7 +364,7 @@ final int mapx = arch.getMapX(); final int mapy = arch.getMapY(); - if (mapx >= mapSize.getWidth() || mapx < 0 || mapy >= mapSize.getHeight() || mapy < 0) { + if (!isPointValid(new Point(mapx, mapy))) { // TODO: // Think about how this could be handled via an exception and caught much earlier, perhaps already while reading the map, not after it // already has been read. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-12 20:17:36
|
Revision: 325 http://svn.sourceforge.net/gridarta/?rev=325&view=rev Author: christianhujer Date: 2006-09-12 13:17:15 -0700 (Tue, 12 Sep 2006) Log Message: ----------- More script edit unification. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainMenu.java trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditMenuBar.java trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditView.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditControl.java trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditMenuBar.java trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditView.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-12 19:43:21 UTC (rev 324) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-12 20:17:15 UTC (rev 325) @@ -1659,7 +1659,6 @@ /** Notifies that the application is about to exit. */ void appExitNotify() { mainView.appExitNotify(); // notify main view - ScriptEditControl.getInstance().appExitNotify(); // notify scriptpad controller if (currentMap != null) { mainView.setMapTileList(null, -1); Modified: trunk/crossfire/src/cfeditor/CMainMenu.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainMenu.java 2006-09-12 19:43:21 UTC (rev 324) +++ trunk/crossfire/src/cfeditor/CMainMenu.java 2006-09-12 20:17:15 UTC (rev 325) @@ -541,7 +541,6 @@ mainControl.getMainView().updateStatusBarFont(); mainControl.getMainView().updateArchPanelFont(); CFTreasureListTree.getInstance().updateFont(); - ScriptEditControl.getInstance().updateGlobalFont(); } else { // update fonts mainControl.newPlainFont(JFontChooser.getDefaultFont()); @@ -553,7 +552,6 @@ mainControl.getMainView().updateStatusBarFont(); mainControl.getMainView().updateArchPanelFont(); CFTreasureListTree.getInstance().updateFont(); - ScriptEditControl.getInstance().updateGlobalFont(); // revert to default fonts mainControl.newPlainFont(null); Modified: trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java =================================================================== --- trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java 2006-09-12 19:43:21 UTC (rev 324) +++ trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditControl.java 2006-09-12 20:17:15 UTC (rev 325) @@ -23,9 +23,6 @@ package cfeditor.textedit.scripteditor; -import cfeditor.CMainControl; -import cfeditor.CSettings; -import cfeditor.IGUIConstants; import cfeditor.textedit.textarea.JEditTextArea; import java.io.File; import java.io.FileWriter; @@ -60,7 +57,7 @@ // default directory to store new scripts in. also used as starting dir for 'open' command private static String defaultScriptDir; - private final MainControl mainControl; // cfeditor main control (is null in stand-alone configuration!) + private final MainControl mainControl; // gridarta main control (is null in stand-alone configuration!) private final ScriptEditView view; // view (window with textareas) @@ -78,7 +75,7 @@ * called before once using this class. * @param mapDefFolder map default folder */ - public static void init(final String mapDefFolder, final CMainControl mainControl) { + public static void init(final String mapDefFolder, final MainControl mainControl) { if (instance == null) { isStandAlone = false; instance = new ScriptEditControl(mainControl); @@ -109,18 +106,13 @@ } /** - * @return instance of cfeditor main control (is null for stand-alone + * @return instance of gridarta main control (is null for stand-alone * configuration!) */ - final MainControl getMainControl() { + @Nullable final MainControl getMainControl() { return mainControl; } - /** Notifies that the application is about to exit. */ - public final void appExitNotify() { - view.appExitNotify(); // notify view - } - /** * Register last active popup. When the script pad frame is hidden, this * popup will be closed (if still open). @@ -131,7 +123,7 @@ } /** - * Open a new empty Python script document. + * Open a new empty script document. */ public final void openScriptNew() { opened.add("<>"); // this script has no filename assigned yet @@ -139,7 +131,7 @@ } /** - * Open a new empty Python script document. + * Open a new empty script document. */ public final void openScriptFile(final String pathname) { final File file = new File(pathname); @@ -169,7 +161,7 @@ // set default folder for new scripts final File baseDir = new File(defaultScriptDir); - if (baseDir != null && baseDir.exists() && baseDir.isDirectory()) { + if (baseDir.exists() && baseDir.isDirectory()) { fileChooser.setCurrentDirectory(baseDir); } @@ -202,11 +194,7 @@ } view.setVisible(false); if (isStandAlone()) { - // if running in stand-alone mode, the application gets terminated at this point - appExitNotify(); - // save settings - CSettings.getInstance(IGUIConstants.APP_NAME).saveSettings(); - System.exit(0); // exit + System.exit(0); //FIXME: replace by proper disposal } } } @@ -279,8 +267,6 @@ // set new path opened.set(tabIndex, file.getAbsolutePath()); view.setTitleAt(tabIndex, file.getName()); - - view.refreshMenuBar(); } } } @@ -358,13 +344,6 @@ } /** - * Global font has been changed, update the menu bar. - */ - public void updateGlobalFont() { - view.updateGlobalFont(); - } - - /** * Main method for testing purpose. * @param args */ @@ -372,9 +351,7 @@ init(System.getProperty("user.dir")); getInstance().openScriptNew(); getInstance().openScriptNew(); - getInstance().openScriptFile("maps\\GuildMage.py"); - - getInstance().view.refreshMenuBar(); + getInstance().openScriptFile("maps/GuildMage.py"); } /** Modified: trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditMenuBar.java =================================================================== --- trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditMenuBar.java 2006-09-12 19:43:21 UTC (rev 324) +++ trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditMenuBar.java 2006-09-12 20:17:15 UTC (rev 325) @@ -33,7 +33,6 @@ import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.KeyStroke; -import org.apache.log4j.Logger; /** * This class implements the MenuBar of the script editor. @@ -41,46 +40,13 @@ */ public final class ScriptEditMenuBar extends JMenuBar { - private static final Logger log = Logger.getLogger(ScriptEditMenuBar.class); - /** Serial Version UID. */ private static final long serialVersionUID = 1L; private final ScriptEditControl control; // controler object - // File menu: - private JMenu menuFile; - - private JMenuItem miNew; - - private JMenuItem miOpen; - - private JMenuItem miSaveAs; - private JMenuItem miSave; - private JMenuItem miClose; - - private JMenuItem miCloseAll; - - // Edit menu: - private JMenu menuEdit; - - private JMenuItem miCut; - - private JMenuItem miCopy; - - private JMenuItem miPaste; - - private JMenuItem miFind; - - // Edit menu: - private JMenu menuSettings; - - private JMenuItem miFont; - - private JMenuItem miColors; - /** * Constructor - Builds the MenuBar. * @param control @@ -89,7 +55,6 @@ this.control = control; // reference to ScriptEditControl control buildFileMenu(); buildEditMenu(); - buildSettingsMenu(); refresh(); } @@ -97,9 +62,9 @@ * Build File menu. */ private void buildFileMenu() { - menuFile = new JMenu("File"); + final JMenu menuFile = new JMenu("File"); - miNew = new JMenuItem("New Script"); + final JMenuItem miNew = new JMenuItem("New Script"); miNew.setMnemonic('N'); miNew.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent event) { @@ -109,7 +74,7 @@ }); menuFile.add(miNew); - miOpen = new JMenuItem("Open"); + final JMenuItem miOpen = new JMenuItem("Open"); miOpen.setMnemonic('O'); miOpen.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent event) { @@ -121,7 +86,7 @@ menuFile.addSeparator(); // ------ - miSaveAs = new JMenuItem("Save As..."); + final JMenuItem miSaveAs = new JMenuItem("Save As..."); //miSaveAs.setIcon(CGUIUtils.getIcon(IGUIConstants.SAVE_LEVEL_SMALLICON)); miSaveAs.setMnemonic('v'); miSaveAs.addActionListener(new ActionListener() { @@ -146,7 +111,7 @@ menuFile.addSeparator(); // ------ - miClose = new JMenuItem("Close"); + final JMenuItem miClose = new JMenuItem("Close"); miClose.setMnemonic('C'); miClose.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, Event.CTRL_MASK)); miClose.addActionListener(new ActionListener() { @@ -157,7 +122,7 @@ }); menuFile.add(miClose); - miCloseAll = new JMenuItem("Close All"); + final JMenuItem miCloseAll = new JMenuItem("Close All"); miCloseAll.setMnemonic('l'); miCloseAll.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent event) { @@ -174,9 +139,9 @@ * Build Edit Menu. */ private void buildEditMenu() { - menuEdit = new JMenu("Edit"); + final JMenu menuEdit = new JMenu("Edit"); - miCut = new JMenuItem("Cut"); + final JMenuItem miCut = new JMenuItem("Cut"); miCut.setMnemonic('t'); miCut.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.CTRL_MASK)); miCut.addActionListener(new ActionListener() { @@ -190,7 +155,7 @@ }); menuEdit.add(miCut); - miCopy = new JMenuItem("Copy"); + final JMenuItem miCopy = new JMenuItem("Copy"); miCopy.setMnemonic('C'); miCopy.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, Event.CTRL_MASK)); miCopy.addActionListener(new ActionListener() { @@ -204,7 +169,7 @@ }); menuEdit.add(miCopy); - miPaste = new JMenuItem("Paste"); + final JMenuItem miPaste = new JMenuItem("Paste"); miPaste.setMnemonic('P'); miPaste.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, Event.CTRL_MASK)); miPaste.addActionListener(new ActionListener() { @@ -218,98 +183,15 @@ }); menuEdit.add(miPaste); - menuEdit.addSeparator(); // ------ - - miFind = new JMenuItem("Find"); - miFind.setMnemonic('F'); - miFind.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, Event.CTRL_MASK)); - miFind.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent event) { - // find - if (log.isInfoEnabled()) { - log.info("find..."); - } - } - }); - menuEdit.add(miFind); - add(menuEdit); } /** - * Build Edit Menu. - */ - private void buildSettingsMenu() { - menuSettings = new JMenu("Settings"); - - miFont = new JMenuItem("Font"); - miFont.setMnemonic('F'); - miFont.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent event) { - // set font - } - }); - menuSettings.add(miFont); - - miColors = new JMenuItem("Colors"); - miColors.setMnemonic('C'); - miColors.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent event) { - // set colors - } - }); - menuSettings.add(miColors); - - add(menuSettings); - } - - /** * Refreshes the enable/disable state of all menus. */ public final void refresh() { - miFind.setEnabled(false); - miColors.setEnabled(false); - miFont.setEnabled(false); - // see if there is a path for direct 'save' miSave.setEnabled(control.getActiveFilePath() != null); } - /** - * Redraws the whole menu with latest custom fonts. - * @param doRedraw if true, menu is redrawn at the end - */ - public void updateFont(final boolean doRedraw) { - if (!control.isStandAlone()) { - // File menu: - control.getMainControl().setBoldFont(menuFile); - control.getMainControl().setBoldFont(miNew); - control.getMainControl().setBoldFont(miOpen); - control.getMainControl().setBoldFont(miSaveAs); - control.getMainControl().setBoldFont(miSave); - control.getMainControl().setBoldFont(miClose); - control.getMainControl().setBoldFont(miCloseAll); - - // Edit menu: - control.getMainControl().setBoldFont(menuEdit); - control.getMainControl().setBoldFont(miCut); - control.getMainControl().setBoldFont(miCopy); - control.getMainControl().setBoldFont(miPaste); - control.getMainControl().setBoldFont(miFind); - - // Edit menu: - control.getMainControl().setBoldFont(menuSettings); - control.getMainControl().setBoldFont(miFont); - control.getMainControl().setBoldFont(miColors); - } - - if (doRedraw) { - // redraw the menu bar - refresh(); - if (getGraphics() != null) { - update(getGraphics()); - } - } - } - } // class ScriptEditMenuBar Modified: trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditView.java =================================================================== --- trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditView.java 2006-09-12 19:43:21 UTC (rev 324) +++ trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditView.java 2006-09-12 20:17:15 UTC (rev 325) @@ -24,13 +24,10 @@ package cfeditor.textedit.scripteditor; import cfeditor.CGUIUtils; -import cfeditor.CSettings; -import cfeditor.IGUIConstants; import cfeditor.textedit.textarea.JEditTextArea; import cfeditor.textedit.textarea.PythonTokenMarker; import cfeditor.textedit.textarea.SyntaxDocument; import java.awt.Dimension; -import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; @@ -75,8 +72,6 @@ /** key used to store the main windows height to settings-file. */ private static final String WINDOW_HEIGHT = "ScriptPadWindow.height"; - private final ScriptEditControl control; - private final ScriptEditMenuBar menuBar; // the menu bar private final JTabbedPane tabPane; // tab pane @@ -90,7 +85,6 @@ super("Script Pad"); // window title setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); - this.control = control; textAreas = new ArrayList<JEditTextArea>(); menuBar = new ScriptEditMenuBar(control); // build menu bar setJMenuBar(menuBar); // add menu bar to frame @@ -109,17 +103,11 @@ // calculate some default values in case there is no settings file final Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); - final int defwidth = (int) (0.6 * screen.getWidth()); - final int defheight = (int) (0.8 * screen.getHeight()); - - // get the old location and size - final CSettings settings = CSettings.getInstance(IGUIConstants.APP_NAME); - final int x = Integer.parseInt(settings.getProperty(WINDOW_X, "" + (int) ((screen.getWidth() - defwidth) / 2.))); - final int y = Integer.parseInt(settings.getProperty(WINDOW_Y, "" + (int) ((screen.getHeight() - defheight) / 2.))); - final int width = Integer.parseInt(settings.getProperty(WINDOW_WIDTH, "" + defwidth)); - final int height = Integer.parseInt(settings.getProperty(WINDOW_HEIGHT, "" + defheight)); - - this.setBounds(x, y, width, height); + final int width = (int) (0.6 * screen.getWidth()); + final int height = (int) (0.8 * screen.getHeight()); + final int x = (int) (0.2 * screen.getWidth()); + final int y = (int) (0.1 * screen.getWidth()); + setBounds(x, y, width, height); } /** @@ -132,12 +120,9 @@ //ta.setFont(new Font("Courier New", Font.PLAIN, 12)); ta.setDocument(new SyntaxDocument()); ta.getDocument().setTokenMarker(new PythonTokenMarker()); - boolean isFirstTimeShowing = false; // true when frame was hidden and now is showing - tabPane.addTab(title, ta); if (getTabCount() <= 1 || !isShowing()) { setVisible(true); - isFirstTimeShowing = true; } tabPane.setSelectedIndex(getTabCount() - 1); @@ -145,7 +130,7 @@ // very important: There must be a drawing update after showing the frame, to make // sure the graphics context is fully initialized before calling 'setEditingFocus()' //if (isFirstTimeShowing) { - this.update(this.getGraphics()); + update(getGraphics()); //} textAreas.add(ta); @@ -153,29 +138,24 @@ if (file != null && file.exists()) { // print file into this document try { - // open ascii streams - final FileReader fread = new FileReader(file); - final BufferedReader bfread = new BufferedReader(fread); - - boolean firstLine = true; - final StringBuffer buff = new StringBuffer(""); - String line = bfread.readLine(); - while (line != null) { - if (!firstLine) { - buff.append('\n'); - } else { - firstLine = false; + final BufferedReader in = new BufferedReader(new FileReader(file)); + try { + boolean firstLine = true; + final StringBuffer buff = new StringBuffer(""); + String line; + while ((line = in.readLine()) != null) { + if (!firstLine) { + buff.append('\n'); + } else { + firstLine = false; + } + buff.append(line); } - buff.append(line); - line = bfread.readLine(); + ta.getDocument().insertString(0, buff.toString(), null); + } finally { + in.close(); } - - // close filestreams - bfread.close(); - fread.close(); - // insert buffer into the document - ta.getDocument().insertString(0, buff.toString(), null); } catch (final FileNotFoundException e) { log.info("addTab(): File '" + file.getName() + "' not found."); } catch (final IOException e) { @@ -189,7 +169,6 @@ //ta.scrollToCaret(); // make sure the window shows caret (top left corner) toFront(); // bring window to front - refreshMenuBar(); } /** @@ -240,24 +219,6 @@ } /** - * Refresh the menu bar (update enable/disable state of all menus). - */ - public void refreshMenuBar() { - menuBar.updateFont(true); - } - - /** - * Update the global fonts (-> menu bar and tab labels). - */ - public void updateGlobalFont() { - if (!control.isStandAlone()) { - control.getMainControl().setBoldFont(tabPane); - } - - menuBar.updateFont(true); - } - - /** * Shows the given confirmation message as popup frame. The message is a * yes/no option. The parent frame is disabled until the user picks an * answer. @@ -285,22 +246,6 @@ } /** - * Notifies that the application is about to exit. The window settings get - * saved to the settings file here. - */ - final void appExitNotify() { - // store location and size - final CSettings settings = CSettings.getInstance(IGUIConstants.APP_NAME); - final Rectangle bounds = getBounds(); // window frame bounds - settings.setProperty(WINDOW_X, "" + bounds.x); - settings.setProperty(WINDOW_Y, "" + bounds.y); - settings.setProperty(WINDOW_WIDTH, "" + bounds.width); - settings.setProperty(WINDOW_HEIGHT, "" + bounds.height); - } - - // -------------------------------------- - - /** * Inner class: Listener for ChangeEvents in the tabPane. */ private final class EditTabListener implements ChangeListener { Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-09-12 19:43:21 UTC (rev 324) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-09-12 20:17:15 UTC (rev 325) @@ -1970,7 +1970,6 @@ /** Notifies that the application is about to exit. */ void appExitNotify() { mainView.appExitNotify(); // notify main view - ScriptEditControl.getInstance().appExitNotify(); // notify scriptpad controller if (currentMap != null) { mainView.setMapTileList(null, null); Modified: trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditControl.java =================================================================== --- trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditControl.java 2006-09-12 19:43:21 UTC (rev 324) +++ trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditControl.java 2006-09-12 20:17:15 UTC (rev 325) @@ -58,7 +58,7 @@ // default directory to store new scripts in. also used as starting dir for 'open' command private static String defaultScriptDir; - private final MainControl mainControl; // daieditor main control (is null in stand-alone configuration!) + private final MainControl mainControl; // gridarta main control (is null in stand-alone configuration!) private final ScriptEditView view; // view (window with textareas) @@ -76,7 +76,7 @@ * called before once using this class. * @param mapDefFolder map default folder */ - public static void init(final String mapDefFolder, final CMainControl mainControl) { + public static void init(final String mapDefFolder, final MainControl mainControl) { if (instance == null) { isStandAlone = false; instance = new ScriptEditControl(mainControl); @@ -107,18 +107,13 @@ } /** - * @return instance of daieditor main control (is null for stand-alone + * @return instance of gridarta main control (is null for stand-alone * configuration!) */ - final MainControl getMainControl() { + @Nullable final MainControl getMainControl() { return mainControl; } - /** Notifies that the application is about to exit. */ - public final void appExitNotify() { - view.appExitNotify(); // notify view - } - /** * Register last active popup. When the script pad frame is hidden, this * popup will be closed (if still open). @@ -129,7 +124,7 @@ } /** - * Open a new empty Lua script document. + * Open a new empty script document. */ public final void openScriptNew() { opened.add("<>"); // this script has no filename assigned yet @@ -137,7 +132,7 @@ } /** - * Open a new empty Lua script document. + * Open a new empty script document. */ public final void openScriptFile(final String pathname) { final File file = new File(pathname); @@ -200,9 +195,7 @@ } view.setVisible(false); if (isStandAlone()) { - // if running in stand-alone mode, the application gets terminated at this point - appExitNotify(); - System.exit(0); // exit + System.exit(0); //FIXME: replace by proper disposal } } } @@ -352,15 +345,6 @@ } /** - * This calls the showMessage funtion from view - * @param strTitle String - * @param strMessage String - */ - public final void showMessage(final String strTitle, final String strMessage) { - view.showMessage(strTitle, strMessage); - } - - /** * Main method for testing purpose. * @param args */ @@ -368,7 +352,7 @@ init(System.getProperty("user.dir")); getInstance().openScriptNew(); getInstance().openScriptNew(); - getInstance().openScriptFile("maps\\GuildMage.lua"); + getInstance().openScriptFile("maps/GuildMage.lua"); } public ScriptEditView getView() { Modified: trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditMenuBar.java =================================================================== --- trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditMenuBar.java 2006-09-12 19:43:21 UTC (rev 324) +++ trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditMenuBar.java 2006-09-12 20:17:15 UTC (rev 325) @@ -33,7 +33,6 @@ import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.KeyStroke; -import net.sf.gridarta.help.Help; /** * This class implements the MenuBar of the script editor. @@ -48,12 +47,6 @@ private JMenuItem miSave; - private JMenuItem miFind; - - private JMenuItem miFont; - - private JMenuItem miColors; - /** * Constructor - Builds the MenuBar. * @param control @@ -62,8 +55,6 @@ this.control = control; // reference to ScriptEditControl control buildFileMenu(); buildEditMenu(); - buildSettingsMenu(); - buildHelpMenu(); refresh(); } @@ -192,95 +183,15 @@ }); menuEdit.add(miPaste); - menuEdit.addSeparator(); // ------ - - miFind = new JMenuItem("Find"); - miFind.setMnemonic('F'); - miFind.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, Event.CTRL_MASK)); - miFind.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent event) { - // find - // TODO - System.err.print("find..."); - } - }); - menuEdit.add(miFind); - add(menuEdit); } /** - * Build Edit Menu. - */ - private void buildSettingsMenu() { - final JMenu menuSettings = new JMenu("Settings"); - - miFont = new JMenuItem("Font"); - miFont.setMnemonic('F'); - miFont.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent event) { - // set font - } - }); - menuSettings.add(miFont); - - miColors = new JMenuItem("Colors"); - miColors.setMnemonic('C'); - miColors.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent event) { - // set colors - } - }); - menuSettings.add(miColors); - - add(menuSettings); - } - - /** - * This builds the help menu. - */ - private void buildHelpMenu() { - final JMenu menuHelp = new JMenu("Help"); - final JMenuItem miOnlineHelp = new JMenuItem("Online Help"); - miOnlineHelp.setMnemonic('H'); - miOnlineHelp.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent event) { - // FIXME: "pystart.html" shouldn't be hardcoded - new Help(control.getView(), "pystart.html").setVisible(true); - } - }); - menuHelp.add(miOnlineHelp); - -// final JMenuItem miAbout = new JMenuItem("About"); -// miAbout.setMnemonic('A'); -// miAbout.addActionListener(new ActionListener() { -// public void actionPerformed(final ActionEvent event) { -// control.showMessage("About " + IGUIConstants.APP_NAME, -// " Version " + IGUIConstants.VERSION + '\n' -// + "(c) 2005 Michael Toennies\n" -// + " Andreas Vogl\n" -// + " Peter Plischewsky\n" -// + " Gecko\n"); -// } -// }); -// menuHelp.add(miAbout); - add(menuHelp); - } - - /** * Refreshes the enable/disable state of all menus. */ - public void refresh() { - miFind.setEnabled(false); - miColors.setEnabled(false); - miFont.setEnabled(false); - + public final void refresh() { // see if there is a path for direct 'save' - if (control.getActiveFilePath() != null) { - miSave.setEnabled(true); - } else { - miSave.setEnabled(false); - } + miSave.setEnabled(control.getActiveFilePath() != null); } } // class ScriptEditMenuBar Modified: trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditView.java =================================================================== --- trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditView.java 2006-09-12 19:43:21 UTC (rev 324) +++ trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditView.java 2006-09-12 20:17:15 UTC (rev 325) @@ -28,7 +28,6 @@ import daieditor.textedit.textarea.LuaTokenMarker; import daieditor.textedit.textarea.SyntaxDocument; import java.awt.Dimension; -import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; @@ -39,8 +38,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.prefs.Preferences; -import static java.util.prefs.Preferences.userNodeForPackage; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JOptionPane; @@ -48,6 +45,7 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.text.BadLocationException; +import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; /** @@ -57,6 +55,8 @@ */ public final class ScriptEditView extends JFrame { + private static final Logger log = Logger.getLogger(ScriptEditView.class); + /** Serial Version UID. */ private static final long serialVersionUID = 1L; @@ -103,16 +103,10 @@ // calculate some default values in case there is no settings file final Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); - final int defwidth = (int) (0.6 * screen.getWidth()); - final int defheight = (int) (0.8 * screen.getHeight()); - - // get the old location and size - final Preferences prefs = userNodeForPackage(ScriptEditView.class); - final int x = prefs.getInt(WINDOW_X, screen.width - defwidth >> 1); - final int y = prefs.getInt(WINDOW_Y, screen.height - defheight >> 1); - final int width = prefs.getInt(WINDOW_WIDTH, defwidth); - final int height = prefs.getInt(WINDOW_HEIGHT, defheight); - + final int width = (int) (0.6 * screen.getWidth()); + final int height = (int) (0.8 * screen.getHeight()); + final int x = (int) (0.2 * screen.getWidth()); + final int y = (int) (0.1 * screen.getWidth()); setBounds(x, y, width, height); } @@ -143,40 +137,31 @@ if (file != null && file.exists()) { // print file into this document - BufferedReader in = null; try { - // open ascii streams - in = new BufferedReader(new FileReader(file)); - - boolean firstLine = true; - final StringBuffer buff = new StringBuffer(""); - String line; - while ((line = in.readLine()) != null) { - if (!firstLine) { - buff.append('\n'); - } else { - firstLine = false; + final BufferedReader in = new BufferedReader(new FileReader(file)); + try { + boolean firstLine = true; + final StringBuffer buff = new StringBuffer(""); + String line; + while ((line = in.readLine()) != null) { + if (!firstLine) { + buff.append('\n'); + } else { + firstLine = false; + } + buff.append(line); } - buff.append(line); + ta.getDocument().insertString(0, buff.toString(), null); + } finally { + in.close(); } - - // close filestreams - in.close(); - // insert buffer into the document - ta.getDocument().insertString(0, buff.toString(), null); } catch (final FileNotFoundException e) { - System.err.println("ScriptEditView.addTab(): File '" + file.getName() + "' not found."); + log.info("addTab(): File '" + file.getName() + "' not found."); } catch (final IOException e) { - System.err.println("ScriptEditView.addTab(): I/O-Error while reading '" + file.getName() + "'."); + log.info("addTab(): I/O-Error while reading '" + file.getName() + "'."); } catch (final BadLocationException e) { - System.err.println("ScriptEditView.addTab(): Bad Location in Document!"); - } finally { - try { - in.close(); - } catch (final Exception e) { /* ignore */ } finally { - in = null; - } + log.info("addTab(): Bad Location in Document!"); } } @@ -261,22 +246,6 @@ } /** - * Notifies that the application is about to exit. The window settings get - * saved to the settings file here. - */ - final void appExitNotify() { - // store location and size - final Preferences prefs = userNodeForPackage(ScriptEditView.class); - final Rectangle bounds = getBounds(); // window frame bounds - prefs.putInt(WINDOW_X, bounds.x); - prefs.putInt(WINDOW_Y, bounds.y); - prefs.putInt(WINDOW_WIDTH, bounds.width); - prefs.putInt(WINDOW_HEIGHT, bounds.height); - } - - // -------------------------------------- - - /** * Inner class: Listener for ChangeEvents in the tabPane. */ private final class EditTabListener implements ChangeListener { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-12 20:24:57
|
Revision: 326 http://svn.sourceforge.net/gridarta/?rev=326&view=rev Author: christianhujer Date: 2006-09-12 13:24:42 -0700 (Tue, 12 Sep 2006) Log Message: ----------- Commented icon setting so code less depends on which editor is run. Modified Paths: -------------- trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditView.java trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditView.java Modified: trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditView.java =================================================================== --- trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditView.java 2006-09-12 20:17:15 UTC (rev 325) +++ trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditView.java 2006-09-12 20:24:42 UTC (rev 326) @@ -23,7 +23,6 @@ package cfeditor.textedit.scripteditor; -import cfeditor.CGUIUtils; import cfeditor.textedit.textarea.JEditTextArea; import cfeditor.textedit.textarea.PythonTokenMarker; import cfeditor.textedit.textarea.SyntaxDocument; @@ -38,7 +37,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JTabbedPane; @@ -49,7 +47,7 @@ import org.jetbrains.annotations.Nullable; /** - * The Python script editor frame. This class should only exist in + * The script editor frame. This class should only exist in * ScriptEditControl. No other class should refer to it. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> */ @@ -92,11 +90,11 @@ tabPane = new JTabbedPane(JTabbedPane.TOP); // init tab pane tabPane.addChangeListener(new EditTabListener(this)); - // set the window icon - final ImageIcon icon = CGUIUtils.getIcon("Script.gif"); - if (icon != null) { - setIconImage(icon.getImage()); - } +// // set the window icon +// final ImageIcon icon = CGUIUtils.getIcon("Script.gif"); +// if (icon != null) { +// setIconImage(icon.getImage()); +// } getContentPane().add(tabPane); addWindowListener(new EditWindowListener(control)); // add listener for close box Modified: trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditView.java =================================================================== --- trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditView.java 2006-09-12 20:17:15 UTC (rev 325) +++ trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditView.java 2006-09-12 20:24:42 UTC (rev 326) @@ -23,7 +23,6 @@ package daieditor.textedit.scripteditor; -import daieditor.CGUIUtils; import daieditor.textedit.textarea.JEditTextArea; import daieditor.textedit.textarea.LuaTokenMarker; import daieditor.textedit.textarea.SyntaxDocument; @@ -38,7 +37,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JTabbedPane; @@ -49,7 +47,7 @@ import org.jetbrains.annotations.Nullable; /** - * The Lua script editor frame. This class should only exist in + * The script editor frame. This class should only exist in * ScriptEditControl. No other class should refer to it. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> */ @@ -92,11 +90,11 @@ tabPane = new JTabbedPane(JTabbedPane.TOP); // init tab pane tabPane.addChangeListener(new EditTabListener(this)); - // set the window icon - final ImageIcon icon = CGUIUtils.getIcon("Script.gif"); - if (icon != null) { - setIconImage(icon.getImage()); - } +// // set the window icon +// final ImageIcon icon = CGUIUtils.getIcon("Script.gif"); +// if (icon != null) { +// setIconImage(icon.getImage()); +// } getContentPane().add(tabPane); addWindowListener(new EditWindowListener(control)); // add listener for close box This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-13 01:44:56
|
Revision: 328 http://svn.sourceforge.net/gridarta/?rev=328&view=rev Author: christianhujer Date: 2006-09-12 18:44:31 -0700 (Tue, 12 Sep 2006) Log Message: ----------- Unified I/O. It's late and it might be bogus, please test it. It's unified enough to move it to the common code base, but I'm too tired right now. Maybe tomorrow. Modified Paths: -------------- trunk/crossfire/src/cfeditor/AutojoinList.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CFileInputStream.java trunk/crossfire/src/cfeditor/CFileReader.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/FaceObject.java trunk/crossfire/src/cfeditor/MultiPositionData.java trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java trunk/crossfire/src/cfeditor/textedit/scripteditor/CFPythonPopup.java trunk/daimonin/src/daieditor/CFileInputStream.java trunk/daimonin/src/daieditor/CFileReader.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/TrackedBufferedInputStream.java Modified: trunk/crossfire/src/cfeditor/AutojoinList.java =================================================================== --- trunk/crossfire/src/cfeditor/AutojoinList.java 2006-09-12 20:50:47 UTC (rev 327) +++ trunk/crossfire/src/cfeditor/AutojoinList.java 2006-09-13 01:44:31 UTC (rev 328) @@ -98,7 +98,7 @@ final CFileReader stream = new CFileReader(baseDir, filename); // read the file - while ((line = stream.getReader().readLine()) != null) { + while ((line = stream.readLine()) != null) { if (!line.startsWith("#") && line.length() > 0) { line = line.trim(); // remove whitespace at both ends Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-09-12 20:50:47 UTC (rev 327) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-09-13 01:44:31 UTC (rev 328) @@ -78,7 +78,6 @@ CFArchTypeList() { CFArchType cfType = head; // index of CFArchType list final boolean headLoaded = false; // true when the default type (=head) is loaded - CFileReader fread = null; // file reader for "types.txt" // initialize the arrays of "special-data" bitmaskTable = new HashMap(); @@ -90,111 +89,115 @@ try { // open ascii filestream to the xml data final String baseDir = IGUIConstants.CONFIG_DIR; - fread = new CFileReader(baseDir, IGUIConstants.TYPEDEF_FILE); + final CFileReader fread = new CFileReader(baseDir, IGUIConstants.TYPEDEF_FILE); + try { - // parse xml document - final SAXBuilder builder = new SAXBuilder(); - builder.setValidation(true); - final Document doc = builder.build(fread.getReader()); + // parse xml document + final SAXBuilder builder = new SAXBuilder(); + builder.setValidation(true); + final Document doc = builder.build(fread); - // start parsing the xml - final Element root = doc.getRootElement(); - Element elem; - Attribute a; - if (root == null || !root.getName().equalsIgnoreCase("types")) { - LOG.warn("File '" + IGUIConstants.TYPEDEF_FILE + "' lacks root element 'types'."); - } else { - List children; - // parse all bitmask elements - children = root.getChildren("bitmask"); - for (int i = 0; children != null && i < children.size(); i++) { - elem = (Element) children.get(i); - if (elem.getAttribute("name") == null) { - LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load bitmask element without 'name'."); - } else { - bitmaskTable.put(elem.getAttribute("name").getValue(), new CAttribBitmask(elem)); + // start parsing the xml + final Element root = doc.getRootElement(); + Element elem; + Attribute a; + if (root == null || !root.getName().equalsIgnoreCase("types")) { + LOG.warn("File '" + IGUIConstants.TYPEDEF_FILE + "' lacks root element 'types'."); + } else { + List children; + // parse all bitmask elements + children = root.getChildren("bitmask"); + for (int i = 0; children != null && i < children.size(); i++) { + elem = (Element) children.get(i); + if (elem.getAttribute("name") == null) { + LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load bitmask element without 'name'."); + } else { + bitmaskTable.put(elem.getAttribute("name").getValue(), new CAttribBitmask(elem)); + } } - } - // parse all list elements - children = root.getChildren("list"); - for (int i = 0; children != null && i < children.size(); i++) { - elem = (Element) children.get(i); - if (elem.getAttribute("name") == null) { - LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load list element without 'name'."); - } else { - final Vector list = parseListFromElement(elem); - if (list != null && list.size() > 0) { - listTable.put(elem.getAttribute("name").getValue(), list); + // parse all list elements + children = root.getChildren("list"); + for (int i = 0; children != null && i < children.size(); i++) { + elem = (Element) children.get(i); + if (elem.getAttribute("name") == null) { + LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load list element without 'name'."); + } else { + final Vector list = parseListFromElement(elem); + if (list != null && list.size() > 0) { + listTable.put(elem.getAttribute("name").getValue(), list); + } } } - } - // parse default type - elem = root.getChild("default_type"); - if (elem == null) { - LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': default_type element is missing!"); - } else { - // create a new CFArchType element - final CFArchType newType = new CFArchType(head); + // parse default type + elem = root.getChild("default_type"); + if (elem == null) { + LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': default_type element is missing!"); + } else { + // create a new CFArchType element + final CFArchType newType = new CFArchType(head); - // attach the new CFArchType element to the list - // if we manage to parse it properly from the file - if (head.load(elem, this)) { - cfType = head; - //length++; // our list is now one element longer + // attach the new CFArchType element to the list + // if we manage to parse it properly from the file + if (head.load(elem, this)) { + cfType = head; + //length++; // our list is now one element longer + } } - } - // parse ignore lists - children = root.getChildren("ignore_list"); - for (int i = 0; children != null && i < children.size(); i++) { - elem = (Element) children.get(i); - if (elem.getAttribute("name") == null) { - LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load ignore_list element without 'name'."); - } else { - final String lname = elem.getAttribute("name").getValue().trim(); - final List children2 = elem.getChildren(CFArchType.XML_ATTRIBUTE); - if (children2 != null && children2.size() > 0) { - // load all attribute entries - final Vector content = new Vector(); - for (int k = 0; k < children2.size(); k++) { - elem = (Element) children2.get(k); - if ((a = elem.getAttribute(CFArchAttrib.XML_KEY_ARCH)) != null) { - content.addElement(a.getValue().trim()); - } else { - LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': ignore_list '" + lname + "' has " + CFArchType.XML_ATTRIBUTE + " missing '" + CFArchAttrib.XML_KEY_ARCH + "'."); + // parse ignore lists + children = root.getChildren("ignore_list"); + for (int i = 0; children != null && i < children.size(); i++) { + elem = (Element) children.get(i); + if (elem.getAttribute("name") == null) { + LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load ignore_list element without 'name'."); + } else { + final String lname = elem.getAttribute("name").getValue().trim(); + final List children2 = elem.getChildren(CFArchType.XML_ATTRIBUTE); + if (children2 != null && children2.size() > 0) { + // load all attribute entries + final Vector content = new Vector(); + for (int k = 0; k < children2.size(); k++) { + elem = (Element) children2.get(k); + if ((a = elem.getAttribute(CFArchAttrib.XML_KEY_ARCH)) != null) { + content.addElement(a.getValue().trim()); + } else { + LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': ignore_list '" + lname + "' has " + CFArchType.XML_ATTRIBUTE + " missing '" + CFArchAttrib.XML_KEY_ARCH + "'."); + } } + // now add the list vector to the ignoreListTable: + ignoreListTable.put(lname, content); } - // now add the list vector to the ignoreListTable: - ignoreListTable.put(lname, content); } } - } - // parse all type elements - children = root.getChildren("type"); - for (int i = 0; children != null && i < children.size(); i++) { - elem = (Element) children.get(i); - if (elem.getAttribute("name") == null || elem.getAttribute("number") == null) { - LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': found type element without 'name' or 'number'."); - } else { - // create a new CFArchType element - final CFArchType newType = new CFArchType(head); + // parse all type elements + children = root.getChildren("type"); + for (int i = 0; children != null && i < children.size(); i++) { + elem = (Element) children.get(i); + if (elem.getAttribute("name") == null || elem.getAttribute("number") == null) { + LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': found type element without 'name' or 'number'."); + } else { + // create a new CFArchType element + final CFArchType newType = new CFArchType(head); - // attach the new CFArchType element to the list - // if we manage to parse it properly from the file - if (newType.load(elem, this)) { - cfType.setNext(newType); - cfType = cfType.getNext(); - length++; // our list is now one element longer + // attach the new CFArchType element to the list + // if we manage to parse it properly from the file + if (newType.load(elem, this)) { + cfType.setNext(newType); + cfType = cfType.getNext(); + length++; // our list is now one element longer + } } } - } - if (LOG.isInfoEnabled()) { - LOG.info("Loaded " + length + " types from '" + IGUIConstants.TYPEDEF_FILE + "'"); + if (LOG.isInfoEnabled()) { + LOG.info("Loaded " + length + " types from '" + IGUIConstants.TYPEDEF_FILE + "'"); + } } + } finally { + fread.close(); } } catch (JDOMException e) { LOG.error("Parsing error in '" + IGUIConstants.TYPEDEF_FILE, e); @@ -202,10 +205,6 @@ LOG.error("Cannot read file '" + IGUIConstants.TYPEDEF_FILE + "'!", e); } - // close data stream - if (fread != null) { - fread.close(); - } ignoreListTable = null; // this was only needed during load phase } @@ -284,77 +283,76 @@ public void loadSpellsFromXML() { spellName = null; spellNum = null; - CFileReader reader = null; // input reader final int spnum = 0; // number of spells try { // open reading stream to the spells xml file final String baseDir = IGUIConstants.CONFIG_DIR; - reader = new CFileReader(baseDir, IGUIConstants.SPELL_FILE); + final CFileReader reader = new CFileReader(baseDir, IGUIConstants.SPELL_FILE); + try { + // parse xml document + final SAXBuilder builder = new SAXBuilder(); + final Document doc = builder.build(reader); - // parse xml document - final SAXBuilder builder = new SAXBuilder(); - final Document doc = builder.build(reader.getReader()); - - // retrieve the spell data from the xml - final Element root = doc.getRootElement(); - Element spellElem; - Attribute a; - if (root == null || !root.getName().equalsIgnoreCase("spells")) { - LOG.warn("File '" + IGUIConstants.SPELL_FILE + "' lacks root element 'spells'."); - } else { - final List spells = root.getChildren("spell"); - if (spells == null || spells.size() == 0) { - LOG.warn("File '" + IGUIConstants.SPELL_FILE + "' has no content."); + // retrieve the spell data from the xml + final Element root = doc.getRootElement(); + Element spellElem; + Attribute a; + if (root == null || !root.getName().equalsIgnoreCase("spells")) { + LOG.warn("File '" + IGUIConstants.SPELL_FILE + "' lacks root element 'spells'."); } else { - // initialize array with appropriate size - spellName = new String[spells.size() + 1]; - spellNum = new int[spells.size() + 1]; + final List spells = root.getChildren("spell"); + if (spells == null || spells.size() == 0) { + LOG.warn("File '" + IGUIConstants.SPELL_FILE + "' has no content."); + } else { + // initialize array with appropriate size + spellName = new String[spells.size() + 1]; + spellNum = new int[spells.size() + 1]; - // first element is <none> - spellName[0] = " <none>"; - spellNum[0] = -1; + // first element is <none> + spellName[0] = " <none>"; + spellNum[0] = -1; - int i; - int j; - for (j = 0, i = 1; j < spells.size(); j++) { - spellElem = (Element) spells.get(j); + int i; + int j; + for (j = 0, i = 1; j < spells.size(); j++) { + spellElem = (Element) spells.get(j); - if (spellElem.getAttribute("id") == null) { - LOG.warn("In File '" + IGUIConstants.SPELL_FILE + "': Found 'spell' element without 'id'"); - } else if (spellElem.getAttribute("name") == null) { - LOG.warn("In File '" + IGUIConstants.SPELL_FILE + "': Found 'spell' element without 'name'"); - } else { - try { - // parse spell number and -name - spellNum[i] = spellElem.getAttribute("id").getIntValue(); - spellName[i] = spellElem.getAttribute("name").getValue().trim(); - i++; - } catch (DataConversionException de) { - LOG.error("in '" + IGUIConstants.SPELL_FILE + "': spell id '" + spellElem.getAttribute("id").getValue() + "' is not an integer."); + if (spellElem.getAttribute("id") == null) { + LOG.warn("In File '" + IGUIConstants.SPELL_FILE + "': Found 'spell' element without 'id'"); + } else if (spellElem.getAttribute("name") == null) { + LOG.warn("In File '" + IGUIConstants.SPELL_FILE + "': Found 'spell' element without 'name'"); + } else { + try { + // parse spell number and -name + spellNum[i] = spellElem.getAttribute("id").getIntValue(); + spellName[i] = spellElem.getAttribute("name").getValue().trim(); + i++; + } catch (DataConversionException de) { + LOG.error("in '" + IGUIConstants.SPELL_FILE + "': spell id '" + spellElem.getAttribute("id").getValue() + "' is not an integer."); + } } } - } - // loading successful - i--; - if (LOG.isInfoEnabled()) { - if (i == spells.size()) { - LOG.info("Loaded " + i + " spells from '" + IGUIConstants.SPELL_FILE + "'"); - } else { - LOG.info("Loaded " + i + " of " + spells.size() + " defined spells from '" + IGUIConstants.SPELL_FILE + "'"); + // loading successful + i--; + if (LOG.isInfoEnabled()) { + if (i == spells.size()) { + LOG.info("Loaded " + i + " spells from '" + IGUIConstants.SPELL_FILE + "'"); + } else { + LOG.info("Loaded " + i + " of " + spells.size() + " defined spells from '" + IGUIConstants.SPELL_FILE + "'"); + } } } } + } finally { + reader.close(); } } catch (JDOMException e) { LOG.error("Parsing error in '" + IGUIConstants.SPELL_FILE + "'", e); } catch (IOException e) { LOG.error("Cannot read file '" + IGUIConstants.SPELL_FILE + "'!"); } - if (reader != null) { - reader.close(); - } } /** Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-09-12 20:50:47 UTC (rev 327) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-09-13 01:44:31 UTC (rev 328) @@ -252,7 +252,7 @@ // read the whole file line by line TreasureTreeNode node = null; - while ((line = reader.getReader().readLine()) != null) { + while ((line = reader.readLine()) != null) { line = line.trim(); if (line.length() > 0 && !line.startsWith("#")) { // reading outside of treasurelist @@ -265,7 +265,7 @@ tListCount++; // read this treasurelist till the very end - readInsideList(node, reader.getReader(), needLink); + readInsideList(node, reader, needLink); } else { errorLog.append("After treasurelist " + node.getTreasureObj().getName() + ": unexpected line:\n\"" + line + "\"\n"); Modified: trunk/crossfire/src/cfeditor/CFileInputStream.java =================================================================== --- trunk/crossfire/src/cfeditor/CFileInputStream.java 2006-09-12 20:50:47 UTC (rev 327) +++ trunk/crossfire/src/cfeditor/CFileInputStream.java 2006-09-13 01:44:31 UTC (rev 328) @@ -2,6 +2,7 @@ * Crossfire Java Editor. * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl + * Copyright (C) 2005 Christian Hujer * * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * @@ -24,126 +25,98 @@ package cfeditor; +import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; -import java.io.IOException; import java.io.InputStream; -import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Class for opening and reading a buffered stream to a BINARY resource-file. * If no such file is found, the file is loaded from the jar archive. * This class is very similar to {@link CFileReader}. + * The file is tried to open in the following order: + * <ol> + * <li>Try opening it with the given directory. The directory path is relative + * to the current working directory, the file path relative to that + * directory..</li> + * <li>Try opening it without the given directory. The file path is relative to + * the current working directory.</li> + * <li>Try opening the file as a system resource through the class loader.</li> + * </ol> + * Only if all tries failed, creating the stream fails. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @see CFileReader */ -public final class CFileInputStream { +public final class CFileInputStream extends BufferedInputStream { - private static final Logger LOG = Logger.getLogger(CFileInputStream.class); - - private final String filename; // name of the resource file - - private final String filedir; // directory of the resource file - - private boolean isBinfile = false; // true if the resource was opened as binary file - - private boolean isJar = false; // true if resource was opened from jar archive - - // streams - private FileInputStream fileInput; // binary file input stream - - private InputStream inStream; // basic binary input stream - - private TrackedBufferedInputStream stream; // buffered stream - /** - * Constructor: Open a byte-stream to the specified resource file. - * @param dname name of directory that the file is in - * (null means the file is located in the editor root dir) + * Creates a new CFileInputStream to a specified resource file. + * @param dname name of directory that the file is in (<code>null</code> + * means the file is located in the editor root dir) * @param fname name of the resource file + * @throws FileNotFoundException In case all three tries to open the file failed */ - public CFileInputStream(final String dname, final String fname) throws FileNotFoundException { - filename = fname; - filedir = dname; - fileInput = null; - inStream = null; - stream = null; - - // now try to open the file - open(); + public CFileInputStream(@Nullable final String dname, @NotNull final String fname) throws FileNotFoundException { + super(createStream(dname, fname)); } - /** open the resource file for reading */ - private void open() throws FileNotFoundException { - try { - // first we look if the resource is available as normal binary-file - // in the specified directory - fileInput = new FileInputStream(filedir + File.separator + filename); - stream = new TrackedBufferedInputStream(fileInput); - isBinfile = true; - } catch (final FileNotFoundException e) { - try { - // second we look if the resource is available as normal binary-file - // in the editor's root directory - fileInput = new FileInputStream(filename); - stream = new TrackedBufferedInputStream(fileInput); - isBinfile = true; - } catch (final FileNotFoundException ex) { - // if there is no binary file at all, we try to load it from - // the system-jar-archive: - inStream = ClassLoader.getSystemResourceAsStream(filename); - if (inStream != null) { - stream = new TrackedBufferedInputStream(inStream); - isJar = true; - } - } + /** + * Open the resource file for reading. + * @param dname directory name to read from + * @param fname file name of file to read + * @return Stream for reading from <var>fname</var> + * @throws FileNotFoundException In case all tries to open the file failed + */ + @SuppressWarnings({"MethodWithMultipleReturnPoints", "MethodWithMoreThanThreeNegations"}) + @NotNull private static InputStream createStream(@Nullable final String dname, @NotNull final String fname) throws FileNotFoundException { + try { // 1st try normal binary file relative to specified directory + return new FileInputStream(new File(dname, fname)); + } catch (final Exception e) { + // ignore } - - if (!isBinfile && !isJar) { - if (LOG.isInfoEnabled()) { - LOG.info("File \"" + filename + "\" was not found!"); + try { // 2nd try binary file relative to user's current working directory + return new FileInputStream(fname); + } catch (final Exception e) { // 3rd try via system resource from class loader + // ignore + } + final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); + try { // 3rd try context class loader relative to specified directory + @Nullable final InputStream stream = contextClassLoader.getResourceAsStream(new File(dname, fname).toURL().toURI().toString()); + if (stream != null) { + return stream; } - throw new FileNotFoundException(); + } catch (final Exception e) { + // ignore } - } - - /** @return <code>BufferedInputStream</code> to the resource file */ - public TrackedBufferedInputStream getBufferedStream() { - return stream; - } - - /** - * Read one byte from the stream - * (Wrapper method for <code>BufferedInputStream.read()</code>) - * @return one read byte-character - */ - public int read() throws IOException { - return stream.read(); - } - - /** close all open streams, print errormessages if closing failed */ - public void close() { - if (stream != null) { - try { - stream.close(); - } catch (final IOException e) { - LOG.warn("Couldn't close BufferedInputStream for \"" + filename + "\"."); + try { // 4th try context class loader relative to class loader's top level directory + @Nullable final InputStream stream = contextClassLoader.getResourceAsStream(new File(fname).toURL().toURI().toString()); + if (stream != null) { + return stream; } + } catch (final Exception e) { + // ignore } - if (inStream != null) { - try { - inStream.close(); - } catch (final IOException e) { - LOG.warn("Couldn't close InputStream for \"" + filename + "\"."); + try { // 5th try system class loader relative to specified directory + @Nullable final InputStream stream = ClassLoader.getSystemResourceAsStream(new File(dname, fname).toURL().toURI().toString()); + if (stream != null) { + return stream; } + } catch (final Exception e) { + // ignore } - if (fileInput != null) { - try { - fileInput.close(); - } catch (final IOException e) { - LOG.warn("Couldn't close FileInputStream for \"" + filename + "\"."); + try { // 6th try system class loader relative to class loader's top level directory + @Nullable final InputStream stream = ClassLoader.getSystemResourceAsStream(new File(fname).toURL().toURI().toString()); + if (stream != null) { + return stream; } + } catch (final Exception e) { + // ignore } + throw new FileNotFoundException("CFileInputStream couldn't find " + new File(dname, fname) + "."); } } // class CFileInputStream Modified: trunk/crossfire/src/cfeditor/CFileReader.java =================================================================== --- trunk/crossfire/src/cfeditor/CFileReader.java 2006-09-12 20:50:47 UTC (rev 327) +++ trunk/crossfire/src/cfeditor/CFileReader.java 2006-09-13 01:44:31 UTC (rev 328) @@ -2,6 +2,7 @@ * Crossfire Java Editor. * Copyright (C) 2000 Michael Toennies * Copyright (C) 2001 Andreas Vogl + * Copyright (C) 2005 Christian Hujer * * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) * @@ -26,40 +27,31 @@ import java.io.BufferedReader; import java.io.EOFException; -import java.io.File; import java.io.FileNotFoundException; -import java.io.FileReader; import java.io.IOException; -import java.io.InputStream; import java.io.InputStreamReader; -import org.apache.log4j.Logger; +import java.io.Reader; +import java.io.UnsupportedEncodingException; /** * Class for opening and reading a buffered stream to an ASCII resource-file. * If no such file is found, the file is loaded from the jar archive. + * This class is very similar to {@link CFileInputStream}. + * The file is tried to open in the following order: + * <ol> + * <li>Try opening it with the given directory. The directory path is relative to the current working directory, the file path relative to that + * directory..</li> + * <li>Try opening it without the given directory. The file path is relative to the current working directory.</li> + * <li>Try opening the file as a system resource through the class loader.</li> + * </ol> + * Only if all tries failed, creating the stream fails. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @todo eventually remove readUntil - this is afaik only used for reading arches and such, and since there should be an integrated arch editor... + * @see CFileInputStream */ -public final class CFileReader { +public final class CFileReader extends BufferedReader { - private static final Logger LOG = Logger.getLogger(CFileReader.class); - - private final String filename; // name of the resource file - - private final String filedir; // directory of the resource file - - private boolean isAscii = false; // true if the resource was opened as ascii file - - private boolean isJar = false; // true if resource was opened from jar archive - - // streams - private FileReader fileRead; - - private InputStream inStream; - - private InputStreamReader streamRead; - - private BufferedReader read; - /** Maximum number of characters to read in readUntil. */ private static final long READ_MAX = 10000L; @@ -70,58 +62,24 @@ * @throws FileNotFoundException in case all three tries to open the file failed */ public CFileReader(final String dname, final String fname) throws FileNotFoundException { - filename = fname; - filedir = dname; - fileRead = null; - inStream = null; - streamRead = null; - read = null; - - // now try to open the file - open(); + super(createReader(dname, fname)); } - /** open the resource file for reading */ - private void open() throws FileNotFoundException { + /** + * Open the resource file for reading. + * @param dname name of directory that the file is in (null means the file is located in the editor root dir) + * @param fname name of the resource file + * @return Stream for reading from <var>fname</var> + * @throws FileNotFoundException In case all three tries to open the file failed + */ + private static Reader createReader(final String dname, final String fname) throws FileNotFoundException { try { - // first we look if the resource is available as normal ascii-file - // in the specified directory - fileRead = new FileReader(filedir + File.separator + filename); - isAscii = true; - } catch (final FileNotFoundException e) { - try { - // second we look if the resource is available as normal ascii-file - // in the editor's root directory - fileRead = new FileReader(filename); - isAscii = true; - } catch (final FileNotFoundException ex) { - // if there is no ascii file at all, we try to load it from - // the system-jar-archive: - inStream = ClassLoader.getSystemResourceAsStream(filename); - if (inStream != null) { - streamRead = new InputStreamReader(inStream); - isJar = true; - } - } + return new InputStreamReader(new CFileInputStream(dname, fname), CMainControl.MAP_ENCODING); + } catch (final UnsupportedEncodingException e) { + throw new Error(e); } - - if (isAscii) { - read = new BufferedReader(fileRead); - } else if (isJar) { - read = new BufferedReader(streamRead); - } else { - if (LOG.isInfoEnabled()) { - LOG.info("File \"" + filename + "\" was not found!"); - } - throw new FileNotFoundException(); - } } - /** @return <code>BufferedReader</code> to the resource file */ - public BufferedReader getReader() { - return read; - } - /** * Reads characters from the BufferedReader stream till 'tag' is found. If * found, the method returns with stream pointing right after the @@ -216,46 +174,4 @@ return sb.substring(0, sb.length() - tag.length()); } - // wrapper method for readUntil, using BufferReader from 'this' - public void readUntil(final String tag, final String abort) throws IOException { - readUntil(read, tag, abort); - } - - // wrapper method for readUntil, using BufferReader from 'this' - public String readUntil(final String tag) throws IOException { - return readUntil(read, tag); - } - - /** close all open streams, print errormessages if closing failed */ - public void close() { - if (read != null) { - try { - read.close(); - } catch (final IOException e) { - LOG.warn("Couldn't close BufferedReader for \"" + filename + "\".", e); - } - } - if (fileRead != null) { - try { - fileRead.close(); - } catch (IOException e) { - LOG.warn("Couldn't close FileReader for \"" + filename + "\".", e); - } - } - if (streamRead != null) { - try { - streamRead.close(); - } catch (final IOException e) { - LOG.warn("Couldn't close InputStreamReader for \"" + filename + "\".", e); - } - } - if (inStream != null) { - try { - inStream.close(); - } catch (final IOException e) { - LOG.warn("Couldn't close InputStream for \"" + filename + "\".", e); - } - } - } - } // class CFileReader Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-12 20:50:47 UTC (rev 327) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-13 01:44:31 UTC (rev 328) @@ -80,8 +80,18 @@ /** Logger. */ private static final Logger log = Logger.getLogger(CMainControl.class); - private static CMainControl instance = null; + /** Singleton instance reference. */ + private static CMainControl instance; + /** + * Encoding to use for maps and other data. + * The encoding given here is used for reading and writing maps. + * You shouldn't change this only because you use an UTF-8 system or so, since the encoding used here MUST be compatible with the server and the + * client. The paragraph sign § is the critical character. + * @todo once the mailing list decided on the § character, eventually replace by "us-ascii". + */ + public static final String MAP_ENCODING = "iso-8859-1"; + public static final String DOCU_VERSION_KEY = "docuVersion"; public static final String MAP_DIR_KEY = "mapDirectory"; Modified: trunk/crossfire/src/cfeditor/FaceObject.java =================================================================== --- trunk/crossfire/src/cfeditor/FaceObject.java 2006-09-12 20:50:47 UTC (rev 327) +++ trunk/crossfire/src/cfeditor/FaceObject.java 2006-09-13 01:44:31 UTC (rev 328) @@ -98,12 +98,11 @@ log.debug("Lazy loading " + name); } final CFileInputStream fi = new CFileInputStream(ressourceDirectory, ressourceName); - final BufferedInputStream bis = fi.getBufferedStream(); if (dataStartIndex > 0) { - bis.skip(dataStartIndex); + fi.skip(dataStartIndex); } final byte[] data = new byte[dataSize]; - bis.read(data); + fi.read(data); final PngImage png = new PngImage(new ByteArrayInputStream(data)); // read png data from bytestream png.setFlushAfterNextProduction(true); final ImageIcon im = new ImageIcon(Toolkit.getDefaultToolkit().createImage(png)); Modified: trunk/crossfire/src/cfeditor/MultiPositionData.java =================================================================== --- trunk/crossfire/src/cfeditor/MultiPositionData.java 2006-09-12 20:50:47 UTC (rev 327) +++ trunk/crossfire/src/cfeditor/MultiPositionData.java 2006-09-13 01:44:31 UTC (rev 328) @@ -82,7 +82,7 @@ int yp = 0; // y-index in the data array // read the whole file line by line - while ((line = reader.getReader().readLine()) != null) { + while ((line = reader.readLine()) != null) { line = line.trim(); if (line.length() > 0 && !line.startsWith("#") && yp < Y_DIM) { final StringTokenizer s = new StringTokenizer(line, " ", false); Deleted: trunk/crossfire/src/cfeditor/TrackedBufferedInputStream.java =================================================================== --- trunk/crossfire/src/cfeditor/TrackedBufferedInputStream.java 2006-09-12 20:50:47 UTC (rev 327) +++ trunk/crossfire/src/cfeditor/TrackedBufferedInputStream.java 2006-09-13 01:44:31 UTC (rev 328) @@ -1,94 +0,0 @@ -/* - * Created on 12 janv. 2005 - * - * TODO To change the template for this generated file go to - * Window - Preferences - Java - Code Style - Code Templates - */ - -package cfeditor; - -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.InputStream; -import org.apache.log4j.Logger; - -/** - * A BufferedInputStream that keeps track of its current position. - * @author tchize - */ -public final class TrackedBufferedInputStream extends BufferedInputStream { - - private static final Logger log = Logger.getLogger(TrackedBufferedInputStream.class); - - private long position = 0; - - private long lastPosition = -1; - - public TrackedBufferedInputStream(final InputStream stream) { - super(stream); - } - - public TrackedBufferedInputStream(final InputStream stream, final int size) { - super(stream, size); - } - - /* (non-Javadoc) - * @see java.io.InputStream#mark(int) - */ - @Override public synchronized void mark(final int max) { - // TODO Auto-generated method stub - super.mark(max); - lastPosition = position; - } - - /* (non-Javadoc) - * @see java.io.InputStream#read() - */ - @Override public synchronized int read() throws IOException { - // TODO Auto-generated method stub - final int result = super.read(); - if (result >= 0) { - position++; - } - return result; - } - - /* (non-Javadoc) - * @see java.io.InputStream#read(byte[], int, int) - */ - @Override public synchronized int read(final byte[] data, final int offset, final int length) - throws IOException { - // TODO Auto-generated method stub - final int result = super.read(data, offset, length); - if (result > 0) { - position += result; - } - return result; - } - - /* (non-Javadoc) - * @see java.io.InputStream#reset() - */ - @Override public synchronized void reset() throws IOException { - // TODO Auto-generated method stub - super.reset(); - position = lastPosition; - } - - /* (non-Javadoc) - * @see java.io.InputStream#skip(long) - */ - @Override public synchronized long skip(final long count) throws IOException { - // TODO Auto-generated method stub - final long realSkipped = super.skip(count); - position += realSkipped; - return realSkipped; - } - - public long getPosition() { - if (log.isDebugEnabled()) { - log.debug("getPosition : " + position); - } - return position; - } -} Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-09-12 20:50:47 UTC (rev 327) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-09-13 01:44:31 UTC (rev 328) @@ -94,7 +94,7 @@ // parse xml document final SAXBuilder builder = new SAXBuilder(); builder.setValidation(true); - final Document doc = builder.build(reader.getReader()); + final Document doc = builder.build(reader); // retrieve the spell data from the xml final Element root = doc.getRootElement(); @@ -131,8 +131,6 @@ } } } - } catch (final IOException e) { - LOG.error("Error while reading file '" + IGUIConstants.TYPENR_FILE + "'!", e); } finally { reader.close(); } @@ -140,6 +138,8 @@ LOG.error("Parsing error in '" + IGUIConstants.TYPENR_FILE + "'", e); } catch (final FileNotFoundException e) { LOG.error("Cannot read file '" + IGUIConstants.TYPENR_FILE + "'!", e); + } catch (final IOException e) { + LOG.error("Error while reading file '" + IGUIConstants.TYPENR_FILE + "'!", e); } } Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java 2006-09-12 20:50:47 UTC (rev 327) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java 2006-09-13 01:44:31 UTC (rev 328) @@ -294,18 +294,19 @@ try { // open the resource file - final String baseDir = IGUIConstants.CONFIG_DIR; - final CFileReader stream = new CFileReader(baseDir, IGUIConstants.ARCH_FILE); - - // load all arches - mainControl.getArchObjectParser().parseDefArchFromStream(stream.getReader(), 0); - - // close filestream - stream.close(); - + final CFileReader stream = new CFileReader(IGUIConstants.CONFIG_DIR, IGUIConstants.ARCH_FILE); + try { + // load all arches + mainControl.getArchObjectParser().parseDefArchFromStream(stream, 0); + } finally { + // close filestream + stream.close(); + } loadAllCrossfirePNGFromCollect(); } catch (final FileNotFoundException e) { // no need for a message here, CFileReader takes care of this + } catch (final IOException e) { + LOG.error("Error:", e); } } @@ -437,7 +438,7 @@ /** Loading all pngs from the big collected png file */ private void loadAllCrossfirePNGFromCollect() { - + int filePosition = 0; try { // open a bytestream to the resource file final String baseDir = IGUIConstants.CONFIG_DIR; @@ -457,6 +458,7 @@ for (t = 0; t < 3; t++) { do { r = stream.read(); + filePosition++; } while (r != -1 && (char) r != ' '); } @@ -466,6 +468,7 @@ do { while ((c != '.' || face.length() < 3) && r != -1) { r = stream.read(); + filePosition++; c = (char) r; face += String.valueOf(c); } @@ -474,8 +477,10 @@ if (r != -1) { for (t = 0; t < 3; t++) { face += String.valueOf((char) stream.read()); + filePosition++; } final char l = (char) stream.read(); + filePosition++; if (face.indexOf("/") >= 0) { face = face.substring(face.lastIndexOf("/") + 1); @@ -500,11 +505,12 @@ if (r != -1) { // now we try to figure the size of the png data in byte, // later we jump back to the beginning position and read those bytes - stream.getBufferedStream().mark(100000); // mark position + stream.mark(100000); // mark position t = 0; int size = 0; do { r = stream.read(); // read one character + // don't add to filePosition because we marked and will reset. c = (char) r; size++; // count overall bytesize if (c == tag.charAt(t)) { @@ -523,10 +529,11 @@ // for all other pngs, must subtract the size of next starting tag size -= tag.length(); } - stream.getBufferedStream().reset(); // jump to beginning of png data + stream.reset(); // jump to beginning of png data - faceObjects[faceListCount] = new FaceObject(baseDir, IGUIConstants.PNG_FILE, stream.getBufferedStream().getPosition(), size); // lazy load object - stream.getBufferedStream().skip(size); + faceObjects[faceListCount] = new FaceObject(baseDir, IGUIConstants.PNG_FILE, filePosition, size); // lazy load object + stream.skip(size); + filePosition += size; // put this png into the list of faces faceObjects[faceListCount].setName(face); faceObjects[faceListCount].setPath("null"); @@ -548,13 +555,13 @@ // make sure we free all unneeded memory System.runFinalization(); System.gc(); - } catch (final IOException e) { - LOG.warn("Read error in file '" + IGUIConstants.PNG_FILE + "'.", e); } finally { stream.close(); } } catch (final FileNotFoundException e) { LOG.warn("file " + IGUIConstants.PNG_FILE + " not found!"); + } catch (final IOException e) { + LOG.warn("Read error in file '" + IGUIConstants.PNG_FILE + "'.", e); } } Modified: trunk/crossfire/src/cfeditor/textedit/scripteditor/CFPythonPopup.java =================================================================== --- trunk/crossfire/src/cfeditor/textedit/scripteditor/CFPythonPopup.java 2006-09-12 20:50:47 UTC (rev 327) +++ trunk/crossfire/src/cfeditor/textedit/scripteditor/CFPythonPopup.java 2006-09-13 01:44:31 UTC (rev 328) @@ -114,7 +114,7 @@ final CFileReader reader = new CFileReader(baseDir, IGUIConstants.PYTHONMENU_FILE); try { // read file into the cmdList vector: - for (String line; (line = reader.getReader().readLine()) != null;) { + for (String line; (line = reader.readLine()) != null;) { line = line.trim(); if (line.length() > 0 && !line.startsWith("#")) { // ATM, the descriptive info about method headers is cut out Modified: trunk/daimonin/src/daieditor/CFileInputStream.java =================================================================== --- trunk/daimonin/src/daieditor/CFileInputStream.java 2006-09-12 20:50:47 UTC (rev 327) +++ trunk/daimonin/src/daieditor/CFileInputStream.java 2006-09-13 01:44:31 UTC (rev 328) @@ -30,8 +30,6 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; -import java.net.URISyntaxException; -import java.net.MalformedURLException; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -62,7 +60,7 @@ * @param fname name of the resource file * @throws FileNotFoundException In case all three tries to open the file failed */ - public CFileInputStream(final String dname, final String fname) throws FileNotFoundException { + public CFileInputStream(@Nullable final String dname, @NotNull final String fname) throws FileNotFoundException { super(createStream(dname, fname)); } @@ -71,41 +69,54 @@ * @param dname directory name to read from * @param fname file name of file to read * @return Stream for reading from <var>fname</var> - * @throws FileNotFoundException In case all three tries to open the file failed + * @throws FileNotFoundException In case all tries to open the file failed */ - @NotNull private static InputStream createStream(final String dname, final String fname) throws FileNotFoundException { + @SuppressWarnings({"MethodWithMultipleReturnPoints", "MethodWithMoreThanThreeNegations"}) + @NotNull private static InputStream createStream(@Nullable final String dname, @NotNull final String fname) throws FileNotFoundException { try { // 1st try normal binary file relative to specified directory return new FileInputStream(new File(dname, fname)); - } catch (final FileNotFoundException e) { - System.err.println(e); - try { // 2nd try binary file relative to user's current working directory - return new FileInputStream(fname); - } catch (final FileNotFoundException ex) { // 3rd try via system resource from class loader - System.err.println(ex); - @Nullable InputStream stream = null; - try { - ClassLoader.getSystemResourceAsStream(new File(fname).toURL().toURI().toString()); - } catch (final URISyntaxException e1) { - /* ignore */ - } catch (final MalformedURLException e1) { - /* ignore */ - } - if (stream == null) { - try { - stream = ClassLoader.getSystemResourceAsStream(new File(dname, fname).toURL().toURI().toString()); - } catch (final URISyntaxException e1) { - /* ignore */ - } catch (final MalformedURLException e1) { - /* ignore */ - } - } - if (stream == null) { - System.err.println("File \"" + fname + "\" was not found!"); - throw new FileNotFoundException("File \"" + fname + "\" was not found!"); - } + } catch (final Exception e) { + // ignore + } + try { // 2nd try binary file relative to user's current working directory + return new FileInputStream(fname); + } catch (final Exception e) { // 3rd try via system resource from class loader + // ignore + } + final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); + try { // 3rd try context class loader relative to specified directory + @Nullable final InputStream stream = contextClassLoader.getResourceAsStream(new File(dname, fname).toURL().toURI().toString()); + if (stream != null) { return stream; } + } catch (final Exception e) { + // ignore } + try { // 4th try context class loader relative to class loader's top level directory + @Nullable final InputStream stream = contextClassLoader.getResourceAsStream(new File(fname).toURL().toURI().toString()); + if (stream != null) { + return stream; + } + } catch (final Exception e) { + // ignore + } + try { // 5th try system class loader relative to specified directory + @Nullable final InputStream stream = ClassLoader.getSystemResourceAsStream(new File(dname, fname).toURL().toURI().toString()); + if (stream != null) { + return stream; + } + } catch (final Exception e) { + // ignore + } + try { // 6th try system class loader relative to class loader's top level directory + @Nullable final InputStream stream = ClassLoader.getSystemResourceAsStream(new File(fname).toURL().toURI().toString()); + if (stream != null) { + return stream; + } + } catch (final Exception e) { + // ignore + } + throw new FileNotFoundException("CFileInputStream couldn't find " + new File(dname, fname) + "."); } } // class CFileInputStream Modified: trunk/daimonin/src/daieditor/CFileReader.java =================================================================== --- trunk/daimonin/src/daieditor/CFileReader.java 2006-09-12 20:50:47 UTC (rev 327) +++ trunk/daimonin/src/daieditor/CFileReader.java 2006-09-13 01:44:31 UTC (rev 328) @@ -33,7 +33,6 @@ import java.io.Reader; import java.io.UnsupportedEncodingException; - /** * Class for opening and reading a buffered stream to an ASCII resource-file. * If no such file is found, the file is loaded from the jar archive. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-14 21:33:34
|
Revision: 333 http://svn.sourceforge.net/gridarta/?rev=333&view=rev Author: akirschbaum Date: 2006-09-14 14:33:23 -0700 (Thu, 14 Sep 2006) Log Message: ----------- Move common code into a function. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-13 23:12:31 UTC (rev 332) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-09-14 21:33:23 UTC (rev 333) @@ -322,11 +322,11 @@ * @param intern ??? */ private boolean testArchToMap(final int archnr, final int xx, final int yy, final int intern) { - final int count = mainControl.getArchObjectStack().getArch(archnr).getMultiRefCount(); // count of multi tile. 0= single tile + final int count = getDefaultArch(archnr).getMultiRefCount(); // count of multi tile. 0= single tile for (int c = 0; c <= count; c++) { - final int mapx = xx + mainControl.getArchObjectStack().getArch(archnr + c).getMultiRefX(); - final int mapy = yy + mainControl.getArchObjectStack().getArch(archnr + c).getMultiRefY(); + final int mapx = xx + getDefaultArch(archnr + c).getMultiRefX(); + final int mapy = yy + getDefaultArch(archnr + c).getMultiRefY(); if (!isPointValid(mapx, mapy)) { // outside map return false; @@ -463,7 +463,7 @@ return false; } - newarch = mainControl.getArchObjectStack().getArch(archnr); // temp. store this arch + newarch = getDefaultArch(archnr); // temp. store this arch if (mainControl.getAutojoin() && join == JOIN_ENABLE && mainControl.getJoinlist() != null && newarch.getJoinList() != null && !newarch.isMulti()) { // do autojoining if enabled @@ -473,13 +473,13 @@ } } - final int count = mainControl.getArchObjectStack().getArch(archnr).getMultiRefCount(); // count of multi tile. 0= single tile + final int count = getDefaultArch(archnr).getMultiRefCount(); // count of multi tile. 0= single tile oldarch = null; startarch = null; for (int c = 0; c <= count; c++) { - final int mapx = pos.x + mainControl.getArchObjectStack().getArch(archnr + c).getMultiRefX(); - final int mapy = pos.y + mainControl.getArchObjectStack().getArch(archnr + c).getMultiRefY(); + final int mapx = pos.x + getDefaultArch(archnr + c).getMultiRefX(); + final int mapy = pos.y + getDefaultArch(archnr + c).getMultiRefY(); newarch = mainControl.getArchObjectStack().newArchObjectInstance(archnr + c); if (oldarch != null) { newarch.setMapMultiHead(startarch); @@ -755,7 +755,7 @@ it.remove(); // do autojoining - final ArchObject temp = mainControl.getArchObjectStack().getArch(node.getNodeNr()); // get defarch + final ArchObject temp = getDefaultArch(node.getNodeNr()); // get defarch if (mainControl.getAutojoin() && join == JOIN_ENABLE && mainControl.getJoinlist() != null && temp.getJoinList() != null && !temp.isMulti()) { // remove connections to the deleted arch @@ -1191,4 +1191,16 @@ } */ + /** + * Get a default {@link ArchObject} instance. + * + * @param archnr arch object identification id + * + * @return the default arch object instance corresponding to + * <code>archnr</code>, or <code>null</code> if it does not exist + */ + private ArchObject getDefaultArch(final int archnr) { + return mainControl.getArchObjectStack().getArch(archnr); + } + } // class DefaultMapModel Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-09-13 23:12:31 UTC (rev 332) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-09-14 21:33:23 UTC (rev 333) @@ -218,7 +218,7 @@ /** {@inheritDoc} */ public boolean isMultiArchFittingToMap(final String archname, final Point pos, final boolean allowDouble) { - final ArchObject head = mainControl.getArchObjectStack().getArch(archname); + final ArchObject head = getDefaultArch(archname); final Point mapH = new Point(head.getMultiRefX(), head.getMultiRefY()); mapH.translate(pos.x, pos.y); if (!isPointValid(mapH)) { @@ -252,7 +252,7 @@ return false; } - final ArchObject defaultArch = mainControl.getArchObjectStack().getArch(archname); + final ArchObject defaultArch = getDefaultArch(archname); // FIXME: Check maximum RefX and RefY to check whether the multitile arch fits on the map. if (pos.x + defaultArch.getRefMaxX() > mapSize.getWidth() @@ -335,7 +335,7 @@ archname = newarch.getArchName(); } // create a new copy of a default arch - invnew = mainControl.getArchObjectStack().getArch(archname).createArch(); + invnew = getDefaultArch(archname).createArch(); } else { // create clone from a pickmap if (!newarch.isMulti()) { @@ -607,4 +607,16 @@ } } + /** + * Get a default {@link ArchObject} instance. + * + * @param archName the archetype name + * + * @return the default arch object instance corresponding to + * <code>archName</code>, or <code>null</code> if it does not exist + */ + private ArchObject getDefaultArch(final String archName) { + return mainControl.getArchObjectStack().getArch(archName); + } + } // class DefaultMapModel This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-17 19:48:18
|
Revision: 334 http://svn.sourceforge.net/gridarta/?rev=334&view=rev Author: christianhujer Date: 2006-09-17 12:46:54 -0700 (Sun, 17 Sep 2006) Log Message: ----------- Fixed errors in I/O handling of cfeditor.CMapFileDecode. Moved encoding declaration from CMainControl to CFileReader. Changed cfeditor.CMapFileDecode.decodeMapFile to throw IOException and FileNotFoundException instead of GridderException. Fixed documentation of daieditor.CMapFileDecode. Moved CFileInputStream and CFileReader to Gridarta. Improved cfeditor MultiPositionData I/O code. Changed storage location of Daieditor's python menu definition. Unified script editor and moved it to Gridarta. Improved CFileInputStream's file lookup. It now should create paths correctly and thus find files in the jar again. cfpython_menu.def is now included in Gridarta and stored in all three jars (crossfire editor, daimonin editor and yet unused common gridarta jar). Sorry for the large changeset, I did these changes during a LAN party that had no Internet Access. Modified Paths: -------------- trunk/build.xml trunk/crossfire/build.xml trunk/crossfire/src/cfeditor/AutojoinList.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainMenu.java trunk/crossfire/src/cfeditor/CMapFileDecode.java trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/crossfire/src/cfeditor/CPickmapPanel.java trunk/crossfire/src/cfeditor/FaceObject.java trunk/crossfire/src/cfeditor/IGUIConstants.java trunk/crossfire/src/cfeditor/MultiPositionData.java trunk/crossfire/src/cfeditor/ScriptArchData.java trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java trunk/daimonin/build.xml trunk/daimonin/src/daieditor/CFTreasureListTree.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMapFileDecode.java trunk/daimonin/src/daieditor/CMapFileEncode.java trunk/daimonin/src/daieditor/IGUIConstants.java trunk/daimonin/src/daieditor/MultiPositionData.java trunk/daimonin/src/daieditor/ScriptArchData.java trunk/daimonin/src/daieditor/Spells.java trunk/daimonin/src/daieditor/arch/ArchObjectStack.java trunk/daimonin/src/daieditor/arch/anim/AnimationObjects.java trunk/daimonin/src/daieditor/gui/map/MapTilePane.java trunk/src/app/net/sf/gridarta/CommonConstants.java trunk/src/app/net/sf/gridarta/MainControl.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditMenuBar.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java trunk/src/app/net/sf/gridarta/textedit/textarea/CTokenMarker.java trunk/src/app/net/sf/gridarta/textedit/textarea/DefaultInputHandler.java trunk/src/app/net/sf/gridarta/textedit/textarea/HTMLTokenMarker.java trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java trunk/src/app/net/sf/gridarta/textedit/textarea/JavaScriptTokenMarker.java trunk/src/app/net/sf/gridarta/textedit/textarea/KeywordMap.java trunk/src/app/net/sf/gridarta/textedit/textarea/LuaTokenMarker.java trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxDocument.java trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxStyle.java trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxUtilities.java trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaDefaults.java trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java trunk/src/app/net/sf/gridarta/textedit/textarea/TextUtilities.java trunk/src/app/net/sf/gridarta/textedit/textarea/Token.java trunk/src/app/net/sf/gridarta/textedit/textarea/TokenMarker.java trunk/src/app/net/sf/gridarta/textedit/textarea/XMLTokenMarker.java Added Paths: ----------- trunk/lib/annotations.jar trunk/src/app/cfpython_menu.def trunk/src/app/net/sf/gridarta/io/ trunk/src/app/net/sf/gridarta/io/CFileInputStream.java trunk/src/app/net/sf/gridarta/io/CFileReader.java trunk/src/app/net/sf/gridarta/io/package.html trunk/src/app/net/sf/gridarta/textedit/ trunk/src/app/net/sf/gridarta/textedit/scripteditor/ trunk/src/app/net/sf/gridarta/textedit/textarea/ trunk/src/app/net/sf/gridarta/textedit/textarea/PythonTokenMarker.java Removed Paths: ------------- trunk/crossfire/resource/conf/cfpython_menu.def trunk/crossfire/src/cfeditor/CFileInputStream.java trunk/crossfire/src/cfeditor/CFileReader.java trunk/crossfire/src/cfeditor/textedit/scripteditor/ trunk/crossfire/src/cfeditor/textedit/textarea/ trunk/daimonin/src/daieditor/CFileInputStream.java trunk/daimonin/src/daieditor/CFileReader.java trunk/daimonin/src/daieditor/textedit/scripteditor/ trunk/daimonin/src/daieditor/textedit/textarea/ Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/build.xml 2006-09-17 19:46:54 UTC (rev 334) @@ -110,11 +110,12 @@ <classpath> <fileset dir="lib" includes="annotations.jar" /> <fileset dir="lib" includes="japi.jar" /> + <fileset dir="lib" includes="log4j-1.2.13.jar" /> </classpath> <compilerarg line="${javac.args}" /> </javac> <copy todir="dest/app"> - <fileset dir="src/app" includes="**/*.properties" /> + <fileset dir="src/app" includes="**/*.properties,cfpython_menu.def" /> </copy> </target> @@ -299,7 +300,6 @@ <property name="distLib" value="dist/gridarta-${project.version}.lib" /> <jar destfile="${distLib}.jar"> <zipfileset dir="dest/app"/> - <zipfileset src="lib/annotations.jar"/> <manifest> <attribute name="Implementation-Title" value="Gridarta" /> <attribute name="Implementation-Vendor" value="The Gridarta Developers" /> Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/build.xml 2006-09-17 19:46:54 UTC (rev 334) @@ -107,6 +107,9 @@ <copy todir="${build.dir}"> <fileset dir="${build.dir}/conf" /> </copy> + <copy todir="${build.dir}"> + <fileset dir="../src/app" excludes="**/*.java,**/package.html,**/overview.html" /> + </copy> <delete dir="${build.dir}/pickmaps" /> <delete dir="${build.dir}/conf" /> Deleted: trunk/crossfire/resource/conf/cfpython_menu.def =================================================================== --- trunk/crossfire/resource/conf/cfpython_menu.def 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/resource/conf/cfpython_menu.def 2006-09-17 19:46:54 UTC (rev 334) @@ -1,194 +0,0 @@ -############################################################ -# This file contains all python commands of the CFPython # -# package. These get displayed in the popup menu when # -# typing "CFPython" on the script pad. # -############################################################ - -AcquireSpell(object who, int spellid) : void -ActivateRune(object who, object what) : void -Apply(object who, object what, int flags) : int -BlocksView(object who) : int -CastAbility(object who, int spellid, int direction, string options) : void -CheckTrigger(object who, object what) : void -CastSpell(object who, int spellid, int direction, string options) : void -CheckInvisibleObjectInside(object who, string id) : object -CreateInvisibleObjectInside() -CreateObjectInside() -CheckMap() -CheckInventory() -CreateObject() -CanSeeInvisible(object who) : int -CanRoll(object who) : int -CanPassThru(object who) : int -CanPickUp(object who) : int -CanCastSpell(object who) : int -CanUseScroll(object who) : int -CanUseWand(object who) : int -CanUseBow(object who) : int -CanUseArmour(object who) : int -CanUseWeapon(object who) : int -CanUseRing(object who) : int -CanUseSkill(object who) : int -CanUseRod(object who) : int -CanUseHorn(object who) : int -CanSeeInDark(object who) : int -Drop() -DirectionN() : int -DirectionNE() : int -DirectionE() : int -DirectionSE() : int -DirectionS() : int -DirectionSW() : int -DirectionW() : int -DirectionNW() : int -DoKnowSpell() -FindPlayer() -FixObject() -ForgetSpell() -GetMapDirectory() : string -GetUniqueDirectory() : string -GetTempDirectory() : string -GetConfigurationDirectory() : string -GetDataDirectory() : string -GetLocalDirectory() : string -GetPlayerDirectory() : string -GetSkillExperience() -GetMapPath() -GetMapObject() -GetMessage(object who) : string -GetGod(object who) : string -GetWeight(object who) : int -GetMap() -GetNextObject() -GetPreviousObject() -GetFirstObjectOnSquare() -GetQuantity() -GetExperience(object who) : int -GetSpeed(object who) -GetFood(object who) : int -GetGrace(object who) : int -GetReturnValue() -GetDirection() -GetLastSP(object who) : int -GetLastGrace(object who) : int -GetAttackType() -GetDamage(object who) : int -GetName(object who) -GetEventOptions() -GetEventPlugin() -GetType(object who) : int -GetEventHandler() -GetIP() -GetInventory() -GetInternalName() -GetAC(object who) : int -GetCha(object who) : int -GetCon(object who) : int -GetDex(object who) : int -GetHP(object who) : int -GetInt(object who) : int -GetPow(object who) : int -GetSP(object who) : int -GetStr(object who) : int -GetWis(object who) : int -GetMaxHP(object who) : int -GetMaxSP(object who) : int -GetXPos() : int -GetYPos() : int -HitBack() -HasXRays() -HasStealth() -HasBeenApplied() -IsOutOfMap() -IsCanBePicked(object who) : int -InsertObjectInside() -IsInvisible(object who) : int -IsAlive(object who) : int -IsWiz(object who) : int -IsApplied(object who) : int -IsUnpaid(object who) : int -IsFlying(object who) : int -IsMonster(object who) : int -IsFriendly(object who) : int -IsGenerator(object who) : int -IsThrown(object who) : int -IsTurnable(object who) : int -IsUsedUp(object who) : int -IsIdentified(object who) : int -IsSplitting(object who) : int -IsUndead(object who) : int -IsScared(object who) : int -IsUnaggressive(object who) : int -IsOfType() -IsRunningAway(object who) : int -IsUnique(object who) : int -IsFloor(object who) : int -IsLifeSaver(object who) : int -IsSleeping(object who) : int -IsConfused(object who) : int -IsCursed(object who) : int -IsDamned(object who) : int -IsKnownMagical(object who) : int -IsKnownCursed(object who) : int -IsBlind(object who) : int -KillObject() -LoadObject() -MatchString() -Message() -MakeInvisible() -OnlyAttack() -PickUp() -ReadyMap() -ReflectMissiles() -ReflectSpells() -RemoveObject() -RegisterCommand() -SetQuantity() -SetName() -SetMessage() -SetSkillExperience() -SetCursed() -SetUnaggressive() -SetGod() -SetWeight() -Say() -SetInvisible() -SetSpeed() -SetFood() -SetGrace() -SetReturnValue() -SetDirection() -SetLastSP() -SetLastGrace() -SetFace() -SetAttackType() -SetDamage() -SetBeenApplied() -SetIdentified() -SaveObject() -SetEventHandler() -SetEventPlugin() -SetEventOptions() -SetPosition() -SetNickname() -SetAC() -SetCha() -SetCon() -SetDex() -SetHP() -SetInt() -SetMaxHP() -SetMaxSP() -SetPow() -SetSP() -SetStr() -SetWis() -StandStill() -Take() -Teleport() -WhoAmI() -WhoIsActivator() -WhatIsMessage() -Write() -WhoIsOther() -WasWiz() Modified: trunk/crossfire/src/cfeditor/AutojoinList.java =================================================================== --- trunk/crossfire/src/cfeditor/AutojoinList.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/src/cfeditor/AutojoinList.java 2006-09-17 19:46:54 UTC (rev 334) @@ -32,6 +32,7 @@ import java.io.IOException; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; +import net.sf.gridarta.io.CFileReader; /** * The <code>AutojoinList</code> class contains a list of (typically wall-)arches which Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-09-17 19:46:54 UTC (rev 334) @@ -46,6 +46,7 @@ import org.jdom.Element; import org.jdom.JDOMException; import org.jdom.input.SAXBuilder; +import net.sf.gridarta.io.CFileReader; /** * This class handles all the CFArchTypes and makes them conveniently Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-09-17 19:46:54 UTC (rev 334) @@ -54,6 +54,7 @@ import javax.swing.tree.TreePath; import cfeditor.GridderException; import net.sf.gridarta.help.Help; +import net.sf.gridarta.io.CFileReader; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; Deleted: trunk/crossfire/src/cfeditor/CFileInputStream.java =================================================================== --- trunk/crossfire/src/cfeditor/CFileInputStream.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/src/cfeditor/CFileInputStream.java 2006-09-17 19:46:54 UTC (rev 334) @@ -1,122 +0,0 @@ -/* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * Copyright (C) 2005 Christian Hujer - * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package cfeditor; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * Class for opening and reading a buffered stream to a BINARY resource-file. - * If no such file is found, the file is loaded from the jar archive. - * This class is very similar to {@link CFileReader}. - * The file is tried to open in the following order: - * <ol> - * <li>Try opening it with the given directory. The directory path is relative - * to the current working directory, the file path relative to that - * directory..</li> - * <li>Try opening it without the given directory. The file path is relative to - * the current working directory.</li> - * <li>Try opening the file as a system resource through the class loader.</li> - * </ol> - * Only if all tries failed, creating the stream fails. - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @see CFileReader - */ -public final class CFileInputStream extends BufferedInputStream { - - /** - * Creates a new CFileInputStream to a specified resource file. - * @param dname name of directory that the file is in (<code>null</code> - * means the file is located in the editor root dir) - * @param fname name of the resource file - * @throws FileNotFoundException In case all three tries to open the file failed - */ - public CFileInputStream(@Nullable final String dname, @NotNull final String fname) throws FileNotFoundException { - super(createStream(dname, fname)); - } - - /** - * Open the resource file for reading. - * @param dname directory name to read from - * @param fname file name of file to read - * @return Stream for reading from <var>fname</var> - * @throws FileNotFoundException In case all tries to open the file failed - */ - @SuppressWarnings({"MethodWithMultipleReturnPoints", "MethodWithMoreThanThreeNegations"}) - @NotNull private static InputStream createStream(@Nullable final String dname, @NotNull final String fname) throws FileNotFoundException { - try { // 1st try normal binary file relative to specified directory - return new FileInputStream(new File(dname, fname)); - } catch (final Exception e) { - // ignore - } - try { // 2nd try binary file relative to user's current working directory - return new FileInputStream(fname); - } catch (final Exception e) { // 3rd try via system resource from class loader - // ignore - } - final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); - try { // 3rd try context class loader relative to specified directory - @Nullable final InputStream stream = contextClassLoader.getResourceAsStream(new File(dname, fname).toURL().toURI().toString()); - if (stream != null) { - return stream; - } - } catch (final Exception e) { - // ignore - } - try { // 4th try context class loader relative to class loader's top level directory - @Nullable final InputStream stream = contextClassLoader.getResourceAsStream(new File(fname).toURL().toURI().toString()); - if (stream != null) { - return stream; - } - } catch (final Exception e) { - // ignore - } - try { // 5th try system class loader relative to specified directory - @Nullable final InputStream stream = ClassLoader.getSystemResourceAsStream(new File(dname, fname).toURL().toURI().toString()); - if (stream != null) { - return stream; - } - } catch (final Exception e) { - // ignore - } - try { // 6th try system class loader relative to class loader's top level directory - @Nullable final InputStream stream = ClassLoader.getSystemResourceAsStream(new File(fname).toURL().toURI().toString()); - if (stream != null) { - return stream; - } - } catch (final Exception e) { - // ignore - } - throw new FileNotFoundException("CFileInputStream couldn't find " + new File(dname, fname) + "."); - } - -} // class CFileInputStream Deleted: trunk/crossfire/src/cfeditor/CFileReader.java =================================================================== --- trunk/crossfire/src/cfeditor/CFileReader.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/src/cfeditor/CFileReader.java 2006-09-17 19:46:54 UTC (rev 334) @@ -1,177 +0,0 @@ -/* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * Copyright (C) 2005 Christian Hujer - * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package cfeditor; - -import java.io.BufferedReader; -import java.io.EOFException; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; -import java.io.UnsupportedEncodingException; - -/** - * Class for opening and reading a buffered stream to an ASCII resource-file. - * If no such file is found, the file is loaded from the jar archive. - * This class is very similar to {@link CFileInputStream}. - * The file is tried to open in the following order: - * <ol> - * <li>Try opening it with the given directory. The directory path is relative to the current working directory, the file path relative to that - * directory..</li> - * <li>Try opening it without the given directory. The file path is relative to the current working directory.</li> - * <li>Try opening the file as a system resource through the class loader.</li> - * </ol> - * Only if all tries failed, creating the stream fails. - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo eventually remove readUntil - this is afaik only used for reading arches and such, and since there should be an integrated arch editor... - * @see CFileInputStream - */ -public final class CFileReader extends BufferedReader { - - /** Maximum number of characters to read in readUntil. */ - private static final long READ_MAX = 10000L; - - /** - * Open an ascii-stream to the specified resource file. - * @param dname name of directory that the file is in (<code>null</code> means the file is located in the editor root dir) - * @param fname name of the resource file - * @throws FileNotFoundException in case all three tries to open the file failed - */ - public CFileReader(final String dname, final String fname) throws FileNotFoundException { - super(createReader(dname, fname)); - } - - /** - * Open the resource file for reading. - * @param dname name of directory that the file is in (null means the file is located in the editor root dir) - * @param fname name of the resource file - * @return Stream for reading from <var>fname</var> - * @throws FileNotFoundException In case all three tries to open the file failed - */ - private static Reader createReader(final String dname, final String fname) throws FileNotFoundException { - try { - return new InputStreamReader(new CFileInputStream(dname, fname), CMainControl.MAP_ENCODING); - } catch (final UnsupportedEncodingException e) { - throw new Error(e); - } - } - - /** - * Reads characters from the BufferedReader stream till 'tag' is found. If - * found, the method returns with stream pointing right after the - * appearance of 'tag'. - * @param stream ascii input stream to read from - * @param tag stop reading at the string 'tag' - * @param abort throw <code>EOFException</code> at string 'abort' (this can be null) - * @throws IOException an I/O-error occurred while reading the file - * @throws EOFException the end of file was reached, or the 'abort' string - * has been encountered - * @todo Should the encounter of the abort string before the tag really be - * an EOFException? That's semantically wrong, but current usage code - * relies on this :( - */ - public static void readUntil(final BufferedReader stream, final String tag, final String abort) throws IOException { - int c; // character value, read from the stream - int t = 0; // tag index - int a = 0; // abort index - - if (abort != null) { - // look both for 'tag' and 'abort' - do { - c = stream.read(); - if (c == tag.charAt(t)) { - t++; - } else { - t = 0; - } - if (c == abort.charAt(a)) { - a++; - } else { - a = 0; - } - } while (t < tag.length() && a < abort.length() && c != -1); - } else { - // look only for 'tag' - do { - c = stream.read(); - if (c == tag.charAt(t)) { - t++; - } else { - t = 0; - } - } while (t < tag.length() && c != -1); - } - - // if we did not find the tag, an EOFException is thrown - if (c == -1) { - throw new EOFException(); - } - - // if we found the string 'abort', throw EOFException as well - if (abort != null && a == abort.length()) { - throw new EOFException(); - } - } - - /** - * Reads characters from the BufferedReader stream till 'tag' is found. - * Similar to readUntil(), except that the read String is returned. 'tag' - * is not included in the returned String. - * @param stream ascii input stream to read from - * @param tag stop reading at the string 'tag' - * @return the string between the starting pos. of 'stream' (inclusive) and - * the first character of 'tag' (exclusive). - * @throws IOException an I/O-error occurred while reading the file - * @throws EOFException the end of file was reached - */ - public static String readUntil(final BufferedReader stream, final String tag) throws IOException { - final StringBuilder sb = new StringBuilder(); - int c; // character value, read from the stream - int t = 0; // index - - long count = 0; // counter (to realize when shooting past EOF) - final long maxCount = READ_MAX; // bail out when counter exceeds this value - - do { - c = stream.read(); // read one character - sb.append((char) c); - if (c == tag.charAt(t)) { - t++; - } else { - t = 0; - } - } while (t < tag.length() && c != -1 && count++ < maxCount); - - // if we did not find the tag, an EOFException is thrown - if (c == -1 || count >= maxCount) { - throw new EOFException(); - } - // cut 'tag' off, at the end of the string - return sb.substring(0, sb.length() - tag.length()); - } - -} // class CFileReader Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-09-17 19:46:54 UTC (rev 334) @@ -31,13 +31,13 @@ import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; import cfeditor.map.MapModel; -import cfeditor.textedit.scripteditor.ScriptEditControl; import java.awt.Font; import java.awt.Point; import java.awt.Rectangle; import java.awt.Toolkit; import java.io.File; import java.io.IOException; +import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Enumeration; import java.util.Iterator; @@ -57,6 +57,8 @@ import net.sf.gridarta.Size2D; import net.sf.gridarta.MainControl; import net.sf.gridarta.CUndoStack; +import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; +import net.sf.gridarta.gui.HideFileFilterProxy; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.util.filter.file.EndingFileFilter; @@ -83,15 +85,6 @@ /** Singleton instance reference. */ private static CMainControl instance; - /** - * Encoding to use for maps and other data. - * The encoding given here is used for reading and writing maps. - * You shouldn't change this only because you use an UTF-8 system or so, since the encoding used here MUST be compatible with the server and the - * client. The paragraph sign § is the critical character. - * @todo once the mailing list decided on the § character, eventually replace by "us-ascii". - */ - public static final String MAP_ENCODING = "iso-8859-1"; - public static final String DOCU_VERSION_KEY = "docuVersion"; public static final String MAP_DIR_KEY = "mapDirectory"; @@ -522,8 +515,8 @@ refreshMenusAndToolbars(); } - /** Swing FileFilter for Lua scripts. */ - public static final FileFilter pythonFileFilter = new net.sf.gridarta.gui.HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.python"), ".py")); + /** Swing FileFilter for Python scripts. */ + public static final FileFilter pythonFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.python"), ".py")); public String getMapDefaultFolder() { return strMapDir; @@ -572,6 +565,16 @@ return comp; } + /** {@inheritDoc} */ + public FileFilter getScriptFileFilter() { + return pythonFileFilter; + } + + /** {@inheritDoc} */ + public String getScriptSuffix() { + return ".py"; + } + /** * set plain font to the given component * @param comp component @@ -973,11 +976,11 @@ try { objects = mapFileDecoder.decodeMapFile(file); // parse mapfile maparch = mapFileDecoder.getMapArch(); // get map arch - } catch (GridderException e) { + } catch (final IOException e) { // popup display showMessage("Couldn't load Map", e.getMessage()); return null; - } catch (OutOfMemoryError e) { + } catch (final OutOfMemoryError e) { // out of memory!! - display error showMessage("Out of Memory", "Not enough memory available to open more maps!\n" + "You can increase the memory limit by using the '-mx' runtime flag.\n" + @@ -1031,7 +1034,14 @@ * @param mapModel MapModel to save */ public void encodeMapFile(@NotNull final File file, final MapModel mapModel) { - mapFileEncoder.encodeMapFile(file, mapModel); + final String fname = file.getAbsolutePath(); + try { + mapFileEncoder.encodeMapFile(file, mapModel); + } catch (final FileNotFoundException e) { + showMessage("Error Save Map", "Error writing file " + fname + "\n"); + } catch (final IOException e) { + showMessage("Error Save Map", "Error writing file " + fname + "\n"); + } } /** Modified: trunk/crossfire/src/cfeditor/CMainMenu.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainMenu.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/src/cfeditor/CMainMenu.java 2006-09-17 19:46:54 UTC (rev 334) @@ -33,7 +33,6 @@ import cfeditor.menu.MenuManager; import cfeditor.menu.SimpleMenuEntry; import cfeditor.menu.SimpleMenuLocation; -import cfeditor.textedit.scripteditor.ScriptEditControl; import java.awt.Event; import java.awt.Font; import java.awt.event.ActionEvent; Modified: trunk/crossfire/src/cfeditor/CMapFileDecode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-09-17 19:46:54 UTC (rev 334) @@ -28,23 +28,27 @@ import cfeditor.map.MapArchObject; import java.io.BufferedReader; import java.io.File; -import java.io.FileReader; import java.io.IOException; +import java.io.InputStreamReader; +import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.List; -import cfeditor.GridderException; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; +import net.sf.gridarta.io.CFileReader; /** * This class handles the reading of a mapfile and parsing the data * into a list of ArchObjects. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @todo change to classical IO class style */ public final class CMapFileDecode { - private static final Logger log = Logger.getLogger(CMapFileDecode.class); + private static final Logger LOG = Logger.getLogger(CMapFileDecode.class); private int maxxlen, maxylen; @@ -66,14 +70,13 @@ * This method returns a list of arches, connected with the temp pointers. * @param file mapfile * @return first <code>ArchObject</code> in the list - * @throws GridderException when file content invalid + * @throws FileNotFoundException in case the requested map file was not found + * @throws IOException in case the file couldn't be read or is in wrong format + * @todo create a separate exception for the wrong format */ - public List<ArchObject> decodeMapFile(final File file) throws GridderException { - + public List<ArchObject> decodeMapFile(final File file) throws FileNotFoundException, IOException { + final BufferedReader myInput = new BufferedReader(new InputStreamReader(new FileInputStream(file), CFileReader.MAP_ENCODING)); try { - final FileReader fr = new FileReader(file); - final BufferedReader myInput = new BufferedReader(fr); - maxxlen = 0; maxylen = 0; objects = new ArrayList<ArchObject>(); @@ -81,24 +84,17 @@ // first of all we read the map arch (if that fails we throw an exception) maparch = new MapArchObject(); if (!maparch.parseMapArch(myInput, file.getName())) { - throw new GridderException("The file '" + file.getName() + "' does not\n" + - "contain a valid Crossfire map format!\n"); + throw new IOException("The file '" + file.getName() + "' does not contain a valid Crossfire map format!\n"); } //maparch.setName(file.getName()); // now we read all the ArchObjects - String thisLine; - while ((thisLine = myInput.readLine()) != null) { + for (String thisLine; (thisLine = myInput.readLine()) != null;) { readArch(myInput, thisLine, null); // all these are map arches } + } finally { myInput.close(); - fr.close(); - } catch (final IOException e) { - log.debug("Error Loading file " + file.getName(), e); - - throw new GridderException("The file '" + file.getName() + "' cannot be loaded: " + e.getMessage()); } - // finally... here we go // last action: if the map is bigger than the specified size in // the maparch, we set the true size: the maxxlen/maxylen counters. @@ -192,20 +188,20 @@ // now we test for a new arch - thats stuf in inventory // or the end... thats the end of this shit } else if (thisLine.startsWith("arch ")) { - if (log.isDebugEnabled()) { - log.debug("GO INVENTORY: " + arch + " - " + thisLine); + if (LOG.isDebugEnabled()) { + LOG.debug("GO INVENTORY: " + arch + " - " + thisLine); } readArch(myInput, thisLine, arch); - if (log.isDebugEnabled()) { - log.debug("GO INVENTORY2: " + arch + " - " + thisLine); + if (LOG.isDebugEnabled()) { + LOG.debug("GO INVENTORY2: " + arch + " - " + thisLine); } } else if (thisLine.startsWith("end")) { objects.add(arch); archflag = false; archmore = false; - if (log.isDebugEnabled()) { - log.debug("LEAVE!: " + arch + " - " + thisLine); + if (LOG.isDebugEnabled()) { + LOG.debug("LEAVE!: " + arch + " - " + thisLine); } return arch; } else if (thisLine.regionMatches(0, "msg", 0, 3)) { @@ -245,7 +241,7 @@ arch.addEventScript(type, path); } } else { - log.warn("Arch " + arch.getArchName() + " has incorrect event code '" + thisLine + "'"); + LOG.warn("Arch " + arch.getArchName() + " has incorrect event code '" + thisLine + "'"); arch.addArchText(thisLine + "\n"); // keep line, it might have a meaning after all } } else if (thisLine.regionMatches(0, "x ", 0, 2)) { @@ -287,7 +283,7 @@ thisLine2 = myInput.readLine(); } } catch (final IOException e) { - log.error("Read Error while trying to load map: " + maparch.getFileName(), e); + LOG.error("Read Error while trying to load map: " + maparch.getFileName(), e); throw e; // we simply pass this exception to the calling function } Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-09-17 19:46:54 UTC (rev 334) @@ -39,6 +39,7 @@ import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; +import java.util.Map; import net.sf.gridarta.Size2D; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -52,8 +53,6 @@ private static final Logger log = Logger.getLogger(CMapFileEncode.class); - private FileWriter fileWriter; - private BufferedWriter bufferedWriter; private final CMainControl mainControl; @@ -70,13 +69,12 @@ * @param file mapfile * @param mapModel the MapModel to encode */ - public void encodeMapFile(@NotNull final File file, final MapModel mapModel) { + public void encodeMapFile(@NotNull final File file, final MapModel mapModel) throws FileNotFoundException, IOException { final MapArchObject map = mapModel.getMapArchObject(); try { fname = file.getAbsolutePath(); - fileWriter = new FileWriter(file); - bufferedWriter = new BufferedWriter(fileWriter); + bufferedWriter = new BufferedWriter(new FileWriter(file)); //ArchObject multi; // write map header: map arch @@ -129,13 +127,9 @@ } // node } // y } // x - + } finally { bufferedWriter.close(); - fileWriter.close(); - } catch (final FileNotFoundException e) { - mainControl.showMessage("Error Save Map", "Error writing file " + fname + "\n"); - } catch (final IOException e) { - mainControl.showMessage("Error Save Map", "Error writing file " + fname + "\n"); + bufferedWriter = null; } } @@ -159,7 +153,7 @@ final ArchObject defarch = arch.getDefaultArch(); // Collect all fields to write. - final HashMap fields = new HashMap(); // String key -> String value + final Map<String, String> fields = new HashMap<String, String>(); // String key -> String value final String name = arch.getObjName(); if (name != null) { @@ -175,10 +169,10 @@ final String events = arch.getMapArchEventData(); if (!events.equals("")) { final String[] tmp = events.split("\n"); - for (int i = 0; i < tmp.length; i++) { - final String[] line = tmp[i].split(" +", 2); + for (final String aTmp : tmp) { + final String[] line = aTmp.split(" +", 2); if (line.length != 2) { - log.warn("writeMapArch: ignoring invalid event line: " + tmp[i]); + log.warn("writeMapArch: ignoring invalid event line: " + aTmp); } else { fields.put(line[0], line[1]); } @@ -246,10 +240,10 @@ final String text = arch.getArchText(); if (!text.equals("")) { final String[] tmp = text.split("\n"); - for (int i = 0; i < tmp.length; i++) { - final String[] line = tmp[i].split(" +", 2); + for (final String aTmp : tmp) { + final String[] line = aTmp.split(" +", 2); if (line.length != 2) { - log.warn("writeMapArch: ignoring invalid arch line: " + tmp[i]); + log.warn("writeMapArch: ignoring invalid arch line: " + aTmp); } else { fields.put(line[0], line[1]); } @@ -302,20 +296,21 @@ * Comparator to compare two object fields. The comparator sorts the fields * in the order in which they should be written to disk. */ - private final Comparator keyOrderComparator = new Comparator() { - public int compare(final Object o1, final Object o2) { - final String s1 = (String) o1; - final String s2 = (String) o2; - final Integer i1 = (Integer) keys.get(s1); - final Integer i2 = (Integer) keys.get(s2); - final int v1 = i1 == null ? 10000 : i1.intValue(); - final int v2 = i2 == null ? 10000 : i2.intValue(); + private static final Comparator<String> keyOrderComparator = new Comparator<String>() { + + /** {@inheritDoc} */ + public int compare(final String o1, final String o2) { + final Integer i1 = keys.get(o1); + final Integer i2 = keys.get(o2); + final int v1 = i1 == null ? Integer.MAX_VALUE : i1.intValue(); + final int v2 = i2 == null ? Integer.MAX_VALUE : i2.intValue(); if (v1 < v2) { return -1; } if (v1 > v2) { return +1; } + assert v1 == v2; return 0; } }; @@ -325,7 +320,7 @@ * the field name, the value is an Integer that describes the order. Lower * values are written first. */ - private static final HashMap keys = new HashMap(); + private static final Map<String, Integer> keys = new HashMap<String, Integer>(); /* * Initialize {@link keys} array. @@ -570,7 +565,7 @@ * the order in which the objects fields are written out. */ private static void addKey(final String key) { - keys.put(key, new Integer(idKey++)); + keys.put(key, idKey++); } } // class CMapFileEncode Modified: trunk/crossfire/src/cfeditor/CPickmapPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-09-17 19:46:54 UTC (rev 334) @@ -29,6 +29,7 @@ import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; import java.io.File; +import java.io.IOException; import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; @@ -159,7 +160,7 @@ tabpane.insertTab(mapFile.getName(), null, bmapview, null, i); return true; } - } catch (final GridderException e) { + } catch (final IOException e) { // loading failed - could be a system file in that directory, // or something else. Doesn't deserve more attention than a printout. if (!mapFile.getName().startsWith(".")) { Modified: trunk/crossfire/src/cfeditor/FaceObject.java =================================================================== --- trunk/crossfire/src/cfeditor/FaceObject.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/src/cfeditor/FaceObject.java 2006-09-17 19:46:54 UTC (rev 334) @@ -33,6 +33,7 @@ import javax.swing.ImageIcon; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; +import net.sf.gridarta.io.CFileInputStream; /** * The <code>FaceObject</code> Modified: trunk/crossfire/src/cfeditor/IGUIConstants.java =================================================================== --- trunk/crossfire/src/cfeditor/IGUIConstants.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/src/cfeditor/IGUIConstants.java 2006-09-17 19:46:54 UTC (rev 334) @@ -141,8 +141,6 @@ String TREASURES_FILE = "treasures"; // treasurelists file - String PYTHONMENU_FILE = "cfpython_menu.def"; // file with cfpython commands - String BMAPS_FILE = ""; // dummy (only used for iso view) String ARCHDEF_FILE = ""; Modified: trunk/crossfire/src/cfeditor/MultiPositionData.java =================================================================== --- trunk/crossfire/src/cfeditor/MultiPositionData.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/src/cfeditor/MultiPositionData.java 2006-09-17 19:46:54 UTC (rev 334) @@ -29,6 +29,7 @@ import java.io.IOException; import java.util.StringTokenizer; import org.apache.log4j.Logger; +import net.sf.gridarta.io.CFileReader; /** * The MultiPositionData class stores an array of numbers which is required @@ -71,55 +72,56 @@ * the file don't match expected array dimensions. */ private void load() { - final CFileReader reader; - // read datafile line by line, parsing numbers into the array try { - reader = new CFileReader(CMainControl.getInstance().getArchDefaultFolder() + File.separator + IGUIConstants.CONFIG_DIR, IGUIConstants.ARCHDEF_FILE); - String line = null; // read line of file - String num; // number, still in string format - int xp = 0; // x-index in the data array - int yp = 0; // y-index in the data array + final CFileReader reader = new CFileReader(CMainControl.getInstance().getArchDefaultFolder() + File.separator + IGUIConstants.CONFIG_DIR, IGUIConstants.ARCHDEF_FILE); + try { + String num; // number, still in string format + int xp = 0; // x-index in the data array + int yp = 0; // y-index in the data array - // read the whole file line by line - while ((line = reader.readLine()) != null) { - line = line.trim(); - if (line.length() > 0 && !line.startsWith("#") && yp < Y_DIM) { - final StringTokenizer s = new StringTokenizer(line, " ", false); - while (s != null && s.hasMoreTokens()) { - num = s.nextToken(); // get one number - if (num.length() > 0 && xp < X_DIM) { - try { - // parse and store it as integer - data[yp][xp] = Integer.parseInt(num); - xp++; // increase index - } catch (final NumberFormatException e) { + // read the whole file line by line + for (String line; (line = reader.readLine()) != null;) { + line = line.trim(); + if (line.length() > 0 && !line.startsWith("#") && yp < Y_DIM) { + final StringTokenizer s = new StringTokenizer(line, " ", false); + while (s != null && s.hasMoreTokens()) { + num = s.nextToken(); // get one number + if (num.length() > 0 && xp < X_DIM) { + try { + // parse and store it as integer + data[yp][xp] = Integer.parseInt(num); + xp++; // increase index + } catch (final NumberFormatException e) { + } } } - } - // report if there haven't been enough numbers in this row - if (xp < X_DIM) { - log.warn("In file " + IGUIConstants.ARCHDEF_FILE + ": Missing " + (X_DIM - xp) + " numbers in row " + (yp + 1) + "."); + // report if there haven't been enough numbers in this row + if (xp < X_DIM) { + log.warn("In file " + IGUIConstants.ARCHDEF_FILE + ": Missing " + (X_DIM - xp) + " numbers in row " + (yp + 1) + "."); + } + + xp = 0; // prepare indices for next row + yp++; } + } + if (yp < Y_DIM) { + log.warn("In file " + IGUIConstants.ARCHDEF_FILE + ": Missing " + (Y_DIM - yp) + " entire rows of data."); + } - xp = 0; // prepare indices for next row - yp++; - } + } finally { + reader.close(); // close filereader } - reader.close(); // close filereader - // report if there haven't been enough rows in the file - if (yp < Y_DIM) { - log.warn("In file " + IGUIConstants.ARCHDEF_FILE + ": Missing " + (Y_DIM - yp) + " entire rows of data."); - } - // confirm load process if (log.isInfoEnabled()) { log.info("Loaded multipart position data from '" + IGUIConstants.ARCHDEF_FILE + "'"); } } catch (final FileNotFoundException e) { + /* TODO ignore (really?) */ } catch (final IOException e) { + /* TODO ignore (really?) */ } } Modified: trunk/crossfire/src/cfeditor/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-09-17 19:46:54 UTC (rev 334) @@ -25,7 +25,6 @@ package cfeditor; import cfeditor.arch.ArchObject; -import cfeditor.textedit.scripteditor.ScriptEditControl; import java.awt.Color; import java.awt.FlowLayout; import java.awt.Insets; @@ -49,6 +48,7 @@ import javax.swing.JTextField; import static javax.swing.WindowConstants.HIDE_ON_CLOSE; import net.sf.japi.util.Arrays2; +import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-09-17 19:46:54 UTC (rev 334) @@ -24,7 +24,6 @@ package cfeditor.arch; -import cfeditor.CFileReader; import cfeditor.CMainControl; import cfeditor.IGUIConstants; import cfeditor.MultiPositionData; @@ -46,6 +45,7 @@ import org.jdom.JDOMException; import org.jdom.input.SAXBuilder; import org.jetbrains.annotations.Nullable; +import net.sf.gridarta.io.CFileReader; /** * The <code>ArchObjectParser</code> class handles the parsing of arches. It is Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java 2006-09-17 19:46:54 UTC (rev 334) @@ -27,8 +27,6 @@ import cfeditor.CArchPanel; import cfeditor.CFTreasureListTree; -import cfeditor.CFileInputStream; -import cfeditor.CFileReader; import cfeditor.CMainControl; import cfeditor.CMainStatusbar; import cfeditor.CPickmapPanel; @@ -59,6 +57,8 @@ import javax.swing.SwingConstants; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; +import net.sf.gridarta.io.CFileInputStream; +import net.sf.gridarta.io.CFileReader; /** * The <code>ArchObjectStack</code> contains all the default arches. Modified: trunk/daimonin/build.xml =================================================================== --- trunk/daimonin/build.xml 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/daimonin/build.xml 2006-09-17 19:46:54 UTC (rev 334) @@ -102,6 +102,9 @@ <exclude name="**/.xvpics/**"/> </fileset> </copy> + <copy todir="${build.dir}"> + <fileset dir="../src/app" excludes="**/*.java,**/package.html,**/overview.html" /> + </copy> <!--copy todir="${build.dir}"> <fileset dir="${config.dir}" /> </copy--> Modified: trunk/daimonin/src/daieditor/CFTreasureListTree.java =================================================================== --- trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-09-17 19:46:54 UTC (rev 334) @@ -64,6 +64,7 @@ import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreePath; import net.sf.gridarta.help.Help; +import net.sf.gridarta.io.CFileReader; import net.sf.japi.util.EnumerationIterator; import org.jetbrains.annotations.Nullable; Deleted: trunk/daimonin/src/daieditor/CFileInputStream.java =================================================================== --- trunk/daimonin/src/daieditor/CFileInputStream.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/daimonin/src/daieditor/CFileInputStream.java 2006-09-17 19:46:54 UTC (rev 334) @@ -1,122 +0,0 @@ -/* - * Daimonin Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * Copyright (C) 2005 Christian Hujer - * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package daieditor; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * Class for opening and reading a buffered stream to a BINARY resource-file. - * If no such file is found, the file is loaded from the jar archive. - * This class is very similar to {@link CFileReader}. - * The file is tried to open in the following order: - * <ol> - * <li>Try opening it with the given directory. The directory path is relative - * to the current working directory, the file path relative to that - * directory..</li> - * <li>Try opening it without the given directory. The file path is relative to - * the current working directory.</li> - * <li>Try opening the file as a system resource through the class loader.</li> - * </ol> - * Only if all tries failed, creating the stream fails. - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @see CFileReader - */ -public final class CFileInputStream extends BufferedInputStream { - - /** - * Creates a new CFileInputStream to a specified resource file. - * @param dname name of directory that the file is in (<code>null</code> - * means the file is located in the editor root dir) - * @param fname name of the resource file - * @throws FileNotFoundException In case all three tries to open the file failed - */ - public CFileInputStream(@Nullable final String dname, @NotNull final String fname) throws FileNotFoundException { - super(createStream(dname, fname)); - } - - /** - * Open the resource file for reading. - * @param dname directory name to read from - * @param fname file name of file to read - * @return Stream for reading from <var>fname</var> - * @throws FileNotFoundException In case all tries to open the file failed - */ - @SuppressWarnings({"MethodWithMultipleReturnPoints", "MethodWithMoreThanThreeNegations"}) - @NotNull private static InputStream createStream(@Nullable final String dname, @NotNull final String fname) throws FileNotFoundException { - try { // 1st try normal binary file relative to specified directory - return new FileInputStream(new File(dname, fname)); - } catch (final Exception e) { - // ignore - } - try { // 2nd try binary file relative to user's current working directory - return new FileInputStream(fname); - } catch (final Exception e) { // 3rd try via system resource from class loader - // ignore - } - final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); - try { // 3rd try context class loader relative to specified directory - @Nullable final InputStream stream = contextClassLoader.getResourceAsStream(new File(dname, fname).toURL().toURI().toString()); - if (stream != null) { - return stream; - } - } catch (final Exception e) { - // ignore - } - try { // 4th try context class loader relative to class loader's top level directory - @Nullable final InputStream stream = contextClassLoader.getResourceAsStream(new File(fname).toURL().toURI().toString()); - if (stream != null) { - return stream; - } - } catch (final Exception e) { - // ignore - } - try { // 5th try system class loader relative to specified directory - @Nullable final InputStream stream = ClassLoader.getSystemResourceAsStream(new File(dname, fname).toURL().toURI().toString()); - if (stream != null) { - return stream; - } - } catch (final Exception e) { - // ignore - } - try { // 6th try system class loader relative to class loader's top level directory - @Nullable final InputStream stream = ClassLoader.getSystemResourceAsStream(new File(fname).toURL().toURI().toString()); - if (stream != null) { - return stream; - } - } catch (final Exception e) { - // ignore - } - throw new FileNotFoundException("CFileInputStream couldn't find " + new File(dname, fname) + "."); - } - -} // class CFileInputStream Deleted: trunk/daimonin/src/daieditor/CFileReader.java =================================================================== --- trunk/daimonin/src/daieditor/CFileReader.java 2006-09-14 21:33:23 UTC (rev 333) +++ trunk/daimonin/src/daieditor/CFileReader.java 2006-09-17 19:46:54 UTC (rev 334) @@ -1,177 +0,0 @@ -/* - * Daimonin Java Editor. - * Copyright (C) 2000 Michael Toennies - * C... [truncated message content] |
From: <aki...@us...> - 2006-09-18 17:29:53
|
Revision: 335 http://svn.sourceforge.net/gridarta/?rev=335&view=rev Author: akirschbaum Date: 2006-09-18 10:29:36 -0700 (Mon, 18 Sep 2006) Log Message: ----------- Fix typos in comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFArchAttrib.java trunk/crossfire/src/cfeditor/CFArchType.java trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/crossfire/src/cfeditor/ScriptArchData.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CFArchAttrib.java trunk/daimonin/src/daieditor/CFArchType.java trunk/daimonin/src/daieditor/CMapFileEncode.java trunk/daimonin/src/daieditor/ScriptArchData.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-09-17 19:46:54 UTC (rev 334) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-09-18 17:29:36 UTC (rev 335) @@ -174,17 +174,17 @@ listNr = 0; this.mainControl = mainControl; // reference to the main control - typelist = atList; // refernce to the typelist + typelist = atList; // reference to the typelist CAttribDialog.setDefaultBounds(); // set width/height etc - // refernce to the ArchObject + // reference to the ArchObject if (aobj.isMulti() && aobj.getMapMultiHead() != null) { arch = aobj.getMapMultiHead(); defarch = this.mainControl.getArchObjectStack().getArch(arch.getNodeNr()); } else { arch = aobj; - defarch = defaobj; // refernce to the default ArchObject + defarch = defaobj; // reference to the default ArchObject } /* set frame icon Modified: trunk/crossfire/src/cfeditor/CFArchAttrib.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchAttrib.java 2006-09-17 19:46:54 UTC (rev 334) +++ trunk/crossfire/src/cfeditor/CFArchAttrib.java 2006-09-18 17:29:36 UTC (rev 335) @@ -322,7 +322,7 @@ newattr.text = text; - // important: we don't create a new instance of 'misc', only a refernce + // important: we don't create a new instance of 'misc', only a reference newattr.misc = misc; newattr.secId = secId; Modified: trunk/crossfire/src/cfeditor/CFArchType.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchType.java 2006-09-17 19:46:54 UTC (rev 334) +++ trunk/crossfire/src/cfeditor/CFArchType.java 2006-09-18 17:29:36 UTC (rev 335) @@ -277,7 +277,7 @@ // don't forget about the default attribs int numDef = 0; if (defaultArchType != null && defaultArchType.attr != null && defaultArchType.attr.length > 0) { - // create an array to store the refernces to the default atrribs: + // create an array to store the references to the default atrribs: final CFArchAttrib[] defList = new CFArchAttrib[defaultArchType.attr.length]; for (int t = 0; t < defaultArchType.attr.length; t++) { Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-09-17 19:46:54 UTC (rev 334) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-09-18 17:29:36 UTC (rev 335) @@ -88,7 +88,7 @@ final Iterator it = mapModel.getArchObjects(pos); while (it.hasNext()) { final ArchObject node = (ArchObject) it.next(); - // only non muli suckers + // only non multi suckers if (node.getMapMultiHead() == null && node.getMapMultiNext() == null) { if (!writeMapArch(node, false)) { return; Modified: trunk/crossfire/src/cfeditor/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-09-17 19:46:54 UTC (rev 334) +++ trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-09-18 17:29:36 UTC (rev 335) @@ -675,7 +675,7 @@ /** Opens the script pad to display the script for this event. */ public void openScript() { - final CMainControl mainControl = CMainControl.getInstance(); // refernce to main control + final CMainControl mainControl = CMainControl.getInstance(); // reference to main control // trying to get the absolute path to scriptfile: String path; Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-09-17 19:46:54 UTC (rev 334) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-09-18 17:29:36 UTC (rev 335) @@ -214,9 +214,9 @@ listNr = 0; this.mainControl = mainControl; // reference to the main control - typelist = atList; // refernce to the typelist + typelist = atList; // reference to the typelist - // refernce to the ArchObject + // reference to the ArchObject if (aobj.isMulti() && aobj.getMapMultiHead() != null) { arch = aobj.getMapMultiHead(); } else { Modified: trunk/daimonin/src/daieditor/CFArchAttrib.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchAttrib.java 2006-09-17 19:46:54 UTC (rev 334) +++ trunk/daimonin/src/daieditor/CFArchAttrib.java 2006-09-18 17:29:36 UTC (rev 335) @@ -306,7 +306,7 @@ newattr.text = text; - // important: we don't create a new instance of 'misc', only a refernce + // important: we don't create a new instance of 'misc', only a reference newattr.misc = misc; newattr.secId = secId; Modified: trunk/daimonin/src/daieditor/CFArchType.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchType.java 2006-09-17 19:46:54 UTC (rev 334) +++ trunk/daimonin/src/daieditor/CFArchType.java 2006-09-18 17:29:36 UTC (rev 335) @@ -247,7 +247,7 @@ // don't forget about the default attribs int numDef = 0; if (defaultArchType != null && defaultArchType.attr != null && defaultArchType.attr.length > 0) { - // create an array to store the refernces to the default atrribs: + // create an array to store the references to the default atrribs: final CFArchAttrib[] defList = new CFArchAttrib[defaultArchType.attr.length]; for (int t = 0; t < defaultArchType.attr.length; t++) { Modified: trunk/daimonin/src/daieditor/CMapFileEncode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-09-17 19:46:54 UTC (rev 334) +++ trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-09-18 17:29:36 UTC (rev 335) @@ -78,7 +78,7 @@ for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { for (final ArchObject node : mapModel.getMapSquare(pos)) { - // only non muli suckers + // only non multi suckers if (node.getMapMultiHead() == null && node.getMultiRefCount() == 0) { writeMapArch(node, false); } Modified: trunk/daimonin/src/daieditor/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/ScriptArchData.java 2006-09-17 19:46:54 UTC (rev 334) +++ trunk/daimonin/src/daieditor/ScriptArchData.java 2006-09-18 17:29:36 UTC (rev 335) @@ -622,7 +622,7 @@ /** Opens the script pad to display the script for this event. */ public void openScript() { - final CMainControl mainControl = CMainControl.getInstance(); // refernce to main control + final CMainControl mainControl = CMainControl.getInstance(); // reference to main control final String filePath = getFilePath(); // trying to get the absolute path to scriptfile: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-22 07:13:13
|
Revision: 349 http://svn.sourceforge.net/gridarta/?rev=349&view=rev Author: akirschbaum Date: 2006-09-22 00:12:46 -0700 (Fri, 22 Sep 2006) Log Message: ----------- Unify name of Logger instance to 'log'. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CArchPanelPan.java trunk/crossfire/src/cfeditor/CAttribBitmask.java trunk/crossfire/src/cfeditor/CFArchType.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CMapFileDecode.java trunk/crossfire/src/cfeditor/CPickmapPanel.java trunk/crossfire/src/cfeditor/CSettings.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/arch/ArchObject.java trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java trunk/crossfire/src/cfeditor/filter/AttributeFilter.java trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java trunk/crossfire/src/cfeditor/filter/NamedFilterList.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/Updater.java trunk/daimonin/src/daieditor/arch/ArchObjectParser.java Modified: trunk/crossfire/src/cfeditor/CArchPanelPan.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-09-20 18:48:13 UTC (rev 348) +++ trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-09-22 07:12:46 UTC (rev 349) @@ -44,7 +44,7 @@ public final class CArchPanelPan extends JPanel { - private static final Logger LOG = Logger.getLogger(CArchPanel.class); + private static final Logger log = Logger.getLogger(CArchPanel.class); /** Serial Version UID. */ private static final long serialVersionUID = 1L; @@ -140,7 +140,7 @@ arch = mainControl.getArchObjectStack().getArch(index); } catch (final NullPointerException e) { /* - LOG.info("NullPointerException in showArchListObject()!", e); + log.info("NullPointerException in showArchListObject()!", e); This happens in JDK 1.4 when you select an arch in panel A, then select Panel B, then Panel A again. (why??) */ @@ -199,7 +199,7 @@ for (int i = 0; i < (int) (list.length() / 10.0); i++) { numList[i] = Integer.parseInt(list.substring(10 * i, 5 + 10 * i)); - //LOG.debug(CMainControl.getInstance().getArchObjectStack().getArch(numList[i]).getArchName()); + //log.debug(CMainControl.getInstance().getArchObjectStack().getArch(numList[i]).getArchName()); } return numList; @@ -219,7 +219,7 @@ final int index = Integer.parseInt(list.substring(5 + 10 * i, 10 + 10 * i)); catList[i] = jbox.getItemAt(index).toString().trim(); } catch (final NullPointerException e) { - LOG.warn("Nullpointer in getListCategoryArray()!", e); + log.warn("Nullpointer in getListCategoryArray()!", e); } } Modified: trunk/crossfire/src/cfeditor/CAttribBitmask.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribBitmask.java 2006-09-20 18:48:13 UTC (rev 348) +++ trunk/crossfire/src/cfeditor/CAttribBitmask.java 2006-09-22 07:12:46 UTC (rev 349) @@ -51,7 +51,7 @@ */ public final class CAttribBitmask { - private static final Logger LOG = Logger.getLogger(CAttribBitmask.class); + private static final Logger log = Logger.getLogger(CAttribBitmask.class); /** * Maximum number of characters in a line before linebreak (see {@link @@ -100,7 +100,7 @@ elem = (Element) entries.get(i); final Attribute a; if ((a = elem.getAttribute("bit")) == null || elem.getAttribute("name") == null) { - LOG.warn("Parse error: Found bitmask entry without 'bit' or 'name'."); + log.warn("Parse error: Found bitmask entry without 'bit' or 'name'."); elem.detach(); // remove element from DOM tree } else { try { @@ -109,7 +109,7 @@ maxBit = bit; // this is the highest bit so far } } catch (final DataConversionException e) { - LOG.warn("Parse error: Bitmask bit '" + a.getValue() + "' (" + elem.getAttribute("name").getValue() + ") is not an integer."); + log.warn("Parse error: Bitmask bit '" + a.getValue() + "' (" + elem.getAttribute("name").getValue() + ") is not an integer."); elem.detach(); // remove element from DOM tree } } @@ -133,19 +133,19 @@ } } - if (LOG.isDebugEnabled()) { + if (log.isDebugEnabled()) { String s = "bitmask '" + root.getAttribute("name") + "':"; for (int i = 0; i < bitName.length; i++) { s = s + " " + i + " = " + bitName[i]; } - LOG.debug(s); + log.debug(s); } number = bitName.length - 1; maxvalue = ((int) Math.pow(2., (double) (bitName.length + 1))) - 1; } else { // Error: this is an "empty" bitmask - LOG.warn("Error in \"" + IGUIConstants.TYPEDEF_FILE + "\": Found a bitmask without content!"); + log.warn("Error in \"" + IGUIConstants.TYPEDEF_FILE + "\": Found a bitmask without content!"); bitName = new String[1]; bitName[0] = "<none>"; number = 0; @@ -185,7 +185,7 @@ } else { // value too big? if (value > maxvalue) { - LOG.warn("bitmask value " + value + " is too big."); + log.warn("bitmask value " + value + " is too big."); } boolean linebreak = false; Modified: trunk/crossfire/src/cfeditor/CFArchType.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchType.java 2006-09-20 18:48:13 UTC (rev 348) +++ trunk/crossfire/src/cfeditor/CFArchType.java 2006-09-22 07:12:46 UTC (rev 349) @@ -40,7 +40,7 @@ */ public final class CFArchType { - private static final Logger LOG = Logger.getLogger(CFArchType.class); + private static final Logger log = Logger.getLogger(CFArchType.class); public static final String XML_TYPE = "type"; @@ -135,7 +135,7 @@ typenr = -1; typeName = "default"; - LOG.debug("type: default"); + log.debug("type: default"); } else { try { // parse the type name @@ -144,8 +144,8 @@ // parse the type number typenr = Integer.parseInt(root.getAttribute("number").getValue().trim()); - if (LOG.isDebugEnabled()) { - LOG.debug("reading type: " + typeName + ", " + typenr); + if (log.isDebugEnabled()) { + log.debug("reading type: " + typeName + ", " + typenr); } // parse 'required' attributes @@ -158,7 +158,7 @@ a1 = elem.getAttribute(CFArchAttrib.XML_KEY_ARCH); final Attribute a2 = elem.getAttribute(XML_VALUE); if (a1 == null || a2 == null) { - LOG.error("In '" + XML_REQUIRED + "' element of type " + typeName + ": " + XML_ATTRIBUTE + " missing '" + CFArchAttrib.XML_KEY_ARCH + "' or '" + XML_VALUE + "'."); + log.error("In '" + XML_REQUIRED + "' element of type " + typeName + ": " + XML_ATTRIBUTE + " missing '" + CFArchAttrib.XML_KEY_ARCH + "' or '" + XML_VALUE + "'."); } else { tmp.add(a1.getValue().trim()); tmp.add(a2.getValue().trim()); @@ -172,7 +172,7 @@ } } catch (final NumberFormatException e) { // parsing type number failed: - LOG.error("In " + IGUIConstants.TYPEDEF_FILE + ": Type " + typeName + " has invalid type number '" + root.getAttribute("number").getValue() + "'."); + log.error("In " + IGUIConstants.TYPEDEF_FILE + ": Type " + typeName + " has invalid type number '" + root.getAttribute("number").getValue() + "'."); return false; } @@ -185,7 +185,7 @@ elem = (Element) children.get(i); a1 = elem.getAttribute(CFArchAttrib.XML_KEY_ARCH); if (a1 == null) { - LOG.error("In '" + XML_IGNORE + "' section of type " + typeName + ": " + XML_ATTRIBUTE + " missing '" + CFArchAttrib.XML_KEY_ARCH + "'."); + log.error("In '" + XML_IGNORE + "' section of type " + typeName + ": " + XML_ATTRIBUTE + " missing '" + CFArchAttrib.XML_KEY_ARCH + "'."); } else { ignoreTable.put(a1.getValue().trim(), ""); } @@ -197,7 +197,7 @@ elem = (Element) children.get(i); a1 = elem.getAttribute("name"); if (a1 == null) { - LOG.error("In '" + XML_IGNORE + "' section of type " + typeName + ": ignore_list missing 'name'."); + log.error("In '" + XML_IGNORE + "' section of type " + typeName + ": ignore_list missing 'name'."); } else if (tlist.getIgnoreListTable().containsKey(a1.getValue().trim())) { // just copy everything from ignorelist to this ignore section final Vector ignlist = (Vector) (tlist.getIgnoreListTable().get(a1.getValue().trim())); @@ -205,7 +205,7 @@ ignoreTable.put((String) (ignlist.elementAt(k)), ""); } } else { - LOG.error("In '" + XML_IGNORE + "' section of type " + typeName + ": ignore_list with name \"" + a1.getValue() + "\" is undefined."); + log.error("In '" + XML_IGNORE + "' section of type " + typeName + ": ignore_list with name \"" + a1.getValue() + "\" is undefined."); } } } @@ -226,7 +226,7 @@ if ((elem = root.getChild(XML_IMPORT_TYPE)) != null) { a1 = elem.getAttribute("name"); if (a1 == null) { - LOG.error("In file '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has " + XML_IMPORT_TYPE + " element without 'name'."); + log.error("In file '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has " + XML_IMPORT_TYPE + " element without 'name'."); } else { importName = a1.getValue().trim(); } @@ -247,7 +247,7 @@ if (elem.getName().equalsIgnoreCase(XML_SECTION) && !elem.getChildren().isEmpty()) { a1 = elem.getAttribute("name"); if (a1 == null) { - LOG.warn("In " + IGUIConstants.TYPEDEF_FILE + ": Type " + typeName + " contains a " + XML_SECTION + " missing 'name'."); + log.warn("In " + IGUIConstants.TYPEDEF_FILE + ": Type " + typeName + " contains a " + XML_SECTION + " missing 'name'."); inSection = false; // we'll treat the attributes as "sectionless" } else { // get section name @@ -331,8 +331,8 @@ } } } else { - LOG.error("Syntax Error in file '" + filename + "' (" + typeName + "):"); - LOG.error(" import type \"" + importName + "\" not found!"); + log.error("Syntax Error in file '" + filename + "' (" + typeName + "):"); + log.error(" import type \"" + importName + "\" not found!"); } } @@ -341,16 +341,16 @@ // first put in the references to the default attribs: for (int k = numDef; k > 0; k--) { attr[numDef - k] = defList[numDef - k]; - if (LOG.isDebugEnabled()) { - LOG.debug("*** (" + (numDef - k) + ") " + attr[numDef - k].getNameNew()); + if (log.isDebugEnabled()) { + log.debug("*** (" + (numDef - k) + ") " + attr[numDef - k].getNameNew()); } } // next put in the references of imported arches (at end of array) for (int k = 0; k < importNum; k++) { attr[j - importNum + k] = importList[k]; - if (LOG.isDebugEnabled()) { - LOG.debug("*** (" + (j - importNum + k) + ") " + attr[j - importNum + k].getNameNew()); + if (log.isDebugEnabled()) { + log.debug("*** (" + (j - importNum + k) + ") " + attr[j - importNum + k].getNameNew()); } } } else { @@ -405,9 +405,9 @@ attrib.setSection(1, "Special"); } - if (LOG.isDebugEnabled()) { + if (log.isDebugEnabled()) { final Attribute a = elem.getAttribute("arch"); - LOG.debug("attribute " + (a == null ? "null" : a.getValue()) + ", section " + attrib.getSecId() + " = '" + attrib.getSecName() + "'"); + log.debug("attribute " + (a == null ? "null" : a.getValue()) + ", section " + attrib.getSecId() + " = '" + attrib.getSecName() + "'"); } } } @@ -465,8 +465,8 @@ text += "</BODY>\n</HTML>\n"; - if (LOG.isDebugEnabled()) { - LOG.debug(text); + if (log.isDebugEnabled()) { + log.debug(text); } return text; } Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-09-20 18:48:13 UTC (rev 348) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-09-22 07:12:46 UTC (rev 349) @@ -55,7 +55,7 @@ */ public final class CFArchTypeList { - private static final Logger LOG = Logger.getLogger(CFArchTypeList.class); + private static final Logger log = Logger.getLogger(CFArchTypeList.class); private final CFArchType head = new CFArchType(null); // head of CFArchType list (head contains default type) @@ -103,7 +103,7 @@ Element elem; Attribute a; if (root == null || !root.getName().equalsIgnoreCase("types")) { - LOG.warn("File '" + IGUIConstants.TYPEDEF_FILE + "' lacks root element 'types'."); + log.warn("File '" + IGUIConstants.TYPEDEF_FILE + "' lacks root element 'types'."); } else { List children; // parse all bitmask elements @@ -111,7 +111,7 @@ for (int i = 0; children != null && i < children.size(); i++) { elem = (Element) children.get(i); if (elem.getAttribute("name") == null) { - LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load bitmask element without 'name'."); + log.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load bitmask element without 'name'."); } else { bitmaskTable.put(elem.getAttribute("name").getValue(), new CAttribBitmask(elem)); } @@ -122,7 +122,7 @@ for (int i = 0; children != null && i < children.size(); i++) { elem = (Element) children.get(i); if (elem.getAttribute("name") == null) { - LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load list element without 'name'."); + log.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load list element without 'name'."); } else { final Vector list = parseListFromElement(elem); if (list != null && list.size() > 0) { @@ -134,7 +134,7 @@ // parse default type elem = root.getChild("default_type"); if (elem == null) { - LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': default_type element is missing!"); + log.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': default_type element is missing!"); } else { // create a new CFArchType element final CFArchType newType = new CFArchType(head); @@ -152,7 +152,7 @@ for (int i = 0; children != null && i < children.size(); i++) { elem = (Element) children.get(i); if (elem.getAttribute("name") == null) { - LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load ignore_list element without 'name'."); + log.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load ignore_list element without 'name'."); } else { final String lname = elem.getAttribute("name").getValue().trim(); final List children2 = elem.getChildren(CFArchType.XML_ATTRIBUTE); @@ -164,7 +164,7 @@ if ((a = elem.getAttribute(CFArchAttrib.XML_KEY_ARCH)) != null) { content.addElement(a.getValue().trim()); } else { - LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': ignore_list '" + lname + "' has " + CFArchType.XML_ATTRIBUTE + " missing '" + CFArchAttrib.XML_KEY_ARCH + "'."); + log.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': ignore_list '" + lname + "' has " + CFArchType.XML_ATTRIBUTE + " missing '" + CFArchAttrib.XML_KEY_ARCH + "'."); } } // now add the list vector to the ignoreListTable: @@ -178,7 +178,7 @@ for (int i = 0; children != null && i < children.size(); i++) { elem = (Element) children.get(i); if (elem.getAttribute("name") == null || elem.getAttribute("number") == null) { - LOG.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': found type element without 'name' or 'number'."); + log.warn("In file '" + IGUIConstants.TYPEDEF_FILE + "': found type element without 'name' or 'number'."); } else { // create a new CFArchType element final CFArchType newType = new CFArchType(head); @@ -193,17 +193,17 @@ } } - if (LOG.isInfoEnabled()) { - LOG.info("Loaded " + length + " types from '" + IGUIConstants.TYPEDEF_FILE + "'"); + if (log.isInfoEnabled()) { + log.info("Loaded " + length + " types from '" + IGUIConstants.TYPEDEF_FILE + "'"); } } } finally { fread.close(); } } catch (JDOMException e) { - LOG.error("Parsing error in '" + IGUIConstants.TYPEDEF_FILE, e); + log.error("Parsing error in '" + IGUIConstants.TYPEDEF_FILE, e); } catch (IOException e) { - LOG.error("Cannot read file '" + IGUIConstants.TYPEDEF_FILE + "'!", e); + log.error("Cannot read file '" + IGUIConstants.TYPEDEF_FILE + "'!", e); } ignoreListTable = null; // this was only needed during load phase @@ -224,7 +224,7 @@ for (int i = 0; entries != null && i < entries.size(); i++) { elem = (Element) entries.get(i); if (elem.getAttribute("value") == null || elem.getAttribute("name") == null) { - LOG.warn("In '" + IGUIConstants.TYPEDEF_FILE + "', list " + root.getAttribute("name").getValue() + ": found entry missing 'value' or 'name'."); + log.warn("In '" + IGUIConstants.TYPEDEF_FILE + "', list " + root.getAttribute("name").getValue() + ": found entry missing 'value' or 'name'."); } else { // every list entry adds value (Integer) and name (String) to the vector try { @@ -232,7 +232,7 @@ list.addElement(new Integer(num)); list.addElement(" " + elem.getAttribute("name").getValue().trim()); } catch (DataConversionException e) { - LOG.warn("In '" + IGUIConstants.TYPEDEF_FILE + "', list " + root.getAttribute("name").getValue() + ": value '" + elem.getAttribute("value").getValue() + "' is not an integer."); + log.warn("In '" + IGUIConstants.TYPEDEF_FILE + "', list " + root.getAttribute("name").getValue() + ": value '" + elem.getAttribute("value").getValue() + "' is not an integer."); } } } @@ -300,11 +300,11 @@ Element spellElem; Attribute a; if (root == null || !root.getName().equalsIgnoreCase("spells")) { - LOG.warn("File '" + IGUIConstants.SPELL_FILE + "' lacks root element 'spells'."); + log.warn("File '" + IGUIConstants.SPELL_FILE + "' lacks root element 'spells'."); } else { final List spells = root.getChildren("spell"); if (spells == null || spells.size() == 0) { - LOG.warn("File '" + IGUIConstants.SPELL_FILE + "' has no content."); + log.warn("File '" + IGUIConstants.SPELL_FILE + "' has no content."); } else { // initialize array with appropriate size spellName = new String[spells.size() + 1]; @@ -320,9 +320,9 @@ spellElem = (Element) spells.get(j); if (spellElem.getAttribute("id") == null) { - LOG.warn("In File '" + IGUIConstants.SPELL_FILE + "': Found 'spell' element without 'id'"); + log.warn("In File '" + IGUIConstants.SPELL_FILE + "': Found 'spell' element without 'id'"); } else if (spellElem.getAttribute("name") == null) { - LOG.warn("In File '" + IGUIConstants.SPELL_FILE + "': Found 'spell' element without 'name'"); + log.warn("In File '" + IGUIConstants.SPELL_FILE + "': Found 'spell' element without 'name'"); } else { try { // parse spell number and -name @@ -330,18 +330,18 @@ spellName[i] = spellElem.getAttribute("name").getValue().trim(); i++; } catch (DataConversionException de) { - LOG.error("in '" + IGUIConstants.SPELL_FILE + "': spell id '" + spellElem.getAttribute("id").getValue() + "' is not an integer."); + log.error("in '" + IGUIConstants.SPELL_FILE + "': spell id '" + spellElem.getAttribute("id").getValue() + "' is not an integer."); } } } // loading successful i--; - if (LOG.isInfoEnabled()) { + if (log.isInfoEnabled()) { if (i == spells.size()) { - LOG.info("Loaded " + i + " spells from '" + IGUIConstants.SPELL_FILE + "'"); + log.info("Loaded " + i + " spells from '" + IGUIConstants.SPELL_FILE + "'"); } else { - LOG.info("Loaded " + i + " of " + spells.size() + " defined spells from '" + IGUIConstants.SPELL_FILE + "'"); + log.info("Loaded " + i + " of " + spells.size() + " defined spells from '" + IGUIConstants.SPELL_FILE + "'"); } } } @@ -350,9 +350,9 @@ reader.close(); } } catch (JDOMException e) { - LOG.error("Parsing error in '" + IGUIConstants.SPELL_FILE + "'", e); + log.error("Parsing error in '" + IGUIConstants.SPELL_FILE + "'", e); } catch (IOException e) { - LOG.error("Cannot read file '" + IGUIConstants.SPELL_FILE + "'!"); + log.error("Cannot read file '" + IGUIConstants.SPELL_FILE + "'!"); } } @@ -446,7 +446,7 @@ } } } catch (FileNotFoundException e) { - LOG.error("File '" + spellfile.getAbsolutePath() + "' not found!"); + log.error("File '" + spellfile.getAbsolutePath() + "' not found!"); } catch (EOFException e) { // end of file/spell struct reached try { @@ -455,7 +455,7 @@ } catch (IOException ioe) { } } catch (IOException e) { - LOG.error("Cannot read file '" + spellfile.getAbsolutePath() + "'!"); + log.error("Cannot read file '" + spellfile.getAbsolutePath() + "'!"); } } @@ -509,7 +509,7 @@ fileWriter.close(); return list.size(); } catch (IOException e) { - LOG.error("Cannot write file '" + dfile.getAbsolutePath() + "'!"); + log.error("Cannot write file '" + dfile.getAbsolutePath() + "'!"); } } @@ -545,8 +545,8 @@ // check if all the type-attributes match final int argsNum = (int) (tmp.getTypeAttr().length / 2.0); - if (LOG.isDebugEnabled()) { - LOG.debug("# type: " + tmp.getTypeName()); + if (log.isDebugEnabled()) { + log.debug("# type: " + tmp.getTypeName()); } boolean match = true; Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-09-20 18:48:13 UTC (rev 348) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-09-22 07:12:46 UTC (rev 349) @@ -65,7 +65,7 @@ */ public final class CFTreasureListTree extends JTree { - private static final Logger LOG = Logger.getLogger(CFTreasureListTree.class); + private static final Logger log = Logger.getLogger(CFTreasureListTree.class); /** Serial Version UID. */ private static final long serialVersionUID = 1L; @@ -340,11 +340,11 @@ needSecondLink = null; if (errorLog.toString().trim().length() > 0) { - LOG.warn("Syntax errors in treasurelist file:"); - LOG.warn(errorLog.toString()); + log.warn("Syntax errors in treasurelist file:"); + log.warn(errorLog.toString()); } - if (LOG.isInfoEnabled()) { - LOG.info(tListCount + " treasurelists loaded."); + if (log.isInfoEnabled()) { + log.info(tListCount + " treasurelists loaded."); } // free unused memory Modified: trunk/crossfire/src/cfeditor/CMapFileDecode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-09-20 18:48:13 UTC (rev 348) +++ trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-09-22 07:12:46 UTC (rev 349) @@ -48,7 +48,7 @@ */ public final class CMapFileDecode { - private static final Logger LOG = Logger.getLogger(CMapFileDecode.class); + private static final Logger log = Logger.getLogger(CMapFileDecode.class); private int maxxlen, maxylen; @@ -188,20 +188,20 @@ // now we test for a new arch - thats stuf in inventory // or the end... thats the end of this shit } else if (thisLine.startsWith("arch ")) { - if (LOG.isDebugEnabled()) { - LOG.debug("GO INVENTORY: " + arch + " - " + thisLine); + if (log.isDebugEnabled()) { + log.debug("GO INVENTORY: " + arch + " - " + thisLine); } readArch(myInput, thisLine, arch); - if (LOG.isDebugEnabled()) { - LOG.debug("GO INVENTORY2: " + arch + " - " + thisLine); + if (log.isDebugEnabled()) { + log.debug("GO INVENTORY2: " + arch + " - " + thisLine); } } else if (thisLine.startsWith("end")) { objects.add(arch); archflag = false; archmore = false; - if (LOG.isDebugEnabled()) { - LOG.debug("LEAVE!: " + arch + " - " + thisLine); + if (log.isDebugEnabled()) { + log.debug("LEAVE!: " + arch + " - " + thisLine); } return arch; } else if (thisLine.regionMatches(0, "msg", 0, 3)) { @@ -241,7 +241,7 @@ arch.addEventScript(type, path); } } else { - LOG.warn("Arch " + arch.getArchName() + " has incorrect event code '" + thisLine + "'"); + log.warn("Arch " + arch.getArchName() + " has incorrect event code '" + thisLine + "'"); arch.addArchText(thisLine + "\n"); // keep line, it might have a meaning after all } } else if (thisLine.regionMatches(0, "x ", 0, 2)) { @@ -283,7 +283,7 @@ thisLine2 = myInput.readLine(); } } catch (final IOException e) { - LOG.error("Read Error while trying to load map: " + maparch.getFileName(), e); + log.error("Read Error while trying to load map: " + maparch.getFileName(), e); throw e; // we simply pass this exception to the calling function } Modified: trunk/crossfire/src/cfeditor/CPickmapPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-09-20 18:48:13 UTC (rev 348) +++ trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-09-22 07:12:46 UTC (rev 349) @@ -50,7 +50,7 @@ */ public final class CPickmapPanel { - private static final Logger LOG = Logger.getLogger(CPickmapPanel.class); + private static final Logger log = Logger.getLogger(CPickmapPanel.class); /** static instance of this class */ private static CPickmapPanel instance; @@ -103,7 +103,7 @@ final File pickmapDir = new File(IGUIConstants.PICKMAP_DIR); if (!pickmapDir.exists() || !pickmapDir.isDirectory()) { - LOG.warn("No pickmaps directory found."); + log.warn("No pickmaps directory found."); return; } @@ -164,7 +164,7 @@ // loading failed - could be a system file in that directory, // or something else. Doesn't deserve more attention than a printout. if (!mapFile.getName().startsWith(".")) { - LOG.warn("Couldn't load Pickmap ", e); + log.warn("Couldn't load Pickmap ", e); } } return false; @@ -278,14 +278,14 @@ // this is the new active pickmap currentPickMap = tmp; // <- new pickmap foundMap = true; - if (LOG.isDebugEnabled()) { - LOG.debug("new pickmap: " + newName); + if (log.isDebugEnabled()) { + log.debug("new pickmap: " + newName); } } if (!foundMap && mainControl.getMainView().isPickmapActive() && loadComplete) { // error: the new selected pickmap couldn't be found - LOG.error("Bad Error in CPickmapPanel.updateActivePickmap: Selected pickmap couldn't be found!"); + log.error("Bad Error in CPickmapPanel.updateActivePickmap: Selected pickmap couldn't be found!"); } } Modified: trunk/crossfire/src/cfeditor/CSettings.java =================================================================== --- trunk/crossfire/src/cfeditor/CSettings.java 2006-09-20 18:48:13 UTC (rev 348) +++ trunk/crossfire/src/cfeditor/CSettings.java 2006-09-22 07:12:46 UTC (rev 349) @@ -46,7 +46,7 @@ */ @Deprecated public final class CSettings { - private static final Logger LOG = Logger.getLogger(CSettings.class); + private static final Logger log = Logger.getLogger(CSettings.class); /** The properties object that contains the settings. */ private final Properties properties = new Properties(); @@ -105,8 +105,8 @@ } try { - if (LOG.isDebugEnabled()) { - LOG.debug("SAVE SETTINGS: " + (new File(strFile)).getAbsolutePath()); + if (log.isDebugEnabled()) { + log.debug("SAVE SETTINGS: " + (new File(strFile)).getAbsolutePath()); } properties.store(new FileOutputStream(strFile), ""); } catch (final IOException ioe) { Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-09-20 18:48:13 UTC (rev 348) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-09-22 07:12:46 UTC (rev 349) @@ -42,7 +42,7 @@ */ public final class CopyBuffer { - private static final Logger LOG = Logger.getLogger(CopyBuffer.class); + private static final Logger log = Logger.getLogger(CopyBuffer.class); /** Clear the selection. */ private static final int DO_CLEAR = 1; Modified: trunk/crossfire/src/cfeditor/arch/ArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObject.java 2006-09-20 18:48:13 UTC (rev 348) +++ trunk/crossfire/src/cfeditor/arch/ArchObject.java 2006-09-22 07:12:46 UTC (rev 349) @@ -50,7 +50,7 @@ */ public class ArchObject implements Cloneable, net.sf.gridarta.arch.ArchObject, Iterable<ArchObject> { - private static final Logger LOG = Logger.getLogger(ArchObject.class); + private static final Logger log = Logger.getLogger(ArchObject.class); /** Special constant that's used if an arch has no arch type set. */ public static final int TYPE_UNSET = -666; @@ -1409,8 +1409,8 @@ type = typeList.getTypeOfArch(this); // the type of this arch } - if (LOG.isDebugEnabled()) { - LOG.debug("Applying type: " + type.getTypeName()); + if (log.isDebugEnabled()) { + log.debug("Applying type: " + type.getTypeName()); } String line = null; @@ -1430,8 +1430,8 @@ attrKey = line.substring(0, line.indexOf(" ")); } - if (LOG.isDebugEnabled()) { - LOG.debug("read attribute '" + line + "' -> "); + if (log.isDebugEnabled()) { + log.debug("read attribute '" + line + "' -> "); } // now check if there's a match in the definitions @@ -1467,7 +1467,7 @@ sstream.close(); sread.close(); } catch (IOException e) { - LOG.error("in getSyntaxErrors: Cannot close StringReader", e); + log.error("in getSyntaxErrors: Cannot close StringReader", e); } // return errors, or null if empty Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-09-20 18:48:13 UTC (rev 348) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-09-22 07:12:46 UTC (rev 349) @@ -58,7 +58,7 @@ public final class ArchObjectParser { /** Logger. */ - private static final Logger LOG = Logger.getLogger(ArchObjectParser.class); + private static final Logger log = Logger.getLogger(ArchObjectParser.class); // name of the system-arch containing path of starting map public static final String STARTARCH_NAME = "map"; @@ -100,11 +100,11 @@ final Element root = doc.getRootElement(); final Attribute a; if (root == null || !"typenumbers".equalsIgnoreCase(root.getName())) { - LOG.warn("File '" + IGUIConstants.TYPENR_FILE + "' lacks root element 'typenumbers'."); + log.warn("File '" + IGUIConstants.TYPENR_FILE + "' lacks root element 'typenumbers'."); } else { final List types = root.getChildren("type"); if (types == null || types.size() == 0) { - LOG.warn("File '" + IGUIConstants.TYPENR_FILE + "' has no content."); + log.warn("File '" + IGUIConstants.TYPENR_FILE + "' has no content."); } else { // process all 'type' elements from the xml file int i; @@ -112,22 +112,22 @@ final Element typeElem = (Element) types.get(i); if (typeElem.getAttribute("number") == null) { - LOG.warn("In File '" + IGUIConstants.TYPENR_FILE + "': Found 'type' element without 'number'"); + log.warn("In File '" + IGUIConstants.TYPENR_FILE + "': Found 'type' element without 'number'"); } else if (typeElem.getAttribute("name") == null) { - LOG.warn("In File '" + IGUIConstants.TYPENR_FILE + "': Found 'type' element without 'name'"); + log.warn("In File '" + IGUIConstants.TYPENR_FILE + "': Found 'type' element without 'name'"); } else { try { // parse type number and -name, then add it to the table 'archTypeNumbers' archTypeNumbers.put(typeElem.getAttribute("number").getIntValue(), typeElem.getAttribute("name").getValue()); } catch (final DataConversionException de) { - LOG.error("In '" + IGUIConstants.TYPENR_FILE + "':\n type number '" + typeElem.getAttribute("number").getValue() + "' is not an integer."); + log.error("In '" + IGUIConstants.TYPENR_FILE + "':\n type number '" + typeElem.getAttribute("number").getValue() + "' is not an integer."); } } } // loading successful - if (LOG.isInfoEnabled()) { - LOG.info("" + i + " typenumbers loaded."); + if (log.isInfoEnabled()) { + log.info("" + i + " typenumbers loaded."); } } } @@ -135,11 +135,11 @@ reader.close(); } } catch (final JDOMException e) { - LOG.error("Parsing error in '" + IGUIConstants.TYPENR_FILE + "'", e); + log.error("Parsing error in '" + IGUIConstants.TYPENR_FILE + "'", e); } catch (final FileNotFoundException e) { - LOG.error("Cannot read file '" + IGUIConstants.TYPENR_FILE + "'!", e); + log.error("Cannot read file '" + IGUIConstants.TYPENR_FILE + "'!", e); } catch (final IOException e) { - LOG.error("Error while reading file '" + IGUIConstants.TYPENR_FILE + "'!", e); + log.error("Error while reading file '" + IGUIConstants.TYPENR_FILE + "'!", e); } } @@ -170,9 +170,9 @@ in.close(); } } catch (final FileNotFoundException e) { - LOG.error("Archfile " + fname + " could not be found"); + log.error("Archfile " + fname + " could not be found"); } catch (final IOException e) { - LOG.error("IOException in parseDefArch!"); + log.error("IOException in parseDefArch!"); } } @@ -279,11 +279,11 @@ arch.addLoreText(thisLine + "\n"); } } else if (thisLine.regionMatches(0, "Object", 0, 6)) { - LOG.error("Find inventory Object in def arch: " + thisLine); + log.error("Find inventory Object in def arch: " + thisLine); } else if (thisLine.regionMatches(0, "end", 0, 3)) { //if (arch.getArchTypNr() == 0) { - if (LOG.isDebugEnabled()) { - LOG.debug("Arch " + arch.getArchName() + " has no type info!"); + if (log.isDebugEnabled()) { + log.debug("Arch " + arch.getArchName() + " has no type info!"); } //} // we got full arch @@ -362,30 +362,30 @@ } else if (thisLine.equals("lore")) { loreflag = true; } else if (thisLine.regionMatches(0, "visibility ", 0, 11)) { - if (LOG.isDebugEnabled()) { - LOG.debug("Remove visibility: " + arch.getArchName()); + if (log.isDebugEnabled()) { + log.debug("Remove visibility: " + arch.getArchName()); } } else if (thisLine.regionMatches(0, "magicmap ", 0, 9)) { - if (LOG.isDebugEnabled()) { - LOG.debug("Remove magicmap: " + arch.getArchName()); + if (log.isDebugEnabled()) { + log.debug("Remove magicmap: " + arch.getArchName()); } } else if (thisLine.regionMatches(0, "color_fg ", 0, 9)) { - if (LOG.isDebugEnabled()) { - LOG.debug("Remove color_fg: " + arch.getArchName()); + if (log.isDebugEnabled()) { + log.debug("Remove color_fg: " + arch.getArchName()); } } else if (thisLine.regionMatches(0, "color_bg ", 0, 9)) { - if (LOG.isDebugEnabled()) { - LOG.debug("Remove color_bg: " + arch.getArchName()); + if (log.isDebugEnabled()) { + log.debug("Remove color_bg: " + arch.getArchName()); } } else if (thisLine.regionMatches(0, "x ", 0, 2)) { if (!archmore && !arch.getArchName().equals(STARTARCH_NAME)) { - LOG.warn("Find x cmd in single tile or head (add it to arch text): " + arch.getArchName()); + log.warn("Find x cmd in single tile or head (add it to arch text): " + arch.getArchName()); arch.addArchText(thisLine + "\n"); } arch.setMultiX(Integer.parseInt(thisLine.substring(2))); } else if (thisLine.regionMatches(0, "y ", 0, 2)) { if (!archmore && !arch.getArchName().equals(STARTARCH_NAME)) { - LOG.warn("Find y cmd in single tile or head (add it to arch text): " + arch.getArchName()); + log.warn("Find y cmd in single tile or head (add it to arch text): " + arch.getArchName()); arch.addArchText(thisLine + "\n"); } arch.setMultiY(Integer.parseInt(thisLine.substring(2))); @@ -394,10 +394,10 @@ final int i = Integer.parseInt(thisLine.substring(5)); arch.setArchTypNr(i); if (i == 0) { - LOG.warn("Arch " + arch.getArchName() + " type number is zero. (" + thisLine.substring(5) + ")"); + log.warn("Arch " + arch.getArchName() + " type number is zero. (" + thisLine.substring(5) + ")"); } } catch (final Exception e) { - LOG.warn("Arch " + arch.getArchName() + " has a invalid type nr. (" + thisLine.substring(5) + ")"); + log.warn("Arch " + arch.getArchName() + " has a invalid type nr. (" + thisLine.substring(5) + ")"); arch.addArchText(thisLine + "\n"); } } else if (thisLine.regionMatches(0, "face ", 0, 5)) { @@ -416,15 +416,15 @@ isNewCategory = true; // this arch has a new category } }arch.addArchText(thisLine + "\n"); - if (LOG.isDebugEnabled()) { - LOG.debug("add String: " + thisLine); + if (log.isDebugEnabled()) { + log.debug("add String: " + thisLine); } } } thisLine2 = myInput.readLine(); } // while loop ends here } catch (final IOException e) { - LOG.error("Error: ", e); + log.error("Error: ", e); } return null; } Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java 2006-09-20 18:48:13 UTC (rev 348) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java 2006-09-22 07:12:46 UTC (rev 349) @@ -67,7 +67,7 @@ */ public final class ArchObjectStack { - private static final Logger LOG = Logger.getLogger(ArchObjectStack.class); + private static final Logger log = Logger.getLogger(ArchObjectStack.class); // load status: is archstack fully loaded? public static final int IS_EMPTY = 0; @@ -239,7 +239,7 @@ public void loadArches() { final Date timeStart = new Date(); // get starting time loadStatus = IS_LOADING; // status: loading - LOG.info("Start to collect arches..."); + log.info("Start to collect arches..."); CMainStatusbar.getInstance().setText(" Loading Arches... "); // browse arch archive @@ -278,8 +278,8 @@ loadStatus = IS_COMPLETE; // status: stack completed final Date timeFinish = new Date(); // get finishing time final long diff = timeFinish.getTime() - timeStart.getTime(); - if (LOG.isInfoEnabled()) { - LOG.info("Arch collect took " + diff / 1000.0 + " Seconds"); + if (log.isInfoEnabled()) { + log.info("Arch collect took " + diff / 1000.0 + " Seconds"); } // load pickmaps @@ -311,7 +311,7 @@ } catch (final FileNotFoundException e) { // no need for a message here, CFileReader takes care of this } catch (final IOException e) { - LOG.error("Error:", e); + log.error("Error:", e); } } @@ -415,8 +415,8 @@ if (animflag) { if (thisLine.regionMatches(0, "mina", 0, 4)) { animflag = false; - if (LOG.isDebugEnabled()) { - LOG.debug("We found this>> name: >" + animName + " \n>" + animText + "<\n"); + if (log.isDebugEnabled()) { + log.debug("We found this>> name: >" + animName + " \n>" + animText + "<\n"); } mainControl.getAnimationObject().addAnimObject(animName, animText); } else { @@ -435,9 +435,9 @@ myInput.close(); } } catch (final FileNotFoundException e) { - LOG.warn("Error opening face file: " + e); + log.warn("Error opening face file: " + e); } catch (final IOException e) { - LOG.warn("Error reading face file: " + e); + log.warn("Error reading face file: " + e); } } @@ -497,7 +497,7 @@ if (l == 10 || !Character.isLetterOrDigit(l) && l != '/') { faceComplete = true; } else { - LOG.debug("face-path contained '.'"); + log.debug("face-path contained '.'"); face += l; if (!crappyFacepath) { crappyFacepath = true; @@ -550,9 +550,9 @@ if (crappyFacepath) { // print message if there were messy face-pathes with '.' - LOG.warn("######"); - LOG.warn("# Some image-paths contain illegal characters in your collected png file '" + IGUIConstants.PNG_FILE + "'"); - LOG.warn("Re-collect the arches for better loading performance."); + log.warn("######"); + log.warn("# Some image-paths contain illegal characters in your collected png file '" + IGUIConstants.PNG_FILE + "'"); + log.warn("Re-collect the arches for better loading performance."); } // close stream @@ -564,9 +564,9 @@ stream.close(); } } catch (final FileNotFoundException e) { - LOG.warn("file " + IGUIConstants.PNG_FILE + " not found!"); + log.warn("file " + IGUIConstants.PNG_FILE + " not found!"); } catch (final IOException e) { - LOG.warn("Read error in file '" + IGUIConstants.PNG_FILE + "'.", e); + log.warn("Read error in file '" + IGUIConstants.PNG_FILE + "'.", e); } } @@ -689,7 +689,7 @@ arch = mainControl.getArch(numList[i]); if (arch.isTail()) { - LOG.error("Collect Error: Multipart Tail in Panel found!"); + log.error("Collect Error: Multipart Tail in Panel found!"); } binFile.writeBytes("Object " + arch.getArchName() + "\n"); @@ -731,11 +731,11 @@ arch = mainControl.getArch(numList[i] + j); if (arch.isHead()) { - LOG.warn("Multipart object is too short!"); + log.warn("Multipart object is too short!"); final ArchObject before = mainControl.getArch(numList[i]); if (before != null) { - LOG.warn("-> " + multiparts + " tails expected for multipart: '" + before.getArchName() + "',"); - LOG.warn(" but arch '" + arch.getArchName() + "' follows on position " + j + " and it's not a tail."); + log.warn("-> " + multiparts + " tails expected for multipart: '" + before.getArchName() + "',"); + log.warn(" but arch '" + arch.getArchName() + "' follows on position " + j + " and it's not a tail."); } } @@ -818,13 +818,13 @@ // check if we still missed any arches if (count - mainControl.getArchCount() != 0) { - LOG.warn((mainControl.getArchCount() - count) + " arches have been missed during collect!"); + log.warn((mainControl.getArchCount() - count) + " arches have been missed during collect!"); } pbar.setValue(count); binFile.close(); } catch (final IOException e) { - LOG.error("Error: Exception collecting: archfile", e); + log.error("Error: Exception collecting: archfile", e); return; } @@ -873,10 +873,10 @@ try { fin1 = new FileInputStream(faceObjects[0].getPath()); } catch (final ArrayIndexOutOfBoundsException e) { - LOG.warn("You have to give me the name of a file to open."); + log.warn("You have to give me the name of a file to open."); return; } catch (final FileNotFoundException e) { - LOG.warn("Could not open input file " + faceObjects[0].getPath()); + log.warn("Could not open input file " + faceObjects[0].getPath()); return; } @@ -885,12 +885,12 @@ try { numBytes = fin1.read(b, 0, 50000); } catch (final IOException e) { - LOG.error("Unexpected exception: ", e); + log.error("Unexpected exception: ", e); return; } if (numBytes == -1) { - LOG.error("Unexpected EOF: " + faceObjects[0].getPath() + " >> " + numBytes); + log.error("Unexpected EOF: " + faceObjects[0].getPath() + " >> " + numBytes); return; } @@ -908,10 +908,10 @@ // try to open the png image file fin2 = new FileInputStream(faceObjects[i].getPath()); } catch (final ArrayIndexOutOfBoundsException e) { - LOG.warn("You have to give me the name of a file to open."); + log.warn("You have to give me the name of a file to open."); return; } catch (final FileNotFoundException e) { - LOG.warn("Could not open input file " + faceObjects[i].getPath()); + log.warn("Could not open input file " + faceObjects[i].getPath()); return; } @@ -919,12 +919,12 @@ // read size and byte-data from png file numBytes = fin2.read(b, 0, 50000); } catch (final IOException e) { - LOG.error("Unexpected exception ", e); + log.error("Unexpected exception ", e); return; } if (numBytes == -1) { - LOG.warn("Unexpected EOF: " + faceObjects[i].getPath() + " >> " + numBytes); + log.warn("Unexpected EOF: " + faceObjects[i].getPath() + " >> " + numBytes); return; } @@ -960,7 +960,7 @@ // close png file binFile.close(); } catch (final IOException e) { - LOG.error("Exception collecting images", e); + log.error("Exception collecting images", e); } CMainStatusbar.getInstance().setText("Collect Arches: done."); Modified: trunk/crossfire/src/cfeditor/filter/AttributeFilter.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/AttributeFilter.java 2006-09-20 18:48:13 UTC (rev 348) +++ trunk/crossfire/src/cfeditor/filter/AttributeFilter.java 2006-09-22 07:12:46 UTC (rev 349) @@ -28,7 +28,7 @@ */ public class AttributeFilter implements Filter { - private static final Logger LOG = Logger.getLogger(AttributeFilter.class); + private static final Logger log = Logger.getLogger(AttributeFilter.class); private final Map<String, String> attrList; @@ -72,9 +72,9 @@ } if (matchType >= 0) { hasChecked = true; - if (LOG.isDebugEnabled()) { - LOG.debug("checking type for " + object.getBestName()); - LOG.debug("o.getArchTypNr() != matchType: " + object.getArchTypNr() + " != " + matchType); + if (log.isDebugEnabled()) { + log.debug("checking type for " + object.getBestName()); + log.debug("o.getArchTypNr() != matchType: " + object.getArchTypNr() + " != " + matchType); } if (object.getArchTypNr() != matchType) { return false; @@ -95,7 +95,7 @@ /** {@inheritDoc} */ public FilterConfig createConfig() { - LOG.debug("CreateConfig"); + log.debug("CreateConfig"); return new SimpleFilterConfig(); } Modified: trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java 2006-09-20 18:48:13 UTC (rev 348) +++ trunk/crossfire/src/cfeditor/filter/BasicFilterConfig.java 2006-09-22 07:12:46 UTC (rev 349) @@ -19,7 +19,7 @@ @SuppressWarnings({"AbstractClassWithoutAbstractMethods"}) public abstract class BasicFilterConfig implements FilterConfig { - private static final Logger LOG = Logger.getLogger(BasicFilterConfig.class); + private static final Logger log = Logger.getLogger(BasicFilterConfig.class); private boolean enabled = false; @@ -28,16 +28,16 @@ public void setEnabled(final boolean enabled) { this.enabled = enabled; if (enabled) { - if (LOG.isDebugEnabled()) { - LOG.debug("enabling filter " + this); + if (log.isDebugEnabled()) { + log.debug("enabling filter " + this); } if (!enabled) { final ConfigEvent e = new ConfigEvent(ConfigEventType.ENABLE, this); fireEvent(e); } } else { - if (LOG.isDebugEnabled()) { - LOG.debug("disabling filter " + this); + if (log.isDebugEnabled()) { + log.debug("disabling filter " + this); } if (enabled) { final ConfigEvent e = new ConfigEvent(ConfigEventType.DISABLE, this); Modified: trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java 2006-09-20 18:48:13 UTC (rev 348) +++ trunk/crossfire/src/cfeditor/filter/NamedFilterConfig.java 2006-09-22 07:12:46 UTC (rev 349) @@ -24,7 +24,7 @@ private final Map<String, FilterConfig> map = new Has... [truncated message content] |
From: <aki...@us...> - 2006-09-22 07:19:25
|
Revision: 350 http://svn.sourceforge.net/gridarta/?rev=350&view=rev Author: akirschbaum Date: 2006-09-22 00:19:15 -0700 (Fri, 22 Sep 2006) Log Message: ----------- Rename variable names. Modified Paths: -------------- trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java trunk/daimonin/src/daieditor/arch/ArchObjectParser.java Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-09-22 07:12:46 UTC (rev 349) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-09-22 07:19:15 UTC (rev 350) @@ -176,21 +176,21 @@ } } - public void parseDefArchFromStream(final BufferedReader myInput, final int index) { - parseDefArchFromStream(myInput, null, null, null, index); + public void parseDefArchFromStream(final BufferedReader in, final int index) { + parseDefArchFromStream(in, null, null, null, index); } /** * Here we take a default arch from a filestream, parses the data and * put the result on the arch stack in CMainControl. - * @param myInput <code>BufferedReader</code> file stream of arch data + * @param in <code>BufferedReader</code> file stream of arch data * @param defArch default arch (only for artifacts) * @param line first line, pre-parsed (only for artifacts) * @param archName arch-object name (only for artifacts) * @param index current index on the ArchPanel */ @Nullable - public ArchObject parseDefArchFromStream(final BufferedReader myInput, final ArchObject defArch, final String line, final String archName, int index) { + public ArchObject parseDefArchFromStream(final BufferedReader in, final ArchObject defArch, final String line, final String archName, int index) { //Open the file for reading try { @@ -207,7 +207,7 @@ String thisLine2; if (line == null) { - thisLine2 = myInput.readLine(); + thisLine2 = in.readLine(); } else { thisLine2 = line; // pre read "Object" from artifacts file loader } @@ -227,7 +227,7 @@ if (thisLine.regionMatches(0, "#", 0, 1)) { // skip comments - thisLine2 = myInput.readLine(); + thisLine2 = in.readLine(); continue; } @@ -421,7 +421,7 @@ } } } - thisLine2 = myInput.readLine(); + thisLine2 = in.readLine(); } // while loop ends here } catch (final IOException e) { log.error("Error: ", e); Modified: trunk/daimonin/src/daieditor/arch/ArchObjectParser.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectParser.java 2006-09-22 07:12:46 UTC (rev 349) +++ trunk/daimonin/src/daieditor/arch/ArchObjectParser.java 2006-09-22 07:19:15 UTC (rev 350) @@ -76,12 +76,12 @@ public void parseDefArch(final String fname, final int index) { //Open the file for reading try { - final BufferedReader myInput = new BufferedReader(new FileReader(fname)); + final BufferedReader in = new BufferedReader(new FileReader(fname)); try { // do the actual parsing - parseDefArchFromStream(myInput, index, fname); + parseDefArchFromStream(in, index, fname); } finally { - myInput.close(); + in.close(); } } catch (final FileNotFoundException e) { log.log(Level.WARNING, "archfileNotFound", fname); @@ -90,14 +90,14 @@ } } - public void parseDefArchFromStream(final BufferedReader myInput, final int index, final String fname) throws IOException { - parseDefArchFromStream(myInput, null, null, null, index, fname); + public void parseDefArchFromStream(final BufferedReader in, final int index, final String fname) throws IOException { + parseDefArchFromStream(in, null, null, null, index, fname); } /** * Here we take a default arch from a filestream, parses the data and * put the result on the arch stack in CMainControl. - * @param myInput <code>BufferedReader</code> file stream of arch data + * @param in <code>BufferedReader</code> file stream of arch data * @param defArch default arch (only for artifacts) * @param line first line, pre-parsed (only for artifacts) * @param archName arch-object name (only for artifacts) @@ -106,7 +106,7 @@ * @throws IOException in case of I/O problems */ @Nullable @SuppressWarnings({"StringContatenationInLoop", "ObjectAllocationInLoop"}) - public ArchObject parseDefArchFromStream(final BufferedReader myInput, @Nullable final ArchObject defArch, @Nullable final String line, @Nullable final String archName, /* TODO: final*/ int index, final String fname) throws IOException { + public ArchObject parseDefArchFromStream(final BufferedReader in, @Nullable final ArchObject defArch, @Nullable final String line, @Nullable final String archName, /* TODO: final*/ int index, final String fname) throws IOException { // start with new clean ArchObject instance ArchObject arch; ArchObject archlast = null; @@ -139,7 +139,7 @@ String thisLine2; if (line == null) { - thisLine2 = myInput.readLine(); + thisLine2 = in.readLine(); } else { thisLine2 = line; // pre read "Object" from artifacts file loader } @@ -159,7 +159,7 @@ if (!msgflag && thisLine.startsWith("#")) { // skip comments (only outside msges) - thisLine2 = myInput.readLine(); + thisLine2 = in.readLine(); continue; } @@ -398,7 +398,7 @@ //System.err.println("add String: "+thisLine); } } - thisLine2 = myInput.readLine(); + thisLine2 = in.readLine(); } // while loop ends here return null; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-22 07:30:24
|
Revision: 352 http://svn.sourceforge.net/gridarta/?rev=352&view=rev Author: akirschbaum Date: 2006-09-22 00:30:15 -0700 (Fri, 22 Sep 2006) Log Message: ----------- Unify string/char/int constants. Modified Paths: -------------- trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java trunk/daimonin/src/daieditor/arch/ArchObjectParser.java Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-09-22 07:23:08 UTC (rev 351) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-09-22 07:30:15 UTC (rev 352) @@ -447,7 +447,7 @@ boolean scriptflag = false; for (int i = 0, s = 0; i < len; i++) { - if (text.charAt(i) == 0x0a) { + if (text.charAt(i) == '\n') { if (i - s > 0) { if (scriptflag) { arch.addArchText(text.substring(s, i) + "\n"); @@ -506,7 +506,7 @@ arch.resetArchText(); for (int i = 0, s = 0; i < len; i++) { - if (text.charAt(i) == 0x0a) { + if (text.charAt(i) == '\n') { if (i - s > 0) { if (text.regionMatches(s, "name ", 0, 5)) { arch.setObjName(text.substring(s + 5, i)); Modified: trunk/daimonin/src/daieditor/arch/ArchObjectParser.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectParser.java 2006-09-22 07:23:08 UTC (rev 351) +++ trunk/daimonin/src/daieditor/arch/ArchObjectParser.java 2006-09-22 07:30:15 UTC (rev 352) @@ -192,7 +192,7 @@ if (thisLine.startsWith("endmsg")) { msgflag = false; } else { - arch.addMsgText(thisLine2 + '\n'); // thisLine2 allows leading whitespaces + arch.addMsgText(thisLine2 + "\n"); // thisLine2 allows leading whitespaces } } else if (animflag) { if (thisLine.startsWith("mina")) { @@ -204,14 +204,14 @@ log.log(Level.WARNING, "duplicateAnimation", e); } - arch.addArchText("animation " + arch.getArchName() + '\n'); + arch.addArchText("animation " + arch.getArchName() + "\n"); arch.setAnimName(arch.getArchName()); // here we must add this to AnimationObject // and add Animation cmd here! animflag = false; } else { - animText.append(thisLine).append('\n'); + animText.append(thisLine).append("\n"); } } else if (thisLine.startsWith("Object")) { log.log(Level.WARNING, "inventoryInDefArch", thisLine); @@ -308,12 +308,12 @@ if (thisLine.startsWith("msg")) { msgflag = true; } else if (thisLine.startsWith("animation ")) { - arch.addArchText(thisLine + '\n'); + arch.addArchText(thisLine + "\n"); final String animName = thisLine.substring(10).trim(); arch.setAnimName(animName); //arch.setAnimNr(mainControl.animationObjects.findAnimObject(animName)); // probably not needed, but better not delete it yet } else if (thisLine.startsWith("anim_speed ")) { - arch.addArchText(thisLine + '\n'); + arch.addArchText(thisLine + "\n"); } else if (thisLine.startsWith("anim")) { animflag = true; animText = new StringBuilder(); @@ -328,13 +328,13 @@ } else if (thisLine.startsWith("x ")) { if (!archmore && !arch.getArchName().equals(STARTARCH_NAME)) { log.log(Level.WARNING, "foundCoordInDefArchSingleTileOrHead", new Object[]{"x", arch.getArchName()}); - arch.addArchText(thisLine + '\n'); + arch.addArchText(thisLine + "\n"); } arch.setRefX(Integer.parseInt(thisLine.substring(2))); } else if (thisLine.startsWith("y ")) { if (!archmore && !arch.getArchName().equals(STARTARCH_NAME)) { log.log(Level.WARNING, "foundCoordInDefArchSingleTileOrHead", new Object[]{"y", arch.getArchName()}); - arch.addArchText(thisLine + '\n'); + arch.addArchText(thisLine + "\n"); } arch.setRefY(Integer.parseInt(thisLine.substring(2))); } else if (thisLine.startsWith("type ")) { @@ -346,7 +346,7 @@ } } catch (final NumberFormatException e) { log.log(Level.WARNING, "defArchWithInvalidTypeNr", new Object[]{arch.getArchName(), thisLine.substring(5)}); - arch.addArchText(thisLine + '\n'); + arch.addArchText(thisLine + "\n"); } } else if (thisLine.startsWith("direction ")) { try { @@ -354,7 +354,7 @@ } catch (final NumberFormatException e) { log.log(Level.WARNING, "defArchWithInvalidDirection", new Object[]{arch.getArchName(), thisLine.substring(10)}); } - arch.addArchText(thisLine + '\n'); + arch.addArchText(thisLine + "\n"); } else if (thisLine.startsWith("face ")) { int x; for (x = 4; x < thisLine.length(); x++) { @@ -363,7 +363,7 @@ } } arch.setFaceRealName(thisLine.substring(x, thisLine.length())); - arch.addArchText(thisLine + '\n'); + arch.addArchText(thisLine + "\n"); } else if (thisLine.startsWith("editor_folder ")) { // the display category (= "folder" the arch belongs to) newCat = thisLine.substring(14).trim(); @@ -381,7 +381,7 @@ } } catch (final NumberFormatException e) { System.err.println("WARNING: Arch " + arch.getArchName() + " has a invalid mpart_id (" + thisLine.substring(9) + ')'); - arch.addArchText(thisLine + '\n'); + arch.addArchText(thisLine + "\n"); } } else if (thisLine.startsWith("mpart_nr ")) { // part nr for multiparts @@ -390,10 +390,10 @@ arch.setMultiPartNr(i); } catch (final NumberFormatException e) { System.err.println("WARNING: Arch " + arch.getArchName() + " has a invalid mpart_nr (" + thisLine.substring(9) + ')'); - arch.addArchText(thisLine + '\n'); + arch.addArchText(thisLine + "\n"); } } else { - arch.addArchText(thisLine + '\n'); + arch.addArchText(thisLine + "\n"); } //System.err.println("add String: "+thisLine); } @@ -424,19 +424,19 @@ if (text.charAt(i) == '\n') { if (i - s > 0) { if (scriptflag) { - arch.addArchText(text.substring(s, i) + '\n'); + arch.addArchText(text.substring(s, i) + "\n"); if (text.regionMatches(s, "end_script_", 0, 11)) { scriptflag = false; } } else if (text.regionMatches(s, "start_script_", 0, 13)) { - arch.addArchText(text.substring(s, i) + '\n'); + arch.addArchText(text.substring(s, i) + "\n"); scriptflag = true; } else if (text.regionMatches(s, "editable ", 0, 9)) { arch.setEditType(Integer.parseInt(text.substring(s + 9, i))); } else if (text.regionMatches(s, "name ", 0, 5)) { arch.setObjName(text.substring(s + 5, i)); } else { - arch.addArchText(text.substring(s, i) + '\n'); + arch.addArchText(text.substring(s, i) + "\n"); } } @@ -486,12 +486,12 @@ if (i - s > 0) { if (text.regionMatches(s, "animation ", 0, 9)) { arch.setAnimName(text.substring(s + 10, i)); - arch.addArchText(text.substring(s, i) + '\n'); + arch.addArchText(text.substring(s, i) + "\n"); } else if (text.regionMatches(s, "name ", 0, 5)) { arch.setObjName(text.substring(s + 5, i)); } else { // this is an unparsed arch attribute, it has to stay in the archtext - arch.addArchText(text.substring(s, i) + '\n'); + arch.addArchText(text.substring(s, i) + "\n"); } } s = i + 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-23 06:01:19
|
Revision: 357 http://svn.sourceforge.net/gridarta/?rev=357&view=rev Author: akirschbaum Date: 2006-09-22 23:01:11 -0700 (Fri, 22 Sep 2006) Log Message: ----------- Add spaces around binary operators. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapFileDecode.java trunk/daimonin/src/daieditor/CMapFileDecode.java Modified: trunk/crossfire/src/cfeditor/CMapFileDecode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-09-23 05:54:34 UTC (rev 356) +++ trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-09-23 06:01:11 UTC (rev 357) @@ -178,7 +178,7 @@ arch.addMsgText(thisLine2 + "\n"); } } else if (animflag) { - //arch.addArchText(thisLine+"\n"); + //arch.addArchText(thisLine + "\n"); if (thisLine.regionMatches(0, "mina", 0, 4)) { animflag = false; } else { // we not include anim yet in panel @@ -205,7 +205,7 @@ } return arch; } else if (thisLine.regionMatches(0, "msg", 0, 3)) { - // arch.addArchText(thisLine+"\n"); + // arch.addArchText(thisLine + "\n"); arch.addMsgText(""); // this init the msg text buffer // in the case of msg/endmsg // with no content to overrule def msg @@ -216,7 +216,7 @@ } else if (thisLine.regionMatches(0, "anim_speed", 0, 10)) { arch.addArchText(thisLine + "\n"); } else if (thisLine.regionMatches(0, "anim", 0, 4)) { - //arch.addArchText(thisLine+"\n"); + //arch.addArchText(thisLine + "\n"); animflag = true; } else if (thisLine.startsWith("event_")) { // here's something about a scripted event Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-09-23 05:54:34 UTC (rev 356) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-09-23 06:01:11 UTC (rev 357) @@ -150,15 +150,15 @@ // ok, we had a full arch... don't care here about map or object // now we test for a new arch - thats stuf in inventory // or the end... thats the end of this shit - //System.err.println("GO INVENTORY: "+arch+" - "+thisLine); + //System.err.println("GO INVENTORY: " + arch + " - " + thisLine); arch.addLast(readArch(myInput, thisLine)); - //System.err.println("GO INVENTORY2: "+arch+" - "+thisLine); + //System.err.println("GO INVENTORY2: " + arch + " - " + thisLine); } else if (thisLine.startsWith("end")) { // chain this to temp list objects.add(arch); archflag = false; - // System.err.println("LEAVE!: "+arch+" - "+thisLine); + // System.err.println("LEAVE!: " + arch + " - " + thisLine); return arch; } else if (thisLine.startsWith("msg")) { arch.addMsgText(""); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-09-23 06:33:29
|
Revision: 361 http://svn.sourceforge.net/gridarta/?rev=361&view=rev Author: akirschbaum Date: 2006-09-22 23:33:20 -0700 (Fri, 22 Sep 2006) Log Message: ----------- Unify comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java trunk/daimonin/src/daieditor/arch/ArchObjectParser.java Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-09-23 06:28:35 UTC (rev 360) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectParser.java 2006-09-23 06:33:20 UTC (rev 361) @@ -591,9 +591,9 @@ /** * Sort the temp list of arches, placing all multiparts at the end. * This is neccessary to assure multiparts are always on top. - * Note: This method assumes that all pieces of one multipart are - * listed in a row. (Which is okay as long as the loader puts it that way.) - * @param objects list of arches + * @param objects list of objects + * @note This method assumes that all pieces of one multipart are listed in + * a row, which is okay as long as the loader puts it that way. */ public static void sortTempList(final List<ArchObject> objects) { final Comparator<ArchObject> sorter = new Comparator<ArchObject>() { Modified: trunk/daimonin/src/daieditor/arch/ArchObjectParser.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectParser.java 2006-09-23 06:28:35 UTC (rev 360) +++ trunk/daimonin/src/daieditor/arch/ArchObjectParser.java 2006-09-23 06:33:20 UTC (rev 361) @@ -586,7 +586,6 @@ * @param objects list of objects * @note This method assumes that all pieces of one multipart are listed in * a row, which is okay as long as the loader puts it that way. - * @note The returned list is the same list, not a new list. */ public static void sortTempList(final List<ArchObject> objects) { final Comparator<ArchObject> sorter = new Comparator<ArchObject>() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-09-23 11:31:17
|
Revision: 363 http://svn.sourceforge.net/gridarta/?rev=363&view=rev Author: christianhujer Date: 2006-09-23 04:31:03 -0700 (Sat, 23 Sep 2006) Log Message: ----------- Added performance test stuff. Added Paths: ----------- trunk/teststuff/ trunk/teststuff/perfTest/ trunk/teststuff/perfTest/PerfTest.java trunk/teststuff/perfTest/PerfTestMapDecode.java trunk/teststuff/perfTest/foo trunk/teststuff/perfTest/foo2 Added: trunk/teststuff/perfTest/PerfTest.java =================================================================== --- trunk/teststuff/perfTest/PerfTest.java (rev 0) +++ trunk/teststuff/perfTest/PerfTest.java 2006-09-23 11:31:03 UTC (rev 363) @@ -0,0 +1,9 @@ +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Retention; +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface PerfTest { + String value(); +} Property changes on: trunk/teststuff/perfTest/PerfTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/teststuff/perfTest/PerfTestMapDecode.java =================================================================== --- trunk/teststuff/perfTest/PerfTestMapDecode.java (rev 0) +++ trunk/teststuff/perfTest/PerfTestMapDecode.java 2006-09-23 11:31:03 UTC (rev 363) @@ -0,0 +1,904 @@ +import java.io.*; +import java.nio.*; +import java.nio.channels.*; +import java.nio.charset.*; +import java.util.*; +import java.lang.reflect.*; +import java.util.regex.*; + +class LongValueComparator implements Comparator<Map.Entry<Method, Long>> { + + public int compare(final Map.Entry<Method, Long> o1, final Map.Entry<Method, Long> o2) { + final long d = o1.getValue() - o2.getValue(); + return + d < 0 ? -1 : + d > 0 ? +2 : + o1.getKey().getName().compareTo(o2.getKey().getName()); + } + + private LongValueComparator() { + } + + private static LongValueComparator instance = new LongValueComparator(); + + public static Comparator<Map.Entry<Method, Long>> getInstance() { + return instance; + } +} + +public class PerfTestMapDecode { + + public static final int NUM_OF_TEST_REPETITIONS = 200; + + private static String testFileName; + public static int sum; + + private static Pattern lineSplit = Pattern.compile("\n"); + private static Pattern wordSplit = Pattern.compile("\\s+"); + + public static void main(final String... args) throws Throwable { + testFileName = args[0]; + final List<Method> performanceTestMethods = new ArrayList<Method>(); + for (final Method method : PerfTestMapDecode.class.getMethods()) { + if (method.getAnnotation(PerfTest.class) != null) { + performanceTestMethods.add(method); + } + } + Collections.shuffle(performanceTestMethods); + final Map<Method, Long> results = new HashMap<Method, Long>(); + final List<Integer> sums = new ArrayList<Integer>(); + for (final Method performanceTestMethod : performanceTestMethods) { + sum = 0; + performanceTestMethod.invoke(null); + final long start = System.currentTimeMillis(); + for (int i = 0; i < NUM_OF_TEST_REPETITIONS; i++) { + performanceTestMethod.invoke(null); + } + sums.add(sum); + final long end = System.currentTimeMillis(); + final long time = end - start; + results.put(performanceTestMethod, time); + //System.out.println(sum + " " + performanceTestMethod); + } + final SortedSet<Map.Entry<Method, Long>> sortedResults = new TreeSet<Map.Entry<Method, Long>>(LongValueComparator.getInstance()); + sortedResults.addAll(results.entrySet()); + for (final Map.Entry<Method, Long> result : sortedResults) { + final Method performanceTestMethod = result.getKey(); + final long time = result.getValue(); + System.out.printf("%24s %05dms %s%n", performanceTestMethod.getName(), time, performanceTestMethod.getAnnotation(PerfTest.class).value()); + } + //System.out.println(sums); + } + + @PerfTest("BufferedReader, regionMatches (old)") + public static void old() throws IOException { + final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(testFileName), "iso-8859-1")); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + if (line.regionMatches(0, "arch ", 0, 5)) { + state += 1; + } else if (line.regionMatches(0, "endmsg", 0, 6)) { + state += 2; + } else if (line.regionMatches(0, "end", 0, 3)) { + state += 3; + } else if (line.regionMatches(0, "msg", 0, 3)) { + state += 4; + } else if (line.regionMatches(0, "x ", 0, 2)) { + state += 5; + } else if (line.regionMatches(0, "y ", 0, 2)) { + state += 6; + } else if (line.regionMatches(0, "type ", 0, 5)) { + state += 7; + } else if (line.regionMatches(0, "direction ", 0, 10)) { + state += 8; + } else if (line.regionMatches(0, "face ", 0, 5)) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + } + + @PerfTest("BufferedReader, startsWith (current)") + public static void current() throws IOException { + final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(testFileName), "iso-8859-1")); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + if (line.startsWith("arch ")) { + state += 1; + } else if (line.startsWith("endmsg")) { + state += 2; + } else if (line.startsWith("end")) { + state += 3; + } else if (line.startsWith("msg")) { + state += 4; + } else if (line.startsWith("x ")) { + state += 5; + } else if (line.startsWith("y ")) { + state += 6; + } else if (line.startsWith("type ")) { + state += 7; + } else if (line.startsWith("direction ")) { + state += 8; + } else if (line.startsWith("face ")) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + } + + @PerfTest("BufferedReader, word by regex split of java.lang.String") + public static void splitEqualsString() throws IOException { + final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(testFileName), "iso-8859-1")); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + final String word = line.split("\\s+")[0]; + if ("arch".equals(word)) { + state += 1; + } else if ("endmsg".equals(word)) { + state += 2; + } else if ("end".equals(word)) { + state += 3; + } else if ("msg".equals(word)) { + state += 4; + } else if ("x".equals(word)) { + state += 5; + } else if ("y".equals(word)) { + state += 6; + } else if ("type".equals(word)) { + state += 7; + } else if ("direction".equals(word)) { + state += 8; + } else if ("face".equals(word)) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + } + + @PerfTest("BufferedReader, word by regex split of java.util.regex.Pattern") + public static void splitEqualsPattern() throws IOException { + final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(testFileName), "iso-8859-1")); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + final String word = wordSplit.split(line)[0]; + if ("arch".equals(word)) { + state += 1; + } else if ("endmsg".equals(word)) { + state += 2; + } else if ("end".equals(word)) { + state += 3; + } else if ("msg".equals(word)) { + state += 4; + } else if ("x".equals(word)) { + state += 5; + } else if ("y".equals(word)) { + state += 6; + } else if ("type".equals(word)) { + state += 7; + } else if ("direction".equals(word)) { + state += 8; + } else if ("face".equals(word)) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + } + + @PerfTest("BufferedReader, manual word split using String.indexOf(' ')") + public static void manualEquals() throws IOException { + final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(testFileName), "iso-8859-1")); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + final int indexOfSpace = line.indexOf(' '); + final String word = indexOfSpace > 0 ? line.substring(0, indexOfSpace) : line; + if ("arch".equals(word)) { + state += 1; + } else if ("endmsg".equals(word)) { + state += 2; + } else if ("end".equals(word)) { + state += 3; + } else if ("msg".equals(word)) { + state += 4; + } else if ("x".equals(word)) { + state += 5; + } else if ("y".equals(word)) { + state += 6; + } else if ("type".equals(word)) { + state += 7; + } else if ("direction".equals(word)) { + state += 8; + } else if ("face".equals(word)) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + } + + @PerfTest("BufferedReader, manual word split using String.indexOf(' ') using hashCode") + public static void manualEqualsHash() throws IOException { + final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(testFileName), "iso-8859-1")); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + final int indexOfSpace = line.indexOf(' '); + final String word = indexOfSpace > 0 ? line.substring(0, indexOfSpace) : line; + final int hash = word.hashCode(); + if ("arch".hashCode() == hash) { + state += 1; + } else if ("endmsg".hashCode() == hash) { + state += 2; + } else if ("end".hashCode() == hash) { + state += 3; + } else if ("msg".hashCode() == hash) { + state += 4; + } else if ("x".hashCode() == hash) { + state += 5; + } else if ("y".hashCode() == hash) { + state += 6; + } else if ("type".hashCode() == hash) { + state += 7; + } else if ("direction".hashCode() == hash) { + state += 8; + } else if ("face".hashCode() == hash) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + } + + private static final int hashArch = "arch".hashCode(); + private static final int hashEndmsg = "endmsg".hashCode(); + private static final int hashEnd = "end".hashCode(); + private static final int hashMsg = "msg".hashCode(); + private static final int hashX = "x".hashCode(); + private static final int hashY = "y".hashCode(); + private static final int hashType = "type".hashCode(); + private static final int hashDirection = "direction".hashCode(); + private static final int hashFace = "face".hashCode(); + + private static final int[] hashes = { + hashArch, + hashEndmsg, + hashEnd, + hashMsg, + hashX, + hashY, + hashType, + hashDirection, + hashFace + }; + + @PerfTest("BufferedReader, manual word split using String.indexOf(' ') using a cached hashCode") + public static void manualEqualsCashedHash() throws IOException { + final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(testFileName), "iso-8859-1")); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + final int indexOfSpace = line.indexOf(' '); + final String word = indexOfSpace > 0 ? line.substring(0, indexOfSpace) : line; + final int hash = word.hashCode(); + if (hash == hashArch) { + state += 1; + } else if (hash == hashEndmsg) { + state += 2; + } else if (hash == hashEnd) { + state += 3; + } else if (hash == hashMsg) { + state += 4; + } else if (hash == hashX) { + state += 5; + } else if (hash == hashY) { + state += 6; + } else if (hash == hashType) { + state += 7; + } else if (hash == hashDirection) { + state += 8; + } else if (hash == hashFace) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + } + + @PerfTest("BufferedReader, manual word split using String.indexOf(' ') using a cached hashCode via switch") + public static void manualEqualsCashedHashSwitch() throws IOException { + final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(testFileName), "iso-8859-1")); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + final int indexOfSpace = line.indexOf(' '); + final String word = indexOfSpace > 0 ? line.substring(0, indexOfSpace) : line; + final int hash = word.hashCode(); + int hashIndex; + for (hashIndex = 0; hashIndex < hashes.length; hashIndex++) { + if (hashes[hashIndex] == hash) + break; + } + switch (hashIndex) { + case 0: + state += 1; break; + case 1: + state += 2; break; + case 2: + state += 3; break; + case 3: + state += 4; break; + case 4: + state += 5; break; + case 5: + state += 6; break; + case 6: + state += 7; break; + case 7: + state += 8; break; + case 8: + state += 9; break; + } + } + } finally { + in.close(); + } + sum += state; + } + + /*@PerfTest("RandomAccessFile, startsWith") + public static void currentRA() throws IOException { + final RandomAccessFile in = new RandomAccessFile(testFileName, "r"); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + if (line.startsWith("arch ")) { + state += 1; + } else if (line.startsWith("endmsg")) { + state += 2; + } else if (line.startsWith("end")) { + state += 3; + } else if (line.startsWith("msg")) { + state += 4; + } else if (line.startsWith("x ")) { + state += 5; + } else if (line.startsWith("y ")) { + state += 6; + } else if (line.startsWith("type ")) { + state += 7; + } else if (line.startsWith("direction ")) { + state += 8; + } else if (line.startsWith("face ")) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + }*/ + + /*@PerfTest("RandomAccessFile, word by regex split of java.lang.String") + public static void splitEqualsStringRA() throws IOException { + final RandomAccessFile in = new RandomAccessFile(testFileName, "r"); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + final String word = line.split("\\s+")[0]; + if ("arch".equals(word)) { + state += 1; + } else if ("endmsg".equals(word)) { + state += 2; + } else if ("end".equals(word)) { + state += 3; + } else if ("msg".equals(word)) { + state += 4; + } else if ("x".equals(word)) { + state += 5; + } else if ("y".equals(word)) { + state += 6; + } else if ("type".equals(word)) { + state += 7; + } else if ("direction".equals(word)) { + state += 8; + } else if ("face".equals(word)) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + }*/ + + /*@PerfTest("RandomAccessFile, word by regex split of java.util.regex.Pattern") + public static void splitEqualsPatternRA() throws IOException { + final RandomAccessFile in = new RandomAccessFile(testFileName, "r"); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + final String word = wordSplit.split(line)[0]; + if ("arch".equals(word)) { + state += 1; + } else if ("endmsg".equals(word)) { + state += 2; + } else if ("end".equals(word)) { + state += 3; + } else if ("msg".equals(word)) { + state += 4; + } else if ("x".equals(word)) { + state += 5; + } else if ("y".equals(word)) { + state += 6; + } else if ("type".equals(word)) { + state += 7; + } else if ("direction".equals(word)) { + state += 8; + } else if ("face".equals(word)) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + }*/ + + /*@PerfTest("RandomAccessFile, manual word split using String.indexOf(' ')") + public static void manualEqualsRA() throws IOException { + final RandomAccessFile in = new RandomAccessFile(testFileName, "r"); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + final int indexOfSpace = line.indexOf(' '); + final String word = indexOfSpace > 0 ? line.substring(0, indexOfSpace) : line; + if ("arch".equals(word)) { + state += 1; + } else if ("endmsg".equals(word)) { + state += 2; + } else if ("end".equals(word)) { + state += 3; + } else if ("msg".equals(word)) { + state += 4; + } else if ("x".equals(word)) { + state += 5; + } else if ("y".equals(word)) { + state += 6; + } else if ("type".equals(word)) { + state += 7; + } else if ("direction".equals(word)) { + state += 8; + } else if ("face".equals(word)) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + }*/ + + /*@PerfTest("DataInputStream, startsWith (current)") + public static void currentDI() throws IOException { + final DataInputStream in = new DataInputStream(new FileInputStream(testFileName)); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + if (line.startsWith("arch ")) { + state += 1; + } else if (line.startsWith("endmsg")) { + state += 2; + } else if (line.startsWith("end")) { + state += 3; + } else if (line.startsWith("msg")) { + state += 4; + } else if (line.startsWith("x ")) { + state += 5; + } else if (line.startsWith("y ")) { + state += 6; + } else if (line.startsWith("type ")) { + state += 7; + } else if (line.startsWith("direction ")) { + state += 8; + } else if (line.startsWith("face ")) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + }*/ + + /*@PerfTest("DataInputStream, word by regex split of java.lang.String") + public static void splitEqualsStringDI() throws IOException { + final DataInputStream in = new DataInputStream(new FileInputStream(testFileName)); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + final String word = line.split("\\s+")[0]; + if ("arch".equals(word)) { + state += 1; + } else if ("endmsg".equals(word)) { + state += 2; + } else if ("end".equals(word)) { + state += 3; + } else if ("msg".equals(word)) { + state += 4; + } else if ("x".equals(word)) { + state += 5; + } else if ("y".equals(word)) { + state += 6; + } else if ("type".equals(word)) { + state += 7; + } else if ("direction".equals(word)) { + state += 8; + } else if ("face".equals(word)) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + }*/ + + /*@PerfTest("DataInputStream, word by regex split of java.util.regex.Pattern") + public static void splitEqualsPatternDI() throws IOException { + final DataInputStream in = new DataInputStream(new FileInputStream(testFileName)); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + final String word = wordSplit.split(line)[0]; + if ("arch".equals(word)) { + state += 1; + } else if ("endmsg".equals(word)) { + state += 2; + } else if ("end".equals(word)) { + state += 3; + } else if ("msg".equals(word)) { + state += 4; + } else if ("x".equals(word)) { + state += 5; + } else if ("y".equals(word)) { + state += 6; + } else if ("type".equals(word)) { + state += 7; + } else if ("direction".equals(word)) { + state += 8; + } else if ("face".equals(word)) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + }*/ + + /*@PerfTest("DataInputStream, manual word split using String.indexOf(' ')") + public static void manualEqualsDI() throws IOException { + final DataInputStream in = new DataInputStream(new FileInputStream(testFileName)); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + final int indexOfSpace = line.indexOf(' '); + final String word = indexOfSpace > 0 ? line.substring(0, indexOfSpace) : line; + if ("arch".equals(word)) { + state += 1; + } else if ("endmsg".equals(word)) { + state += 2; + } else if ("end".equals(word)) { + state += 3; + } else if ("msg".equals(word)) { + state += 4; + } else if ("x".equals(word)) { + state += 5; + } else if ("y".equals(word)) { + state += 6; + } else if ("type".equals(word)) { + state += 7; + } else if ("direction".equals(word)) { + state += 8; + } else if ("face".equals(word)) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + }*/ + + /*@PerfTest("Buffered DataInputStream, startsWith (current)") + public static void currentBDI() throws IOException { + final DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(testFileName))); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + if (line.startsWith("arch ")) { + state += 1; + } else if (line.startsWith("endmsg")) { + state += 2; + } else if (line.startsWith("end")) { + state += 3; + } else if (line.startsWith("msg")) { + state += 4; + } else if (line.startsWith("x ")) { + state += 5; + } else if (line.startsWith("y ")) { + state += 6; + } else if (line.startsWith("type ")) { + state += 7; + } else if (line.startsWith("direction ")) { + state += 8; + } else if (line.startsWith("face ")) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + }*/ + + /*@PerfTest("Buffered DataInputStream, word by regex split of java.lang.String") + public static void splitEqualsStringBDI() throws IOException { + final DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(testFileName))); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + final String word = line.split("\\s+")[0]; + if ("arch".equals(word)) { + state += 1; + } else if ("endmsg".equals(word)) { + state += 2; + } else if ("end".equals(word)) { + state += 3; + } else if ("msg".equals(word)) { + state += 4; + } else if ("x".equals(word)) { + state += 5; + } else if ("y".equals(word)) { + state += 6; + } else if ("type".equals(word)) { + state += 7; + } else if ("direction".equals(word)) { + state += 8; + } else if ("face".equals(word)) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + }*/ + + /*@PerfTest("Buffered DataInputStream, word by regex split of java.util.regex.Pattern") + public static void splitEqualsPatternBDI() throws IOException { + final DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(testFileName))); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + final String word = wordSplit.split(line)[0]; + if ("arch".equals(word)) { + state += 1; + } else if ("endmsg".equals(word)) { + state += 2; + } else if ("end".equals(word)) { + state += 3; + } else if ("msg".equals(word)) { + state += 4; + } else if ("x".equals(word)) { + state += 5; + } else if ("y".equals(word)) { + state += 6; + } else if ("type".equals(word)) { + state += 7; + } else if ("direction".equals(word)) { + state += 8; + } else if ("face".equals(word)) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + }*/ + + /*@PerfTest("Buffered DataInputStream, manual word split using String.indexOf(' ')") + public static void manualEqualsBDI() throws IOException { + final DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(testFileName))); + int state = 0; + try { + for (String line; (line = in.readLine()) != null;) { + line = line.trim(); + final int indexOfSpace = line.indexOf(' '); + final String word = indexOfSpace > 0 ? line.substring(0, indexOfSpace) : line; + if ("arch".equals(word)) { + state += 1; + } else if ("endmsg".equals(word)) { + state += 2; + } else if ("end".equals(word)) { + state += 3; + } else if ("msg".equals(word)) { + state += 4; + } else if ("x".equals(word)) { + state += 5; + } else if ("y".equals(word)) { + state += 6; + } else if ("type".equals(word)) { + state += 7; + } else if ("direction".equals(word)) { + state += 8; + } else if ("face".equals(word)) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + }*/ + + @PerfTest("New File I/O nondirect -> String, manual split of java.lang.String") + public static void nioManual() throws IOException { + int state = 0; + final FileChannel fileChannel = new FileInputStream(testFileName).getChannel(); + final ByteBuffer buffer = ByteBuffer.allocate((int) fileChannel.size()); + fileChannel.read(buffer); + try { + final String file = new String(buffer.array(), 0); + for (String line : lineSplit.split(file)) { + line = line.trim(); + final int indexOfSpace = line.indexOf(' '); + final String word = indexOfSpace > 0 ? line.substring(0, indexOfSpace) : line; + if ("arch".equals(word)) { + state += 1; + } else if ("endmsg".equals(word)) { + state += 2; + } else if ("end".equals(word)) { + state += 3; + } else if ("msg".equals(word)) { + state += 4; + } else if ("x".equals(word)) { + state += 5; + } else if ("y".equals(word)) { + state += 6; + } else if ("type".equals(word)) { + state += 7; + } else if ("direction".equals(word)) { + state += 8; + } else if ("face".equals(word)) { + state += 9; + } + } + } finally { + fileChannel.close(); + } + sum += state; + } + + private static final CharsetDecoder decoder = Charset.forName("iso-8859-1").newDecoder(); + + @PerfTest("Mapped File I/O nondirect -> charset, pattern split") + public static void nioChar() throws IOException { + int state = 0; + final FileChannel fileChannel = new FileInputStream(testFileName).getChannel(); + final ByteBuffer buffer = fileChannel.map(FileChannel.MapMode.READ_ONLY, 0, fileChannel.size()); + final CharBuffer charBuffer = decoder.decode(buffer); + try { + for (String line : lineSplit.split(charBuffer)) { + line = line.trim(); + final int indexOfSpace = line.indexOf(' '); + final String word = indexOfSpace > 0 ? line.substring(0, indexOfSpace) : line; + if ("arch".equals(word)) { + state += 1; + } else if ("endmsg".equals(word)) { + state += 2; + } else if ("end".equals(word)) { + state += 3; + } else if ("msg".equals(word)) { + state += 4; + } else if ("x".equals(word)) { + state += 5; + } else if ("y".equals(word)) { + state += 6; + } else if ("type".equals(word)) { + state += 7; + } else if ("direction".equals(word)) { + state += 8; + } else if ("face".equals(word)) { + state += 9; + } + } + } finally { + fileChannel.close(); + } + sum += state; + } + + @PerfTest("BufferdReader -> StringBuilder, manual split of java.lang.String") + public static void bufReadManBuf() throws IOException { + int state = 0; + final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(testFileName), "iso-8859-1"), 8192); + try { + final StringBuilder file = new StringBuilder(); + final char[] buf = new char[8192]; + for (int charsRead; (charsRead = in.read(buf)) != -1;) { + file.append(buf, 0, charsRead); + } + for (String line : lineSplit.split(file)) { + line = line.trim(); + final int indexOfSpace = line.indexOf(' '); + final String word = indexOfSpace > 0 ? line.substring(0, indexOfSpace) : line; + if ("arch".equals(word)) { + state += 1; + } else if ("endmsg".equals(word)) { + state += 2; + } else if ("end".equals(word)) { + state += 3; + } else if ("msg".equals(word)) { + state += 4; + } else if ("x".equals(word)) { + state += 5; + } else if ("y".equals(word)) { + state += 6; + } else if ("type".equals(word)) { + state += 7; + } else if ("direction".equals(word)) { + state += 8; + } else if ("face".equals(word)) { + state += 9; + } + } + } finally { + in.close(); + } + sum += state; + } + +} // class PerfTestMapDecode + Property changes on: trunk/teststuff/perfTest/PerfTestMapDecode.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/teststuff/perfTest/foo =================================================================== --- trunk/teststuff/perfTest/foo (rev 0) +++ trunk/teststuff/perfTest/foo 2006-09-23 11:31:03 UTC (rev 363) @@ -0,0 +1,2601 @@ +arch map +name desert_map_0200 +msg +Creator: omega +Date: 2006-05-28 +endmsg +width 24 +height 24 +tile_path_1 /omg_desert/desert_map_0201 +tile_path_2 /omg_desert/desert_map_0300 +tile_path_4 /omg_desert/desert_map_0100 +tile_path_5 /omg_desert/desert_map_0301 +tile_path_8 /omg_desert/desert_map_0101 +end +arch desert.102 +end +arch desert.104 +y 1 +end +arch thorns +y 1 +end +arch desert.102 +y 2 +end +arch thorns +y 2 +end +arch desert.104 +y 3 +end +arch desert.104 +y 4 +end +arch desert.101 +y 5 +end +arch desert.104 +y 6 +end +arch desert.103 +y 7 +end +arch desert.101 +y 8 +end +arch desert.103 +y 9 +end +arch desert.102 +y 10 +end +arch desert.103 +y 11 +end +arch desert.102 +y 12 +end +arch desert.103 +y 13 +end +arch desert.103 +y 14 +end +arch desert.107 +y 15 +end +arch cactus2 +y 15 +end +arch desert.102 +y 16 +end +arch desert.101 +y 17 +end +arch desert.102 +y 18 +end +arch desert.104 +y 19 +end +arch desert.103 +y 20 +end +arch desert.104 +y 21 +end +arch desert.103 +y 22 +end +arch desert.102 +y 23 +end +arch desert.103 +x 1 +end +arch thorns +x 1 +end +arch desert.104 +x 1 +y 1 +end +arch desert.101 +x 1 +y 2 +end +arch desert.102 +x 1 +y 3 +end +arch desert.102 +x 1 +y 4 +end +arch desert.105 +x 1 +y 5 +end +arch desert.103 +x 1 +y 6 +end +arch desert.101 +x 1 +y 7 +end +arch desert.101 +x 1 +y 8 +end +arch desert.101 +x 1 +y 9 +end +arch desert.104 +x 1 +y 10 +end +arch desert.107 +x 1 +y 11 +end +arch desert.101 +x 1 +y 12 +end +arch desert.104 +x 1 +y 13 +end +arch desert.104 +x 1 +y 14 +end +arch desert.105 +x 1 +y 15 +end +arch desert.104 +x 1 +y 16 +end +arch desert.103 +x 1 +y 17 +end +arch desert.101 +x 1 +y 18 +end +arch desert.101 +x 1 +y 19 +end +arch sand_dm1 +x 1 +y 19 +end +arch desert.102 +x 1 +y 20 +end +arch desert.102 +x 1 +y 21 +end +arch desert.104 +x 1 +y 22 +end +arch desert.107 +x 1 +y 23 +end +arch desert.106 +x 2 +end +arch desert.102 +x 2 +y 1 +end +arch desert.104 +x 2 +y 2 +end +arch desert.105 +x 2 +y 3 +end +arch desert.102 +x 2 +y 4 +end +arch desert.101 +x 2 +y 5 +end +arch desert.101 +x 2 +y 6 +end +arch desert.105 +x 2 +y 7 +end +arch desert.103 +x 2 +y 8 +end +arch rock2 +x 2 +y 8 +end +arch desert.103 +x 2 +y 9 +end +arch desert.102 +x 2 +y 10 +end +arch desert.102 +x 2 +y 11 +end +arch desert.104 +x 2 +y 12 +end +arch desert.103 +x 2 +y 13 +end +arch desert.102 +x 2 +y 14 +end +arch desert.102 +x 2 +y 15 +end +arch desert.106 +x 2 +y 16 +end +arch desert.105 +x 2 +y 17 +end +arch desert.102 +x 2 +y 18 +end +arch desert.103 +x 2 +y 19 +end +arch desert.103 +x 2 +y 20 +end +arch desert.105 +x 2 +y 21 +end +arch desert.101 +x 2 +y 22 +end +arch desert.104 +x 2 +y 23 +end +arch desert.102 +x 3 +end +arch desert.106 +x 3 +y 1 +end +arch desert.102 +x 3 +y 2 +end +arch desert.107 +x 3 +y 3 +end +arch cactus1 +x 3 +y 3 +end +arch desert.104 +x 3 +y 4 +end +arch desert.101 +x 3 +y 5 +end +arch desert.101 +x 3 +y 6 +end +arch desert.101 +x 3 +y 7 +end +arch desert.102 +x 3 +y 8 +end +arch desert.102 +x 3 +y 9 +end +arch desert.106 +x 3 +y 10 +end +arch desert.103 +x 3 +y 11 +end +arch desert.103 +x 3 +y 12 +end +arch desert.104 +x 3 +y 13 +end +arch desert.102 +x 3 +y 14 +end +arch desert.102 +x 3 +y 15 +end +arch desert.103 +x 3 +y 16 +end +arch desert.105 +x 3 +y 17 +end +arch desert.102 +x 3 +y 18 +end +arch desert.103 +x 3 +y 19 +end +arch desert.102 +x 3 +y 20 +end +arch desert.102 +x 3 +y 21 +end +arch desert.103 +x 3 +y 22 +end +arch desert.105 +x 3 +y 23 +end +arch desert.103 +x 4 +end +arch desert.103 +x 4 +y 1 +end +arch desert.104 +x 4 +y 2 +end +arch desert.103 +x 4 +y 3 +end +arch desert.102 +x 4 +y 4 +end +arch desert.104 +x 4 +y 5 +end +arch desert.102 +x 4 +y 6 +end +arch desert.103 +x 4 +y 7 +end +arch desert.101 +x 4 +y 8 +end +arch desert.102 +x 4 +y 9 +end +arch desert.102 +x 4 +y 10 +end +arch desert.102 +x 4 +y 11 +end +arch desert.102 +x 4 +y 12 +end +arch desert.101 +x 4 +y 13 +end +arch desert.101 +x 4 +y 14 +end +arch desert.101 +x 4 +y 15 +end +arch desert.102 +x 4 +y 16 +end +arch desert.103 +x 4 +y 17 +end +arch desert.103 +x 4 +y 18 +end +arch desert.101 +x 4 +y 19 +end +arch desert.102 +x 4 +y 20 +end +arch desert.104 +x 4 +y 21 +end +arch stone1 +x 4 +y 21 +end +arch desert.103 +x 4 +y 22 +end +arch desert.102 +x 4 +y 23 +end +arch desert.102 +x 5 +end +arch desert.102 +x 5 +y 1 +end +arch desert.101 +x 5 +y 2 +end +arch desert.102 +x 5 +y 3 +end +arch desert.103 +x 5 +y 4 +end +arch desert.104 +x 5 +y 5 +end +arch desert.101 +x 5 +y 6 +end +arch desert.103 +x 5 +y 7 +end +arch small_stones +x 5 +y 7 +end +arch desert.105 +x 5 +y 8 +end +arch desert.103 +x 5 +y 9 +end +arch desert.104 +x 5 +y 10 +end +arch desert.102 +x 5 +y 11 +end +arch desert.102 +x 5 +y 12 +end +arch desert.106 +x 5 +y 13 +end +arch desert.102 +x 5 +y 14 +end +arch plant22 +x 5 +y 14 +end +arch desert.102 +x 5 +y 15 +end +arch desert.101 +x 5 +y 16 +end +arch desert.103 +x 5 +y 17 +end +arch desert.101 +x 5 +y 18 +end +arch desert.104 +x 5 +y 19 +end +arch desert.102 +x 5 +y 20 +end +arch desert.107 +x 5 +y 21 +end +arch desert.104 +x 5 +y 22 +end +arch desert.102 +x 5 +y 23 +end +arch desert.106 +x 6 +end +arch desert.104 +x 6 +y 1 +end +arch desert.102 +x 6 +y 2 +end +arch desert.107 +x 6 +y 3 +end +arch desert.103 +x 6 +y 4 +end +arch desert.103 +x 6 +y 5 +end +arch desert.104 +x 6 +y 6 +end +arch desert.102 +x 6 +y 7 +end +arch desert.105 +x 6 +y 8 +end +arch desert.104 +x 6 +y 9 +end +arch desert.104 +x 6 +y 10 +end +arch desert.102 +x 6 +y 11 +end +arch desert.104 +x 6 +y 12 +end +arch desert.101 +x 6 +y 13 +end +arch desert.104 +x 6 +y 14 +end +arch desert.101 +x 6 +y 15 +end +arch desert.102 +x 6 +y 16 +end +arch desert.107 +x 6 +y 17 +end +arch desert.105 +x 6 +y 18 +end +arch desert.102 +x 6 +y 19 +end +arch desert.102 +x 6 +y 20 +end +arch desert.102 +x 6 +y 21 +end +arch desert.102 +x 6 +y 22 +end +arch desert.103 +x 6 +y 23 +end +arch desert.103 +x 7 +end +arch desert.107 +x 7 +y 1 +end +arch desert.102 +x 7 +y 2 +end +arch desert.102 +x 7 +y 3 +end +arch desert.102 +x 7 +y 4 +end +arch desert.102 +x 7 +y 5 +end +arch desert.102 +x 7 +y 6 +end +arch desert.105 +x 7 +y 7 +end +arch desert.103 +x 7 +y 8 +end +arch desert.101 +x 7 +y 9 +end +arch desert.104 +x 7 +y 10 +end +arch desert.101 +x 7 +y 11 +end +arch desert.102 +x 7 +y 12 +end +arch desert.102 +x 7 +y 13 +end +arch desert.102 +x 7 +y 14 +end +arch desert.104 +x 7 +y 15 +end +arch desert.101 +x 7 +y 16 +end +arch desert.103 +x 7 +y 17 +end +arch desert.102 +x 7 +y 18 +end +arch desert.101 +x 7 +y 19 +end +arch desert.104 +x 7 +y 20 +end +arch desert.102 +x 7 +y 21 +end +arch desert.102 +x 7 +y 22 +end +arch desert.103 +x 7 +y 23 +end +arch desert.101 +x 8 +end +arch desert.105 +x 8 +y 1 +end +arch desert.102 +x 8 +y 2 +end +arch desert.101 +x 8 +y 3 +end +arch desert.102 +x 8 +y 4 +end +arch desert.102 +x 8 +y 5 +end +arch desert.105 +x 8 +y 6 +end +arch desert.102 +x 8 +y 7 +end +arch desert.103 +x 8 +y 8 +end +arch desert.103 +x 8 +y 9 +end +arch desert.101 +x 8 +y 10 +end +arch desert.101 +x 8 +y 11 +end +arch desert.107 +x 8 +y 12 +end +arch cactus4 +x 8 +y 12 +end +arch desert.102 +x 8 +y 13 +end +arch desert.103 +x 8 +y 14 +end +arch desert.104 +x 8 +y 15 +end +arch desert.101 +x 8 +y 16 +end +arch desert.101 +x 8 +y 17 +end +arch desert.101 +x 8 +y 18 +end +arch desert.102 +x 8 +y 19 +end +arch desert.103 +x 8 +y 20 +end +arch desert.106 +x 8 +y 21 +end +arch desert.103 +x 8 +y 22 +end +arch desert.101 +x 8 +y 23 +end +arch desert.104 +x 9 +end +arch desert.101 +x 9 +y 1 +end +arch desert.101 +x 9 +y 2 +end +arch desert.106 +x 9 +y 3 +end +arch desert.103 +x 9 +y 4 +end +arch desert.106 +x 9 +y 5 +end +arch fmask_ruin1_s2.101 +x 9 +y 5 +end +arch desert.101 +x 9 +y 6 +end +arch desert.107 +x 9 +y 7 +end +arch desert.102 +x 9 +y 8 +end +arch desert.102 +x 9 +y 9 +end +arch desert.101 +x 9 +y 10 +end +arch desert.103 +x 9 +y 11 +end +arch desert.106 +x 9 +y 12 +end +arch desert.105 +x 9 +y 13 +end +arch desert.103 +x 9 +y 14 +end +arch desert.101 +x 9 +y 15 +end +arch desert.101 +x 9 +y 16 +end +arch desert.104 +x 9 +y 17 +end +arch desert.107 +x 9 +y 18 +end +arch cactus5 +x 9 +y 18 +end +arch desert.103 +x 9 +y 19 +end +arch desert.103 +x 9 +y 20 +end +arch desert.101 +x 9 +y 21 +end +arch desert.101 +x 9 +y 22 +end +arch desert.102 +x 9 +y 23 +end +arch desert.101 +x 10 +end +arch desert.103 +x 10 +y 1 +end +arch desert.103 +x 10 +y 2 +end +arch desert.102 +x 10 +y 3 +end +arch desert.104 +x 10 +y 4 +end +arch desert.104 +x 10 +y 5 +end +arch desert.102 +x 10 +y 6 +end +arch desert.105 +x 10 +y 7 +end +arch desert.104 +x 10 +y 8 +end +arch desert.103 +x 10 +y 9 +end +arch desert.101 +x 10 +y 10 +end +arch desert.102 +x 10 +y 11 +end +arch desert.104 +x 10 +y 12 +end +arch desert.103 +x 10 +y 13 +end +arch desert.101 +x 10 +y 14 +end +arch desert.104 +x 10 +y 15 +end +arch desert.105 +x 10 +y 16 +end +arch desert.104 +x 10 +y 17 +end +arch desert.104 +x 10 +y 18 +end +arch desert.103 +x 10 +y 19 +end +arch desert.104 +x 10 +y 20 +end +arch sand_dm2 +x 10 +y 20 +end +arch desert.101 +x 10 +y 21 +end +arch desert.103 +x 10 +y 22 +end +arch desert.107 +x 10 +y 23 +end +arch desert.102 +x 11 +end +arch desert.102 +x 11 +y 1 +end +arch desert.107 +x 11 +y 2 +end +arch cactus3 +x 11 +y 2 +end +arch desert.102 +x 11 +y 3 +end +arch desert.102 +x 11 +y 4 +end +arch desert.104 +x 11 +y 5 +end +arch desert.105 +x 11 +y 6 +end +arch desert.102 +x 11 +y 7 +end +arch desert.102 +x 11 +y 8 +end +arch desert.102 +x 11 +y 9 +end +arch desert.104 +x 11 +y 10 +end +arch wood_pile.101 +x 11 +y 10 +end +arch desert.102 +x 11 +y 11 +end +arch desert.104 +x 11 +y 12 +end +arch wood_pile.101 +x 11 +y 12 +end +arch desert.102 +x 11 +y 13 +end +arch dirt_floor2 +x 11 +y 13 +end +arch desert.104 +x 11 +y 14 +end +arch desert.102 +x 11 +y 15 +end +arch desert.106 +x 11 +y 16 +end +arch desert.103 +x 11 +y 17 +end +arch desert.101 +x 11 +y 18 +end +arch desert.101 +x 11 +y 19 +end +arch desert.103 +x 11 +y 20 +end +arch desert.102 +x 11 +y 21 +end +arch desert.104 +x 11 +y 22 +end +arch desert.102 +x 11 +y 23 +end +arch desert.103 +x 12 +end +arch desert.101 +x 12 +y 1 +end +arch desert.104 +x 12 +y 2 +end +arch desert.103 +x 12 +y 3 +end +arch desert.102 +x 12 +y 4 +end +arch sand_dm1 +x 12 +y 4 +end +arch desert.103 +x 12 +y 5 +end +arch desert.104 +x 12 +y 6 +end +arch desert.103 +x 12 +y 7 +end +arch desert.102 +x 12 +y 8 +end +arch archer +x 12 +y 8 +end +arch desert.102 +x 12 +y 9 +end +arch desert.103 +x 12 +y 10 +end +arch wood_pile.101 +x 12 +y 10 +end +arch desert.102 +x 12 +y 11 +end +arch desert.102 +x 12 +y 12 +end +arch wood_pile.101 +x 12 +y 12 +end +arch desert.102 +x 12 +y 13 +end +arch dirt_floor1 +x 12 +y 13 +end +arch desert.104 +x 12 +y 14 +end +arch dirt_floor3 +x 12 +y 14 +end +arch desert.104 +x 12 +y 15 +end +arch ranger +x 12 +y 15 +end +arch desert.106 +x 12 +y 16 +end +arch desert.102 +x 12 +y 17 +end +arch desert.102 +x 12 +y 18 +end +arch desert.103 +x 12 +y 19 +end +arch desert.107 +x 12 +y 20 +end +arch desert.103 +x 12 +y 21 +end +arch desert.103 +x 12 +y 22 +end +arch desert.102 +x 12 +y 23 +end +arch desert.102 +x 13 +end +arch desert.104 +x 13 +y 1 +end +arch desert.103 +x 13 +y 2 +end +arch desert.101 +x 13 +y 3 +end +arch desert.103 +x 13 +y 4 +end +arch desert.104 +x 13 +y 5 +end +arch desert.101 +x 13 +y 6 +end +arch metal_bucket.101 +x 13 +y 6 +end +arch desert.102 +x 13 +y 7 +end +arch desert.103 +x 13 +y 8 +end +arch box2.101 +x 13 +y 8 +end +arch desert.101 +x 13 +y 9 +end +arch desert.102 +x 13 +y 10 +end +arch desert.101 +x 13 +y 11 +end +arch desert.103 +x 13 +y 12 +end +arch pile_floor2 +x 13 +y 12 +end +arch desert.102 +x 13 +y 13 +end +arch desert.107 +x 13 +y 14 +end +arch desert.103 +x 13 +y 15 +end +arch desert.102 +x 13 +y 16 +end +arch desert.101 +x 13 +y 17 +end +arch desert.103 +x 13 +y 18 +end +arch desert.104 +x 13 +y 19 +end +arch desert.104 +x 13 +y 20 +end +arch desert.103 +x 13 +y 21 +end +arch desert.101 +x 13 +y 22 +end +arch desert.104 +x 13 +y 23 +end +arch desert.102 +x 14 +end +arch desert.107 +x 14 +y 1 +end +arch desert.101 +x 14 +y 2 +end +arch desert.102 +x 14 +y 3 +end +arch desert.102 +x 14 +y 4 +end +arch pile_floor2 +x 14 +y 4 +end +arch desert.103 +x 14 +y 5 +end +arch ranger +x 14 +y 5 +end +arch desert.106 +x 14 +y 6 +end +arch desert.102 +x 14 +y 7 +end +arch desert.103 +x 14 +y 8 +end +arch desert.102 +x 14 +y 9 +end +arch desert.106 +x 14 +y 10 +end +arch desert.103 +x 14 +y 11 +end +arch traveller_wife +x 14 +y 11 +end +arch desert.106 +x 14 +y 12 +end +arch desert.101 +x 14 +y 13 +end +arch desert.104 +x 14 +y 14 +end +arch desert.103 +x 14 +y 15 +end +arch desert.102 +x 14 +y 16 +end +arch desert.104 +x 14 +y 17 +end +arch fmask_ruin1_s1.101 +x 14 +y 17 +end +arch desert.101 +x 14 +y 18 +end +arch desert.101 +x 14 +y 19 +end +arch desert.101 +x 14 +y 20 +end +arch desert.101 +x 14 +y 21 +end +arch desert.103 +x 14 +y 22 +end +arch desert.101 +x 14 +y 23 +end +arch desert.102 +x 15 +end +arch desert.103 +x 15 +y 1 +end +arch desert.104 +x 15 +y 2 +end +arch desert.103 +x 15 +y 3 +end +arch desert.104 +x 15 +y 4 +end +arch desert.102 +x 15 +y 5 +end +arch desert.103 +x 15 +y 6 +end +arch desert.102 +x 15 +y 7 +end +arch dirt_floor1 +x 15 +y 7 +end +arch desert.105 +x 15 +y 8 +end +arch desert.102 +x 15 +y 9 +end +arch desert.104 +x 15 +y 10 +end +arch desert.102 +x 15 +y 11 +end +arch sand_dm1 +x 15 +y 11 +end +arch desert.102 +x 15 +y 12 +end +arch sand_dm5 +x 15 +y 12 +end +arch desert.101 +x 15 +y 13 +end +arch sand_dm2 +x 15 +y 13 +end +arch desert.104 +x 15 +y 14 +end +arch peasant +x 15 +y 14 +end +arch desert.104 +x 15 +y 15 +end +arch pile_floor2 +x 15 +y 15 +end +arch desert.102 +x 15 +y 16 +end +arch desert.101 +x 15 +y 17 +end +arch desert.102 +x 15 +y 18 +end +arch desert.103 +x 15 +y 19 +end +arch desert.101 +x 15 +y 20 +end +arch desert.103 +x 15 +y 21 +end +arch thorns +x 15 +y 21 +end +arch desert.102 +x 15 +y 22 +end +arch desert.104 +x 15 +y 23 +end +arch desert.102 +x 16 +end +arch desert.104 +x 16 +y 1 +end +arch desert.101 +x 16 +y 2 +end +arch desert.102 +x 16 +y 3 +end +arch desert.101 +x 16 +y 4 +end +arch desert.102 +x 16 +y 5 +end +arch desert.104 +x 16 +y 6 +end +arch desert.103 +x 16 +y 7 +end +arch pile_floor2 +x 16 +y 7 +end +arch desert.102 +x 16 +y 8 +end +arch desert.104 +x 16 +y 9 +end +arch desert.104 +x 16 +y 10 +end +arch desert.102 +x 16 +y 11 +end +arch sand_dm7 +x 16 +y 11 +end +arch desert.102 +x 16 +y 12 +end +arch floor_sand_d4 +x 16 +y 12 +end +arch fire_cauld.131 +x 16 +y 12 +end +arch desert.102 +x 16 +y 13 +end +arch sand_dm6 +x 16 +y 13 +end +arch desert.102 +x 16 +y 14 +end +arch desert.103 +x 16 +y 15 +end +arch desert.102 +x 16 +y 16 +end +arch desert.101 +x 16 +y 17 +end +arch desert.102 +x 16 +y 18 +end +arch desert.104 +x 16 +y 19 +end +arch desert.102 +x 16 +y 20 +end +arch desert.104 +x 16 +y 21 +end +arch thorns +x 16 +y 21 +end +arch desert.103 +x 16 +y 22 +end +arch desert.102 +x 16 +y 23 +end +arch desert.102 +x 17 +end +arch desert.102 +x 17 +y 1 +end +arch desert.101 +x 17 +y 2 +end +arch desert.102 +x 17 +y 3 +end +arch desert.103 +x 17 +y 4 +end +arch desert.102 +x 17 +y 5 +end +arch woman_old +x 17 +y 5 +end +arch desert.102 +x 17 +y 6 +end +arch pile_floor2 +x 17 +y 6 +end +arch desert.102 +x 17 +y 7 +end +arch pile_floor3 +x 17 +y 7 +end +arch desert.102 +x 17 +y 8 +end +arch desert.106 +x 17 +y 9 +end +arch desert.103 +x 17 +y 10 +end +arch desert.102 +x 17 +y 11 +end +arch sand_dm4 +x 17 +y 11 +end +arch desert.101 +x 17 +y 12 +end +arch sand_dm8 +x 17 +y 12 +end +arch desert.105 +x 17 +y 13 +end +arch sand_dm3 +x 17 +y 13 +end +arch desert.102 +x 17 +y 14 +end +arch desert.102 +x 17 +y 15 +end +arch desert.102 +x 17 +y 16 +end +arch desert.101 +x 17 +y 17 +end +arch desert.102 +x 17 +y 18 +end +arch desert.102 +x 17 +y 19 +end +arch desert.106 +x 17 +y 20 +end +arch desert.102 +x 17 +y 21 +end +arch desert.102 +x 17 +y 22 +end +arch thorns +x 17 +y 22 +end +arch desert.102 +x 17 +y 23 +end +arch desert.104 +x 18 +end +arch rock_big11 +x 18 +end +arch desert.102 +x 18 +y 1 +end +arch desert.102 +x 18 +y 2 +end +arch desert.104 +x 18 +y 3 +end +arch archer +x 18 +y 3 +end +arch desert.102 +x 18 +y 4 +end +arch desert.107 +x 18 +y 5 +end +arch desert.103 +x 18 +y 6 +end +arch desert.102 +x 18 +y 7 +end +arch dirt_floor3 +x 18 +y 7 +end +arch desert.101 +x 18 +y 8 +end +arch desert.107 +x 18 +y 9 +end +arch desert.102 +x 18 +y 10 +end +arch desert.104 +x 18 +y 11 +end +arch desert.102 +x 18 +y 12 +end +arch desert.103 +x 18 +y 13 +end +arch desert.102 +x 18 +y 14 +end +arch desert.102 +x 18 +y 15 +end +arch grain4.101 +x 18 +y 15 +end +arch desert.102 +x 18 +y 16 +end +arch grain2.101 +x 18 +y 16 +end +arch desert.101 +x 18 +y 17 +end +arch desert.102 +x 18 +y 18 +end +arch desert.101 +x 18 +y 19 +end +arch desert.103 +x 18 +y 20 +end +arch desert.104 +x 18 +y 21 +end +arch desert.101 +x 18 +y 22 +end +arch desert.101 +x 18 +y 23 +end +arch desert.102 +x 19 +end +arch desert.104 +x 19 +y 1 +end +arch desert.102 +x 19 +y 2 +end +arch desert.102 +x 19 +y 3 +end +arch desert.101 +x 19 +y 4 +end +arch desert.101 +x 19 +y 5 +end +arch desert.102 +x 19 +y 6 +end +arch desert.102 +x 19 +y 7 +end +arch straw2.111 +x 19 +y 7 +end +arch desert.103 +x 19 +y 8 +end +arch desert.102 +x 19 +y 9 +end +arch desert.104 +x 19 +y 10 +end +arch desert.101 +x 19 +y 11 +end +arch barrel_water.101 +x 19 +y 11 +end +arch desert.103 +x 19 +y 12 +end +arch barrel.101 +x 19 +y 12 +end +arch desert.102 +x 19 +y 13 +end +arch water_floor +x 19 +y 13 +end +arch desert.102 +x 19 +y 14 +end +arch desert.102 +x 19 +y 15 +end +arch grain1.101 +x 19 +y 15 +end +arch desert.107 +x 19 +y 16 +end +arch desert.104 +x 19 +y 17 +end +arch desert.102 +x 19 +y 18 +end +arch desert.103 +x 19 +y 19 +end +arch desert.101 +x 19 +y 20 +end +arch desert.104 +x 19 +y 21 +end +arch desert.104 +x 19 +y 22 +end +arch desert.104 +x 19 +y 23 +end +arch desert.102 +x 20 +end +arch desert.102 +x 20 +y 1 +end +arch desert.102 +x 20 +y 2 +end +arch desert.104 +x 20 +y 3 +end +arch desert.104 +x 20 +y 4 +end +arch desert.104 +x 20 +y 5 +end +arch desert.102 +x 20 +y 6 +end +arch desert.101 +x 20 +y 7 +end +arch straw2.111 +x 20 +y 7 +end +arch desert.101 +x 20 +y 8 +end +arch straw2.111 +x 20 +y 8 +end +arch desert.103 +x 20 +y 9 +end +arch desert.101 +x 20 +y 10 +end +arch keg_big.101 +x 20 +y 10 +end +arch desert.105 +x 20 +y 11 +end +arch box2.101 +x 20 +y 11 +end +arch desert.102 +x 20 +y 12 +end +arch box1.101 +x 20 +y 12 +end +arch desert.102 +x 20 +y 13 +end +arch desert.102 +x 20 +y 14 +end +arch desert.104 +x 20 +y 15 +end +arch desert.104 +x 20 +y 16 +end +arch desert.102 +x 20 +y 17 +end +arch desert.104 +x 20 +y 18 +end +arch desert.102 +x 20 +y 19 +end +arch desert.101 +x 20 +y 20 +end +arch desert.102 +x 20 +y 21 +end +arch desert.102 +x 20 +y 22 +end +arch desert.102 +x 20 +y 23 +end +arch desert.102 +x 21 +end +arch desert.102 +x 21 +y 1 +end +arch desert.107 +x 21 +y 2 +end +arch desert.102 +x 21 +y 3 +end +arch desert.102 +x 21 +y 4 +end +arch desert.103 +x 21 +y 5 +end +arch fmask_ruin1_s4.101 +x 21 +y 5 +end +arch desert.104 +x 21 +y 6 +end +arch desert.101 +x 21 +y 7 +end +arch desert.102 +x 21 +y 8 +end +arch desert.103 +x 21 +y 9 +end +arch desert.102 +x 21 +y 10 +end +arch desert.102 +x 21 +y 11 +end +arch desert.103 +x 21 +y 12 +end +arch desert.101 +x 21 +y 13 +end +arch desert.103 +x 21 +y 14 +end +arch desert.102 +x 21 +y 15 +end +arch desert.101 +x 21 +y 16 +end +arch desert.101 +x 21 +y 17 +end +arch desert.101 +x 21 +y 18 +end +arch desert.102 +x 21 +y 19 +end +arch desert.102 +x 21 +y 20 +end +arch desert.104 +x 21 +y 21 +end +arch desert.103 +x 21 +y 22 +end +arch stone5 +x 21 +y 22 +end +arch desert.102 +x 21 +y 23 +end +arch desert.104 +x 22 +end +arch desert.103 +x 22 +y 1 +end +arch desert.104 +x 22 +y 2 +end +arch desert.104 +x 22 +y 3 +end +arch small_stones +x 22 +y 3 +end +arch desert.104 +x 22 +y 4 +end +arch desert.104 +x 22 +y 5 +end +arch desert.102 +x 22 +y 6 +end +arch desert.101 +x 22 +y 7 +end +arch desert.101 +x 22 +y 8 +end +arch desert.102 +x 22 +y 9 +end +arch desert.102 +x 22 +y 10 +end +arch desert.101 +x 22 +y 11 +end +arch desert.104 +x 22 +y 12 +end +arch sand_dm2 +x 22 +y 12 +end +arch desert.106 +x 22 +y 13 +end +arch desert.102 +x 22 +y 14 +end +arch desert.101 +x 22 +y 15 +end +arch desert.103 +x 22 +y 16 +end +arch desert.103 +x 22 +y 17 +end +arch desert.102 +x 22 +y 18 +end +arch desert.101 +x 22 +y 19 +end +arch rock_big7 +x 22 +y 19 +end +arch desert.104 +x 22 +y 20 +end +arch desert.101 +x 22 +y 21 +end +arch desert.104 +x 22 +y 22 +end +arch desert.103 +x 22 +y 23 +end +arch desert.105 +x 23 +end +arch desert.104 +x 23 +y 1 +end +arch desert.106 +x 23 +y 2 +end +arch desert.101 +x 23 +y 3 +end +arch desert.103 +x 23 +y 4 +end +arch desert.102 +x 23 +y 5 +end +arch desert.105 +x 23 +y 6 +end +arch desert.102 +x 23 +y 7 +end +arch desert.105 +x 23 +y 8 +end +arch desert.103 +x 23 +y 9 +end +arch desert.104 +x 23 +y 10 +end +arch desert.103 +x 23 +y 11 +end +arch desert.101 +x 23 +y 12 +end +arch desert.104 +x 23 +y 13 +end +arch desert.103 +x 23 +y 14 +end +arch desert.101 +x 23 +y 15 +end +arch desert.106 +x 23 +y 16 +end +arch desert.101 +x 23 +y 17 +end +arch desert.102 +x 23 +y 18 +end +arch desert.102 +x 23 +y 19 +end +arch desert.103 +x 23 +y 20 +end +arch desert.104 +x 23 +y 21 +end +arch desert.101 +x 23 +y 22 +end +arch desert.103 +x 23 +y 23 +end +arch tent_small +x 11 +y 10 +end +arch tent_small +x 12 +y 6 +end +arch tent_small2 +x 15 +y 3 +end +arch tent_large2 +x 15 +y 8 +end +arch tent_small2 +x 15 +y 16 +end +arch tent_large2 +x 16 +y 8 +end +arch tent_large2 +x 17 +y 8 +end +arch tent_small2 +x 17 +y 17 +end +arch tent_small2 +x 18 +y 4 +end +arch tent_small +x 19 +y 13 +end +arch rock_big9 +x 19 +y 20 +end +arch tent_small +x 20 +y 8 +end Property changes on: trunk/teststuff/perfTest/foo ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/teststuff/perfTest/foo2 =================================================================== --- trunk/teststuff/perfTest/foo2 (rev 0) +++ trunk/teststuff/perfTest/foo2 2006-09-23 11:31:03 UTC (rev 363) @@ -0,0 +1,59823 @@ +arch map +name desert_map_0200 +msg +Creator: omega +Date: 2006-05-28 +endmsg +width 24 +height 24 +tile_path_1 /omg_desert/desert_map_0201 +tile_path_2 /omg_desert/desert_map_0300 +tile_path_4 /omg_desert/desert_map_0... [truncated message content] |