diff -Nru freemind-0.7.1/.classpath freemind-0.8.1/.classpath --- freemind-0.7.1/.classpath 2003-12-21 12:16:22.000000000 +0000 +++ freemind-0.8.1/.classpath 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +0,0 @@ - - - - - - diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/changelog /tmp/Offd2O1oj4/freemind-0.8.1/debian/changelog --- freemind-0.7.1/debian/changelog 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/debian/changelog 2009-05-14 23:12:10.000000000 +0100 @@ -1,39 +1,198 @@ -freemind (0.7.1-6ubuntu4) jaunty; urgency=low +freemind (0.8.1-2~ppa1) jaunty; urgency=low - * debian/freemind.desktop - - Add a .desktop file. - * debian/freemind.install - - Install the .desktop file at appropriate location. - (LP: #244140) + * Snapshot and conversion of Debian package to Ubuntu to host in PPA + * Changed Recommends entry from iceweasel to firefox + * Added ${misc:Depends} to dependencies to satisfy lintian + * Changed standards version to 3.8.0 + * Added javahelp2 as a dependency and a build dependency + * Added libjcalendar-java as a dependency and a build dependency - -- Andreas Olsson Sat, 07 Feb 2009 17:45:43 +0100 + -- Liam Green-Hughes Thu, 14 May 2009 19:08:46 +0100 -freemind (0.7.1-6ubuntu3) hardy; urgency=low +freemind (0.8.1-2) UNRELEASED; urgency=low - * debian/control: - - Replace icedtea-java7 dependencies with openjdk-6 (LP: #203636) + * Make dependency on libjaxp1.3 possible in addition to libjaxp1.2. + * Update freemind.sh to accept OpenJDK as valid Java VM. - -- David Futcher Tue, 18 Mar 2008 19:35:02 +0000 + -- Eric Lavarde Sun, 02 Nov 2008 20:27:46 +0100 -freemind (0.7.1-6ubuntu2) hardy; urgency=low +freemind (0.8.1-1) UNRELEASED; urgency=low - * debian/control: - - Depend on icedtea-java7-jre|sun-java6-jre|java2-runtime (LP: #164535) - - Standards-Version 3.7.3 - - Moved Homepage from description to control field - - Move debhelper from Build-Depends-Indep to B-D (lintian) - * debian/copyright: add license/copyright for - freemind/freemind/main/ExampleFileFilter.java + * Upstream minor release to add support for Java 6 (preferences dialog + and encryption were fixed). + * Help plugin now depends on the javahelp2 plugin instead of using + local jhall.jar copy. + * Added watch file, and improved urlsee andfreemind.sh + * Corrected different smaller lintian warnings. Moved FreeMind to + menu section Applications/Office. Add overrides for empty plugin + directory. Bumped Standard Version to 3.7.3. - -- Daniel Hahler Fri, 22 Feb 2008 01:00:10 +0100 + -- Eric Lavarde Wed, 06 Feb 2008 20:35:30 +0100 -freemind (0.7.1-6ubuntu1) hardy; urgency=low +freemind (0.8.0+01-4) unstable; urgency=low - * debian/control: (Build-)Depend on icedtea to avoid Sun Java's EULA. - (LP: #126537) - * freemind/freemind.sh: Prefer to run with $FREEMIND_JAVA or icedtea. + * Corrected polish translation (thanks to hekto5 on sf.net). + * Add debug dpkg/rpm information and check for Sun/Blackdown VM in + freemind.sh. - -- William Grant Tue, 06 Nov 2007 14:16:43 +1100 + -- Eric Lavarde Wed, 9 Nov 2005 17:07:52 +0000 + +freemind (0.8.0+01-3) unstable; urgency=low + + * Introduce usage of commons-codec to replace sun.misc.Base64Encoder/Decoder. + * Set java source and target version to 1.3 in order to avoid warnings from + jikes. + * Suppress useless import of sun.java2d.loops.FontInfo from + FontSizeAction.java. + + -- Eric Lavarde Sun, 6 Nov 2005 16:02:33 +0000 + +freemind (0.8.0+01-2) unstable; urgency=low + + * Made the freemind.sharedmimeinfo file multi-lingual. + * Improved French traduction. + * corrected urlsee to send output to /tmp/urlsee.log when DEBUG is + defined because FreeMind discards all output. + * corrected urlsee to transform %20 into when using 'see' or + other local command. + * Corrected the polish translation (it's neither complete nor + guaranteed correct but at least it loads). + + -- Eric Lavarde Sun, 6 Nov 2005 15:20:01 +0000 + +freemind (0.8.0+01-1) unstable; urgency=low + + * Adding avalon-framework, commons-io, commons-logging to svg plugin + classpath for fop-transcoder to work. + * removing pdf-transcoder.jar from source package. + + -- Eric Lavarde Sat, 22 Oct 2005 15:11:13 +0000 + +freemind (0.8.0-2) unstable; urgency=low + + * replaced gnujaxp through xmlParserAPIs in rules file (thanks to WBaer). + * included use of fop-transcoder from libbatik-java >= 1.6. + + -- Eric Lavarde Fri, 21 Oct 2005 07:47:07 +0000 + +freemind (0.8.0-1) unstable; urgency=low + + * Finalized upstream version. + + -- Eric Lavarde Wed, 7 Sep 2005 18:49:37 +0200 + +freemind (0.7.9.rc5-4) unstable; urgency=low + + * Bug fixing: link to freemind.jar had old version and forgot to fully + remove forms.jar from package. + + -- Eric Lavarde Sat, 27 Aug 2005 12:23:35 +0200 + +freemind (0.7.9.rc5-3) unstable; urgency=low + + * Moved to policy 3.6.2.0 (no change required). + * Introduced dependency to libforms-java. + + -- Eric Lavarde Thu, 18 Aug 2005 17:04:18 +0200 + +freemind (0.7.9.rc5-2) unstable; urgency=low + + * Migrating to cdbs system. + + -- Eric Lavarde Thu, 18 Aug 2005 16:24:16 +0200 + +freemind (0.7.9.rc5-1) unstable; urgency=low + + * New upstream release + + -- Eric Lavarde Tue, 19 Jul 2005 14:11:14 +0200 + +freemind (0.7.9.rc4-1) unstable; urgency=low + + * New upstream release + + -- Eric Lavarde Tue, 5 Jul 2005 11:27:24 +0200 + +freemind (0.7.9.rc3-2) unstable; urgency=low + + * Fixed some warnings from docbook-to-man concerning freemind.sgml. + * Simplified all debian/freemind-plugins-*.install files. + * Added new package freemind-plugins-collab-jabber for collaboration + through jabber. + * Removed need for replacement variables in freemind.properties and + user.properties as it becomes more complicated than it brings anything. + + -- Eric Lavarde Tue, 24 May 2005 19:50:42 +0200 + +freemind (0.7.9.rc3-1) unstable; urgency=low + + * New upstream release + + -- Eric Lavarde Sun, 22 May 2005 17:08:09 +0200 + +freemind (0.7.9.rc2-4) unstable; urgency=low + + * Got the hint that I was compiling against the wrong libraries (thanks + to Wolfgang). + * Fixed small dependencies and recommends glitches. + * Remove jhall (non free) from source and binary packages. + * Added urlsee as 'default_browser_command_other_os' default (i.e. the + command used by FreeMind to display links and files). Manpage included. + * Source for freemind.1 is now SGML based. + + -- Eric Lavarde Wed, 16 Mar 2005 20:37:40 +0100 + +freemind (0.7.9.rc2-3) unstable; urgency=low + + * Added alternative dependencies for Java 1.5. + * Replaced some more jars through dependencies on librelaxng-datatype- + java, libjaxp1.2-java, libcommons-lang-java. + + -- Eric Lavarde Fri, 4 Mar 2005 20:31:28 +0100 + +freemind (0.7.9.rc2-2) unstable; urgency=low + + * Replaced jar files from svg plugin through standard jars from + libxerces2-java, libbatik-java and rhino + + -- Eric Lavarde Tue, 1 Mar 2005 20:20:25 +0100 + +freemind (0.7.9.rc2-1) unstable; urgency=low + + * New upstream release + * Added package freemind-plugins-time + * Added freedesktop support (closes: #296258) + + -- Eric Lavarde Mon, 28 Feb 2005 20:38:33 +0100 + +freemind (0.7.9.rc1-3) unstable; urgency=low + + * Modified dependencies to non-free Java implementations, Sun and Blackdown + packaged with java-package (Closes: #291946, #292182). + + -- Eric Lavarde Sat, 5 Feb 2005 12:11:32 +0100 + +freemind (0.7.9.rc1-2) unstable; urgency=low + + * Move 'accessories' to usr/share/freemind for exports. + * Add -Dfreemind.base.dir to freemind.sh for FreeMind to find plugins and + accessories. + + -- Eric Lavarde Fri, 14 Jan 2005 20:32:39 +0100 + +freemind (0.7.9.rc1-1) unstable; urgency=low + + * New upstream release + + -- Eric Lavarde Tue, 11 Jan 2005 20:12:57 +0100 + +freemind (0.7.9.beta4-1) unstable; urgency=low + + * New upstream release + * Added packages freemind-browser, freemind-plugins-help and freemind- + plugins-svg. + + -- Eric Lavarde Sat, 8 Jan 2005 20:00:00 +0100 freemind (0.7.1-6) unstable; urgency=low diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/control /tmp/Offd2O1oj4/freemind-0.8.1/debian/control --- freemind-0.7.1/debian/control 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/debian/control 2009-05-14 23:12:10.000000000 +0100 @@ -1,21 +1,64 @@ Source: freemind Section: contrib/text Priority: optional -Maintainer: Ubuntu MOTU Developers +Maintainer: Liam Green-Hughes XSBC-Original-Maintainer: Eric Lavarde -Build-Depends: debhelper (>= 4.0.0) -Build-Depends-Indep: ant, openjdk-6-jdk, imagemagick -Standards-Version: 3.7.3 -Homepage: http://freemind.sourceforge.net/ +Build-Depends-Indep: docbook-to-man, ant, openjdk-6-jdk | java2-compiler, imagemagick, librelaxng-datatype-java, libjaxp1.3-java | libjaxp1.2-java, libcommons-lang-java, libbatik-java (>= 1.6), rhino, libxerces2-java, libforms-java, libcommons-codec-java, javahelp2, libjcalendar-java +Build-Depends: debhelper (>= 4.1.0), cdbs (>= 0.4.8) +Standards-Version: 3.8.0 Package: freemind Architecture: all -Depends: openjdk-6-jre | sun-java6-jre | java2-runtime -Recommends: mozilla-browser | www-browser -Description: A Java Program for creating and viewing Mindmaps +Depends: openjdk-6-jre | sun-java5-jre | sun-java6-jre | java2-runtime, librelaxng-datatype-java, libjaxp1.3-java | libjaxp1.2-java, libcommons-lang-java, libforms-java, libcommons-codec-java, javahelp2, libjcalendar-java, ${misc:Depends} +Recommends: xdg-utils, firefox | www-browser +Suggests: freemind-plugins-help, freemind-plugins-svg, freemind-plugins-time +#, freemind-plugins-collab-jabber +Description: Java Program for creating and viewing Mindmaps Taking the Concept-Mapping approach to Human-Computer Interface design. A mind mapper, and at the same time an easy-to-operate hierarchical editor with strong emphasis on folding. These two are not really two different things, just two different descriptions of a single application. Often used for knowledge and content management. + . + Home: http://freemind.sourceforge.net/ + (and http://freemind.sourceforge.net/wiki/index.php/FreeMind_on_Linux) + . + Use a Java(TM) Runtime Environment 1.4, 1.5 or 6. + FreeMind doesn't work with free (and incomplete) Java implementations. +#Package: freemind-browser +#Architecture: all +#Recommends: thttpd | httpd +#Suggests: freemind +#Description: Java Applet for publishing Mindmaps produced with FreeMind +# This package contains a java applet as well as an example of an HTML file to +# publish FreeMind maps using a standard web server. + +Package: freemind-plugins-svg +Architecture: all +Depends: openjdk-6-jre | sun-java5-jre | sun-java6-jre | java2-runtime, freemind (= ${binary:Version}), libbatik-java (>= 1.6), rhino, libxerces2-java, javahelp2, libjcalendar-java, ${misc:Depends} +Description: Java Plugin for FreeMind to export Mindmaps to SVG and PDF + This plugin will add two menu points 'File -> Export -> SVG-Export' and + 'File -> Export -> PDF-Export'. + +Package: freemind-plugins-help +Architecture: all +Depends: openjdk-6-jre | sun-java5-jre | sun-java6-jre | java2-runtime, freemind (= ${binary:Version}), javahelp2, libjcalendar-java, ${misc:Depends} +Description: Java Plugin for FreeMind to show an extended online help + This plugin will add a menu point 'Help -> Online Help'. + +Package: freemind-plugins-time +Architecture: all +Depends: openjdk-6-jre | sun-java5-jre | sun-java6-jre | java2-runtime, freemind (= ${binary:Version}), libjcalendar-java, javahelp2, libjcalendar-java, ${misc:Depends} +Description: Java Plugin for FreeMind to paste dates and set reminders + This plugin will add a menu point 'Tools -> Show Calendar...'. + +#Package: freemind-plugins-collab-jabber +#Architecture: all +#Depends: openjdk-6-jre | sun-java5-jre | sun-java6-jre | java2-runtime, freemind (= ${binary:Version}), libcommons-logging-java, libcrimson-java, liboro-java, libgnujaxp-java, libjdom0-java, liblog4j1.2-java +#Description: Java Plugin for FreeMind to collaborate over Jabber. +# This plugin will add a menu point 'Tools -> Start Collaboration Mode'. +# . +# Attention, this feature is still alpha-code and not guaranteed to work, +# it might munge your data, eat your dog and quick your baby (or the other way +# around). diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/copyright /tmp/Offd2O1oj4/freemind-0.8.1/debian/copyright --- freemind-0.7.1/debian/copyright 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/debian/copyright 2009-05-14 23:12:10.000000000 +0100 @@ -8,7 +8,7 @@ Copyright: FreeMind - A Program for creating and viewing Mindmaps -Copyright (C) 2000-2001 Joerg Mueller +Copyright (C) 2000-2004 Joerg Mueller and others. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -24,40 +24,6 @@ /usr/share/common-licenses/GPL in the Debian GNU/Linux distribution or on the World Wide Web at . -You can also obtain it by writing to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +You can also obtain it by writing to the Free Software Foundation, +Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - -Files: freemind/freemind/main/ExampleFileFilter.java -Copyright: (c) 2003 Sun Microsystems, Inc. All Rights Reserved. -License: other - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * -Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * -Redistribution in binary form must reproduct the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the distribution. - * - * Neither the name of Sun Microsystems, Inc. or the names of contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * This software is provided "AS IS," without a warranty of any kind. ALL - * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING - * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE - * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT - * BE LIABLE FOR ANY DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT - * OF OR RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR ITS - * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST - * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, - * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY - * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN - * IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that Software is not designed, licensed or intended for - * use in the design, construction, operation or maintenance of any nuclear - * facility. diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/export-freemind-cvs.sh /tmp/Offd2O1oj4/freemind-0.8.1/debian/export-freemind-cvs.sh --- freemind-0.7.1/debian/export-freemind-cvs.sh 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/export-freemind-cvs.sh 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,64 @@ +#!/bin/bash +# This small script can be used to export the FreeMind source tree from CVS +if [ $# -lt 2 ] +then + echo "Usage: $0 " >&2 + echo "Example: $0 0.7.9.rc4 fm_0_8_0_rc4" >&2 + echo "Example: $0 0.8.0+01 FM-0-8-0" >&2 + exit 1 +fi + +freemind_dir="freemind-$1" +freemind_tar="freemind_$1" +mkdir "${freemind_dir}" || exit 1 # we don't want to overwrite anything... +cd "${freemind_dir}" || exit 1 +cvs -d:pserver:anonymous@freemind.cvs.sourceforge.net:/cvsroot/freemind export -r "$2" freemind || exit 1 + +### SAVE FIRST THE WHOLE FREEMIND TREE ### For another version of this script +#cd .. +#mv ${freemind_dir} ${freemind_dir}.complete +#tar cvzf ${freemind_tar}.complete.tar.gz ${freemind_dir}.complete/freemind +#mv ${freemind_dir}.complete ${freemind_dir} +#cd ${freemind_dir} + +### THEN REMOVE UNWANTED FILES ### +rm -vfr freemind/windows-launcher/ +#rm -vf freemind/lib/ant/lib/jaxb-api.jar +rm -vf freemind/lib/ant/lib/dom.jar +#rm -vf freemind/lib/ant/lib/jax-qname.jar +#rm -vf freemind/lib/ant/lib/jaxb-impl.jar +#rm -vf freemind/lib/ant/lib/jaxb-libs.jar +#rm -vf freemind/lib/ant/lib/jaxb-xjc.jar +#rm -vf freemind/lib/ant/lib/namespace.jar +rm -vf freemind/lib/ant/lib/relaxngDatatype.jar +rm -vf freemind/lib/ant/lib/sax.jar +#rm -vf freemind/lib/ant/lib/xsdlib.jar +rm -vf freemind/lib/commons-lang-2.0.jar +rm -vf freemind/lib/forms-1.0.5.jar +rm -vf freemind/lib/jarbundler-1.4.jar +rm -vf freemind/plugins/help/jhall.jar +rm -vf freemind/plugins/time/jcalendar.jar +rm -vf freemind/plugins/svg/js.jar +rm -vf freemind/plugins/svg/batik-* +rm -vf freemind/plugins/svg/pdf-transcoder.jar +rm -vf freemind/plugins/svg/xerces_2_5_0.jar +rm -vf freemind/plugins/svg/xml-apis.jar + +## Required for the collab-jabber plugin - not yet productive +rm -vf freemind/plugins/collaboration/jabber/commons-logging.jar +rm -vf freemind/plugins/collaboration/jabber/crimson-1.1.3.jar +rm -vf freemind/plugins/collaboration/jabber/jakarta-oro.jar +rm -vf freemind/plugins/collaboration/jabber/jaxp-1.1.jar +rm -vf freemind/plugins/collaboration/jabber/jdom.jar +rm -vf freemind/plugins/collaboration/jabber/log4j.jar +rm -vf freemind/plugins/collaboration/jabber/muse.jar + +### CREATE ORIG.TAR.GZ ### +cd .. +if [ -f "${freemind_tar}.orig.tar.gz" ] +then + mv -f "${freemind_tar}.orig.tar.gz" "${freemind_tar}.orig.tar.gz.BAK" \ + || exit 1 +fi +tar cvzf "${freemind_tar}.orig.tar.gz" "${freemind_dir}" || exit 1 +rm -fr "${freemind_dir}" diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind.1 /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind.1 --- freemind-0.7.1/debian/freemind.1 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/debian/freemind.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,84 +0,0 @@ -.\" Hey, EMACS: -*- nroff -*- -.\" First parameter, NAME, should be all caps -.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection -.\" other parameters are allowed: see man(7), man(1) -.TH FREEMIND 1 "February 9, 2004" -.\" Please adjust this date whenever revising the manpage. -.\" -.\" Some roff macros, for reference: -.\" .nh disable hyphenation -.\" .hy enable hyphenation -.\" .ad l left justify -.\" .ad b justify to both left and right margins -.\" .nf disable filling -.\" .fi enable filling -.\" .br insert line break -.\" .sp insert n+1 empty lines -.\" for manpage-specific macros, see man(7) -.SH NAME -freemind \- A Java Program for creating and viewing Mindmaps - -.SH SYNOPSIS -.B freemind -.I - -.SH DESCRIPTION -This manual page documents briefly the -.B freemind -command. -This manual page was written for the Debian distribution -because the original program does not have a manual page. -Instead, it has documentation as a mindmap (see help menu). -.PP -.\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invode bold face and italics, -.\" respectively. -\fBfreemind\fP is a program that allows to create and view so-called -Mind Maps, as well as export them to HTML. - -.SH OPTIONS -This program does not have any option. Just start it! - -.SH ENVIRONMENT -.IP \fBDEBUG\fP -If this environment variable is set, freemind gives more information on how it -finds its different elements. -.IP \fBJAVACMD\fP -Default value for the java virtual machine (the \fBjava\fP command). -.IP \fBJAVA_BINDIR\fP -If $\fBJAVACMD\fP is not set, the java virtual machine is searched under -$\fBJAVA_BINDIR\fP\fI/java\fP. -.IP \fBJAVA_HOME\fP -If $\fBJAVACMD\fP and $\fBJAVA_BINDIR\fP are not set, the java virtual machine -is searched under $\fBJAVA_HOME\fP\fI/bin/java\fP. -.IP \fBPATH\fP -If all $\fBJAVA\fP... environment variables fail, the java virtual machine -command (\fBjava\fP) is searched in the $\fBPATH\fP (with \fBwhich\fP). -.IP \fBCLASSPATH\fP -.IP \fBADD_JARS\fP -The $\fBCLASSPATH\fP variable also lets one specify additional jars, -which is good, if you want to add a new Look&Feel jar (the motif one is so -ugly...). Alternatively, the content of $\fBADD_JARS\fP will be prepended to -$\fBCLASSPATH\fP. - -.SH FILES -.IP \fI/etc/freemind/freemindrc\fP -.IP \fI~/.freemind/freemindrc\fP -.B freemind -tries to read its environment variables from \fI/etc/freemind/freemindrc\fP -and \fI~/.freemind/freemindrc\fP, so that specific settings are possible at -machine and user level. -.IP \fI/usr/bin/java\fP -If all searches through environment variables fail, the java virtual machine -is expected to be \fI/usr/bin/java\fP; -if not, \fBfreemind\fP exits with an error. - -.SH SEE ALSO -The online documentation under -.UR http://freemind.sf.net/ -.I http://freemind.sf.net/ -.UE - -.SH AUTHOR -This manual page was written by Eric Lavarde , -for the Debian project (but may be used by others). diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind-browser.dirs /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind-browser.dirs --- freemind-0.7.1/debian/freemind-browser.dirs 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/freemind-browser.dirs 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1 @@ +usr/share/doc/freemind-browser/browser diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind-browser.docs /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind-browser.docs --- freemind-0.7.1/debian/freemind-browser.docs 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/freemind-browser.docs 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1 @@ +bin/dist/browser diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind-browser.README.Debian /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind-browser.README.Debian --- freemind-0.7.1/debian/freemind-browser.README.Debian 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/freemind-browser.README.Debian 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,21 @@ +freemind-browser for Debian +--------------------------- + +freemind-browser is a java applet to present FreeMind Mindmaps on the web +(read-only). + +freemindbrowser.jar and freemindbrowser.html are examples of files to be used +for this purpose. Place those two files in your web arborescence, make sure that +freemindbrowser.html (or whatever name you gave to it) points properly to +freemindbrowser.jar in the "archive" attribute of the "applet" tag (the example +file assumes that both are in the same directory). + +Then copy a mind-map as well to the same web arborescence, and adapt the +following lines to your need: + + +NOTE: the URL to the map file must be absolute, but can only be on the same + server as the jar file (for security reasons). + +-- Eric Lavarde , Sun, 05 Dec 2004 21:01:14 +0100 diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind.desktop /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind.desktop --- freemind-0.7.1/debian/freemind.desktop 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/debian/freemind.desktop 2009-05-14 23:12:10.000000000 +0100 @@ -1,8 +1,13 @@ [Desktop Entry] -Type=Application -Name=Freemind -Comment=Visual mind mapping tool -Exec=freemind -Categories=Office; +Version=1.0 +Encoding=UTF-8 +Name=FreeMind +Comment=A free mind mapping tool +Exec=/usr/bin/freemind Terminal=false -Icon=FreeMindWindowIcon +Icon=/usr/share/pixmaps/FreeMindWindowIcon.xpm +Type=Application +MimeType=application/x-freemind +Categories=Application;Office; +GenericName=FreeMind + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind.dirs /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind.dirs --- freemind-0.7.1/debian/freemind.dirs 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/debian/freemind.dirs 2009-05-14 23:12:10.000000000 +0100 @@ -1,6 +1,6 @@ usr/bin usr/share/freemind/lib -usr/share/freemind/accessories +usr/share/freemind/plugins usr/share/doc/freemind usr/share/pixmaps etc/freemind diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind.docs /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind.docs --- freemind-0.7.1/debian/freemind.docs 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/debian/freemind.docs 2009-05-14 23:12:10.000000000 +0100 @@ -1,2 +1 @@ bin/dist/doc/freemind.mm -bin/dist/accessories diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind.install /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind.install --- freemind-0.7.1/debian/freemind.install 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/debian/freemind.install 2009-05-14 23:12:10.000000000 +0100 @@ -1,5 +1,14 @@ bin/dist/freemind.sh usr/share/freemind -bin/dist/lib/* usr/share/freemind/lib +bin/dist/lib/freemind.jar usr/share/freemind/lib +bin/dist/lib/ant/lib/jaxb-api.jar usr/share/freemind/lib/ant/lib +bin/dist/lib/ant/lib/jax-qname.jar usr/share/freemind/lib/ant/lib +bin/dist/lib/ant/lib/jaxb-impl.jar usr/share/freemind/lib/ant/lib +bin/dist/lib/ant/lib/jaxb-libs.jar usr/share/freemind/lib/ant/lib +bin/dist/lib/ant/lib/namespace.jar usr/share/freemind/lib/ant/lib +bin/dist/lib/ant/lib/xsdlib.jar usr/share/freemind/lib/ant/lib bin/dist/patterns.xml etc/freemind freemind/images/FreeMindWindowIcon.xpm usr/share/pixmaps +bin/dist/accessories/* usr/share/freemind/accessories debian/freemind.desktop usr/share/applications +debian/urlsee usr/bin +debian/overrides/freemind usr/share/lintian/overrides diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind.links /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind.links --- freemind-0.7.1/debian/freemind.links 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/debian/freemind.links 2009-05-14 23:12:10.000000000 +0100 @@ -1,2 +1,2 @@ usr/share/freemind/freemind.sh usr/bin/freemind -usr/share/freemind/lib/freemind.jar usr/share/java/freemind-0.7.1.jar +usr/share/freemind/lib/freemind.jar usr/share/java/freemind-0.8.0.jar diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind.manpages /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind.manpages --- freemind-0.7.1/debian/freemind.manpages 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/debian/freemind.manpages 2009-05-14 23:12:10.000000000 +0100 @@ -1 +1,2 @@ -debian/freemind.1 +freemind.1 +urlsee.1 diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind.menu /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind.menu --- freemind-0.7.1/debian/freemind.menu 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/debian/freemind.menu 2009-05-14 23:12:10.000000000 +0100 @@ -1,3 +1,3 @@ -?package(freemind):needs="X11" section="Apps/Text"\ +?package(freemind):needs="X11" section="Applications/Office"\ icon="/usr/share/pixmaps/FreeMindWindowIcon.xpm"\ title="FreeMind" command="/usr/bin/freemind" diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind-plugins-collab-jabber.dirs /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind-plugins-collab-jabber.dirs --- freemind-0.7.1/debian/freemind-plugins-collab-jabber.dirs 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/freemind-plugins-collab-jabber.dirs 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,2 @@ +usr/share/freemind/plugins/collaboration/jabber +usr/share/doc/freemind-plugins-collab-jabber diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind-plugins-collab-jabber.docs /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind-plugins-collab-jabber.docs --- freemind-0.7.1/debian/freemind-plugins-collab-jabber.docs 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/freemind-plugins-collab-jabber.docs 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1 @@ +freemind/plugins/collaboration/jabber/readme.txt diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind-plugins-collab-jabber.install /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind-plugins-collab-jabber.install --- freemind-0.7.1/debian/freemind-plugins-collab-jabber.install 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/freemind-plugins-collab-jabber.install 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,2 @@ +bin/dist/plugins/collaboration/jabber usr/share/freemind/plugins/collaboration +bin/dist/plugins/CollaborationJabber.xml usr/share/freemind/plugins diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind-plugins-help.dirs /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind-plugins-help.dirs --- freemind-0.7.1/debian/freemind-plugins-help.dirs 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/freemind-plugins-help.dirs 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,2 @@ +usr/share/freemind/plugins/help +usr/share/doc/freemind-plugins-help diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind-plugins-help.install /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind-plugins-help.install --- freemind-0.7.1/debian/freemind-plugins-help.install 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/freemind-plugins-help.install 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,2 @@ +bin/dist/plugins/help usr/share/freemind/plugins +bin/dist/plugins/FreemindHelp.xml usr/share/freemind/plugins diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind-plugins-svg.dirs /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind-plugins-svg.dirs --- freemind-0.7.1/debian/freemind-plugins-svg.dirs 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/freemind-plugins-svg.dirs 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,2 @@ +usr/share/freemind/plugins/svg +usr/share/doc/freemind-plugins-svg diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind-plugins-svg.install /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind-plugins-svg.install --- freemind-0.7.1/debian/freemind-plugins-svg.install 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/freemind-plugins-svg.install 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,2 @@ +bin/dist/plugins/svg usr/share/freemind/plugins +bin/dist/plugins/ExportSvg.xml usr/share/freemind/plugins diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind-plugins-time.dirs /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind-plugins-time.dirs --- freemind-0.7.1/debian/freemind-plugins-time.dirs 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/freemind-plugins-time.dirs 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,2 @@ +usr/share/freemind/plugins/time +usr/share/doc/freemind-plugins-time diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind-plugins-time.install /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind-plugins-time.install --- freemind-0.7.1/debian/freemind-plugins-time.install 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/freemind-plugins-time.install 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,2 @@ +bin/dist/plugins/time usr/share/freemind/plugins +bin/dist/plugins/TimeManagement.xml usr/share/freemind/plugins diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind.README.Debian /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind.README.Debian --- freemind-0.7.1/debian/freemind.README.Debian 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/freemind.README.Debian 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,7 @@ +freemind for Debian +------------------- + +freemind.mm is the FreeMind help file, itself in FreeMind format. +To read it, start FreeMind and call the menu point 'Help -> Documentation'. + +-- Eric Lavarde , Sun, 05 Dec 2004 21:14:14 +0100 diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind.sgml /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind.sgml --- freemind-0.7.1/debian/freemind.sgml 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/freemind.sgml 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,225 @@ + manpage.1'. You may view + the manual page with: `docbook-to-man manpage.sgml | nroff -man | + less'. A typical entry in a Makefile or Makefile.am is: + +manpage.1: manpage.sgml + docbook-to-man $< > $@ + + + The docbook-to-man binary is found in the docbook-to-man package. + Please remember that if you create the nroff version in one of the + debian/rules file targets (such as build), you will need to include + docbook-to-man in your Build-Depends control field. + + --> + + + Eric"> + Lavarde"> + + 2005-03-16"> + + 1"> + deb@zorglub.s.bawue.de"> + + FREEMIND"> + + + Debian"> + GNU"> + GPL"> +]> + + + +
+ &dhemail; +
+ + &dhfirstname; + &dhsurname; + + + 2003 + &dhusername; + + &dhdate; +
+ + &dhucpackage; + + &dhsection; + + + &dhpackage; + + A Java program for creating and viewing mindmaps. + + + + &dhpackage; + + no_options + + + + + DESCRIPTION + + This manual page documents briefly the + &dhpackage; command. + + This manual page was written for the &debian; distribution + because the original program does not have a manual page. + Instead, it has documentation as a mindmap (see Help menu in + FreeMind). + + &dhpackage; is a program that allows to create + and view so-called mindmaps, as well as export them to HTML or different + image formats. + It also has a plugin concept to extend its functionality. + + + + OPTIONS + + This program does not have any option. Just start it! + + + + ENVIRONMENT VARIABLES + + + + + + If this environment variable is set and non-empty, freemind gives + more information on how it finds its different elements, as well as some + other information. If the variable contains 'exit', the script + exits without starting FreeMind, and if it contains 'script', + set -x is called. + + + + + + + Default value for the java virtual machine (the java command). + + + + + + + If $JAVACMD is not set, the java virtual machine is searched + under $JAVA_BINDIR/java. + + + + + + + If $JAVACMD and $JAVA_BINDIR are not set, the java virtual + machine is searched under $JAVA_HOME/bin/java. + + + + + + + If all $JAVA... environment variables fail, the java virtual + machine command (java) is searched in the $PATH (with which). + + + + + + + + The $CLASSPATH variable also lets one specify additional jars, + which is good, if you want to add a new Look&Feel jar (the motif + one is so ugly...). Alternatively, the content of $ADD_JARS will + be prepended to $CLASSPATH. + + + + + + + Directory where FreeMind searches for its plugins and + libraries + + + + + + FILES + + + + + + + freemind tries to read its environment variables from + /etc/freemind/freemindrc and ~/.freemind/freemindrc, + so that specific settings are possible at machine and user level. + + + + + + + + If all searches through environment variables fail, the + java virtual machine is expected to be /usr/bin/java; if not, + freemind exits with an error. + + + + + + + SEE ALSO + The online documentation under http://freemind.sf.net/, + especially the Linux related one under the Wiki page link + http://freemind.sourceforge.net/wiki/index.php/FreeMind_on_Linux. + + + AUTHOR + + This manual page was written by &dhusername; &dhemail; for + the &debian; system (but may be used by others). Permission is + granted to copy, distribute and/or modify this document under + the terms of the &gnu; General Public License, Version 2 any + later version published by the Free Software Foundation. + + + On Debian systems, the complete text of the GNU General Public + License can be found in /usr/share/common-licenses/GPL. + + + +
+ + + + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind.sharedmimeinfo /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind.sharedmimeinfo --- freemind-0.7.1/debian/freemind.sharedmimeinfo 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/freemind.sharedmimeinfo 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,27 @@ + + + + FreeMind Mapa + FreeMind Map + FreeMind Map + FreeMind Map + FreeMind Mapa + FreeMind Carte Mentale + FreeMind Térkép + FreeMind Mappa + FreeMind マップ + FreeMind 맵 + FreeMind Žemėlapis + FreeMind Map + FreeMind Map + FreeMind Mapa + FreeMind Mapa + FreeMind Mapa + FreeMind Ассоциативная арта + FreeMind Miselni vzorec + FreeMind 思维导图 + FreeMind 心智圖 + + + + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind.TODO /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind.TODO --- freemind-0.7.1/debian/freemind.TODO 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/freemind.TODO 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,12 @@ +- find a way to replace freemind-plugins-help through a free alternative + (because javahelp2 is not free). +- migrate FreeMind to a *free* java engine. +- get Debian packages for all jar files coming as binary with freemind: + ./lib/ant/lib/jaxb-api.jar + ./lib/ant/lib/jax-qname.jar + ./lib/ant/lib/jaxb-impl.jar + ./lib/ant/lib/jaxb-libs.jar + ./lib/ant/lib/jaxb-xjc.jar + ./lib/ant/lib/namespace.jar + ./lib/ant/lib/xsdlib.jar + ./plugins/collaboration/jabber/muse.jar diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/freemind.watch /tmp/Offd2O1oj4/freemind-0.8.1/debian/freemind.watch --- freemind-0.7.1/debian/freemind.watch 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/debian/freemind.watch 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +0,0 @@ -# Example watch control file for uscan -# Rename this file to "watch" and then you can run the "uscan" command -# to check for upstream updates and more. -# Site Directory Pattern Version Script -version=2 -freemind.sf.net /pub/Linux/Incoming freemind-(.*)\.tar\.gz debian uupdate diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/overrides/freemind /tmp/Offd2O1oj4/freemind-0.8.1/debian/overrides/freemind --- freemind-0.7.1/debian/overrides/freemind 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/overrides/freemind 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1 @@ +freemind binary: package-contains-empty-directory usr/share/freemind/plugins/ diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/01_build_xml.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/01_build_xml.patch --- freemind-0.7.1/debian/patches/01_build_xml.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/01_build_xml.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,75 @@ +--- freemind/build.xml ++++ freemind/build.xml +@@ -16,17 +16,13 @@ + + + +- +- + + + + +- +- +- ++ ++ ++ + + + + + +- +- + + + +@@ -123,11 +117,6 @@ + + + +- +- +- + + + +@@ -308,21 +297,26 @@ + + + +- ++ ++ + +- + ++ ++ ++ + + + +- ++ + + + +- + ++ ++ ++ + + + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/02_build_xml.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/02_build_xml.patch --- freemind-0.7.1/debian/patches/02_build_xml.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/02_build_xml.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,13 @@ +--- freemind/build.xml 2005-11-08 14:28:18.000000000 +0100 ++++ freemind/build.xml 2005-11-08 14:27:58.000000000 +0100 +@@ -12,8 +12,8 @@ + + + +- +- ++ ++ + + + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/02_manifest.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/02_manifest.patch --- freemind-0.7.1/debian/patches/02_manifest.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/02_manifest.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,8 @@ +--- freemind/MANIFEST.MF ++++ freemind/MANIFEST.MF +@@ -1,5 +1,4 @@ + Manifest-Version: 1.0 + Main-Class: freemind.main.FreeMind +-Class-Path: freemind.jar ant/lib/jaxb-api.jar ant/lib/jaxb-impl.jar ant/lib/jaxb-libs.jar ant/lib/namespace.jar ant/lib/relaxngDatatype.jar ant/lib/xsdlib.jar ant/lib/jax-qname.jar ant/lib/sax.jar ant/lib/dom.jar ../ commons-lang-2.0.jar forms-1.0.5.jar + Created-By: Joerg Mueller + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/03_freemind_sh_cairo.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/03_freemind_sh_cairo.patch --- freemind-0.7.1/debian/patches/03_freemind_sh_cairo.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/03_freemind_sh_cairo.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,10 @@ +--- freemind/freemind.sh 2006-01-18 12:29:44.000000000 +0000 ++++ freemind/freemind.sh 2006-01-18 12:32:14.000000000 +0000 +@@ -138,5 +138,5 @@ + ${freedir}/lib/ant/lib/dom.jar:\ + ${freedir}/lib/forms-1.0.5.jar:\ + ${freedir}" +-_debug "Calling: '${JAVACMD} -Dfreemind.base.dir=${freedir} -cp ${CLASSPATH} freemind.main.FreeMind $@'." +-"${JAVACMD}" -Dfreemind.base.dir="${freedir}" -cp "${CLASSPATH}" freemind.main.FreeMind "$@" ++_debug "Calling: '${JAVACMD} -Dgnu.java.awt.peer.gtk.Graphics=Graphics2D -Dfreemind.base.dir=${freedir} -cp ${CLASSPATH} freemind.main.FreeMind $@'." ++"${JAVACMD}" -Dgnu.java.awt.peer.gtk.Graphics=Graphics2D -Dfreemind.base.dir="${freedir}" -cp "${CLASSPATH}" freemind.main.FreeMind "$@" diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/03_freemind_sh.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/03_freemind_sh.patch --- freemind-0.7.1/debian/patches/03_freemind_sh.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/03_freemind_sh.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,91 @@ +--- freemind/freemind.sh 2005-11-09 13:44:32.000000000 +0000 ++++ freemind/freemind.sh 2005-11-09 14:19:16.000000000 +0000 +@@ -7,6 +7,7 @@ + # 2005-01-16, added usage of FREEMIND_BASE_DIR variable + # 2005-02-18, add -Dfreemind.base.dir to make plugins work, add some "" + # and enhance debug mode. ++# 2005-11-09, add some dpkg/rpm information and check for Sun/Blackdown VM. + + _debug() { + if [ -n "${DEBUG}" ] +@@ -60,12 +61,24 @@ + _debug "Using '$JAVACMD' as java virtual machine..." + if [ -n "${DEBUG}" ] + then +- "$JAVACMD" -version ++ "$JAVACMD" -version >&2 ++ fi ++ if (! "${JAVACMD}" -version 2>&1 | grep -qe \ ++ 'Java(TM) 2 Runtime Environment, Standard Edition') ++ then ++ _error "Your Java virtual machine is neither Sun nor Blackdown," \ ++ "=======================================" \ ++ "FREEMIND WILL MOST PROBABLY *NOT* WORK," \ ++ "=======================================" \ ++ "define JAVACMD, JAVA_BINDIR, JAVA_HOME or PATH in order" \ ++ "to point to such a VM. See the manpage of freemind(1) for details." ++ return 0 + fi + return 0 + else + _error "Couldn't find a java virtual machine," \ +- "define JAVACMD, JAVA_BINDIR, JAVA_HOME or PATH." ++ "define JAVACMD, JAVA_BINDIR, JAVA_HOME or PATH." \ ++ "See the manpage of freemind(1) for details." + return 1 + fi + } +@@ -78,8 +91,25 @@ + fi + } + +-_debug "Freemind parameters are '${@}'." +-_debug "$(uname -a)" ++output_info() { ++ if [ -z "${DEBUG}" ] ++ then ++ return 0 ++ fi ++ _debug "Freemind parameters are '${@}'." ++ _debug "$(uname -a)" ++ if [ -x $(which dpkg) ] ++ then ++ _debug "The following DEB packages are installed:" ++ COLUMNS=132 dpkg -l \*freemind\* \*j\* | grep -v '' >&2 ++ elif [ -x $(which rpm) ] ++ then ++ _debug "The following RPM packages are installed:" ++ rpm -qa | grep -i -e freemind -e j >&2 ++ else ++ _debug "Neither dpkg nor rpm is installed." ++ fi ++} + + _source /etc/freemind/freemindrc + _source ~/.freemind/freemindrc +@@ -90,6 +120,8 @@ + exit 1 + fi + ++output_info ++ + freepath=$(dirname "$0") + freepath="${freepath%/bin}" # nothing happens if freemind is not installed + # under something/bin +@@ -131,12 +163,12 @@ + ${freedir}/lib/ant/lib/jaxb-impl.jar:\ + ${freedir}/lib/ant/lib/jaxb-libs.jar:\ + ${freedir}/lib/ant/lib/namespace.jar:\ +-${freedir}/lib/ant/lib/relaxngDatatype.jar:\ + ${freedir}/lib/ant/lib/xsdlib.jar:\ + ${freedir}/lib/ant/lib/jax-qname.jar:\ +-${freedir}/lib/ant/lib/sax.jar:\ +-${freedir}/lib/ant/lib/dom.jar:\ +-${freedir}/lib/forms-1.0.5.jar:\ ++/usr/share/java/forms.jar:\ ++/usr/share/java/commons-lang.jar:\ ++/usr/share/java/jaxp-1.3.jar:/usr/share/java/jaxp-1.2.jar:\ ++/usr/share/java/relaxngDatatype.jar:\ + ${freedir}" + _debug "Calling: '${JAVACMD} -Dfreemind.base.dir=${freedir} -cp ${CLASSPATH} freemind.main.FreeMind $@'." + "${JAVACMD}" -Dfreemind.base.dir="${freedir}" -cp "${CLASSPATH}" freemind.main.FreeMind "$@" diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/04_freemind_properties.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/04_freemind_properties.patch --- freemind-0.7.1/debian/patches/04_freemind_properties.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/04_freemind_properties.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,31 @@ +--- freemind/freemind.properties ++++ freemind/freemind.properties +@@ -74,8 +74,8 @@ + #Set Links either relative or absolute + links = relative + #The URL of the documentation mindmap (.mm) +-docmapurl = ./doc/freemind.mm +-docmapurl_since_version_0_7_0 = ./doc/freemind.mm ++docmapurl = file:/usr/share/doc/freemind/freemind.mm ++docmapurl_since_version_0_7_0 = file:/usr/share/doc/freemind/freemind.mm + #This is a hash that maps endings of files to programs which should be used to open them. + #It is only used by the application,not by the applet. + #Special keywords: "default" instead of file and "execute" instead of program +@@ -252,7 +252,7 @@ + # The Browse Mode + # + #The URL of the map that is loaded when browsemode starts up +-browsemode_initial_map = ./doc/freemind.mm ++browsemode_initial_map = file:/usr/share/doc/freemind/freemind.mm + + # + # The default browser setting +@@ -274,7 +274,7 @@ + # Here the default browser for other operating systems goes: + # + # other is typically Linux: +-default_browser_command_other_os = mozilla {0} ++default_browser_command_other_os = urlsee {0} + # + # and MAC: (thanks to Nick!) + default_browser_command_mac = open -a /Applications/Safari.app {0} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/05_user_properties.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/05_user_properties.patch --- freemind-0.7.1/debian/patches/05_user_properties.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/05_user_properties.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,31 @@ +--- freemind/user.properties ++++ freemind/user.properties +@@ -74,8 +74,8 @@ + #Set Links either relative or absolute + links = relative + #The URL of the documentation mindmap (.mm) +-docmapurl = ./doc/freemind.mm +-docmapurl_since_version_0_7_0 = ./doc/freemind.mm ++docmapurl = file:/usr/share/doc/freemind/freemind.mm ++docmapurl_since_version_0_7_0 = file:/usr/share/doc/freemind/freemind.mm + #This is a hash that maps endings of files to programs which should be used to open them. + #It is only used by the application,not by the applet. + #Special keywords: "default" instead of file and "execute" instead of program +@@ -252,7 +252,7 @@ + # The Browse Mode + # + #The URL of the map that is loaded when browsemode starts up +-browsemode_initial_map = ./doc/freemind.mm ++browsemode_initial_map = file:/usr/share/doc/freemind/freemind.mm + + # + # The default browser setting +@@ -274,7 +274,7 @@ + # Here the default browser for other operating systems goes: + # + # other is typically Linux: +-default_browser_command_other_os = mozilla {0} ++default_browser_command_other_os = urlsee {0} + # + # and MAC: (thanks to Nick!) + default_browser_command_mac = open -a /Applications/Safari.app {0} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/06_build_xml_jaxme.nopatch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/06_build_xml_jaxme.nopatch --- freemind-0.7.1/debian/patches/06_build_xml_jaxme.nopatch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/06_build_xml_jaxme.nopatch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,24 @@ +--- freemind/build.xml 2005-10-24 18:32:31.000000000 +0000 ++++ freemind/build.xml 2005-10-24 18:41:57.000000000 +0000 +@@ -16,18 +16,19 @@ + + + ++ + + + + + + +- ++ + + + + +- + + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/06_fontsizeaction.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/06_fontsizeaction.patch --- freemind-0.7.1/debian/patches/06_fontsizeaction.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/06_fontsizeaction.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,11 @@ +--- freemind/freemind/modes/actions/FontSizeAction.java 2004-10-18 01:00:10.000000000 +0200 ++++ freemind/freemind/modes/actions/FontSizeAction.java 2005-11-08 14:02:45.000000000 +0100 +@@ -25,7 +25,7 @@ + + import javax.xml.bind.JAXBException; + +-import sun.java2d.loops.FontInfo; ++// import sun.java2d.loops.FontInfo; // NOT NEEDED + + import freemind.controller.actions.ActionPair; + import freemind.controller.actions.NodeActorXml; diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/07_freemind_sh_jaxme.nopatch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/07_freemind_sh_jaxme.nopatch --- freemind-0.7.1/debian/patches/07_freemind_sh_jaxme.nopatch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/07_freemind_sh_jaxme.nopatch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,23 @@ +--- freemind/freemind.sh 2005-10-24 18:43:56.000000000 +0000 ++++ freemind/freemind.sh 2005-10-24 18:45:52.000000000 +0000 +@@ -126,13 +126,15 @@ + # The CLASSPATH also lets one specify additional jars, which is good, if + # you want to add a new Look&Feel jar (the motif one is so ugly...). + # ++jaxme.dir=/home/ericl/ws-jaxme-0.5/lib + CLASSPATH="${ADD_JARS}:${CLASSPATH}:${freedir}/lib/freemind.jar:\ +-${freedir}/lib/ant/lib/jaxb-api.jar:\ +-${freedir}/lib/ant/lib/jaxb-impl.jar:\ +-${freedir}/lib/ant/lib/jaxb-libs.jar:\ +-${freedir}/lib/ant/lib/namespace.jar:\ ++${jaxme.dir}/jaxme2-0.5.jar:\ ++${jaxme.dir}/jaxme2-rt-0.5.jar:\ ++${jaxme.dir}/jaxmeapi-0.5.jar:\ ++${jaxme.dir}/jaxmejs-0.5.jar:\ ++${jaxme.dir}/jaxmepm-0.5.jar:\ ++${jaxme.dir}/jaxmexs-0.5.jar:\ + ${freedir}/lib/ant/lib/xsdlib.jar:\ +-${freedir}/lib/ant/lib/jax-qname.jar:\ + /usr/share/java/forms.jar:\ + /usr/share/java/commons-lang.jar:\ + /usr/share/java/jaxp-1.2.jar:/usr/share/java/jaxp-1.3.jar:\ diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/07_jaxme_actions_xsd.nopatch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/07_jaxme_actions_xsd.nopatch --- freemind-0.7.1/debian/patches/07_jaxme_actions_xsd.nopatch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/07_jaxme_actions_xsd.nopatch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,15 @@ +--- freemind/freemind_actions.xsd 2005-11-13 12:08:49.000000000 +0000 ++++ freemind/freemind_actions.NEW.xsd 2005-11-13 12:12:51.000000000 +0000 +@@ -772,7 +772,11 @@ + + + +- ++ ++ ++ ++ ++ + + + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/10_plug_collab_jabber.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/10_plug_collab_jabber.patch --- freemind-0.7.1/debian/patches/10_plug_collab_jabber.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/10_plug_collab_jabber.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,20 @@ +--- freemind/plugins/CollaborationJabber.xml ++++ freemind/plugins/CollaborationJabber.xml +@@ -1,11 +1,11 @@ + + +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ + + + + + +- ++ + + + + + +- +\ No newline at end of file ++ diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/20_plug_svg.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/20_plug_svg.patch --- freemind-0.7.1/debian/patches/20_plug_svg.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/20_plug_svg.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,45 @@ +--- freemind-0.8.0/freemind/plugins/ExportSvg.xml 2005-10-22 15:07:23.000000000 +0000 ++++ ExportSvg.xml 2005-10-22 15:07:04.000000000 +0000 +@@ -1,27 +1,14 @@ + + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ + + + +- +\ No newline at end of file ++ diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/21_plug_svg_build.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/21_plug_svg_build.patch --- freemind-0.7.1/debian/patches/21_plug_svg_build.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/21_plug_svg_build.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,15 @@ +--- freemind-0.8.0/freemind/plugins/build_svg.xml 2005-10-22 14:04:46.000000000 +0000 ++++ build_svg.xml 2005-10-22 14:03:17.000000000 +0000 +@@ -6,9 +6,9 @@ + + +- ++ + + + + +- +\ No newline at end of file ++ diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/30_plug_help.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/30_plug_help.patch --- freemind-0.7.1/debian/patches/30_plug_help.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/30_plug_help.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,17 @@ +--- freemind/plugins/FreemindHelp.xml ++++ freemind/plugins/FreemindHelp.xml +@@ -1,6 +1,6 @@ + + +- ++ + + + + +- +\ No newline at end of file ++ diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/31_plug_help_build.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/31_plug_help_build.patch --- freemind-0.7.1/debian/patches/31_plug_help_build.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/31_plug_help_build.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,16 @@ +--- freemind/plugins/build_help.xml ++++ freemind/plugins/build_help.xml +@@ -4,10 +4,10 @@ + + + +- ++ + + + + + +- +\ No newline at end of file ++ diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/32_plug_help_manifest.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/32_plug_help_manifest.patch --- freemind-0.7.1/debian/patches/32_plug_help_manifest.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/32_plug_help_manifest.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,8 @@ +--- freemind/plugins/help/doc/manifest.mf ++++ freemind/plugins/help/doc/manifest.mf +@@ -1,4 +1,4 @@ + Main-Class: sunw.demo.jhdemo.Runner + Run-Class: sunw.demo.jhdemo.JHLauncher +-Class-Path: hsviewer.jar jhall.jar doc ++Class-Path: hsviewer.jar /usr/share/java/jhall.jar doc + Arguments: -helpset .doc/freemind.hs diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/40_plug_time.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/40_plug_time.patch --- freemind-0.7.1/debian/patches/40_plug_time.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/40_plug_time.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,18 @@ +--- freemind/plugins/TimeManagement.xml ++++ freemind/plugins/TimeManagement.xml +@@ -1,7 +1,7 @@ + + + +- ++ + + +@@ -50,4 +50,4 @@ + location="menu_bar/extras/first/time_management/remove_reminder"/> + + +- +\ No newline at end of file ++ diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/41_plug_time_build.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/41_plug_time_build.patch --- freemind-0.7.1/debian/patches/41_plug_time_build.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/41_plug_time_build.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,15 @@ +--- freemind/plugins/build_time.xml ++++ freemind/plugins/build_time.xml +@@ -4,9 +4,9 @@ + + + +- ++ + + + + +- +\ No newline at end of file ++ diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/50_base64_tools.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/50_base64_tools.patch --- freemind-0.7.1/debian/patches/50_base64_tools.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/50_base64_tools.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,36 @@ +--- freemind/freemind/main/Tools.java 2005-11-08 13:08:15.000000000 +0000 ++++ freemind/freemind/main/Tools.java 2005-11-08 13:11:12.000000000 +0000 +@@ -42,6 +42,7 @@ + import java.util.zip.DataFormatException; + import java.util.zip.Deflater; + import java.util.zip.Inflater; ++import org.apache.commons.codec.binary.Base64; // required for Base64 encoding + + public class Tools { + +@@ -562,21 +563,17 @@ + * @return + */ + public static String toBase64(byte[] byteBuffer) { +- return (new sun.misc.BASE64Encoder()).encode(byteBuffer); ++ // return (new sun.misc.BASE64Encoder()).encode(byteBuffer); ++ return (new String(Base64.encodeBase64Chunked(byteBuffer))); + } + + /** + * @param base64String + * @return +- * @throws IOException + */ + public static byte[] fromBase64(String base64String) { +- try { +- return new sun.misc.BASE64Decoder().decodeBuffer(base64String); +- } catch (IOException e) { +- e.printStackTrace(); +- throw new RuntimeException("Base64 unpacking not allowed"); +- } ++ // return new sun.misc.BASE64Decoder().decodeBuffer(base64String); ++ return Base64.decodeBase64(base64String.getBytes()); + } + + public static String compress(String message) { diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/51_base64_build_xml.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/51_base64_build_xml.patch --- freemind-0.7.1/debian/patches/51_base64_build_xml.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/51_base64_build_xml.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,11 @@ +--- freemind/build.xml 2005-11-08 13:53:49.000000000 +0100 ++++ freemind/build.xml 2005-11-08 13:54:56.000000000 +0100 +@@ -24,7 +24,7 @@ + + + +- ++ + + + &2 + fi +- if (! "${JAVACMD}" -version 2>&1 | grep -qe \ +- 'Java(TM) 2 Runtime Environment, Standard Edition') ++ if (! "${JAVACMD}" -version 2>&1 | grep -qe 'Java(TM)' -e 'OpenJDK') + then +- _error "Your Java virtual machine is neither Sun nor Blackdown," \ ++ _error "Your Java is not a complete implementation," \ + "=======================================" \ + "FREEMIND WILL MOST PROBABLY *NOT* WORK," \ + "=======================================" \ + "define JAVACMD, JAVA_BINDIR, JAVA_HOME or PATH in order" \ + "to point to such a VM. See the manpage of freemind(1) for details." +- return 0 ++ JAVA_TYPE=other ++ else ++ JAVA_TYPE=sun + fi + return 0 + else + _error "Couldn't find a java virtual machine," \ +- "define JAVACMD, JAVA_BINDIR, JAVA_HOME or PATH." \ +- "See the manpage of freemind(1) for details." ++ "define JAVACMD, JAVA_BINDIR, JAVA_HOME or PATH." + return 1 + fi + } +@@ -92,26 +104,36 @@ + fi + } + +-output_info() { ++output_debug_info() { + if [ -z "${DEBUG}" ] + then + return 0 + fi + _debug "Freemind parameters are '${@}'." + _debug "$(uname -a)" +- if [ -x $(which dpkg) ] ++ if [ -x "$(which lsb_release 2>/dev/null)" ] ++ then ++ _debug "$(lsb_release -a)" ++ else ++ _debug "System is not LSB conform, 'lsb_release' does not exist." ++ fi ++ if [ -x "$(which dpkg 2>/dev/null)" ] + then + _debug "The following DEB packages are installed:" +- COLUMNS=132 dpkg -l \*freemind\* \*j\* | grep -v '' >&2 +- elif [ -x $(which rpm) ] ++ COLUMNS=132 dpkg -l | grep -i -e freemind >&2 ++ elif [ -x "$(which rpm 2>/dev/null)" ] + then + _debug "The following RPM packages are installed:" +- rpm -qa | grep -i -e freemind -e j >&2 ++ rpm -qa | grep -i -e freemind >&2 + else + _debug "Neither dpkg nor rpm is installed." + fi + } + ++########## START MAIN PART ############################################# ++ ++#--------- Put the environment together -------------------------------- ++ + _source /etc/freemind/freemindrc + _source ~/.freemind/freemindrc + +@@ -121,9 +143,18 @@ + exit 1 + fi + +-output_info ++output_debug_info + +-freepath=$(dirname "$0") ++if [ -L "$0" ] && [ -x $(which readlink) ] ++then # if the script is a link and we have 'readlink' to follow it ++ # -m should be faster and link does always resolve, else this script ++ # wouldn't be called, would it? ++ freefile=$(readlink -mn "$0") ++ _debug "Link '$0' resolved to '${freefile}'." ++else ++ freefile="$0" ++fi ++freepath=$(dirname "${freefile}") + freepath="${freepath%/bin}" # nothing happens if freemind is not installed + # under something/bin + +@@ -156,6 +187,8 @@ + cp /etc/freemind/patterns.xml ~/.freemind/patterns.xml + fi + ++#--------- Call (at last) FreeMind ------------------------------------- ++ + # The CLASSPATH also lets one specify additional jars, which is good, if + # you want to add a new Look&Feel jar (the motif one is so ugly...). + # +@@ -172,5 +205,13 @@ + /usr/share/java/relaxngDatatype.jar:\ + /usr/share/java/commons-codec.jar:\ + ${freedir}" +-_debug "Calling: '${JAVACMD} -Dgnu.java.awt.peer.gtk.Graphics=Graphics2D -Dfreemind.base.dir=${freedir} -cp ${CLASSPATH} freemind.main.FreeMind $@'." +-"${JAVACMD}" -Dgnu.java.awt.peer.gtk.Graphics=Graphics2D -Dfreemind.base.dir="${freedir}" -cp "${CLASSPATH}" freemind.main.FreeMind "$@" ++if [ "${JAVA_TYPE}" = "sun" ] ++then ++ _debug "Calling: '${JAVACMD} -Dfreemind.base.dir=${freedir} -cp ${CLASSPATH} freemind.main.FreeMind $@'." ++ ( echo "${DEBUG}" | grep -qe "exit" ) && exit 0 # do not start FreeMind ++ "${JAVACMD}" -Dfreemind.base.dir="${freedir}" -cp "${CLASSPATH}" freemind.main.FreeMind "$@" ++else # non-Sun environments don't work currently. ++ _debug "Calling: '${JAVACMD} -Dgnu.java.awt.peer.gtk.Graphics=Graphics2D -Dfreemind.base.dir=${freedir} -cp ${CLASSPATH} freemind.main.FreeMind $@'." ++ ( echo "${DEBUG}" | grep -qe "exit" ) && exit 0 # do not start FreeMind ++ "${JAVACMD}" -Dgnu.java.awt.peer.gtk.Graphics=Graphics2D -Dfreemind.base.dir="${freedir}" -cp "${CLASSPATH}" freemind.main.FreeMind "$@" ++fi diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/99_Resources_fr.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/99_Resources_fr.patch --- freemind-0.7.1/debian/patches/99_Resources_fr.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/99_Resources_fr.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,1663 @@ +--- freemind/Resources_fr.properties 2005-08-03 22:09:24.000000000 +0200 ++++ freemind/Resources_fr.properties 2005-10-27 09:35:45.000000000 +0200 +@@ -1,5 +1,6 @@ + # made by Sylvain GAMEL - sgamel +-about = \u00C0 propos ++# revised by Eric Lavarde 2005-10-26 ++about = \u00c0 propos + #Joerg Mueller's FreeMind + #Taking the Concept-Mapping approach to Human-Computer Interface design. + #Copyright (C) 2000-2004 Joerg Mueller and others. +@@ -7,7 +8,7 @@ + #Home\: http\://freemind.sourceforge.net/ + #Have fun\! + #Version\: +-about_text = FreeMind de Joerg Mueller\nApplication du concept des cartes mentales \u00E0 l'interface Homme Machine.\nCopyright (C) 2000-2001 Joerg Mueller \nCe programme est un logiciel libre (GPL)\nAller sur http\://freemind.sourceforge.net/\nAmusez-vous \!\nVersion\: ++about_text = FreeMind de Joerg Mueller\nApplication du concept des cartes mentales \u00e0 l'interface Homme Machine.\nTous droits r\u00e9serv\u00e9s \u00a9 2000-2001 Joerg Mueller \nCe programme est un logiciel libre (GPL)\nAller sur http\://freemind.sourceforge.net/\nAmusez-vous \!\nVersion\: + #Antialias All + antialias_all = Tout lisser + #Antialias Edges +@@ -17,9 +18,9 @@ + #Background + background = Fond + #Bezier +-bezier = B\u00E9zier ++bezier = B\u00e9zier + #Blend Color +-blend_color = M\u00E9lange les couleurs ++blend_color = \u00c9claircir la couleur + #Bold + bold = Gras + #Boldify +@@ -38,69 +39,69 @@ + copy = Copier + copy_single = Copier un seul + cut = Couper +-decrease_branch_font_size = R\u00E9duire la taille de police de la branche +-decrease_node_font_size = R\u00E9duire la taille de police du n\u0153ud ++decrease_branch_font_size = R\u00e9duire la taille de police de la branche ++decrease_node_font_size = R\u00e9duire la taille de police du n\u0153ud + documentation = Documentation + edge = Bord + #Edge Color... + edge_color = Couleur du bord... + edge_width_parent = du parent + edge_width_thin = fine +-edit = \u00C9diter +-edit_link_manually = \u00C9diter le lien manuellement +-edit_long_node = \u00C9diter un n\u0153ud long +-enter_base_url = Je vais coller les liens associ\u00E9s. Merci de saisir l'URL de base. +-enter_confirms = "Entr\u00E9e" confirme ++edit = \u00c9diter ++edit_link_manually = \u00c9diter le lien manuellement ++edit_long_node = \u00c9diter un n\u0153ud long ++enter_base_url = Je vais coller les liens associ\u00e9s. Merci de saisir l'URL de base. ++enter_confirms = "Entr\u00e9e" confirme + export_branch = Exporter la branche + export_branch_to_html = Exporter la branche en HTML + export_to_html = Exporter en HTML + extension_menu = Style + file = Fichier +-file_not_found = Le fichier $1 n'a pas \u00E9t\u00E9 trouv\u00E9 ++file_not_found = Le fichier $1 n'a pas \u00e9t\u00e9 trouv\u00e9 + find = Chercher... + find_what=Que chercher ? + find_next = Chercher le suivant + fold = Plier +-follow_link = Follow Link ++follow_link = Suivre le lien + font = Police + #Fork +-fork = Branche ++fork = Fourche + help = Aide +-html_export_based_on_headings = Export en HTML - Bas\u00E9 sur les ent\u00EAtes +-html_export_no_folding = Export en HTML - Tout d\u00E9pli\u00E9 ++html_export_based_on_headings = Export en HTML - Bas\u00e9 sur les en-t\u00eates ++html_export_no_folding = Export en HTML - Tout d\u00e9pli\u00e9 + html_export_fold_currently_folded = Export en HTML - Respecte les pliages actuels +-html_export_fold_all = Export en HTML - Tout pli\u00E9 ++html_export_fold_all = Export en HTML - Tout pli\u00e9 + #Icons +-icon_menu = Ic\u00F4nes ++icon_menu = Ic\u00f4nes + icon_help = Question + #Important + icon_messagebox_warning = Important +-icon_idea=Id\u00E9e +-icon_button_ok = Valider +-icon_button_cancel = Invalide ++icon_idea=Id\u00e9e ++icon_button_ok = Valide ++icon_button_cancel = Invalid\u00e9 + icon_back = Reculer + icon_forward = Avancer +-icon_attach = Pi\u00E8ce jointe +-icon_ksmiletris = Bonne humeur ++icon_attach = Pi\u00e8ce jointe ++icon_ksmiletris = Je suis content + icon_clanbomber = Danger + icon_desktop_new = Bureau + icon_flag = Drapeau + icon_gohome = Accueil +-icon_kaddressbook = T\u00E9l\u00E9phone ++icon_kaddressbook = T\u00e9l\u00e9phone + icon_knotify = Musique +-icon_korn=Boite \u00E0 lettre ++icon_korn=Bo\u00eete \u00e0 lettres + #Mail + icon_Mail = Message + #Key + icon_password = Clef + #To be refined +-icon_pencil = Modifier ++icon_pencil = \u00c0 modifier + #Stop + icon_stop = Stop + #Magic + icon_wizard = Magique + #To be discussed +-icon_xmag = \u00C0 discuter ++icon_xmag = \u00c0 discuter + icon_bell = Se souvenir + icon_bookmark = Excellent + #Linux +@@ -114,11 +115,11 @@ + #Explorer Favorites... + import_explorer_favorites = Importer les favoris d'Explorer + #Folder Structure... +-import_folder_structure = Importer une arboresce de r\u00E9pertoires ++import_folder_structure = Importer une arborescence de r\u00e9pertoires + #Linked Branch +-import_linked_branch = Importer une branche li\u00E9e ++import_linked_branch = Importer une branche li\u00e9e + #(Linked Branch) Without Root... +-import_linked_branch_without_root = (la branche li\u00E9e) sans la racine ++import_linked_branch_without_root = (la branche li\u00e9e) sans la racine + #Larger Font + increase_branch_font_size = Augmenter la tailler de police de la branche + #Larger Font +@@ -148,23 +149,23 @@ + #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. +-license_text=FreeMind - Une application pour cr\u00E9er et visualiser des Cartes Mentales\nCopyright (C) 2000 Joerg Mueller \nPour plus de d\u00E9tails, se reporter au fichier COPYING\n\nCe logiciel est un logiciel libre. Vous pouvez le redistribuer et/ou\nle modifier en respectant les termes de la GNU General Public License\ntelle qu'elle est publi\u00E9e par la Free Software Foundation; soit avec la version 2\nde la License, ou (selon votre choix) toute version ult\u00E9rieure.\n\nCe logiciel est distribu\u00E9 dans l'espoir qu'il vous soit utile,\nmais SANS AUCUNE GARANTIE ; sans m\u00EAme la garantie implicite d'une VALEUR MARCHANDE ou\nl'AD\u00C9QUATION \u00C0 UN BESOIN SP\u00C9CIFIQUE.\nReportez-vous \u00E0 la Licence Publique G\u00E9n\u00E9rale GNU pour de plus amples informations.\n\nVous devriez avoir re\u00E7u une copie de la Licence Publique G\u00E9n\u00E9rale GNU\navec ce logiciel. Si tel n'est pas le cas, \u00E9crivez \u00E0 \:\nFree Software Foundation, Inc.\n59 Temple Place\nSuite 330,\nBoston, MA 02111-1307, USA. ++license_text=FreeMind - Une application pour cr\u00e9er et visualiser des Cartes Mentales\nTous droits r\u00e9serv\u00e9s \u00a9 2000 Joerg Mueller \nPour plus de d\u00e9tails, se reporter au fichier COPYING\n\nCe logiciel est un logiciel libre. Vous pouvez le redistribuer et/ou\nle modifier en respectant les termes de la GNU General Public License\ntelle qu'elle est publi\u00e9e par la Free Software Foundation; soit avec la version 2\nde la License, ou (selon votre choix) toute version ult\u00e9rieure.\n\nCe logiciel est distribu\u00e9 dans l'espoir qu'il vous soit utile,\nmais SANS AUCUNE GARANTIE ; sans m\u00eame la garantie implicite d'une VALEUR MARCHANDE ou\nl'AD\u00c9QUATION \u00c0 UN BESOIN SP\u00c9CIFIQUE.\nReportez-vous \u00e0 la Licence Publique G\u00e9n\u00e9rale GNU pour de plus amples informations.\n\nVous devriez avoir re\u00e7u une copie de la Licence Publique G\u00e9n\u00e9rale GNU\navec ce logiciel. Si tel n'est pas le cas, \u00e9crivez \u00e0 \:\nFree Software Foundation, Inc.\n59 Temple Place\nSuite 330,\nBoston, MA 02111-1307, USA. + #Linear + linear = rectiligne + #Locking of the map $1 failed. Opening as read-only. + locking_failed_by_open = Je n'ai pas pu verrouiller la carte $1. Ouverture en lecture-seule. + #Locking of the map $1 failed. Action Save As aborted. +-locking_failed_by_save_as = Je n'ai pas pu verrouiller la carte $1. Op\u00E9ration "Sauver sous" abandonn\u00E9e. ++locking_failed_by_save_as = Je n'ai pas pu verrouiller la carte $1. Op\u00e9ration "Sauver sous" abandonn\u00e9e. + #The map $1 was locked by the user $2. The lock has been removed because it is old. +-locking_old_lock_removed = La carte $1 a \u00E9t\u00E9 verrouill\u00E9e par l'utilisateur $2. Le verrou a \u00E9t\u00E9 supprim\u00E9 car il est ancien. ++locking_old_lock_removed = La carte $1 a \u00e9t\u00e9 verrouill\u00e9e par l'utilisateur $2. Le verrou a \u00e9t\u00e9 supprim\u00e9 car il est ancien. + #The map already exists. Do you want to overwrite it? +-map_already_exists = La carte existe d\u00E9j\u00E0. Souhaitez-vous vraiment l'\u00E9craser ? ++map_already_exists = La carte existe d\u00e9j\u00e0. Souhaitez-vous vraiment l'\u00e9craser ? + #Map corrupted. View detail? +-map_corrupted = Carte d\u00E9t\u00E9rior\u00E9e. Afficher les d\u00E9tails ? ++map_corrupted = Carte d\u00e9t\u00e9rior\u00e9e. Afficher les d\u00e9tails ? + #The map $1 is already being edited by the user $2. Opening as read-only. +-map_locked_by_open = La carte $1 est actuellement \u00E9dit\u00E9e par l'utilisateur $2. Ouverture en lecture-seule. ++map_locked_by_open = La carte $1 est actuellement \u00e9dit\u00e9e par l'utilisateur $2. Ouverture en lecture-seule. + #The map $1 is being edited by the user $2. Action Save As aborted. +-map_locked_by_save_as = La carte $1 est actuellement \u00E9dit\u00E9e par l'utilisateur $2. L'op\u00E9ration "Sauver sous" est abandonn\u00E9e. ++map_locked_by_save_as = La carte $1 est actuellement \u00e9dit\u00e9e par l'utilisateur $2. L'op\u00e9ration "Sauver sous" est abandonn\u00e9e. + #Map + mindmap = Carte + #Maps +@@ -174,25 +175,25 @@ + #Mode not available + mode_na = Mode indisponible + #Mode changed to {0} Mode +-mode_status=Mode transform\u00E9 en mode {0} ++mode_status=Mode transform\u00e9 en mode {0} + #FreeMind - {0} Mode + mode_title =FreeMind - Mode {0} + #Modes + modes = Modes + #Move to Root +-move_to_root = Aller \u00E0 la racine ++move_to_root = Aller \u00e0 la racine + #New + new = Nouveau + #New Child Node +-new_child = Nouveau n\u0153ud comme fils de la s\u00E9lection ++new_child = Nouveau n\u0153ud comme fils de la s\u00e9lection + #New Mindmap + new_mindmap = Nouvelle carte mentale + #New Node + new_node = Nouveau n\u0153ud + #New Sibling Node +-new_sibling_behind=Nouveau n\u0153ud fr\u00E8re apr\u00E8s la s\u00E9lection ++new_sibling_behind=Nouveau n\u0153ud fr\u00e8re apr\u00e8s la s\u00e9lection + #New Previous Sibling Node +-new_sibling_before=Nouveau n\u0153ud fr\u00E8re avant la s\u00E9lection ++new_sibling_before=Nouveau n\u0153ud fr\u00e8re avant la s\u00e9lection + #Next Map + next_map = Carte suivante + #No +@@ -200,7 +201,7 @@ + #Node + node = N\u0153ud + #You have changed the node. Do you want to discard changes? +-node_changed_discard_changes = Vous avez modifi\u00E9 le n\u0153d. Souhaitez-vous vraiment perdre ces modifications ? ++node_changed_discard_changes = Vous avez modifi\u00e9 le n\u0153d. Souhaitez-vous vraiment perdre ces modifications ? + #Node Color... + node_color = Couleur du n\u0153ud... + #Node Down +@@ -214,13 +215,13 @@ + #Normal + normal = Normal + #No "$1" found from "$2". +-no_found_from = "$1" n'a pas \u00E9t\u00E9 trouv\u00E9 \u00E0 partir de "$2". ++no_found_from = "$1" n'a pas \u00e9t\u00e9 trouv\u00e9 \u00e0 partir de "$2". + #No more "$1" found from "$2". +-no_more_found_from = "$1" n'est plus trouvable \u00E0 partir de "$2". ++no_more_found_from = "$1" n'est plus trouvable \u00e0 partir de "$2". + #No previous find. +-no_previous_find = Pas de pr\u00E9c\u00E9dente recherche. ++no_previous_find = Pas de pr\u00e9c\u00e9dente recherche. + #The map must be saved before you can set a link by file chooser +-not_saved_for_link_error = La carte doit avoir \u00E9t\u00E9 sauv\u00E9e avant de pouvoir d\u00E9finir un lien via le s\u00E9lecteur de fichiers. ++not_saved_for_link_error = La carte doit avoir \u00e9t\u00e9 sauv\u00e9e avant de pouvoir d\u00e9finir un lien via le s\u00e9lecteur de fichiers. + #Open... + open = Ouvrir... + #Page Setup... +@@ -228,11 +229,11 @@ + #Paste + paste = Coller + #New node as sibling is not possible for the root +-new_node_as_sibling_not_possible_for_the_root=Impossible de cr\u00E9er un n\u0153ud fr\u00E8re pour la racine ++new_node_as_sibling_not_possible_for_the_root=Impossible de cr\u00e9er un n\u0153ud fr\u00e8re pour la racine + #Preferences +-preferences = Pr\u00E9f\u00E9rences ++preferences = Pr\u00e9f\u00e9rences + #Previous Map +-previous_map = Carte pr\u00E9c\u00E9dente ++previous_map = Carte pr\u00e9c\u00e9dente + #Print... + print = Imprimer... + #Quit +@@ -240,36 +241,36 @@ + #Remove Node + remove_node = Supprimer ce n\u0153ud + #Read Only +-read_only = Lecture seule ++read_only = En lecture seule + #Repair Link +-repair_link = R\u00E9parer le lien ++repair_link = R\u00e9parer le lien + #Couldn't load the linked map. Repair the link manually? +-repair_link_question = Impossible de charger la carte li\u00E9e. Faut-il r\u00E9parer le lien manuellement ? ++repair_link_question = Impossible de charger la carte li\u00e9e. Faut-il r\u00e9parer le lien manuellement ? + #Save + save = Sauver + save_as = Sauver sous... + #Attempt to save the map $1 failed. +-save_failed = La tentatice de souver la carte $1 a \u00E9chou\u00E9e. ++save_failed = La tentatice de sauver la carte $1 a \u00e9chou\u00e9e. + #Save the following mindmap? \: + save_unsaved = Faut-il sauver la carte suivante ? + #Saved +-saved = Sauv\u00E9(e) ++saved = Sauv\u00e9(e) + #Evaluate\! +-scheme_evaluate = \u00C9valuer \! ++scheme_evaluate = \u00c9valuer \! + #Select the folder, in which your favorites reside +-select_favorites_folder = S\u00E9lectionnez le r\u00E9pertoire dans lequel se trouvent vos favoris ++select_favorites_folder = S\u00e9lectionnez le r\u00e9pertoire dans lequel se trouvent vos favoris + #Select the folder to import +-select_folder_for_importing = S\u00E9lectionnez le r\u00E9pertoire \u00E0 importer ++select_folder_for_importing = S\u00e9lectionnez le r\u00e9pertoire \u00e0 importer + #Image (File Chooser or Link)... +-set_image_by_filechooser = D\u00E9finir l'image (s\u00E9lection de fichier ou lien) ++set_image_by_filechooser = Ins\u00e9rer une image (s\u00e9lection de fichier ou lien) + #Hyperlink (File Chooser)... +-set_link_by_filechooser = D\u00E9finir le lien (s\u00E9lection de fichier) ++set_link_by_filechooser = Ins\u00e9rer un lien (s\u00e9lection de fichier) + #Hyperlink (Text Field)... +-set_link_by_textfield = D\u00E9finir le lien (champ de saisie) ++set_link_by_textfield = Ins\u00e9rer un lien (champ de saisie) + #Sharp Bezier +-sharp_bezier = B\u00E9zier effil\u00E9 ++sharp_bezier = B\u00e9zier effil\u00e9 + #Sharp Linear +-sharp_linear = rectiligne effil\u00E9 ++sharp_linear = rectiligne effil\u00e9 + #Split + split = Diviser + #Style +@@ -277,70 +278,70 @@ + #Toggle Bold + toggle_bold_branch = Branche avec/sans gras + #(Un)fold Children +-toggle_children_folded = Plier/d\u00E9plier les enfants ++toggle_children_folded = Plier/d\u00e9plier les enfants + #Toggle Folded +-toggle_folded = Plier/d\u00E9plier ++toggle_folded = Plier/d\u00e9plier + #Toggle Italic + toggle_italic_branch = Branche avec/sans italique + #Toggle Menubar + toggle_menubar = Montrer/masquer la barre de menu + toggle_toolbar = Montrer/masquer la barre d'outils + #Toggle Left Toolbar +-toggle_left_toolbar = Montrer/masquer la barre d'ic\u00F4nes ++toggle_left_toolbar = Montrer/masquer la barre d'ic\u00f4nes + #Underline + underline = Souligner + #Unfold +-unfold = D\u00E9plier ++unfold = D\u00e9plier + #This URL is malformed\! + url_error = Cette URL est incorrecte \! + #Could not load map at URL\: +-url_load_error = Je suis incapable de charger la carte \u00E0 l'URL \: ++url_load_error = Je suis incapable de charger la carte \u00e0 l'URL \: + #Width +-width = \u00C9paisseur ++width = \u00c9paisseur + #Yes + yes = Oui + #Zoom In + zoom_in = Augmenter le zoom + #Zoom Out +-zoom_out = R\u00E9duire le zoom ++zoom_out = R\u00e9duire le zoom + #Remove Last Icon +-remove_last_icon = Retirer le dernier ic\u00F4nes ++remove_last_icon = Retirer la derni\u00e8re ic\u00f4ne + #Remove All Icons +-remove_all_icons = Retirer tous les ic\u00F4nes ++remove_all_icons = Retirer toutes les ic\u00f4nes + #You are going to create a lot of links to the same node. Do you really want to create these links? +-lots_of_links_warning = Vous allez cr\u00E9er un nombre important de liens vers le m\u00EAme n\u0153ud. Voulez-vous vraiment cr\u00E9er ces liens ? ++lots_of_links_warning = Vous allez cr\u00e9er un nombre important de liens vers le m\u00eame n\u0153ud. Voulez-vous vraiment cr\u00e9er ces liens ? + #Remove Arrow Link +-remove_arrow_link = Supprimer la fl\u00E8che du lien ++remove_arrow_link = Supprimer la fl\u00e8che du lien + #Arrow Link Color... +-arrow_link_color = Couleur de la fl\u00E8che du lien... ++arrow_link_color = Couleur de la fl\u00e8che du lien... + follow_link = Suivre le lien + #User defined. +-user_defined_zoom = Zoom personnalis\u00E9 ++user_defined_zoom = Zoom personnalis\u00e9 + #Changing the zoom to the user defined zoom value of {0}%. +-user_defined_zoom_status_bar = Changement du facteur de grossissement \u00E0 {0}%, choix de l'utilisateur. ++user_defined_zoom_status_bar = Changement du facteur de grossissement \u00e0 {0}%, choix de l'utilisateur. + # new from 14.12.2003, fc + FAQ = Foire aux questions (FAQ) + #Print Scaling +-printing_settings = R\u00E9glages d'impression +-fit_to_page = Ajuster \u00E0 une seule page ++printing_settings = R\u00e9glages d'impression ++fit_to_page = Ajuster \u00e0 une seule page + #Print Zoom Factor (0.0 - 2.0)\: + user_zoom = Facteur grossissant pour l'impression (0.0 - 2.0) \: + #OK + ok = Valider + #Single-click to Select +-selection_method_by_click = S\u00E9lection par simple clic ++selection_method_by_click = S\u00e9lection par simple clic + #Point to Select +-selection_method_direct = S\u00E9lection par pointage ++selection_method_direct = S\u00e9lection par pointage + #Delayed Automatic Selection +-selection_method_delayed=S\u00E9lection retard\u00E9e ++selection_method_delayed=S\u00e9lection retard\u00e9e + #The selected node has no link to import from. +-import_linked_branch_no_link=Le n\u0153ud s\u00E9lectionn\u00E9 n'a pas de lien exploitable comme source d'importation. ++import_linked_branch_no_link=Le n\u0153ud s\u00e9lectionn\u00e9 n'a pas de lien exploitable comme source d'importation. + + #You have to select at least two nodes to get links. +-less_than_two_selected_nodes=Vous devez s\u00E9lectionner au moins deux n\u0153uds pour les lier. ++less_than_two_selected_nodes=Vous devez s\u00e9lectionner au moins deux n\u0153uds pour les lier. + + #The link is not valid anymore. The node was deleted in between. +-link_not_available_any_more=Ce lien n'est plus valide. Le n\u0153ud a \u00E9t\u00E9 supprim\u00E9 dans l'intervalle. ++link_not_available_any_more=Ce lien n'est plus valide. Le n\u0153ud a \u00e9t\u00e9 supprim\u00e9 dans l'intervalle. + #Tools + menu_extras=Outils + #Export +@@ -348,9 +349,9 @@ + #Import + menu_file_import=Importer + #Format +-menu_format=Pr\u00E9sentation ++menu_format=Pr\u00e9sentation + #Insert +-menu_insert=Ins\u00E9rer ++menu_insert=Ins\u00e9rer + #Navigate + menu_navigate=Navigation + +@@ -358,10 +359,10 @@ + menu_view=Affichage + + #Most Recent Files +-most_recent_files=Fichier les plus r\u00E9cents ++most_recent_files=Fichier les plus r\u00e9cents + + #You can't paste a format until you've copied one. +-no_format_copy_before_format_paste=Vous ne pouvez coller un format avant d'en avoir copi\u00E9 un. ++no_format_copy_before_format_paste=Vous ne pouvez coller un format avant d'en avoir copi\u00e9 un. + + #Node Background Color... + node_background_color=Couleur de fond du n\u0153ud... +@@ -370,21 +371,21 @@ + undo=Annuler + + #Underlined +-underlined=Soulign\u00E9 ++underlined=Soulign\u00e9 + + #An unexpected error occured. Please try to make a bug report. +-undefined_error=Une erreur impr\u00E9vue viens de se produire. Merci de bien vouloir essayer d'\u00E9tablir un rapport de bogue. ++undefined_error=Une erreur impr\u00e9vue viens de se produire. Merci de bien vouloir essayer d'\u00e9tablir un rapport de bogue. + + #Select Visible Branch +-select_branch=S\u00E9lectionner la branche visible ++select_branch=S\u00e9lectionner la branche visible + + #Select All Visible +-select_all=S\u00E9lectionner ce qui est visible ++select_all=S\u00e9lectionner ce qui est visible + + #Revert +-RevertAction=Revenir \u00E0 la sauvegarde ++RevertAction=Revenir \u00e0 la sauvegarde + #Reset Position +-reset_node_position=Remise \u00E0 z\u00E9ro de la position ++reset_node_position=Remise \u00e0 z\u00e9ro de la position + + #Remove Node Background Color + remove_node_background_color=Retirer la couleur de fond du n\u0153ud +@@ -393,16 +394,16 @@ + redo=Refaire + + #Properties ... +-property_dialog=Propri\u00E9t\u00E9s... ++property_dialog=Propri\u00e9t\u00e9s... + as_parent=En le parent + + #All nodes must have the same parent to use this function. +-cannot_add_parent_diff_parents=Tous les n\u0153uds doivent avoir le m\u00EAme parent pour utiliser cette fonction. ++cannot_add_parent_diff_parents=Tous les n\u0153uds doivent avoir le m\u00eame parent pour utiliser cette fonction. + + #The root node can't be added to a new parent. +-cannot_add_parent_to_root=Le n\u0153ud racine ne peut \u00EAtre ajout\u00E9 \u00E0 un nouveau parent. ++cannot_add_parent_to_root=Le n\u0153ud racine ne peut \u00eatre ajout\u00e9 \u00e0 un nouveau parent. + #Can't move a node to one of its children. +-cannot_move_to_child=Impossible de d\u00E9placer un n\u0153ud dans un de ces enfants. ++cannot_move_to_child=Impossible de d\u00e9placer un n\u0153ud dans un de ces enfants. + + #Combined + combined=Mixte +@@ -416,10 +417,10 @@ + #Edge Width + edge_width=Largeur de ligne + #Edit Node +-edit_node=\u00C9diter le n\u0153ud ++edit_node=\u00c9diter le n\u0153ud + + #Cannot create directory for export. +-error_creating_directory=Impossible de cr\u00E9er un r\u00E9pertoire pour l'exportation. ++error_creating_directory=Impossible de cr\u00e9er un r\u00e9pertoire pour l'exportation. + #Portable Document Format (PDF) + export_pdf_text=Adobe PDF (Portable Document Format) + +@@ -427,7 +428,7 @@ + export_svg_text=Graphique vectoriel SVG (Scalable Vector Graphic) + + #The file {0} already exists. Do you want to overwrite it? +-file_already_exists=Le fichier {0} existe d\u00E9j\u00E0. Voulez-vous vraiment l'\u00E9craser ? ++file_already_exists=Le fichier {0} existe d\u00e9j\u00e0. Voulez-vous vraiment l'\u00e9craser ? + + #font family + font_family=Famille de police +@@ -448,7 +449,7 @@ + accessories/plugins/EncryptNode.properties_2=Entrez le mot de passe \: + + #Re-enter Password\: +-accessories/plugins/EncryptNode.properties_3=Entrez \u00E0 nouveau le mot de passe \: ++accessories/plugins/EncryptNode.properties_3=Entrez \u00e0 nouveau le mot de passe \: + + #Enter your password. + accessories/plugins/EncryptNode.properties_4=Entrez votre mot de passe. +@@ -460,13 +461,14 @@ + accessories/plugins/EncryptNode.properties_7=Annuler + + #Select me to continue\! +-accessories/plugins/EncryptNode.properties_select_me=S\u00E9lectionnez-moi pour continuer \! ++accessories/plugins/EncryptNode.properties_select_me=S\u00e9lectionnez-moi pour continuer \! + + #The password is not correct. + accessories/plugins/EncryptNode.properties_wrong_password=Le mot de passe n'est pas valide. + + #Toggle Crypted / Encrypted +-accessories/plugins/EnterPassword.properties_name=Basculer de/vers chiffr\u00E9 \u00E0 non-chiffr\u00E9 ++accessories/plugins/EnterPassword.properties_name=Chiffrer/d\u00e9chiffrer ++accessories/plugins/EnterPassword.properties_documentation=Basculer de/vers chiffr\u00e9 \u00e0 non-chiffr\u00e9 + + #As JPEG... + accessories/plugins/ExportToImage_JPEG.properties_name=En JPEG... +@@ -479,9 +481,11 @@ + + #As XHTML (JavaScript version)... + accessories/plugins/ExportWithXSLT_HTML.properties_name=En XHTML (version JavaScript)... ++accessories/plugins/ExportWithXSLT_HTML.properties_documentation=Fichier XHTML avec avec une liste pouvant \u00eatre pli\u00e9e et d\u00e9pli\u00e9e. + + #As XHTML (Clickable map image version)... + accessories/plugins/ExportWithXSLT_HTML3.properties_name=En XHTML (image cliquable).. ++accessories/plugins/ExportWithXSLT_HTML3.properties_documentation=Fichier XHTML avec une image cliquable en t\u00eate. + + #Zoom to Fit to Page + accessories/plugins/FitToPage.properties_name=Faire tenir dans la page +@@ -499,10 +503,10 @@ + accessories/plugins/FormatPaste.properties_name=Coller la mise en forme + + #Formular Editor +-accessories/plugins/FormularEditor.properties_name=\u00C9diteur de formule ++accessories/plugins/FormularEditor.properties_name=\u00c9diteur de formule + + #Unfold One Level +-accessories/plugins/UnfoldOneLevel.properties_name=D\u00E9plier un niveau ++accessories/plugins/UnfoldOneLevel.properties_name=D\u00e9plier un niveau + + #Add Graphical Link + add_link=Ajouter un lien graphique +@@ -511,18 +515,18 @@ + add_local_link=Ajouter un lien local + + #Unfold All +-accessories/plugins/UnfoldAll.properties_name=Tout d\u00E9plier ++accessories/plugins/UnfoldAll.properties_name=Tout d\u00e9plier + #Show icons hierarchically +-accessories/plugins/HierarchicalIcons.properties_name=Afficher les ic\u00F4nes hi\u00E9rarchiquement ++accessories/plugins/HierarchicalIcons.properties_name=Afficher les ic\u00f4nes hi\u00e9rarchiquement + + #Select Icon... +-accessories/plugins/IconSelectionPlugin.properties_name=S\u00E9lection d'ic\u00F4nes... ++accessories/plugins/IconSelectionPlugin.properties_name=S\u00e9lection d'ic\u00f4nes... + + #Create a new encrypted map +-accessories/plugins/NewEncryptedMap.properties_documentation=Cr\u00E9er une nouvelle carte chriffr\u00E9e ++accessories/plugins/NewEncryptedMap.properties_documentation=Cr\u00e9er une nouvelle carte chriffr\u00e9e + + #Create Encrypted Map ... +-accessories/plugins/NewEncryptedMap.properties_name=Cr\u00E9er carte chriffr\u00E9e... ++accessories/plugins/NewEncryptedMap.properties_name=Cr\u00e9er carte chriffr\u00e9e... + + #New Parent Node + accessories/plugins/NewParentNode.properties_name=Nouveau n\u0153ud parent +@@ -531,63 +535,63 @@ + accessories/plugins/NodeNote.properties_name=Note + + #Priority 1 +-icon_full-1=Priorit\u00E9 1 ++icon_full-1=Priorit\u00e9 1 + #Priority 2 +-icon_full-2=Priorit\u00E9 2 ++icon_full-2=Priorit\u00e9 2 + #Priority 3 +-icon_full-3=Priorit\u00E9 3 ++icon_full-3=Priorit\u00e9 3 + #Priority 4 +-icon_full-4=Priorit\u00E9 4 ++icon_full-4=Priorit\u00e9 4 + #Priority 5 +-icon_full-5=Priorit\u00E9 5 ++icon_full-5=Priorit\u00e9 5 + #Priority 6 +-icon_full-6=Priorit\u00E9 6 ++icon_full-6=Priorit\u00e9 6 + #Priority 7 +-icon_full-7=Priorit\u00E9 7 ++icon_full-7=Priorit\u00e9 7 + #Choose password for encrypted node +-accessories/plugins/EncryptNode.properties_0=Choisir le mot de passe pour le n\u0153ud chiffr\u00E9 ++accessories/plugins/EncryptNode.properties_0=Choisir le mot de passe pour le n\u0153ud chiffr\u00e9 + + #Passwords are not equal or to short. + accessories/plugins/EncryptNode.properties_1=Les mots de passe ne sont pas identiques ou sont trop courts. + + #Insert Encrypted Node... +-accessories/plugins/EncryptNode.properties_name=Ins\u00E9rer un n\u0153ud chiffr\u00E9 ++accessories/plugins/EncryptNode.properties_name=Ins\u00e9rer un n\u0153ud chiffr\u00e9 + + #Show Revisions in Yellow +-accessories/plugins/RevisionPlugin.properties_name=Afficher les r\u00E9visions en jaune ++accessories/plugins/RevisionPlugin.properties_name=Afficher les r\u00e9visions en jaune + #Fixes the layout of the map.
The first level is black, the second blue, etc. + accessories/plugins/AutomaticLayout.properties_documentation=Corrige la mise en forme de la carte.
Le premier niveau est noir, le second bleu, etc. + + #This makes the node blinking. But be careful. Do not associate it to many nodes, and not with other automatic formattings to the same node +-accessories/plugins/BlinkingNodeHook.properties_documentation=Ceci rend la n\u0153ud clignotant. Mais prennez garde \u00E0 ne pas l'associer \u00E0 trop de n\u0153uds, et surtout pas avec d'autres n\u0153uds ayant un formattage automatique pour ce m\u00EAme n\u0153ud ++accessories/plugins/BlinkingNodeHook.properties_documentation=Ceci rend la n\u0153ud clignotant. Mais prennez garde \u00e0 ne pas l'associer \u00e0 trop de n\u0153uds, et surtout pas avec d'autres n\u0153uds ayant un formattage automatique pour ce m\u00eame n\u0153ud + + #This function keeps track of node creation and modification times. +-accessories/plugins/CreationModificationPlugin.properties_documentation=Cette fonction garde la trace des date et heure de cr\u00E9ation et modification des n\u0153uds. ++accessories/plugins/CreationModificationPlugin.properties_documentation=Cette fonction garde la trace des date et heure de cr\u00e9ation et modification des n\u0153uds. + #Remember, that the strength of the encryption
depends nearly completely on the quality of your password. +-accessories/plugins/EncryptNode.properties_5=Souvenez-vous que la qualit\u00E9 d'un chiffrement d\u00E9pend presque enti\u00E8rement de la qualit\u00E9 de votre mot de passe. ++accessories/plugins/EncryptNode.properties_5=Souvenez-vous que la qualit\u00e9 d'un chiffrement d\u00e9pend presque enti\u00e8rement de la qualit\u00e9 de votre mot de passe. + + #Inserts a new node whose child nodes are stored encrypted. +-accessories/plugins/EncryptNode.properties_documentation=Ins\u00E8re un nouveau n\u0153ud dont les descendants seront stock\u00E9s chiffr\u00E9s. ++accessories/plugins/EncryptNode.properties_documentation=Ins\u00e8re un nouveau n\u0153ud dont les descendants seront stock\u00e9s chiffr\u00e9s. + + #You can only toggle the encryption state of an encrypted node. Please insert such a node using the tools menu. +-accessories/plugins/EncryptNode.properties_insert_encrypted_node_first=Vous ne pouvez changer l'\u00E9tat de chiffrement d'un n\u0153ud chiffr\u00E9. Ins\u00E9rez un tel n\u0153ud en utilisant le menu "outils". ++accessories/plugins/EncryptNode.properties_insert_encrypted_node_first=Vous ne pouvez changer l'\u00e9tat de chiffrement d'un n\u0153ud chiffr\u00e9. Ins\u00e9rez un tel n\u0153ud en utilisant le menu "outils". + #Exports the map in the current folding to a JPEG image. +-accessories/plugins/ExportToImage_JPEG.properties_documentation=Exporte la carte telle qu'elle est pli\u00E9e sous forme d'image au format JPEG. ++accessories/plugins/ExportToImage_JPEG.properties_documentation=Exporte la carte telle qu'elle est pli\u00e9e sous forme d'image au format JPEG. + + #Exports the map in the current folding to a PNG image. +-accessories/plugins/ExportToImage_PNG.properties_documentation=Exporte la carte telle qu'elle est pli\u00E9e sous forme d'image au format PNG. ++accessories/plugins/ExportToImage_PNG.properties_documentation=Exporte la carte telle qu'elle est pli\u00e9e sous forme d'image au format PNG. + + #This is an uniform export method using XSLT scripts. + accessories/plugins/ExportWithXSLT.properties_documentation=Ceci est une exportation qui utilise une feuille de style XML de transformation (XSLT). + + #Adjusts the zoom such that the entire map fits into the current window. +-accessories/plugins/FitToPage.properties_documentation=Ajuste le facteur de grossissement de sorte que la carte tienne enti\u00E8rement dans la fen\u00EAtre courante. ++accessories/plugins/FitToPage.properties_documentation=Ajuste le facteur de grossissement de sorte que la carte tienne enti\u00e8rement dans la fen\u00eatre courante. + + #Folds the selected nodes and all their children. +-accessories/plugins/FoldAll.properties_documentation=Plie les n\u0153uds s\u00E9lectionn\u00E9s ainsi que leurs descendants. ++accessories/plugins/FoldAll.properties_documentation=Plie les n\u0153uds s\u00e9lectionn\u00e9s ainsi que leurs descendants. + + #Folds the selected nodes by one level. +-accessories/plugins/FoldOneLevel.properties_documentation=Plie 'un niveau du n\u0153ud s\u00E9lectionn\u00E9. ++accessories/plugins/FoldOneLevel.properties_documentation=Plie 'un niveau du n\u0153ud s\u00e9lectionn\u00e9. + + #Copies the format of a node. + accessories/plugins/FormatCopy.properties_documentation=Copie la mise en forme du n\u0153ud. +@@ -596,22 +600,22 @@ + accessories/plugins/FormatPaste.properties_documentation=Colle la mise en forme d'un n\u0153ud. + + #Associates a simple formular editor to the current note. +-accessories/plugins/FormularEditor.properties_documentation=Associe un \u00E9diteur de formule basique au n\u0153uds courant. ++accessories/plugins/FormularEditor.properties_documentation=Associe un \u00e9diteur de formule basique au n\u0153uds courant. + + #If one of the (grand)children of me has an icon, I will show this icon in little format, too. +-accessories/plugins/HierarchicalIcons.properties_documentation=Si un de mes descendants a un ic\u00F4ne, je vais \u00E9galement afficher cet ic\u00F4ne. ++accessories/plugins/HierarchicalIcons.properties_documentation=Si un de mes descendants a une ic\u00f4ne, je vais \u00e9galement afficher cette ic\u00f4ne. + + #Here you can select an icon using a subwindow. +-accessories/plugins/IconSelectionPlugin.properties_documentation=Ici vous pourrez s\u00E9lectionner un ic\u00F4ne en utisant une palette. ++accessories/plugins/IconSelectionPlugin.properties_documentation=Ici vous pourrez s\u00e9lectionner une ic\u00f4ne en utisant une palette. + + #All selected are sent to a new parent. +-accessories/plugins/NewParentNode.properties_documentation=Tout ce qui est s\u00E9lectionn\u00E9 est envoy\u00E9 vers un nouveau parent. ++accessories/plugins/NewParentNode.properties_documentation=Tout ce qui est s\u00e9lectionn\u00e9 est envoy\u00e9 vers un nouveau parent. + + #Associates a simple note editor to the current note. +-accessories/plugins/NodeNote.properties_documentation=Associe un \u00E9diteur de note basique au n\u0153ud courant. ++accessories/plugins/NodeNote.properties_documentation=Associe un \u00e9diteur de note basique au n\u0153ud courant. + + #Change Arrows of Arrow Link +-change_arrows_in_arrow_link=Modifie la fl\u00E8che utilis\u00E9e pour ce lien. ++change_arrows_in_arrow_link=Modifie la fl\u00e8che utilis\u00e9e pour ce lien. + #change_link_arrows + change_link_arrows=change_link_arrows [TRANSLATE] + +@@ -631,19 +635,19 @@ + choose_node_color=Choix de la couleur du n\u0153ud \: + + #Unfolds the selected nodes by one level. +-accessories/plugins/UnfoldOneLevel.properties_documentation=D\u00E9plie un niveau du n\u0153ud s\u00E9lectionn\u00E9. ++accessories/plugins/UnfoldOneLevel.properties_documentation=D\u00e9plie un niveau du n\u0153ud s\u00e9lectionn\u00e9. + + #Unfolds the selected nodes and all their children. +-accessories/plugins/UnfoldAll.properties_documentation=D\u00E9plie le n\u0153ud s\u00E9lectionn\u00E9 ainsi que ses descendants. ++accessories/plugins/UnfoldAll.properties_documentation=D\u00e9plie le n\u0153ud s\u00e9lectionn\u00e9 ainsi que ses descendants. + + #PMCalculation + accessories/plugins/PMCalculation.properties_name=PMCalculation [TRANSLATE] + + #Calculates the efforts for different tasks. +-accessories/plugins/PMCalculation.properties_documentation=Calcul les efforts pour diff\u00E9rentes t\u00E2ches. ++accessories/plugins/PMCalculation.properties_documentation=Calcul les efforts pour diff\u00e9rentes t\u00e2ches. + + #Marks the background of each changed node. +-accessories/plugins/RevisionPlugin.properties_documentation=Marque le fond de chaque n\u0153ud modifi\u00E9. ++accessories/plugins/RevisionPlugin.properties_documentation=Marque le fond de chaque n\u0153ud modifi\u00e9. + + #Goto Link + goto_link_node_action=Aller au lien +@@ -655,10 +659,10 @@ + GrabKeyDialog.common.ok=Valider + + #Assigned to +-GrabKeyDialog.grab-key.assigned-to=Assign\u00E9e \u00E0 ++GrabKeyDialog.grab-key.assigned-to=Assign\u00e9e \u00e0 + + #Currently not assigned +-GrabKeyDialog.grab-key.assigned-to.none=Actuellement non assign\u00E9 ++GrabKeyDialog.grab-key.assigned-to.none=Actuellement non assign\u00e9 + + #Clear + GrabKeyDialog.grab-key.clear=Effacer +@@ -673,7 +677,7 @@ + GrabKeyDialog.grab-key.title=Entrez une nouvelle touche clavier + + #Freemind_Reverted_ +-freemind_reverted=Freemind_r\u00E9cup\u00E9r\u00E9_ ++freemind_reverted=Freemind_r\u00e9cup\u00e9r\u00e9_ + + #Help... + plugins/FreemindHelp.xml_name=Aide... +@@ -688,18 +692,18 @@ + OptionPanel.separator.html_export=Exporation HTML (HyperText Markup Language) + + #Selection Method +-OptionPanel.selection_method=M\u00E9thode de s\u00E9lection ++OptionPanel.selection_method=M\u00e9thode de s\u00e9lection + #Selection Method +-OptionPanel.separator.selection_method=M\u00E9thode de s\u00E9lection ++OptionPanel.separator.selection_method=M\u00e9thode de s\u00e9lection + + #Set Image By Filechooser +-OptionPanel.keystroke_set_image_by_filechooser=D\u00E9fini l'image avec le s\u00E9lecteur de fichier ++OptionPanel.keystroke_set_image_by_filechooser=D\u00e9fini l'image avec le s\u00e9lecteur de fichier + + #Set Link By Filechooser +-OptionPanel.keystroke_set_link_by_filechooser=D\u00E9fini le lien avec le s\u00E9lecteur de fichier ++OptionPanel.keystroke_set_link_by_filechooser=D\u00e9fini le lien avec le s\u00e9lecteur de fichier + + #Set Link By Textfield +-OptionPanel.keystroke_set_link_by_textfield=D\u00E9fini le lien par une saisie libre ++OptionPanel.keystroke_set_link_by_textfield=D\u00e9fini le lien par une saisie libre + + #Show Calendar... + plugins/TimeManagement.xml_name=Montrer le calendrier... +@@ -708,37 +712,37 @@ + plugins/NodeList.xml_name=Montrer l'historique de la carte... + + #Show Time Scheduler List ... +-plugins/TimeList.xml_name=Montrer la liste des alerte planifi\u00E9es... ++plugins/TimeList.xml_name=Montrer la liste des alerte planifi\u00e9es... + #Standard Background Color +-OptionPanel.standardbackgroundcolor=Couleur de fond par d\u00E9faut ++OptionPanel.standardbackgroundcolor=Couleur de fond par d\u00e9faut + #Standard Cloud Color +-OptionPanel.standardcloudcolor=Couleur de nuage par d\u00E9faut ++OptionPanel.standardcloudcolor=Couleur de nuage par d\u00e9faut + #Standard Cloude Style +-OptionPanel.standardcloudestyle=Style de nuage par d\u00E9faut ++OptionPanel.standardcloudestyle=Style de nuage par d\u00e9faut + + #Standard Edge Color +-OptionPanel.standardedgecolor=Couleur de ligne par d\u00E9faut ++OptionPanel.standardedgecolor=Couleur de ligne par d\u00e9faut + + #Standard Edge Style +-OptionPanel.standardedgestyle=Style de ligne par d\u00E9faut ++OptionPanel.standardedgestyle=Style de ligne par d\u00e9faut + + #Standard Link Color +-OptionPanel.standardlinkcolor=Couleur de lien par d\u00E9faut ++OptionPanel.standardlinkcolor=Couleur de lien par d\u00e9faut + + #Standard Node Color +-OptionPanel.standardnodecolor=Couleur de n\u0153ud par d\u00E9faut ++OptionPanel.standardnodecolor=Couleur de n\u0153ud par d\u00e9faut + + #Standard Node Style +-OptionPanel.standardnodestyle=Style de n\u0153ud par d\u00E9faut ++OptionPanel.standardnodestyle=Style de n\u0153ud par d\u00e9faut + + #Standard Link Style +-OptionPanel.standardlinkestyle=Style de lien par d\u00E9faut ++OptionPanel.standardlinkestyle=Style de lien par d\u00e9faut + + #Standard Root Node Style +-OptionPanel.standardrootnodestyle=Style par d\u00E9faut pour le n\u0153ud racine ++OptionPanel.standardrootnodestyle=Style par d\u00e9faut pour le n\u0153ud racine + + #Standard Selected Node Color +-OptionPanel.standardselectednodecolor=Couleur par d\u00E9faut pour le n\u0153ud s\u00E9lectionn\u00E9 ++OptionPanel.standardselectednodecolor=Couleur par d\u00e9faut pour le n\u0153ud s\u00e9lectionn\u00e9 + + #Text + plugins/TimeList.xml_Text=Texte +@@ -747,7 +751,7 @@ + OptionPanel.keystroke_undo=Annuler + + #Userproperties +-OptionPanel.userproperties=Propri\u00E9t\u00E9es personnelles de l'utilisateur ++OptionPanel.userproperties=Propri\u00e9t\u00e9es personnelles de l'utilisateur + + #Windows + OptionPanel.windows=Windows +@@ -756,7 +760,7 @@ + OptionPanel.keystroke_zoom_in=Augmenter le zoom + + #Zoom Out +-OptionPanel.keystroke_zoom_out=R\u00E9duire le zoom ++OptionPanel.keystroke_zoom_out=R\u00e9duire le zoom + + #Time Management + plugins/TimeManagement.xml_WindowTitle=Gestion du temps +@@ -780,10 +784,10 @@ + OptionPanel.combined=Mixte + + #Default +-OptionPanel.default=R\u00E9glages par d\u00E9faut ++OptionPanel.default=R\u00e9glages par d\u00e9faut + + #Bezier +-OptionPanel.bezier=B\u00E9zier ++OptionPanel.bezier=B\u00e9zier + + #Appearance + OptionPanel.Appearance=Aspect +@@ -791,9 +795,6 @@ + #Behaviour + OptionPanel.Behaviour=Comportement + +-#Automatic +-OptionPanel.automatic=Automatique +- + #As Parent + OptionPanel.as_parent=Comme le parent + +@@ -804,31 +805,31 @@ + OptionPanel.antialiasAll=Tout lisser + + #Absolute +-OptionPanel.absolute=Absolu ++OptionPanel.absolute=Absolus + + #To see the effect of the changed settings, you probably have to restart FreeMind. +-option_changes_may_require_restart=Pour pouvoir voir les effets des nouvelles pr\u00E9f\u00E9rences, vous devrez probablement red\u00E9marrer FreeMind. ++option_changes_may_require_restart=Pour pouvoir voir les effets des nouvelles pr\u00e9f\u00e9rences, vous devrez probablement red\u00e9marrer FreeMind. + + # Auto options. Do not modify these as they will be saved to auto.properties anyway. +-OptionPanel.antialiasEdges.tooltip=Options automatiques. Ne les modifiez pas elle seront sauvegard\u00E9e dans auto.properties de toutes fa\u00E7ons. ++OptionPanel.antialiasEdges.tooltip=Options automatiques. Ne les modifiez pas elles seront sauvegard\u00e9es dans auto.properties de toute fa\u00e7on. + + #Bubble + OptionPanel.bubble=Bulle + + #Defaults +-OptionPanel.Defaults=R\u00E9glages par d\u00E9faut ++OptionPanel.Defaults=R\u00e9glages par d\u00e9faut + + #Drag And Drop +-OptionPanel.draganddrop=Glisser/d\u00E9poser ++OptionPanel.draganddrop=Glisser/d\u00e9poser + + #Buttons Position + OptionPanel.el__buttons_position=Position des boutons + + #Enter Confirms By Default +-OptionPanel.el__enter_confirms_by_default=Par d\u00E9faut, la touche "Entr\u00E9e" confirme ++OptionPanel.el__enter_confirms_by_default=Par d\u00e9faut, la touche "Entr\u00e9e" confirme + + #Based On Headings +-OptionPanel.html_export_based_on_headings=\u00C0 partir des titres ++OptionPanel.html_export_based_on_headings=\u00c0 partir des titres + + #Fold All + OptionPanel.html_export_fold_all=Tout plier +@@ -839,22 +840,19 @@ + OptionPanel.keystroke_delete_child=Supprimer les enfants + + #Min Default Window Height +-OptionPanel.el__min_default_window_height=Hauteur minimale des fen\u00EAtres ++OptionPanel.el__min_default_window_height=Hauteur minimale par d\u00e9faut de fen\u00eatre + + #Edit +-OptionPanel.keystroke_edit=\u00C9diter ++OptionPanel.keystroke_edit=\u00c9diter + + #Apply Pattern 13 +-OptionPanel.keystroke_apply_pattern_13=Appliquer le mod\u00E8le 13 ++OptionPanel.keystroke_apply_pattern_13=Appliquer le mod\u00e8le 13 + + #Copy Single +-OptionPanel.keystroke_copy_single=Copier un \u00E9l\u00E9ment ++OptionPanel.keystroke_copy_single=Copier un \u00e9l\u00e9ment + + # above / below +-OptionPanel.el__buttons_position.tooltip=Au-dessus/dessous +- +-#Sl +-OptionPanel.sl=Sl ++OptionPanel.el__buttons_position.tooltip=Entrez la valeur 'above' (au-dessus) ou 'below' (en dessous) + + #Add Child + OptionPanel.keystroke_add_child=Ajouter un enfant +@@ -863,7 +861,7 @@ + OptionPanel.keystroke_print=Imprimer + + #Patternsfile +-OptionPanel.patternsfile=Fichier de mod\u00E8le ++OptionPanel.patternsfile=Fichier de mod\u00e8le + + #First + OptionPanel.first=Premier +@@ -878,31 +876,28 @@ + OptionPanel.separator.language=Langue + + #Apply Pattern 15 +-OptionPanel.keystroke_apply_pattern_15=Appliquer le mod\u00E8le 15 +- +-#Language +-OptionPanel.language=Langue ++OptionPanel.keystroke_apply_pattern_15=Appliquer le mod\u00e8le 15 + + #Cancel + plugins/TimeManagement.xml_cancelButton=Annuler + + # and MAC\: (thanks to Nick\!) +-OptionPanel.default_browser_command_mac.tooltip= et le Mac\: (grace \u00E0 Nick \!) ++OptionPanel.default_browser_command_mac.tooltip= et le Mac\: (grace \u00e0 Nick \!) + + # Experimental feature +-OptionPanel.experimental_file_locking_on.tooltip=Fonctionalit\u00E9s exp\u00E9rimentales ++OptionPanel.experimental_file_locking_on.tooltip=Fonctionalit\u00e9s exp\u00e9rimentales + + #Add + OptionPanel.keystroke_add=Ajouter + + #Add Arrow Link Action +-OptionPanel.keystroke_add_arrow_link_action=Action pour ajouter une fl\u00E8che de lien ++OptionPanel.keystroke_add_arrow_link_action=Action pour ajouter une fl\u00e8che de lien + + #Add Child Mac + OptionPanel.keystroke_add_child_mac=Ajouter un enfant (Mac) + + #Add Sibling Before +-OptionPanel.keystroke_add_sibling_before=Ajouter un fr\u00E8re au-dessus ++OptionPanel.keystroke_add_sibling_before=Ajouter un fr\u00e8re au-dessus + + #Add Local Link Action + OptionPanel.keystroke_add_local_link_action=Action pour ajouter un lien local +@@ -911,59 +906,59 @@ + OptionPanel.separator.anti_alias=Lissage + + #Apply Pattern 1 +-OptionPanel.keystroke_apply_pattern_1=Appliquer le mod\u00E8le 1 ++OptionPanel.keystroke_apply_pattern_1=Appliquer le mod\u00e8le 1 + + #Apply Pattern 10 +-OptionPanel.keystroke_apply_pattern_10=Appliquer le mod\u00E8le 10 ++OptionPanel.keystroke_apply_pattern_10=Appliquer le mod\u00e8le 10 + + #Apply Pattern 11 +-OptionPanel.keystroke_apply_pattern_11=Appliquer le mod\u00E8le 11 ++OptionPanel.keystroke_apply_pattern_11=Appliquer le mod\u00e8le 11 + + #Apply Pattern 12 +-OptionPanel.keystroke_apply_pattern_12=Appliquer le mod\u00E8le 12 ++OptionPanel.keystroke_apply_pattern_12=Appliquer le mod\u00e8le 12 + + #Apply Pattern 14 +-OptionPanel.keystroke_apply_pattern_14=Appliquer le mod\u00E8le 14 ++OptionPanel.keystroke_apply_pattern_14=Appliquer le mod\u00e8le 14 + + #Apply Pattern 16 +-OptionPanel.keystroke_apply_pattern_16=Appliquer le mod\u00E8le 16 ++OptionPanel.keystroke_apply_pattern_16=Appliquer le mod\u00e8le 16 + + #Apply Pattern 17 +-OptionPanel.keystroke_apply_pattern_17=Appliquer le mod\u00E8le 17 ++OptionPanel.keystroke_apply_pattern_17=Appliquer le mod\u00e8le 17 + + #Apply Pattern 18 +-OptionPanel.keystroke_apply_pattern_18=Appliquer le mod\u00E8le 18 ++OptionPanel.keystroke_apply_pattern_18=Appliquer le mod\u00e8le 18 + + #Apply Pattern 2 +-OptionPanel.keystroke_apply_pattern_2=Appliquer le mod\u00E8le 2 ++OptionPanel.keystroke_apply_pattern_2=Appliquer le mod\u00e8le 2 + + #Apply Pattern 3 +-OptionPanel.keystroke_apply_pattern_3=Appliquer le mod\u00E8le 3 ++OptionPanel.keystroke_apply_pattern_3=Appliquer le mod\u00e8le 3 + + #Apply Pattern 4 +-OptionPanel.keystroke_apply_pattern_4=Appliquer le mod\u00E8le 4 ++OptionPanel.keystroke_apply_pattern_4=Appliquer le mod\u00e8le 4 + + #Apply Pattern 5 +-OptionPanel.keystroke_apply_pattern_5=Appliquer le mod\u00E8le 5 ++OptionPanel.keystroke_apply_pattern_5=Appliquer le mod\u00e8le 5 + + #Apply Pattern 6 +-OptionPanel.keystroke_apply_pattern_6=Appliquer le mod\u00E8le 6 ++OptionPanel.keystroke_apply_pattern_6=Appliquer le mod\u00e8le 6 + + #Apply Pattern 7 +-OptionPanel.keystroke_apply_pattern_7=Appliquer le mod\u00E8le 7 ++OptionPanel.keystroke_apply_pattern_7=Appliquer le mod\u00e8le 7 + + #Apply Pattern 8 +-OptionPanel.keystroke_apply_pattern_8=Appliquer le mod\u00E8le 8 ++OptionPanel.keystroke_apply_pattern_8=Appliquer le mod\u00e8le 8 + + #Apply Pattern 9 +-OptionPanel.keystroke_apply_pattern_9=Appliquer le mod\u00E8le 9 ++OptionPanel.keystroke_apply_pattern_9=Appliquer le mod\u00e8le 9 + + #Append Date To Selected Nodes +-plugins/TimeManagement.xml_appendButton=Ajouter la date au(x) n\u0153ud(s) s\u00E9lectionn\u00E9(s) ++plugins/TimeManagement.xml_appendButton=Ajouter la date au(x) n\u0153ud(s) s\u00e9lectionn\u00e9(s) + #As PDF... +-plugins/ExportPdf.xml_name=En PDF... ++plugins/ExportPdf.xml_name=Comme PDF... + #As SVG... +-plugins/ExportSvg.xml_name=En SVG... ++plugins/ExportSvg.xml_name=Comme SVG... + + #Automatic Save + OptionPanel.separator.automatic_save=Sauvegarde automatique +@@ -978,7 +973,7 @@ + OptionPanel.separator.browser=Navigateur + + #By Click +-OptionPanel.selection_method_by_click=Par clic ++OptionPanel.selection_method_by_click=Par clique + + #Close + OptionPanel.keystroke_close=Fermer +@@ -990,7 +985,7 @@ + OptionPanel.keystroke_copy=Copier + + #Created +-plugins/TimeList.xml_Created=Cr\u00E9e ++plugins/TimeList.xml_Created=Cr\u00e9e + + #Cut + OptionPanel.keystroke_cut=Couper +@@ -998,81 +993,69 @@ + #Date + plugins/TimeList.xml_Date=Date + +-#De +-OptionPanel.de=De +- + #Edge Color... + OptionPanel.keystroke_edge_color=Couleur du bord + + #Edit Long Node +-OptionPanel.keystroke_edit_long_node=\u00C9diter un n\u0153ud long ++OptionPanel.keystroke_edit_long_node=\u00c9diter un n\u0153ud long + + #Edit Long Node Window +-OptionPanel.separator.edit_long_node_window=Fen\u00EAtre pour \u00E9diter un n\u0153ud long +- +-#En +-OptionPanel.en=En ++OptionPanel.separator.edit_long_node_window=Fen\u00eatre pour \u00e9diter un n\u0153ud long + + #Enable Leaves Folding +-OptionPanel.enable_leaves_folding=Active la pr\u00E9servation des pliages ++OptionPanel.enable_leaves_folding=Permet le (d\u00e9)pliage des feuilles + + #Direct +-OptionPanel.selection_method_direct=Direct ++OptionPanel.selection_method_direct=Directe + + #Disable Cursor Move Paper +-OptionPanel.disable_cursor_move_paper=Inactiver le d\u00E9placement du papier par le curseur ++OptionPanel.disable_cursor_move_paper=Inactiver le curseur de d\u00e9placement du papier + + #Disable Key Type + OptionPanel.disable_key_type=Inactiver la saisie au clavier + +-#Dk +-OptionPanel.dk=Dk +- + #Docmapurl + OptionPanel.docmapurl_since_version_0_7_0=URL de la carte de documentation + + #Default Colors +-OptionPanel.separator.default_colors=Couleurs par d\u00E9faut ++OptionPanel.separator.default_colors=Couleurs par d\u00e9faut + + #Default Font +-OptionPanel.defaultfont=Police par d\u00E9faut +-OptionPanel.defaultfontsize=Default Font Size ++OptionPanel.defaultfont=Police par d\u00e9faut ++OptionPanel.defaultfontsize=Taille de police par d\u00e9faut + + #Default Font Style +-OptionPanel.defaultfontstyle=Default Font Style ++OptionPanel.defaultfontstyle=Style de police par d\u00e9faut + + #Default Fonts +-OptionPanel.separator.default_fonts=Police par d\u00E9faut ++OptionPanel.separator.default_fonts=Police par d\u00e9faut + + #Default Styles +-OptionPanel.separator.default_styles=Style par d\u00E9faut ++OptionPanel.separator.default_styles=Styles par d\u00e9faut + + #Delayed +-OptionPanel.selection_method_delayed=Retard\u00E9 ++OptionPanel.selection_method_delayed=Retard\u00e9e + + #Delete Automatic Saves At Exit + OptionPanel.delete_automatic_saves_at_exit=Supprime les sauvegardes automatiques en quittant + + #Default Browser Command Mac +-OptionPanel.default_browser_command_mac=Commande pour le navigateur par d\u00E9faut pour Mac ++OptionPanel.default_browser_command_mac=Commande pour le navigateur par d\u00e9faut pour Mac + + #Default Browser Command Other Os +-OptionPanel.default_browser_command_other_os=Commande pour le navigateur par d\u00E9faut pour d'autres syst\u00E8mes ++OptionPanel.default_browser_command_other_os=Commande pour le navigateur par d\u00e9faut pour d'autres syst\u00e8mes + + #Default Browser Command Windows 9x +-OptionPanel.default_browser_command_windows_9x=Commande pour le navigateur par d\u00E9faut pour Windows 9x ++OptionPanel.default_browser_command_windows_9x=Commande pour le navigateur par d\u00e9faut pour Windows 9x + + #Default Browser Command Windows Nt +-OptionPanel.default_browser_command_windows_nt=Commande pour le navigateur par d\u00E9faut pour Windows NT +- +-#Es +-OptionPanel.es=Es ++OptionPanel.default_browser_command_windows_nt=Commande pour le navigateur par d\u00e9faut pour Windows NT + + #Environment + OptionPanel.Environment=Environnement + + #Experimental File Locking +-OptionPanel.experimental_file_locking_on=V\u00E9rouillage de fichier exp\u00E9rimental ++OptionPanel.experimental_file_locking_on=V\u00e9rouillage de fichier exp\u00e9rimental + + #Export Branch + OptionPanel.keystroke_export_branch=Exporter la branche +@@ -1081,18 +1064,18 @@ + OptionPanel.keystroke_export_branch_to_html=Exporter la branche en HTML + + #Export Icons In Html +-OptionPanel.export_icons_in_html=Exporter les ic\u00F4nes en HTML ++OptionPanel.export_icons_in_html=Exporter les ic\u00f4nes en HTML + #Export To Html +-OptionPanel.keystroke_export_to_html=Exporter en HTML ++OptionPanel.keystroke_export_to_html=Exporter au format HTML + + #Export to PDF +-plugins/ExportPdf.xml_documentation=Exporter en PDF ++plugins/ExportPdf.xml_documentation=Exporter au format PDF + + #Export to SVG +-plugins/ExportSvg.xml_documentation=Exporter en SVG ++plugins/ExportSvg.xml_documentation=Exporter au format SVG + + #Fold Currently Folded +-OptionPanel.html_export_fold_currently_folded=Conserver pli\u00E9 ce qui est pli\u00E9 ++OptionPanel.html_export_fold_currently_folded=Conserver pli\u00e9 ce qui est pli\u00e9 + + + #Folding Symbol Width +@@ -1102,41 +1085,31 @@ + OptionPanel.keystroke_follow_link=Suivre le lien + + #Fork +-OptionPanel.fork=Branche +- +-#Fr +-OptionPanel.fr=Fr ++OptionPanel.fork=Fourche + + #Gtk + OptionPanel.gtk=Gtk + + #FreeMind Extended Help +-plugins/FreemindHelp.xml_documentation=Aide \u00E9tendue de FreeMind ++plugins/FreemindHelp.xml_documentation=Aide \u00e9tendue de FreeMind + + #Html Export Folding +-OptionPanel.html_export_folding=l'HTML pr\u00E9serve le pliage +- +-#Hu +-OptionPanel.hu=Hu ++OptionPanel.html_export_folding=l'HTML pr\u00e9serve le pliage + + #Hyperlink Types + OptionPanel.separator.hyperlink_types=Types d'hyper-liens + + #Icons +-plugins/TimeList.xml_Icons=Ic\u00F4nes ++plugins/TimeList.xml_Icons=Ic\u00f4nes + + #Initial Map Size + OptionPanel.separator.initial_map_size=Taille initiale de la carte + +-OptionPanel.it=It +- +-#Ja +-OptionPanel.ja=Ja + #Join Nodes + OptionPanel.keystroke_join_nodes=Fusionner les n\u0153uds + + #Key Type Adds New +-OptionPanel.key_type_adds_new=La frappe ajoute un nouveau ++OptionPanel.key_type_adds_new=La frappe ajoute un nouveau noeud + + #Key Typing + OptionPanel.separator.key_typing=Saisie clavier +@@ -1144,17 +1117,14 @@ + #Keystrokes + OptionPanel.Keystrokes=Raccourcis clavier + +-#Kr +-OptionPanel.kr=Kr +- + #Last + OptionPanel.last=Dernier + + #Last Opened List Length +-OptionPanel.last_opened_list_length=Longueur de la liste des fichiers les plus r\u00E9cents ++OptionPanel.last_opened_list_length=Longueur de la liste des fichiers les plus r\u00e9cents + + #Linear +-OptionPanel.linear=Lin\u00E9aire ++OptionPanel.linear=Rectiligne + + #Links + OptionPanel.links=Liens +@@ -1166,7 +1136,7 @@ + OptionPanel.lookandfeel=Aspect de l'interface (Look & Feel) + + #Metal +-OptionPanel.metal=M\u00E9tal ++OptionPanel.metal=M\u00e9tal + + #Minute\: + plugins/TimeManagement.xml_minute=Minutes \: +@@ -1181,25 +1151,25 @@ + OptionPanel.keystroke_mode_MindMap=Mode MindMap + + #Modified +-plugins/TimeList.xml_Modified=Modifi\u00E9e ++plugins/TimeList.xml_Modified=Modifi\u00e9e + + #Motif + OptionPanel.motif=Motif + + #Move Down +-OptionPanel.keystroke_move_down=D\u00E9placer en bas ++OptionPanel.keystroke_move_down=D\u00e9placer en bas + + #Move Left +-OptionPanel.keystroke_move_left=D\u00E9placer \u00E0 gauche ++OptionPanel.keystroke_move_left=D\u00e9placer \u00e0 gauche + + #Move Right +-OptionPanel.keystroke_move_right=D\u00E9placer \u00E0 droite ++OptionPanel.keystroke_move_right=D\u00e9placer \u00e0 droite + + #Move Up +-OptionPanel.keystroke_move_up=D\u00E9placer en haut ++OptionPanel.keystroke_move_up=D\u00e9placer en haut + + #MoveToRoot +-OptionPanel.keystroke_moveToRoot=D\u00E9placer \u00E0 la racine ++OptionPanel.keystroke_moveToRoot=D\u00e9placer \u00e0 la racine + + #NewMap + OptionPanel.keystroke_newMap=Nouvelle carte +@@ -1214,7 +1184,7 @@ + OptionPanel.keystroke_open_first_in_history=Ouvrir le premier fichier de l'historique + + #Other Defaults +-OptionPanel.separator.other_defaults=Autres r\u00E9glages par d\u00E9faut ++OptionPanel.separator.other_defaults=Autres r\u00e9glages par d\u00e9faut + + #Paste + OptionPanel.keystroke_paste=Coller +@@ -1226,56 +1196,41 @@ + OptionPanel.keystroke_remove=Retirer + + #Remove all reminders associated with the selected nodes. +-plugins/TimeManagement.xml_removeReminderButton_tooltip=Supprime toutes les alertes associ\u00E9es aux n\u0153uds s\u00E9lectionn\u00E9. ++plugins/TimeManagement.xml_removeReminderButton_tooltip=Supprime toutes les alertes associ\u00e9es aux n\u0153uds s\u00e9lectionn\u00e9. + + #Reminder scheduled at {0,date} {0,time}. +-plugins/TimeManagement.xml_reminderNode_tooltip=Alerte planifi\u00E9e le {0,date} \u00E0 {0,time}. +- +-#Pt BR +-OptionPanel.pt_BR=Pt BR +- +-#Pt PT +-OptionPanel.pt_PT=Pt PT ++plugins/TimeManagement.xml_reminderNode_tooltip=Alerte planifi\u00e9e le {0,date} \u00e0 {0,time}. + + #Quit + OptionPanel.keystroke_quit=Quitter + + #Remind Me At This Date +-plugins/TimeManagement.xml_reminderButton=M'alerter \u00E0 cette date ++plugins/TimeManagement.xml_reminderButton=M'alerter \u00e0 cette date + #Save + OptionPanel.OK=Sauver + + #Save + OptionPanel.keystroke_save=Sauver + +-#Ru +-OptionPanel.ru=Ru +- + #Save As + OptionPanel.keystroke_saveAs=Sauver sous + + #Select All +-OptionPanel.keystroke_select_all=Tout s\u00E9lectionner ++OptionPanel.keystroke_select_all=Tout s\u00e9lectionner + + #Select Branch +-OptionPanel.keystroke_select_branch=S\u00E9lectionner la branche ++OptionPanel.keystroke_select_branch=S\u00e9lectionner la branche + + #Time For Automatic Save +-OptionPanel.time_for_automatic_save=D\u00E9lai pour la sauvegarde automatique ++OptionPanel.time_for_automatic_save=D\u00e9lai pour la sauvegarde automatique (en millisecondes) + + #Time For Delayed Selection +-OptionPanel.time_for_delayed_selection=D\u00E9lai pour la s\u00E9lection temporis\u00E9e ++OptionPanel.time_for_delayed_selection=D\u00e9lai pour la s\u00e9lection retard\u00e9e + + #Time has elapsed for the node " {0} ". Do you want to snooze for ten minutes? +-plugins/TimeManagement.xml_reminderNode_showNode=L'heure est pass\u00E9 pour le n\u0153ud \u00AB{0}\u00BB. Voullez-vous ignorer pour dix minutes ? ++plugins/TimeManagement.xml_reminderNode_showNode=L'heure est pass\u00e9e pour le n\u0153ud \u00ab{0}\u00bb. Voulez-vous l'ignorer pour dix minutes ? + #Toggle Folded +-OptionPanel.keystroke_toggle_folded=Plier/d\u00E9plier +- +-#Zh +-OptionPanel.zh=Zh +- +-#Zh CN +-OptionPanel.zh_CN=Zh CN ++OptionPanel.keystroke_toggle_folded=Plier/d\u00e9plier + + #Remove Reminder + plugins/TimeManagement.xml_removeReminderButton=Supprimer l'alerte +@@ -1286,13 +1241,10 @@ + plugins/RemoveReminder.xml_documentation=Supprimer une alerte pour un n\u0153ud. + + #PreviousMap +-OptionPanel.keystroke_previousMap=Carte pr\u00E9c\u00E9dente ++OptionPanel.keystroke_previousMap=Carte pr\u00e9c\u00e9dente + + #Position Window Below Node +-OptionPanel.el__position_window_below_node=Positionne la fen\u00EAtre apr\u00E8s le n\u0153ud +- +-#Pl +-OptionPanel.pl=Pl ++OptionPanel.el__position_window_below_node=Positionne la fen\u00eatre sous le n\u0153ud + + #Node Up + OptionPanel.keystroke_node_up=Monter le n\u0153ud +@@ -1300,21 +1252,21 @@ + OptionPanel.keystroke_node_color=Couleur du n\u0153ud + + #Node Color Blend +-OptionPanel.keystroke_node_color_blend=Rapprocher les couleurs du n\u0153ud ++OptionPanel.keystroke_node_color_blend=\u00c9claircir la couleur du n\u0153ud + #The standard node color. In html notation (\#RRGGBB in hex values) +-OptionPanel.standardnodecolor.tooltip=Couleur standard des n\u0153uds.
Syntaxe HTML \: \#RRGGBB en valeurs hexad\u00E9cimal. ++OptionPanel.standardnodecolor.tooltip=Couleur standard des n\u0153uds.
Syntaxe HTML \: \#RRGGBB en valeurs hexad\u00e9cimal. + + #The default maximal node width in pixels +-OptionPanel.max_node_width.tooltip=Largeur maximale par d\u00E9faut des n\u0153uds en pixels. ++OptionPanel.max_node_width.tooltip=Largeur maximale par d\u00e9faut des n\u0153uds en pixels. + + # time between two consecutive automatic saving actions (in msec)\: To disable automatic saving set this number to 2000000000. +-OptionPanel.time_for_automatic_save.tooltip=intervalle entre deux actions cons\u00E9cutives de sauvegarde automatique (en millisecondes). Pour d\u00E9sactiver la sauvegarde automatique, mettre cette valeur \u00E0 2000000000. ++OptionPanel.time_for_automatic_save.tooltip=intervalle entre deux actions cons\u00e9cutives de sauvegarde automatique (en millisecondes). Pour d\u00e9sactiver la sauvegarde automatique, mettre cette valeur \u00e0 2000000000. + + # If the files should be deleted automatically on a normal shutdown of Freemind set the following variable to true +-OptionPanel.delete_automatic_saves_at_exit.tooltip=Si les fichiers doivent \u00EAtre supprim\u00E9s automatiquement lorsque FreeMind se termine normalement, mettez vrai pour cette valeur. ++OptionPanel.delete_automatic_saves_at_exit.tooltip=Si les fichiers doivent \u00eatre supprim\u00e9s automatiquement lorsque FreeMind se termine normalement, mettez vrai pour cette valeur. + + #The default node font. This will only work if the font (TrueTypeFont) is available on the system +-OptionPanel.defaultfont.tooltip=Police par d\u00E9faut pour les n\u0153uds. Cela ne fonctionnera que si la police (TrueType) est disponible sur le syst\u00E8me. ++OptionPanel.defaultfont.tooltip=Police par d\u00e9faut pour les n\u0153uds. Cela ne fonctionnera que si la police (TrueType) est disponible sur le syst\u00e8me. + + #The initial size of every map + OptionPanel.mapxsize.tooltip=Taille initiale de toutes les cartes. +@@ -1322,48 +1274,45 @@ + #Node Toggle Underlined + OptionPanel.keystroke_node_toggle_underlined=Basculer le soulignement du n\u0153ud + +-#Nl +-OptionPanel.nl=Nl +- + #Key typing\: if enabled enters node editing +-OptionPanel.disable_key_type.tooltip=Saisie au clavier \: passe en mode \u00E9dition avec la touche "Entr\u00E9e" lorsque l'option est activ\u00E9e. ++OptionPanel.disable_key_type.tooltip=Saisie au clavier \: passe en mode \u00e9dition avec la touche "Entr\u00e9e" lorsque l'option est activ\u00e9e. + + #Internal hook for scheduling resubmission tasks. +-plugins/TimeManagementReminder.xml_documentation=Accroche interne pour planifier les t\u00E2ches de r\u00E9\u00E9mission. ++plugins/TimeManagementReminder.xml_documentation=Accroche interne pour planifier les t\u00e2ches de r\u00e9\u00e9mission. + + #Relative +-OptionPanel.relative=Relatif ++OptionPanel.relative=Relatifs + + #If dnd is enabled. +-OptionPanel.draganddrop.tooltip=Si le glisser/d\u00E9pos\u00E9 est inactif. ++OptionPanel.draganddrop.tooltip=Si le glisser/d\u00e9pos\u00e9 est inactif. + + #Max Default Window Height +-OptionPanel.el__max_default_window_height=Hauteur maximale par d\u00E9faut des fen\u00EAtres ++OptionPanel.el__max_default_window_height=Hauteur maximale par d\u00e9faut de fen\u00eatre + + #The standard link color in html notation + OptionPanel.standardlinkcolor.tooltip=Couleur standard des liens, en syntaxe HTML. + #Internal hook for scheduling resubmission tasks. +-plugins/TimeManagementReminder.xml_name=Accroche interne pour planifier les t\u00E2ches de r\u00E9\u00E9mission. ++plugins/TimeManagementReminder.xml_name=Accroche interne pour planifier les t\u00e2ches de r\u00e9\u00e9mission. + + #Width of the folding marking circle + OptionPanel.foldingsymbolwidth.tooltip=Largeur du cercle indiquant le pliage. + + #Map-X-size +-OptionPanel.mapxsize=Taille de carte sur l'axe des X ++OptionPanel.mapxsize=Largeur originelle de carte (en pixels) + #Map-Y-size +-OptionPanel.mapysize=Taille de carte sur l'axe des X ++OptionPanel.mapysize=Hauteur originelle de carte (en pixels) + + #Node Decrease Font Size +-OptionPanel.keystroke_node_decrease_font_size=R\u00E9duire la taille des caract\u00E8res du n\u0153ud ++OptionPanel.keystroke_node_decrease_font_size=R\u00e9duire la taille des caract\u00e8res du n\u0153ud + + #Node Down + OptionPanel.keystroke_node_down=Descendre le n\u0153ud + + #Node Increase Font Size +-OptionPanel.keystroke_node_increase_font_size=Augmenter la taille des caract\u00E8res du n\u0153ud ++OptionPanel.keystroke_node_increase_font_size=Augmenter la taille des caract\u00e8res du n\u0153ud + + #Node editing commands +-OptionPanel.separator.node_editing_commands=Commandes d'\u00E9dition des n\u0153uds ++OptionPanel.separator.node_editing_commands=Commandes d'\u00e9dition des n\u0153uds + + #Node navigation commands + OptionPanel.separator.node_navigation_commands=Commandes de navigation dans les n\u0153uds +@@ -1378,7 +1327,7 @@ + OptionPanel.keystroke_node_toggle_italic=Basculer l'italique pour le n\u0153ud + + #New node commands +-OptionPanel.separator.new_node_commands=Commande pour cr\u00E9er un n\u0153ud ++OptionPanel.separator.new_node_commands=Commande pour cr\u00e9er un n\u0153ud + + #Path To Automatic Saves + OptionPanel.path_to_automatic_saves=Chemin pour les sauvegardes automatiques +@@ -1387,111 +1336,111 @@ + OptionPanel.separator.patterns=Fichier pour les gabarits + + #Shows all nodes with its creation/modification dates. +-plugins/NodeList.xml_documentation=Afficher tous les n\u0153uds avec leur date de cr\u00E9ation et modification. ++plugins/NodeList.xml_documentation=Afficher tous les n\u0153uds avec leur date de cr\u00e9ation et modification. + + #Shows all scheduled times and the corresponding nodes. +-plugins/TimeList.xml_documentation=Montre toutes les alertes horaire ainsi que les n\u0153uds associ\u00E9s. ++plugins/TimeList.xml_documentation=Montre toutes les alertes horaire ainsi que les n\u0153uds associ\u00e9s. + + #Toggle Children Folded +-OptionPanel.keystroke_toggle_children_folded=Plier/d\u00E9plier les enfants ++OptionPanel.keystroke_toggle_children_folded=Plier/d\u00e9plier les enfants + + #Max Node Width + OptionPanel.max_node_width=Largeur maximale des n\u0153uds + + #Max Default Window Width +-OptionPanel.el__max_default_window_width=Largeur maximale par d\u00E9faut des fen\u00EAtres ++OptionPanel.el__max_default_window_width=Largeur maximale par d\u00e9faut de fen\u00eatre + #Min Default Window Width +-OptionPanel.el__min_default_window_width=Largeur minimale des fen\u00EAtres ++OptionPanel.el__min_default_window_width=Largeur minimale par d\u00e9faut de fen\u00eatre + + #Place New Branches + OptionPanel.placenewbranches=Postionnement des nouvelles branches + + #Number Of Different Files For Automatic Save +-OptionPanel.number_of_different_files_for_automatic_save=Nombre de fichiers diff\u00E9rents pour la sauvegarde automatique ++OptionPanel.number_of_different_files_for_automatic_save=Nombre de fichiers diff\u00e9rents pour la sauvegarde automatique + + # number n of different files to store the maps into. The first automatic save is done in the first file, and so on up to the n+1-save which is again stored in the first file (cyclic) +-OptionPanel.number_of_different_files_for_automatic_save.tooltip=Quantit\u00E9 de n fichiers diff\u00E9rents utilis\u00E9s pour stocker les cartes.
La premi\u00E8re sauvegarde automatique est faite dans le premier fichier, ainsi de suite jusqu'\u00E0 la n+1\u00E8me sauvegarde qui est \u00E0 nouveau stock\u00E9e dans le premier fichier. ++OptionPanel.number_of_different_files_for_automatic_save.tooltip=Quantit\u00e9 de n fichiers diff\u00e9rents utilis\u00e9s pour stocker les cartes.
La premi\u00e8re sauvegarde automatique est faite dans le premier fichier, ainsi de suite jusqu'\u00e0 la n+1\u00e8me sauvegarde qui est \u00e0 nouveau stock\u00e9e dans le premier fichier. + + # This is typically Linux\: +-OptionPanel.default_browser_command_other_os.tooltip=Cela correspond typiquement \u00E0 Linux. ++OptionPanel.default_browser_command_other_os.tooltip=Cela correspond typiquement \u00e0 Linux. + + # Selection time delay of nodes when mouse is over (in msec). Change this value to 1 if you want direct selection on mouse over. +-OptionPanel.time_for_delayed_selection.tooltip=D\u00E9lai de s\u00E9lection des n\u0153uds lorsque le pointeur de la souris est dessus (en millisecondes).
Mettez 1 dans cette valeur si vous souhaitez une s\u00E9lection directe. ++OptionPanel.time_for_delayed_selection.tooltip=D\u00e9lai de s\u00e9lection des n\u0153uds lorsque le pointeur de la souris est dessus (en millisecondes).
Mettez 1 dans cette valeur si vous souhaitez une s\u00e9lection directe. + + # Tell if HTML exported from FreeMind should contain icons. The trouble with icons is that quite often the links to icons will not be found in the exported HTML. +-OptionPanel.export_icons_in_html.tooltip=Indique que l'HTML export\u00E9 par FreeMind doit int\u00E9grer les ic\u00F4nes.
Malheureusement le lien vers ces ic\u00F4nes n'est que rarement r\u00E9solu et ces derniers ne peuvent \u00EAtre affich\u00E9s. ++OptionPanel.export_icons_in_html.tooltip=Indique que l'HTML export\u00e9 par FreeMind doit int\u00e9grer les ic\u00f4nes.
Malheureusement le lien vers ces ic\u00f4nes n'est que rarement r\u00e9solu et ces derniers ne peuvent \u00eatre affich\u00e9s. + + # with the following switch you can enable/disable the delayed selection scheme. Auto options. Do not modify these as they will be saved to auto.properties anyway. +-OptionPanel.selection_method.tooltip=Avec cet indicateur vous pouvez activer et d\u00E9sactiver le mode de s\u00E9lection-retard\u00E9e. Cette option est automatique. Ne pas la modifier puisqu'elle sera dans tous les cas sauv\u00E9e dans le fichier auto.properties. ++OptionPanel.selection_method.tooltip=Avec cet indicateur vous pouvez activer et d\u00e9sactiver le mode de s\u00e9lection-retard\u00e9e. Cette option est automatique. Ne pas la modifier puisqu'elle sera dans tous les cas sauv\u00e9e dans le fichier auto.properties. + + # to change the default path (this is 'java.io.tmpdir' of java), enter a directory path here\: other possibilities\: * freemind_home stands for the directory, where the auto.properties are. * default points to java.io.tmpdir +-OptionPanel.path_to_automatic_saves.tooltip=Indiquez un chemin par d\u00E9faut pour les fichiers temporaires (propri\u00E9t\u00E9 Java 'java.io.tmpdir).
Il est \u00E9galement possible d'utiliser freemind_home o\u00F9 se trouve auto.properties ++OptionPanel.path_to_automatic_saves.tooltip=Indiquez un chemin par d\u00e9faut pour les fichiers temporaires (propri\u00e9t\u00e9 Java 'java.io.tmpdir).
Il est \u00e9galement possible d'utiliser freemind_home o\u00f9 se trouve auto.properties + + #Don't display 'move' cursor during paper dragging +-OptionPanel.disable_cursor_move_paper.tooltip=Ne pas afficher le pointeur de souris de d\u00E9placement lorsque la page glisse. ++OptionPanel.disable_cursor_move_paper.tooltip=Ne pas afficher le pointeur de souris de d\u00e9placement lorsque la page glisse. + + #Set Links either relative or absolute +-OptionPanel.links.tooltip=D\u00E9fini des liens soit relativement \u00E0 la carte courante, soit en chemin absolus. ++OptionPanel.links.tooltip=D\u00e9fini des liens soit relativement \u00e0 la carte courante, soit en chemin absolus. + + #The standard cloud color in html notation +-OptionPanel.standardcloudcolor.tooltip=Couleur par d\u00E9faut des nuages en syntaxe HTML. ++OptionPanel.standardcloudcolor.tooltip=Couleur par d\u00e9faut des nuages en syntaxe HTML. + + #The standard edge color in html notation +-OptionPanel.standardedgecolor.tooltip=Couleur par d\u00E9faut des lignes en syntaxe HTML. ++OptionPanel.standardedgecolor.tooltip=Couleur par d\u00e9faut des lignes en syntaxe HTML. + + #The standard node color if selected. In html notation (\#RRGGBB in hex values) +-OptionPanel.standardselectednodecolor.tooltip=Couleur standard des n\u0153uds s\u00E9lectionn\u00E9s.
Syntaxe HTML \: \#RRGGBB en valeurs hexad\u00E9cimal. ++OptionPanel.standardselectednodecolor.tooltip=Couleur standard des n\u0153uds s\u00e9lectionn\u00e9s.
Syntaxe HTML \: \#RRGGBB en valeurs hexad\u00e9cimal. + + #The standard background color in html notation +-OptionPanel.standardbackgroundcolor.tooltip=Couleur par d\u00E9faut du fond, en syntaxe HTML. ++OptionPanel.standardbackgroundcolor.tooltip=Couleur par d\u00e9faut du fond, en syntaxe HTML. + + #The standard cloud style. currently, only 'bezier' is supported +-OptionPanel.standardcloudestyle.tooltip=Style par d\u00E9faut des nuages. Seule la valeur 'bezier' est actuellement accept\u00E9e. ++OptionPanel.standardcloudestyle.tooltip=Style par d\u00e9faut des nuages. Seule la valeur 'bezier' est actuellement accept\u00e9e. + + #Currently, there may only be one reminder per node.
The current remnider is scheduled at {0,date} {0,time}, your choice was {1,date} {1,time}.

Do you want to change the node's reminder time (YES)
or do you want to keep the old one (NO)? +-plugins/TimeManagement.xml_reminderNode_onlyOneDate=Il ne peut actuellement y avoir qu'une alerte par n\u0153ud.
\nL'alerte actuelle est planifi\u00E9e pour le {0,date} \u00E0 {0,time}.
\nVotre Choix \u00E9tait le {1,date} \u00E0 {1,time}.
\nVoulez-vous modifier l'alter pour ce n\u0153ud (Oui) ?
\nOu souhaitez conserver la pr\u00E9c\u00E9dente (Non) ? ++plugins/TimeManagement.xml_reminderNode_onlyOneDate=Il ne peut actuellement y avoir qu'une alerte par n\u0153ud.
\nL'alerte actuelle est planifi\u00e9e pour le {0,date} \u00e0 {0,time}.
\nVotre Choix \u00e9tait le {1,date} \u00e0 {1,time}.
\nVoulez-vous modifier l'alter pour ce n\u0153ud (Oui) ?
\nOu souhaitez conserver la pr\u00e9c\u00e9dente (Non) ? + + #Enable leaves folding \=\= changing bubble/fork for fold action (although if false, you can always use node style to change it) +-OptionPanel.enable_leaves_folding.tooltip=Permet de pliage des feuilles.
C'est \u00E0 dire que pour un pliage ++OptionPanel.enable_leaves_folding.tooltip=Une fois cette option activ\u00e9, vous pouvez plier/d\u00e9plier une feuille.
L'int\u00e9r\u00eat est peu \u00e9vident. + + #Shows the calendar module by Kai Toedter. +-plugins/TimeManagement.xml_documentation=Affiche le module de calendrier.
D\u00E9velopp\u00E9 par Kai Toedter. ++plugins/TimeManagement.xml_documentation=Affiche le module de calendrier.
D\u00e9velopp\u00e9 par Kai Toedter. + + #The Look&Feel to use. 'metal','windows','motif', 'gtk' are supported, 'mac' is available only on MacOS. default means, that the default look and feel is used. If you want to put your own L&F, please, enter the class name here and assure that the corresponding jar file(s) are loaded. If there are problems with the look and feel, then choose 'nothing' here. It work for applets +-OptionPanel.lookandfeel.tooltip=Le Look & Feel \u00E0 utiliser.
\n"M\u00E9tal", "Windows", "Motif" "GTk" sont support\u00E9s, "Mac" n'est disponible que sur syst\u00E8me Mac OS.
\n"D\u00E9faut" indique d'utiliser le L&F par d\u00E9faut pour la machine virtuelle.
\nPour utiliser votre propre L&F, merci de saisir le nom de la classe et assurez-vous que le fichier JAR est correctement charg\u00E9.
\nS'il y a un probl\u00E8me de L&F, choississez "Aucun en particulier". Cela fonctionne pour les Applets.\n<,/html> ++OptionPanel.lookandfeel.tooltip=Le Look & Feel \u00e0 utiliser.
\n"M\u00e9tal", "Windows", "Motif" "GTk" sont support\u00e9s, "Mac" n'est disponible que sur syst\u00e8me Mac OS.
\n"D\u00e9faut" indique d'utiliser le L&F par d\u00e9faut pour la machine virtuelle.
\nPour utiliser votre propre L&F, merci de saisir le nom de la classe et assurez-vous que le fichier JAR est correctement charg\u00e9.
\nS'il y a un probl\u00e8me de L&F, choississez "Aucun en particulier". Cela fonctionne pour les Applets.\n<,/html> + + #The root node style if no other is specified. 'fork' and 'bubble' and 'combined' are supported +-OptionPanel.standardrootnodestyle.tooltip=Le style du n\u0153ud racine si aucun n'est sp\u00E9cifi\u00E9.
\nLa valeurs "branche", "bulle" et "mixte" sont support\u00E9es. ++OptionPanel.standardrootnodestyle.tooltip=Le style du n\u0153ud racine si aucun n'est sp\u00e9cifi\u00e9.
\nLes valeurs "fourche", "bulle" et "mixte" sont support\u00e9es. + + #The standard edge style. 'linear' and 'bezier' are supported +-OptionPanel.standardedgestyle.tooltip=Style par d\u00E9faut des lignes.
\nSont support\u00E9es les valeurs "rectiligne" et "b\u00E9zier". ++OptionPanel.standardedgestyle.tooltip=Style par d\u00e9faut des lignes.
\nSont support\u00e9es les valeurs "rectiligne" et "b\u00e9zier". + + #The standard link style. currently, only 'bezier' is supported +-OptionPanel.standardlinkestyle.tooltip=Style par d\u00E9faut des lignes de lien.
\nSeule la valeur "b\u00E9zier" est actuellement support\u00E9e. ++OptionPanel.standardlinkestyle.tooltip=Style par d\u00e9faut des lignes de lien.
\nSeule la valeur "b\u00e9zier" est actuellement support\u00e9e. + + #When pressed a timer is scheduled to the date given. Then blinking icons calls your attention.
If you close the map, the timers are reactivated the next time, the map is opened. +-plugins/TimeManagement.xml_reminderButton_tooltip=Ce bouton permet de planifier une alerte pour la date donn\u00E9e.
\nUn ic\u00F4ne clignotant attirera votre attention.
\nSi vous fermer la carte, les alertes sont r\u00E9activ\u00E9es \u00E0 l'ouverture qui suit. ++plugins/TimeManagement.xml_reminderButton_tooltip=Ce bouton permet de planifier une alerte pour la date donn\u00e9e.
\nUne ic\u00f4ne clignotante attirera votre attention.
\nSi vous fermer la carte, les alertes sont r\u00e9activ\u00e9es \u00e0 l'ouverture qui suit. + + #Where to place new branches. Valid values are 'first' and 'last' +-OptionPanel.placenewbranches.tooltip=O\u00F9 placer les nouvelles branches.
\nLes valeurs acceptables sont "premier" et "dernier". ++OptionPanel.placenewbranches.tooltip=O\u00f9 placer les nouvelles branches.
\nLes valeurs acceptables sont "premier" et "dernier". + + #This is the language that should be used in the program. 'automatic' tries to load the current user's language. +-OptionPanel.language.tooltip=La langue qui doit \u00EAtre utilis\u00E9e par l'application.
\nLa valeur 'automatique" tente de charger la langue utilis\u00E9e actuellement par l'utilisateur dans sont syst\u00E8me. ++OptionPanel.language.tooltip=La langue qui doit \u00eatre utilis\u00e9e par l'application.
\nLa valeur 'automatique" tente de charger la langue utilis\u00e9e actuellement par l'utilisateur dans sont syst\u00e8me. + + #The URL of the map that is loaded when browsemode starts up +-OptionPanel.browsemode_initial_map.tooltip=L'URL de la carte qui est charg\u00E9e lorsque le mode navigation est activ\u00E9. ++OptionPanel.browsemode_initial_map.tooltip=L'URL de la carte qui est charg\u00e9e lorsque le mode navigation est activ\u00e9. + + #The default new node style. 'fork', 'bubble' 'as_parent' and 'combined' are supported +-OptionPanel.standardnodestyle.tooltip=Le style par d\u00E9faut des nouveaux n\u0153uds.
\nSeules les valeurs indiqu\u00E9es dans la liste sont support\u00E9es. ++OptionPanel.standardnodestyle.tooltip=Le style par d\u00e9faut des nouveaux n\u0153uds.
\nSeules les valeurs indiqu\u00e9es dans la liste sont support\u00e9es. + + #For Windows (the "" signs are necessary due to links, that have "\=" in their URL). +-OptionPanel.default_browser_command_windows_9x.tooltip=Pour Windows (les signes "" sont n\u00E9csaires \u00E0 cause des liens qui contiennent un caract\u00E8re "\=" dans leur URL). ++OptionPanel.default_browser_command_windows_9x.tooltip=Pour Windows (les signes "" sont n\u00e9csaires \u00e0 cause des liens qui contiennent un caract\u00e8re "\=" dans leur URL). + + #For Windows (the "" signs are necessary due to links, that have "\=" in their URL). +-OptionPanel.default_browser_command_windows_nt.tooltip=Pour Windows (les signes "" sont n\u00E9csaires \u00E0 cause des liens qui contiennent un caract\u00E8re "\=" dans leur URL). ++OptionPanel.default_browser_command_windows_nt.tooltip=Pour Windows (les signes "" sont n\u00e9csaires \u00e0 cause des liens qui contiennent un caract\u00e8re "\=" dans leur URL). + + #Key typing\: overwrites content (false) / creates new sibling (true) (requires\: disable_key_type \= false) +-OptionPanel.key_type_adds_new.tooltip=Saisie au claiver \:\n
    \n
  • faux remplace le contenu\n
  • vrai cr\u00E9e un nouveau n\u0153ud fr\u00E8re\n
\nLa fonction n\u00E9cessite que l'option disable_key_type ait la valeur false ++OptionPanel.key_type_adds_new.tooltip=Saisie au claiver \:\n
    \n
  • faux remplace le contenu\n
  • vrai cr\u00e9e un nouveau n\u0153ud fr\u00e8re\n
\nLa fonction n\u00e9cessite que l'option disable_key_type ait la valeur false + + OptionPanel.separator.undo=Annulation + +@@ -1501,15 +1450,13 @@ + + OptionPanel.antialias_edges=Lisser les lignes + +-OptionPanel.keystroke_option_dialog=Pr\u00E9f\u00E9rences +- +-OptionPanel.no=Non ++OptionPanel.keystroke_option_dialog=Pr\u00e9f\u00e9rences + + OptionPanel.antialias_all=Tout lisser + + format_menu_edge_widths=Largeur des lignes + +-OptionPanel.ColorProperty.ResetColor=Mise \u00E0 z\u00E9ro des couleurs ++OptionPanel.ColorProperty.ResetColor=Mise \u00e0 z\u00e9ro des couleurs + + accessories/plugins/ExportToOoWriter.properties_name=Comme document Open Writer... + +@@ -1520,12 +1467,34 @@ + accessories/plugins/ImportMindmanagerFiles.properties_name=Carte de MindManager X5... + + #Determines the quality of the map. More antialias needs more time. +-OptionPanel.antialias.tooltip=D\u00E9termine la qualit\u00E9 du rendu de la carte. Plus de lissage demande plus de temps. ++OptionPanel.antialias.tooltip=D\u00e9termine la qualit\u00e9 du rendu de la carte. Plus de lissage demande plus de temps. + + #Determines how many steps are stored that can be undone via "Undo". +-OptionPanel.undo_levels.tooltip=D\u00E9termine combien d'\u00E9tapes sont stock\u00E9es pour pouvoir \u00EAtre annul\u00E9es. ++OptionPanel.undo_levels.tooltip=D\u00e9termine combien d'\u00e9tapes sont stock\u00e9es pour pouvoir \u00eatre annul\u00e9es. + + #Unfolded nodes form the structure, folded nodes the content of the document. +-accessories/plugins/ExportToOoWriter.properties_documentation=Les n\u0153uds d\u00E9pli\u00E9s forment la structure, les n\u0153uds forments le contenu du document. ++accessories/plugins/ExportToOoWriter.properties_documentation=Les n\u0153uds d\u00e9pli\u00e9s forment la structure, les n\u0153uds forments le contenu du document. + +-OptionPanel.cs=Cs ++#Language ++OptionPanel.language=Langue ++OptionPanel.automatic=Automatique ++OptionPanel.cs=Tch\u00e8que ++OptionPanel.de=Allemand ++OptionPanel.dk=Danois ++OptionPanel.en=Anglais ++OptionPanel.es=Espagnol ++OptionPanel.fr=Fran\u00e7ais ++OptionPanel.hu=Hongrois ++OptionPanel.it=Italien ++OptionPanel.ja=Japonais ++OptionPanel.kr=Cor\u00e9en ++OptionPanel.lt=Lituanien ++OptionPanel.nl=N\u00e9erlandais ++OptionPanel.no=Norv\u00e9gien ++OptionPanel.pl=Polonais ++OptionPanel.pt_PT=Portugais (du Portugal) ++OptionPanel.pt_BR=Portugais (du Br\u00e9sil) ++OptionPanel.ru=Russe ++OptionPanel.sl=Slov\u00e8ne ++OptionPanel.zh=Chinois (Mandarin) ++OptionPanel.zh_CN=Chinois (simplifi\u00e9) diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/patches/99_Resources_pl.patch /tmp/Offd2O1oj4/freemind-0.8.1/debian/patches/99_Resources_pl.patch --- freemind-0.7.1/debian/patches/99_Resources_pl.patch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/patches/99_Resources_pl.patch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,988 @@ +--- freemind/Resources_pl.properties 2005-05-24 21:10:17.000000000 +0000 ++++ freemind/Resources_pl.properties 2005-11-09 09:46:15.000000000 +0000 +@@ -1,336 +1,649 @@ +-#Polish translation by Rafal Kraik kraik@poczta.onet.pl +-about = O programie +-#about_text = Joerg Mueller's FreeMind\nTworzenie map pomys\u0142\u00f3w przy pomocy komputera.\nCopyright (C) 2000-2001 Joerg Mueller <joemuell@informatik.uni-freiburg.de>\nTen program jest darmowy (GPL)\nStrona domowa: http://freemind.sourceforge.net/\nMi\u0142ej zabawy!\nWersja: +-about_text = Joerg Mueller's FreeMind\nTworzenie map pomys\u0142\u00f3w przy pomocy komputera.\nCopyright (C) 2000-2004 Joerg Mueller i inni.\nTTen program jest darmowy (GPL)\nStrona domowa: http://freemind.sourceforge.net/\nMi\u0142ej zabawy!\nWersja: +-antialias_all = Antyalias wszystkiego +-antialias_edges = Antyalias kraw\u0119dzi +-antialias_none = Wy\u0142\u0105czy\u0107 antyalias +-background = T\u0142o +-bezier = Krzywa Beziera +-blend_color = Rozja\u015bni\u0107 kolor +-bold = T\u0142usty +-boldify_branch = Pogrubienie +-cloud = Chmurka +-cloud_color = Kolor chmurki... +-branch = Ga\u0142\u0105\u017a +-bubble = W\u0119ze\u0142 z ramk\u0105 +-cancel = Anuluj +-cannot_join_nodes_with_children = Nie mo\u017cna \u0142\u0105czy\u0107 w\u0119z\u0142\u00f3w, kt\u00f3re posiadaj\u0105 dzieci +-center = Wycentruj +-close = Zamknij +-copy = Kopiuj +-copy_single = Kopiuj bez potomk\u00f3w +-cut = Wytnij +-decrease_branch_font_size = Zmniejsz czcionk\u0119 ga\u0142\u0119zi +-decrease_node_font_size = Zmniejsz czcionk\u0119 w\u0119z\u0142a +-documentation = Dokumentacja +-edge = Kraw\u0119d\u017a +-edge_color = Kolor kraw\u0119dzi... +-edge_width_parent = jak rodzic +-edge_width_thin = cienki +-edit = Edycja +-edit_link_manually = Edytuj link r\u0119cznie... +-edit_long_node = Edycja w\u0119z\u0142a w oddzielnym edytorze... +-enter_base_url = FreeMind wklei linki wzgl\u0119dne. Podaj bazowy URL. +-enter_confirms = Enter potwierdza +-export_branch = Eksportuj ga\u0142\u0105\u017a... +-export_branch_to_html = Eksportuj ga\u0142\u0105\u017a do HTML +-export_to_html = Eksportuj do HTML +-extension_menu = Style +-file = Plik +-file_not_found = Plik $1 nie znaleziony +-find = Szukaj... +-find_what = Czego szuka\u0107 +-find_next = Znajd\u017a nast\u0119pny +-fold = Zwi\u0144 +-follow_link = Otw\u00f3rz link +-font = Czcionka +-fork = W\u0119ze\u0142 podkre\u015blony +-help = Pomoc +-html_export_based_on_headings = Eksport HTML - bazuj\u0105cy na nag\u0142\u00f3wkach +-html_export_no_folding = Eksport HTML - bez zwijania +-html_export_fold_currently_folded = Eksport HTML- Zwijanie aktualnie zwini\u0119tych +-html_export_fold_all = Export HTML - Zwijanie wszystkich w\u0119z\u0142\u00f3w +-# Daniel Polansky: This way of maintaining icon text +-# will ultimately lead to unbearable overheads. +-icon_menu = Ikony +-icon_help = Pytanie +-icon_messagebox_warning = Wa\u017cne +-icon_idea = Pomys\u0142 +-icon_button_ok = OK +-icon_button_cancel = \u0179le +-icon_back = Wstecz +-icon_forward = W prz\u00f3d +-icon_attach = Tu zajrze\u0107 +-icon_ksmiletris = Jestem szcz\u0119\u015bliwy +-icon_clanbomber = Gro\u017ane +-icon_desktop_new = Nie zapomnie\u0107 +-icon_flag = Flaga +-icon_gohome = Dom +-icon_kaddressbook = Telefon +-icon_knotify = Muzyka +-icon_korn = Skrzynka pocztowa +-icon_Mail = Poczta +-icon_password = Has\u0142o +-icon_pencil = Do poprawy +-icon_stop = Stop +-icon_wizard = Magia +-icon_xmag = Do om\u00f3wienia +-icon_bell = Pami\u0119taj +-icon_bookmark = Wy\u015bmienicie +-icon_penguin = Linux +-icon_licq = Przyjemny +-import = Import +-import_branch = Import ga\u0142\u0119zi... +-import_explorer_favorites = Import ulubionych... +-import_folder_structure = Import struktury katalog\u00f3w... +-import_linked_branch = Import na podstawie linku +-import_linked_branch_without_root = Import bez korzenia... +-increase_branch_font_size = Zwi\u0119ksz czcionk\u0119 +-increase_node_font_size = Zwi\u0119ksz czcionk\u0119 +-italic = Kursywa +-italicise_branch = Pochyl +-join_nodes = Po\u0142\u0105cz w\u0119z\u0142y +-license = Licencja +-license_text = FreeMind - Program do tworzenia i przegl\u0105dania map my\u015bli\nCopyright (C) 2000-2001 Joerg Mueller <joergmueller@bigfoot.com>\nSee COPYING for Details\n\nThis program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU General Public License\nas published by the Free Software Foundation; either version 2\nof the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-linear = Linia +-locking_failed_by_open = Zablokowanie mapy $1 niemo\u017cliwe. Otwieram tylko do odczytu. +-locking_failed_by_save_as = Zablokowanie mapy $1 niemo\u017cliwe. Polecenie Zapisz jako niedost\u0119pne. +-locking_old_lock_removed = Mapa $1 by\u0142a zablokowana przez u\u017cytkownika $2. Blokada zosta\u0142a usuni\u0119ta, bo by\u0142a ju\u017c stara. +-map_already_exists = Mapa ju\u017c istnieje. Czy j\u0105 nadpisa\u0107? +-map_corrupted = Mapa uszkodzona. Pokaza\u0107 szczeg\u00f3\u0142y? +-map_locked_by_open = Mapa $1 jest ju\u017c otwarta przez u\u017cytkownika $2. Otwieram tylko fo odczytu. +-map_locked_by_save_as = Mapa $1 jest ju\u017c otwarta przez u\u017cytkownika $2. Polecenie Zapisz jako niedost\u0119pne. +-mindmap = Mapa +-mindmaps = Mapy +-mindmaps_desc = Mapy (*.mm) +-mode_na = Tryb jest niedost\u0119pny +-mode_status=Tryb zmieniony na {0} +-mode_title =FreeMind - Tryb {0} +-modes = Tryby +-move_to_root = Przejd\u017a do korzenia +-new = Nowy +-new_child = Nowy w\u0119ze\u0142 potomny +-new_mindmap = Nowa mapa +-new_node = Nowy w\u0119ze\u0142 +-new_sibling_behind = Nowy w\u0119ze\u0142 (poni\u017cej) +-new_sibling_before = Nowy w\u0119ze\u0142 (powy\u017cej) +-next_map = Nast\u0119pna mapa +-no = Nie +-node = W\u0119ze\u0142 +-node_changed_discard_changes = Zmieni\u0142e\u015b w\u0119ze\u0142. Czy odrzuci\u0107 zmiany? +-node_color = Kolor w\u0119z\u0142a... +-node_down = Przesu\u0144 w\u0119ze\u0142 w d\u00f3\u0142 +-node_up = Przesu\u0144 w\u0119ze\u0142 do g\u00f3ry +-nonboldify_branch = Wy\u0142\u0105cz pogrubienie +-nonitalicise_branch = Wy\u0142\u0105cz pochylenie +-normal = Normalny +-no_found_from = "$1" nie znaleziony w "$2". +-no_more_found_from = Wi\u0119cej "$1" nie znaleziono w "$2". +-no_previous_find = \u017badnych poprzednich nie znaleziono. +-not_saved_for_link_error = Przed okre\u015bleniem linku do pliku mapa musi by\u0107 zapisana +-open = Otw\u00f3rz... +-page = Ustawienia strony... +-paste = Wklej +-new_node_as_sibling_not_possible_for_the_root = Nie mo\u017cna tworzy\u0107 w\u0119z\u0142a r\u00f3wnorz\u0119dnego z korzeniem +-preferences = Preferencje +-previous_map = Poprzednia mapa +-print = Drukuj... +-quit = Wyj\u015bcie +-remove_node = Usu\u0144 w\u0119ze\u0142 +-read_only = Tylko do odczytu +-repair_link = Napraw link +-repair_link_question = Nie mo\u017cna za\u0142adowa\u0107 zlinkowanej mapy. Czy naprawi\u0107 link r\u0119cznie? +-save = Zapisz +-save_as = Zapisz jako... +-save_failed = Pr\u00f3ba zapisu mapy $1 nie powiod\u0142a si\u0119. +-save_unsaved = Czy zapisa\u0107 nast\u0119puj\u0105c\u0105 map\u0119? : +-saved = Zapisane +-scheme_evaluate = Oce\u0144! +-select_favorites_folder = Wska\u017c katalog, gdzie znajduj\u0105 si\u0119 ulubione +-select_folder_for_importing = Wska\u017c katalog do zaimportowania +-set_image_by_filechooser = Wybierz obraz (Wyb\u00f3r pliku lub linku)... +-set_link_by_filechooser = Link (Wyb\u00f3r pliku)... +-set_link_by_textfield = Link (Wprowadzany r\u0119cznie)... +-sharp_bezier = Ostra krzywa Beziera +-sharp_linear = Ostra linia +-split = Podziel +-style = Styl +-toggle_bold_branch = W\u0142\u0105cz/wy\u0142\u0105cz pogrubienie +-toggle_children_folded = Zwi\u0144/rozwi\u0144 w\u0119z\u0142y potomne +-toggle_folded = Zwi\u0144/rozwi\u0144 w\u0119ze\u0142 +-toggle_italic_branch = W\u0142\u0105cz/wy\u0142\u0105cz kursyw\u0119 +-toggle_menubar = W\u0142\u0105cz/wy\u0142\u0105cz menu +-toggle_toolbar = W\u0142\u0105cz/wy\u0142\u0105cz pasek narz\u0119dzi +-toggle_left_toolbar = W\u0142\u0105cz/Wy\u0142\u0105cz boczny pasek narz\u0119dzi +-underline = Podkre\u015blenie +-unfold = Rozwi\u0144 +-url_error = B\u0142\u0105d! Niepoprawny URL. +-url_load_error = Nie mo\u017cna za\u0142\u0105dowa\u0107 mapy z URL: +-width = Szeroko\u015b\u0107 +-yes = Tak +-zoom_in = Powi\u0119ksz +-zoom_out = Pomniejsz +-remove_last_icon = Usu\u0144 ostatni\u0105 ikon\u0119 +-remove_all_icons = Usu\u0144 wszystkie ikony +-lots_of_links_warning = Czy chcesz utworzy\u0107 wiele link\u00f3w do tego samego w\u0119z\u0142a? Czy rzeczywi\u015bcie utworzy\u0107 te linki? +-remove_arrow_link = Usu\u0144 strza\u0142k\u0119 +-arrow_link_color = Zmie\u0144 kolor strza\u0142ki... +-follow_link = Id\u017a do: +-user_defined_zoom = Definiowane przez u\u017cytkownika. +-user_defined_zoom_status_bar = Zmiana skalowania do warto\u015bci okre\u015blonej przez u\u017cytkownika {0}%. +-# new from 14.12.2003, fc +-FAQ = Najcz\u0119\u015bciej zadawane pytania +-# new from 20.12.2003, fc +-printing_settings = Skalowanie wydruku +-fit_to_page = Dopasuj do strony +-user_zoom = Czynnik skalowania wydruku (0.0 - 2.0): +-ok = OK +-# changed from 23.1.2004, fc. +-selection_method_by_click = Zaznaczanie przez pojedy\u0144cze klikni\u0119cie +-selection_method_direct = Zaznaczanie przez wskazanie mysz\u0105 +-#new from 30.08.2004, Dimitri +-combined = \u0142\u0105czony +-as_parent = Jako rodzic +-# added at 2.5.2004, fc: +-undo=Cofnij +-redo=Pon\u00f3w +-delete_child=Usu\u0144 w\u0119ze\u0142 +-# added at 22.5.2004, fc: +-most_recent_files=Ostatnio otwierane pliki +-menu_view=Widok +-menu_navigate=Nawigacja +-menu_format=Format +-menu_extras=Narz\u0119dzia +-menu_insert=Wstaw +-# Beware: "Edge Width " and "Edge Style " must end with space. +-edge_width = Szeroko\u015b\u0107 kraw\u0119dzi +-edge_style = Styl kraw\u0119dzi +-menu_file_import = Import +-menu_file_export = Export +-edit_node = Edytuj w\u0119ze\u0142 +-# added at 5.6.2004, fc: +-node_background_color = Kolor t\u0142a w\u0119z\u0142a... +-# added at 25.8.2004, fc: +-choose_edge_color = Wybierz kolor kraw\u0119dzi +-# added at 27.8.2004, fc: +-underlined = Podkre\u015blony +-font_size = rozmiar czcionki +-font_family = rodzina czcionek +-# add at 16.9.2004, fc: +-import_linked_branch_no_link=Wybrany w\u0119ze\u0142 nie zawiera linku do pliku, kt\u00f3ry mo\u017cna zaimportowa\u0107. +-# added at 09.10.2004 +- +-add_link = Dodaj link graficzny +-less_than_two_selected_nodes = Do uzyskania po\u0142\u0105cznia (linku) trzeba wybra\u0107 dwa w\u0119z\u0142y. +-choose_node_background_color = Wybierz kolor t\u0142a w\u0119z\u0142a: +-choose_node_color = Wybierz kolor w\u0119z\u0142a: +-choose_background_color = Wybierz kolor t\u0142a: +-choose_cloud_color = Wybierz kolor chmurki: +-change_arrows_in_arrow_link = Zmie\u0144 kierunek strza\u0142ki +-add_local_link = Dodaj lokalny hyperlink +-link_not_available_any_more = Link jest nieaktualny. W\u0119ze\u0142 zosta\u0142 w mi\u0119dzyczasie usuni\u0119ty. +-file_already_exists = Plik {0} ju\u017 istnieje. Czy chcesz go nadpisa\u0107? +-error_creating_directory = Nie mo\u017na utworzy\u0107 katalogu na eksport. +-export_svg_text = Skalowalna grafika wektorowa (SVG) +-export_pdf_text = Dokument PDF +-goto_link_node_action = Id\017a do linku +-#fc, 14.11.2004: +-undefined_error = Nieoczekiwany b\u0142\u0105d. Spr\u00f3buj przes\u0142a\u0107 raport o b\u0142\u0119dzie. +-cannot_add_parent_diff_parents = Aby u\u017y\u0107 tej funkcji wszystkie w\u0119z\u0142y musz\u0105 mie\u0107 tego samego rodzica. +-cannot_add_parent_to_root = Dla w\u0119z\u0142a korzenia (root) nie mo\u017na doda\u0107 rodzica. +-no_format_copy_before_format_paste = Nie mo\u017na wkleja\u0107 formatu p\u00f3ki jakiego\015b nie skopiowano. +-#fc, 15.11.2004: +-accessories/plugins/AutomaticLayout.properties_documentation = Ustala wygl\u0105d mapy.
Pierwszy poziom jest czarny, drugi niebieski, itd. +-accessories/plugins/AutomaticLayout.properties_name = Uk\u0142ad automatyczny +-accessories/plugins/BlinkingNodeHook.properties_documentation = Spowoduje, \u017e w\u0119ze\u0142 b\u0119dzie miga\u0107. B\u0105d\017a ostro\u017ny. Nie \u0142\u0105cz ze zbyt wieloma w\u0119z\u0142ami i nie \u0142\u0105cz z innymi automatycznymi formatami +-accessories/plugins/BlinkingNodeHook.properties_name = Mrugaj\u0105cy w\u0119ze\u0142 +-accessories/plugins/CreationModificationPlugin.properties_documentation=Ta funkcja \015bledzi czas tworzenia i modyfikacji w\u0119z\u0142\u00f3w. +-accessories/plugins/CreationModificationPlugin.properties_name = Poka\u017 czas modyfikacji +-accessories/plugins/ExportToImage_PNG.properties_documentation = Eksportuje aktualn\u0105 map\u0119 do obrazu PNG. +-accessories/plugins/ExportToImage_PNG.properties_name = Jako PNG... +-accessories/plugins/ExportToImage_JPEG.properties_documentation = Eksportuje aktualn\u0105 map\u0119 do obrazu JPEG. +-accessories/plugins/ExportToImage_JPEG.properties_name = Jako JPEG... +-accessories/plugins/ExportWithXSLT.properties_documentation = To og\u00f3lna metoda eksportu przy u\u017yciu skrypt\u00f3w XSLT. +-accessories/plugins/ExportWithXSLT.properties_name = U\u017ywaj\u0105c XSLT... +-accessories/plugins/ExportWithXSLT_HTML.properties_documentation= +-accessories/plugins/ExportWithXSLT_HTML.properties_name = Jako XHTML (wersja JavaScript)... +-accessories/plugins/ExportWithXSLT_HTML3.properties_documentation= +-accessories/plugins/ExportWithXSLT_HTML3.properties_name = Jako XHTML (Clickable map image version)... +-accessories/plugins/FitToPage.properties_documentation = Ustawia powi\u0119kszenie tak, by ca\u0142a mapa zmie\015bci\u0142a si\u0119 w aktualnym oknie. +-accessories/plugins/FitToPage.properties_name = Ca\u0142a strona +-accessories/plugins/FormatCopy.properties_documentation = Kopiuje format w\u0119z\u0142\u0105. +-accessories/plugins/FormatCopy.properties_name = Kopiuj format +-accessories/plugins/FormatPaste.properties_documentation = Wkleja format w\u0119z\u0142a. +-accessories/plugins/FormatPaste.properties_name = Wklej format +-accessories/plugins/FormularEditor.properties_documentation = \u0142\u0105czy edytor notatek z aktualnym w\u0119z\u0142em. +-accessories/plugins/FormularEditor.properties_name = Formular Editor +-accessories/plugins/IconSelectionPlugin.properties_documentation = Tutaj mo\u017na wybra\u0107 ikon\u0119 w podoknie. +-accessories/plugins/IconSelectionPlugin.properties_name = Wybierz ikon\u0119... +-accessories/plugins/NewParentNode.properties_documentation = Wszystkie zaznaczone wysy\u0142a do nowego rodzica. +-accessories/plugins/NewParentNode.properties_name = Nowy rodzic +-accessories/plugins/NodeNote.properties_documentation = \u0142\u0105czy edytor notatek z aktualnym w\u0119z\u0142em. +-accessories/plugins/NodeNote.properties_name = Notatka +-accessories/plugins/PMCalculation.properties_documentation = Oblicza nak\u0142ad pracy dla r\u00f3\u017nych zada\u0144. +-accessories/plugins/PMCalculation.properties_name = PMCalculation +-accessories/plugins/RevisionPlugin.properties_documentation = Zaznacza t\u0142o ka\u017dego zmienianego w\u0119z\u0142a. +-accessories/plugins/RevisionPlugin.properties_name = Zaznacz zmiany na \u017\u00f3\u0142to +-accessories/plugins/UnfoldAll.properties_documentation = Rozwija zaznaczone w\u0119z\u0142y i wszystkie w\u0119z\u0142y potomne. +-accessories/plugins/UnfoldAll.properties_name = Rozwi\u0144 wszysko +-accessories/plugins/FoldAll.properties_documentation = Zwija zaznaczone w\u0119z\u0142y i wszyskie w\u0119z\u0142y potomne. +-accessories/plugins/FoldAll.properties_name = Zwi\u0144 wszystko +-accessories/plugins/UnfoldOneLevel.properties_documentation = Rozwija zaznaczone w\u0119z\u0142y po jednym poziomie. +-accessories/plugins/UnfoldOneLevel.properties_name = Rozwi\u0144 jeden poziom +-accessories/plugins/FoldOneLevel.properties_documentation = Zwija zaznaczone w\u0119z\u0142y po jednym poziomie. +-accessories/plugins/FoldOneLevel.properties_name = Zwi\u0144 jeden poziom +-plugins/FreemindHelp.xml_documentation = Rozsze\u017ona pomoc FreeMind +-plugins/FreemindHelp.xml_name = Pomoc online... +-plugins/ExportPdf.xml_documentation = Ekdport do PDF +-plugins/ExportPdf.xml_name = Jako PDF... +-plugins/ExportSvg.xml_documentation = Eksport do SVG +-plugins/ExportSvg.xml_name = Jako SVG... +- +-# fc, 28.11.2004: +-cannot_move_to_child = Nie mo\u017na przesun\u0105\u0107 w\u0119z\u0142a do jego potomka. +-# fc, 14.12.2004: +-accessories/plugins/EnterPassword.properties_name = Prze\u0142\u0105cz szyfrowany / rozszyfrowany +-accessories/plugins/EnterPassword.properties_documentation= +-accessories/plugins/EncryptNode.properties_name = Wstaw szyfrowany w\u0119ze\u0142 ... +-accessories/plugins/EncryptNode.properties_documentation = Wstawia nowy w\u0119ze\u0142, kt\u00f3ry jest zachowywany w postaci szyfrowanej. +-accessories/plugins/EncryptNode.properties_0 = Wybierz has\u0142o dla zaszyfrowanego w\u0119z\u0142\u0105 +-accessories/plugins/EncryptNode.properties_1 = Has\u0142a nie s\u0105 zgodne lub s\u0105 za kr\u00f3tkie. +-accessories/plugins/EncryptNode.properties_2 = Wpisz has\u0142o: +-accessories/plugins/EncryptNode.properties_3 = Powt\u00f3rz has\u0142o: +-accessories/plugins/EncryptNode.properties_4 = Wprowad\017a has\u0142o. +-accessories/plugins/EncryptNode.properties_5 = Pami\u0119taj, \u017e si\u0142a szyfrowania
zale\u017y prawie ca\u0142kowicie od trudnos\u0107i has\u0142a. +-accessories/plugins/EncryptNode.properties_6 = OK +-accessories/plugins/EncryptNode.properties_7 = Anuluj +-accessories/plugins/EncryptNode.properties_wrong_password = Has\u0142o nie jest prawid\u0142owe. +-accessories/plugins/NewEncryptedMap.properties_documentation = Tw\u00f3rz now\u0105 zaszyfrowan\u0105 map\u0119 +-accessories/plugins/NewEncryptedMap.properties_name = Tw\u00f3rz map\u0119 szyfrowan\u0105 ... +-accessories/plugins/EncryptNode.properties_select_me = Wybierz aby kontynuowa\u0107! +-accessories/plugins/EncryptNode.properties_insert_encrypted_node_first = Stan szyfrowania mo\u017na prze\u0142\u0105cza\u0107 tylko na w\u0119\017ale zaszyfrowanym. Wstaw taki w\u0119ze\u0142 z menu narz\u0119dzia. +-# fc, 2.2.05: +-selection_method_delayed=Op\u00f3\017aniony wyb\u00f3r automatyczny +-# fc, 4.2.05: +-plugins/TimeManagement.xml_documentation=Pokazuje modu\u0142 kalendarza autorstwa Kai Toedter. +-plugins/TimeManagement.xml_name= Poka\u017 kalendarz... +-plugins/TimeManagement.xml_appendButton= Dodaj dat\u0119 do wybranych w\u0119z\u0142ow +-plugins/TimeManagement.xml_reminderButton= Przypomnij mi tego dnia +-plugins/TimeManagement.xml_cancelButton=Anuluj +-plugins/TimeManagementReminder.xml_documentation=Wewn\u0119trzny znacznik do planowania przypomnienia o zadaniach. +-plugins/TimeManagementReminder.xml_name=Wewn\u0119trzny znacznik do planowania przypominania o zadaniach. +-plugins/TimeManagement.xml_reminderButton_tooltip=Kiedy w\u0142\u0105czony, wykonanie jest zaplanowane na podan\u0105 dat\u0119. O okre\015blonym czasie okienko pop-up przypomni o zadaniu.
Je\015bli zamkniesz map\u0119, zegar jest reaktywowany nast\u0119pnym razem, kiedy mapa jest otwierana. +-plugins/TimeManagement.xml_reminderNode_tooltip=Przypomnienie zaplanowane na {0,date} {0,time}. +-plugins/TimeManagement.xml_reminderNode_showNode=Up\u0142yn\u0105\u0142 czas dla w\u0119z\u0142a " {0} ". Czy przypomnie\u0107 jeszcze raz za 10 minut? +-plugins/TimeManagement.xml_reminderNode_onlyOneDate=Aktualnie mo\u017e by\u0107 tylko jedno przypomnienie dla w\u0119z\u0142a.
Aktualne przypomnienie jest zaplanowane na {0,date} {0,time}, tw\u00f3j wyb\u00f3r to {1,date} {1,time}.

Czy chcesz zmieni\u0107 przypomnienie w\u0119z\u0142a (TAK)
lub zachowa\u0107 poprzedni (NIE)? +-plugins/TimeManagement.xml_removeReminderButton = Usu\u0144 przypomnienie +-plugins/TimeManagement.xml_removeReminderButton_tooltip = Usu\u0144 wszystkie przypomnienia dla zaznaczonych w\u0119z\u0142ach. +-plugins/TimeManagement.xml_minute= Minuta: +-plugins/TimeManagement.xml_hour= Godzina: +-plugins/TimeManagement.xml_WindowTitle=Ustawianie czasu +-# fc, 18.2.2005: +-accessories/plugins/HierarchicalIcons.properties_documentation=Je\015bli jeden z potomk\u00f3w ma ikon\u0119, to ikona ta zostanie pokazana r\u00f3wnie\u017 w ma\u0142ym formacie. +-accessories/plugins/HierarchicalIcons.properties_name=Poka\u017 ikony hierarchicznie +- +- ++#Polish translation by Rafal Kraik kraik@poczta.onet.pl ++#2005-11-06, modified by Wojciech Piekutowski, hekto5.at.gmail.dot.com, some improvments of previos translation and new strings from 0.8.0 ++about=O programie ++about_text=Joerg Mueller's FreeMind\nTworzenie mindmap przy pomocy komputera.\nCopyright (C) 2000-2004 Joerg Mueller i inni.\nTen program jest darmowy (GPL)\nStrona domowa: http://freemind.sourceforge.net/\nMi\u0142ej zabawy!\nWersja: ++antialias_all=Antyaliasing wszystkiego ++antialias_edges=Antyaliasing ga\u0142\u0119zi ++antialias_none=Bez antyaliasingu ++background=T\u0142o ++bezier=Krzywa B\u00e9ziera ++blend_color=Rozja\u015bnij ++bold=Pogrubienie ++boldify_branch=Pogrubienie ++cloud=Chmurka ++cloud_color=Kolor chmurki... ++branch=Ga\u0142\u0105\u017a ++bubble=Ramka ++cancel=Anuluj ++cannot_join_nodes_with_children=Nie mo\u017cna \u0142\u0105czy\u0107 w\u0119z\u0142\u00f3w, kt\u00f3re posiadaj\u0105 potomk\u00f3w. ++center=Wy\u015brodkuj ++close=Zamknij ++copy=Kopiuj ++copy_single=Kopiuj bez potomk\u00f3w ++cut=Wytnij ++decrease_branch_font_size=Zmniejsz czcionk\u0119 ++decrease_node_font_size=Zmniejsz czcionk\u0119 ++documentation=Dokumentacja ++edge=Ga\u0142\u0105\u017a ++edge_color=Kolor ga\u0142\u0119zi... ++edge_width_parent=Jak rodzic ++edge_width_thin=Cienka ++edit=Edycja ++edit_link_manually=Edytuj odno\u015bnik: ++edit_long_node=Edycja w\u0119z\u0142a w edytorku... ++enter_base_url=FreeMind automatycznie wklei linki wzgl\u0119dne. Podaj bazowy URL. ++enter_confirms=Enter zamyka edytorek ++export_branch=Ga\u0142\u0105\u017a do mindmapy... ++export_branch_to_html=Ga\u0142\u0105\u017a do dokumentu HTML... ++export_to_html=Do dokumentu HTML... ++extension_menu=Styl ++file=Plik ++file_not_found=Plik $1 nie zosta\u0142 znaleziony. ++find=Znajd\u017a... ++find_what= Szukaj: ++find_next=Znajd\u017a nast\u0119pny ++fold=Zwi\u0144 ++font=Czcionka ++fork=Bez ramki ++help=Pomoc ++html_export_based_on_headings=Eksport HTML - jako esej ++html_export_no_folding=Eksport HTML - bez zwijania ++html_export_fold_currently_folded=Eksport HTML - zwijanie aktualnie zwini\u0119tych ++html_export_fold_all=Eksport HTML - zwijanie wszystkich w\u0119z\u0142\u00f3w ++## Daniel Polansky: This way of maintaining icon text ++## will ultimately lead to unbearable overheads. ++icon_menu=Ikony ++icon_help=Pytanie ++icon_messagebox_warning=Uwaga! ++icon_idea=Pomys\u0142 ++icon_button_ok=OK ++icon_button_cancel=\u0179le ++icon_back=Wstecz ++icon_forward=Dalej ++icon_attach=Za\u0142\u0105cznik ++icon_ksmiletris=Szcz\u0119\u015bliwy ++icon_clanbomber=Niebezpieczne ++icon_desktop_new=Nie zapomnij ++icon_flag=Flaga ++icon_gohome=Dom ++icon_kaddressbook=Telefon ++icon_knotify=Muzyka ++icon_korn=Skrzynka pocztowa ++icon_Mail=Poczta ++icon_password=Has\u0142o ++icon_pencil=O\u0142\u00f3wek ++icon_stop=Stop ++icon_wizard=Magiczny ++icon_xmag=Do przemy\u015blenia ++icon_bell=Pami\u0119taj ++icon_bookmark=Wspania\u0142e ++icon_penguin=Linux ++icon_licq=Przyjemne ++import=Import ++import_branch=Mindmapy jako nowej ga\u0142\u0119zi... ++import_explorer_favorites=Ulubionych z Internet Explorer... ++import_folder_structure=Struktury katalog\u00f3w... ++import_linked_branch=Odno\u015bnika z zaznaczonego w\u0119z\u0142a... ++import_linked_branch_without_root=Odno\u015bnika z zaznaczonego w\u0119z\u0142a (bez korzenia)... ++increase_branch_font_size=Zwi\u0119ksz czcionk\u0119 ga\u0142\u0119zi ++increase_node_font_size=Zwi\u0119ksz czcionk\u0119 ++italic=Pochylenie ++italicise_branch=Pochyl ++join_nodes=Po\u0142\u0105cz w\u0119z\u0142y ++license=Licencja ++license_text=FreeMind - program do tworzenia i przegl\u0105dania mindmap.\nWszelkie prawa zastrze\u017cone (C) 2000-2001 Joerg Mueller \n\nThis program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU General Public License\nas published by the Free Software Foundation; either version 2\nof the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++linear=Linia ++locking_failed_by_open=Zablokowanie mindmapy $1 niemo\u017cliwe. Otwieram tylko do odczytu. ++locking_failed_by_save_as=Zablokowanie mindmapy $1 niemo\u017cliwe. Polecenie "Zapisz jako..." anulowane. ++locking_old_lock_removed=Mindmapa $1 by\u0142a zablokowana przez u\u017cytkownika $2. Blokada zosta\u0142a usuni\u0119ta, bo jest zbyt stara. ++map_already_exists=Mindmapa o podanej nazwie ju\u017c istnieje. Czy chcesz j\u0105 zamieni\u0107? ++map_corrupted=Mindmapa uszkodzona. Wy\u015bwietli\u0107 szczeg\u00f3\u0142y? ++map_locked_by_open=Mindmapa $1 jest ju\u017c otwarta przez u\u017cytkownika $2. Otwieram tylko do odczytu. ++map_locked_by_save_as=Mindmapa $1 jest ju\u017c otwarta przez u\u017cytkownika $2. Polecenie "Zapisz jako..." niedost\u0119pne. ++mindmap=Mindmapa ++mindmaps=Mindmapa ++mindmaps_desc=Mindmapy (*.mm) ++mode_na=Tryb jest niedost\u0119pny ++mode_status=Tryb zmieniony na {0} ++mode_title =FreeMind - Tryb {0} ++modes=Tryb ++move_to_root=Przejd\u017a do korzenia ++new=Nowy ++new_child=Nowy w\u0119ze\u0142 potomny ++new_mindmap=Nowa mindmapa ++new_node=Nowy w\u0119ze\u0142 ++new_sibling_behind=Nowy w\u0119ze\u0142 (poni\u017cej) ++new_sibling_before=Nowy w\u0119ze\u0142 (powy\u017cej) ++next_map=Nast\u0119pna ++no=Nie ++node=W\u0119ze\u0142 ++node_changed_discard_changes=W\u0119ze\u0142 zosta\u0142 zmieniony. Czy chcesz odrzuci\u0107 zmiany? ++node_color=Kolor w\u0119z\u0142a... ++node_down=Przesu\u0144 w\u0119ze\u0142 w d\u00f3\u0142 ++node_up=Przesu\u0144 w\u0119ze\u0142 w g\u00f3r\u0119 ++nonboldify_branch=Wy\u0142\u0105cz pogrubienie ++nonitalicise_branch=Wy\u0142\u0105cz pochylenie ++normal=Normalny ++no_found_from=Nie znaleziono wyra\u017cenia "$1" w w\u0119\u017ale "$2". ++no_more_found_from=Nie znaleziono wi\u0119cej wyra\u017ce\u0144 "$1" w w\u0119\u017ale "$2". ++no_previous_find= Nie wprowadzono wyra\u017cenia do wyszukania. U\u017cyj polecenia Edycja->Znajd\u017a.... ++not_saved_for_link_error=Mindmapa musi zosta\u0107 zapisana przed wybraniem odno\u015bnika do pliku. ++open=Otw\u00f3rz... ++page=Ustawienia strony... ++paste=Wklej ++new_node_as_sibling_not_possible_for_the_root=Nie mo\u017cna utworzy\u0107 w\u0119z\u0142a r\u00f3wnorz\u0119dnego z korzeniem. ++preferences=Preferencje... ++previous_map=Poprzednia ++print=Drukuj... ++quit=Zako\u0144cz ++remove_node=Usu\u0144 w\u0119ze\u0142 ++read_only=Tylko do odczytu ++repair_link=Popraw odno\u015bnik ++repair_link_question=Nie mo\u017cna za\u0142adowa\u0107 do\u0142\u0105czonej mindmapy. Czy chcesz r\u0119cznie poprawi\u0107 odno\u015bnik? ++save=Zapisz ++save_as=Zapisz jako... ++save_failed=Pr\u00f3ba zapisu mindmapy $1 nie powiod\u0142a si\u0119. ++save_unsaved=Czy zapisa\u0107 nast\u0119puj\u0105c\u0105 mindmap\u0119?: ++saved=Zapisane ++scheme_evaluate=Oce\u0144! ++select_favorites_folder=Wska\u017c katalog, w kt\u00f3rym znajduj\u0105 si\u0119 ulubione ++select_folder_for_importing=Wska\u017c katalog do zaimportowania ++set_image_by_filechooser=Obraz (wybierz plik lub wpisz odno\u015bnika)... ++set_link_by_filechooser=Odno\u015bnik (wybierz plik)... ++set_link_by_textfield=Odno\u015bnik (wprowad\u017a r\u0119cznie)... ++sharp_bezier=Ostra krzywa B\u00e9ziera ++sharp_linear=Ostra linia ++split=Podziel ++style=Styl ++toggle_bold_branch=W\u0142\u0105cz/wy\u0142\u0105cz pogrubienie ++toggle_children_folded=Zwi\u0144/rozwi\u0144 w\u0119z\u0142y potomne ++toggle_folded= Zwi\u0144/rozwi\u0144 w\u0119ze\u0142 ++toggle_italic_branch=W\u0142\u0105cz/wy\u0142\u0105cz kursyw\u0119 ++toggle_menubar=W\u0142\u0105cz/wy\u0142\u0105cz menu ++toggle_toolbar=W\u0142\u0105cz/wy\u0142\u0105cz pasek narz\u0119dzi ++toggle_left_toolbar=W\u0142\u0105cz/Wy\u0142\u0105cz boczny pasek narz\u0119dzi ++underline=Podkre\u015blenie ++unfold=Rozwi\u0144 ++url_error=B\u0142\u0105d! Niepoprawny URL. ++url_load_error=Nie mo\u017cna za\u0142adowa\u0107 mindmapy z URL: ++width=Szeroko\u015b\u0107 ++yes=Tak ++zoom_in=Powi\u0119ksz ++zoom_out=Pomniejsz ++remove_last_icon=Usu\u0144 ostatni\u0105 ikon\u0119 ++remove_all_icons=Usu\u0144 wszystkie ikony ++lots_of_links_warning=Czy na pewno chcesz utworzy\u0107 wiele odno\u015bnik\u00f3w do tego samego w\u0119z\u0142a? ++remove_arrow_link=Usu\u0144 po\u0142\u0105czenie ++arrow_link_color=Zmie\u0144 kolor po\u0142\u0105czenia... ++user_defined_zoom=u\u017cytkownika... ++user_defined_zoom_status_bar=Zmiana powi\u0119kszenia do warto\u015bci {0}%. ++## new from 14.12.2003, fc ++FAQ=FAQ ++# new from 20.12.2003, fc ++printing_settings=Ustawienia drukowania ++fit_to_page=Dopasuj do strony ++user_zoom=Powi\u0119kszenie wydruku (0.0 - 2.0): ++ok=OK ++# changed from 23.1.2004, fc. ++selection_method_by_click=Zaznaczanie przez pojedyncze klikni\u0119cie ++selection_method_direct=Zaznaczanie przez wskazanie mysz\u0105 ++#new from 30.08.2004, Dimitri ++combined=Ramka/bez ramki ++as_parent=Jako rodzic ++# added at 2.5.2004, fc: ++undo=Cofnij ++redo=Powt\u00f3rz ++delete_child=Usu\u0144 w\u0119ze\u0142 ++# added at 22.5.2004, fc: ++most_recent_files=Ostatnio otwierane ++menu_view=Widok ++menu_navigate=Nawigacja ++menu_format=Format ++menu_extras=Narz\u0119dzia ++menu_insert=Wstaw ++# Beware: "Edge Width " and "Edge Style " must end with space. ++edge_width=Szeroko\u015b\u0107 ga\u0142\u0119zi ++edge_style=Styl ga\u0142\u0119zi ++menu_file_import=Import ++menu_file_export=Eksport ++edit_node=Edytuj w\u0119ze\u0142 ++# added at 5.6.2004, fc: ++node_background_color=Kolor t\u0142a w\u0119z\u0142a... ++# added at 25.8.2004, fc: ++choose_edge_color=Wybierz kolor ga\u0142\u0119zi ++# added at 27.8.2004, fc: ++underlined=Podkre\u015blony ++font_size=rozmiar ++font_family=czcionka ++# add at 16.9.2004, fc: ++import_linked_branch_no_link=Wybrany w\u0119ze\u0142 nie zawiera odno\u015bnika do pliku, kt\u00f3ry mo\u017cna zaimportowa\u0107. ++# added at 09.10.2004 ++add_link=Po\u0142\u0105czenie do innego w\u0119z\u0142a ++less_than_two_selected_nodes= Wybierz co najmniej dwa w\u0119z\u0142y, aby utworzy\u0107 po\u0142\u0105czenie. ++choose_node_background_color=Wybierz kolor t\u0142a w\u0119z\u0142a: ++choose_node_color=Wybierz kolor w\u0119z\u0142a: ++choose_background_color=Wybierz kolor t\u0142a: ++choose_cloud_color=Wybierz kolor chmurki: ++change_arrows_in_arrow_link=Zmie\u0144 kierunek po\u0142\u0105czenia ++add_local_link=Odno\u015bnik do innego w\u0119z\u0142a ++link_not_available_any_more=Po\u0142\u0105czenie jest nieaktualne. Jeden z w\u0119z\u0142\u00f3w zosta\u0142 usuni\u0119ty. ++file_already_exists=Plik {0} ju\u017c istnieje. Czy chcesz go nadpisa\u0107? ++error_creating_directory=Nie mo\u017cna utworzy\u0107 katalogu. ++export_svg_text=Skalowalna grafika wektorowa (SVG) ++export_pdf_text=Dokument PDF ++goto_link_node_action=Id\u017a do odno\u015bnika ++#fc, 14.11.2004: ++undefined_error=Nieoczekiwany b\u0142\u0105d. Prosz\u0119 prze\u015blij o nim wiadomo\u015b\u0107. ++cannot_add_parent_diff_parents=Wszystkie w\u0119z\u0142y musz\u0105 mie\u0107 tego samego rodzica, aby u\u017cy\u0107 tej funkcji. ++cannot_add_parent_to_root=Dla w\u0119z\u0142a korzenia (root) nie mo\u017cna doda\u0107 rodzica. ++no_format_copy_before_format_paste=Nie mo\u017cna wklei\u0107 formatowania zanim nie skopiowano go z innego w\u0119z\u0142a. ++#fc, 15.11.2004: ++accessories/plugins/AutomaticLayout.properties_documentation= Ustala wygl\u0105d mindmapy. Pierwszy poziom jest czarny, drugi niebieski, itd. ++accessories/plugins/AutomaticLayout.properties_name=Formatowanie automatyczne ++accessories/plugins/BlinkingNodeHook.properties_documentation= Spowoduje, \u017ce w\u0119ze\u0142 b\u0119dzie miga\u0107. B\u0105d\u017a ostro\u017cny. Nie u\u017cywaj na zbyt wielu w\u0119z\u0142ach i nie razem z innym formatowaniem automatycznym ++accessories/plugins/BlinkingNodeHook.properties_name=Migaj\u0105cy w\u0119ze\u0142 ++accessories/plugins/CreationModificationPlugin.properties_documentation= Ta funkcja \u015bledzi czas tworzenia i modyfikacji w\u0119z\u0142\u00f3w ++accessories/plugins/CreationModificationPlugin.properties_name=Poka\u017c czas modyfikacji (po wskazaniu myszk\u0105) ++accessories/plugins/ExportToImage_PNG.properties_documentation= Eksportuje mindmap\u0119 do obrazu PNG ++accessories/plugins/ExportToImage_PNG.properties_name=Do obrazu PNG... ++accessories/plugins/ExportToImage_JPEG.properties_documentation= Eksportuje mindmap\u0119 do obrazu JPEG ++accessories/plugins/ExportToImage_JPEG.properties_name=Do obrazu JPEG... ++accessories/plugins/ExportWithXSLT.properties_documentation= To og\u00f3lna metoda eksportu przy u\u017cyciu skrypt\u00f3w XSLT ++accessories/plugins/ExportWithXSLT.properties_name=U\u017cywaj\u0105c XSLT... ++accessories/plugins/ExportWithXSLT_HTML.properties_documentation= Eksportuje mindmap\u0119 do dokumentu XHTML z JavaScript ++accessories/plugins/ExportWithXSLT_HTML.properties_name=Do dokumentu XHTML (wersja JavaScript)... ++accessories/plugins/ExportWithXSLT_HTML3.properties_documentation= Eksportuje mindmap\u0119 do dokumentu XHTML bez u\u017cycia JavaScript ++accessories/plugins/ExportWithXSLT_HTML3.properties_name=Do dokumentu XHTML (widok ca\u0142ej mindmapy)... ++accessories/plugins/FitToPage.properties_documentation= Ustawia powi\u0119kszenie tak, by ca\u0142a mindmapa zmie\u015bci\u0142a si\u0119 w aktualnym oknie ++accessories/plugins/FitToPage.properties_name=Dopasuj do strony ++accessories/plugins/FormatCopy.properties_documentation= Kopiuje formatowanie w\u0119z\u0142a ++accessories/plugins/FormatCopy.properties_name=Kopiuj formatowanie ++accessories/plugins/FormatPaste.properties_documentation= Wkleja formatowanie w\u0119z\u0142a. Pami\u0119taj o wcze\u015bniejszym skopiowaniu go z innego w\u0119z\u0142a ++accessories/plugins/FormatPaste.properties_name=Wklej formatowanie ++########################## ++accessories/plugins/FormularEditor.properties_documentation= Associates a simple formular editor to the current note ++########################## ++accessories/plugins/FormularEditor.properties_name=Formular Editor ++accessories/plugins/IconSelectionPlugin.properties_documentation= Otwiera okienko z dost\u0119pnymi ikonami ++accessories/plugins/IconSelectionPlugin.properties_name=Wybierz ikon\u0119... ++accessories/plugins/NewParentNode.properties_documentation= Wszystkie zaznaczone w\u0119z\u0142y przenosi do nowego rodzica ++accessories/plugins/NewParentNode.properties_name=Utw\u00f3rz nowego rodzica ++accessories/plugins/NodeNote.properties_documentation= Do\u0142\u0105cza notatk\u0119 do zaznaczonego w\u0119z\u0142a ++accessories/plugins/NodeNote.properties_name=Notatka ++########################## ++accessories/plugins/PMCalculation.properties_documentation= Oblicza nak\u0142ad pracy dla r\u00f3\u017cnych zada\u0144 ++########################## ++accessories/plugins/PMCalculation.properties_name=PMCalculation ++accessories/plugins/RevisionPlugin.properties_documentation= Zmienia t\u0142o ka\u017cdego zmienionego w\u0119z\u0142a ++accessories/plugins/RevisionPlugin.properties_name=Zaznaczaj zmiany na \u017c\u00f3\u0142to ++accessories/plugins/UnfoldAll.properties_documentation= Rozwija zaznaczone w\u0119z\u0142y i ich w\u0119z\u0142y potomne ++accessories/plugins/UnfoldAll.properties_name=Rozwi\u0144 wszystko ++accessories/plugins/FoldAll.properties_documentation= Zwija zaznaczone w\u0119z\u0142y i ich w\u0119z\u0142y potomne ++accessories/plugins/FoldAll.properties_name=Zwi\u0144 wszystko ++accessories/plugins/UnfoldOneLevel.properties_documentation= Rozwija zaznaczone w\u0119z\u0142y o jeden poziom ++accessories/plugins/UnfoldOneLevel.properties_name=Rozwi\u0144 jeden poziom ++accessories/plugins/FoldOneLevel.properties_documentation= Zwija zaznaczone w\u0119z\u0142y o jeden poziom ++accessories/plugins/FoldOneLevel.properties_name=Zwi\u0144 jeden poziom ++plugins/FreemindHelp.xml_documentation= Rozszerzona pomoc FreeMind ++plugins/FreemindHelp.xml_name=Pomoc... ++plugins/ExportPdf.xml_documentation= Eksport do dokumentu PDF ++plugins/ExportPdf.xml_name=Do dokumentu PDF... ++plugins/ExportSvg.xml_documentation= Eksport do obrazu SVG ++plugins/ExportSvg.xml_name=Do obrazu SVG... ++# fc, 28.11.2004: ++cannot_move_to_child=Nie mo\u017cna przesun\u0105\u0107 w\u0119z\u0142a do jego potomka. ++# fc, 14.12.2004: ++accessories/plugins/EnterPassword.properties_name=W\u0142\u0105cz/wy\u0142\u0105cz szyfrowanie ++accessories/plugins/EnterPassword.properties_documentation= Umo\u017cliwia prze\u0142\u0105czanie si\u0119 mi\u0119dzy trybem za- i roz- szyfrowanym ++accessories/plugins/EncryptNode.properties_name=Wstaw zaszyfrowany w\u0119ze\u0142 ... ++accessories/plugins/EncryptNode.properties_documentation= Wstawia nowy w\u0119ze\u0142, kt\u00f3ry jest zachowywany w postaci zaszyfrowanej ++accessories/plugins/EncryptNode.properties_0=Podaj has\u0142o ++accessories/plugins/EncryptNode.properties_1=Has\u0142a nie s\u0105 zgodne lub s\u0105 zbyt kr\u00f3tkie. ++accessories/plugins/EncryptNode.properties_2=Has\u0142o: ++accessories/plugins/EncryptNode.properties_3=Powt\u00f3rz has\u0142o: ++accessories/plugins/EncryptNode.properties_4=Podaj has\u0142o dla zaszyfrowanego w\u0119z\u0142a. ++accessories/plugins/EncryptNode.properties_5=Pami\u0119taj, \u017ce si\u0142a szyfrowania zale\u017cy prawie ca\u0142kowicie od trudno\u015bci has\u0142a. ++accessories/plugins/EncryptNode.properties_6=OK ++accessories/plugins/EncryptNode.properties_7=Anuluj ++accessories/plugins/EncryptNode.properties_wrong_password=Has\u0142o nie jest prawid\u0142owe. ++accessories/plugins/NewEncryptedMap.properties_documentation= Tworzy now\u0105 zaszyfrowan\u0105 mindmap\u0119 ++accessories/plugins/NewEncryptedMap.properties_name=Utw\u00f3rz zaszyfrowan\u0105 mindmap\u0119... ++accessories/plugins/EncryptNode.properties_select_me=Nowa mindmapa ++accessories/plugins/EncryptNode.properties_insert_encrypted_node_first=Stan szyfrowania mo\u017cna prze\u0142\u0105cza\u0107 tylko dla zaszyfrowanego w\u0119z\u0142a, kt\u00f3ry mo\u017cesz wstawi\u0107 z menu Narz\u0119dzia. ++# fc, 2.2.05: ++selection_method_delayed=Z op\u00f3\u017anieniem ++# fc, 4.2.05: ++plugins/TimeManagement.xml_documentation= Pokazuje modu\u0142 kalendarza autorstwa Kai Toedter ++plugins/TimeManagement.xml_name=Poka\u017c kalendarz... ++plugins/TimeManagement.xml_appendButton=Dodaj dat\u0119 do wybranych w\u0119z\u0142\u00f3w ++plugins/TimeManagement.xml_reminderButton=Przypomnij mi tego dnia ++plugins/TimeManagement.xml_cancelButton=Anuluj ++plugins/TimeManagementReminder.xml_documentation= Wewn\u0119trzny modu\u0142 przypominania o zadaniach ++plugins/TimeManagementReminder.xml_name=Wewn\u0119trzny modu\u0142 przypominania o zadaniach. ++plugins/TimeManagement.xml_reminderButton_tooltip= Kiedy alarm jest w\u0142\u0105czony, o okre\u015blonym czasie okienko pop-up przypomni o zadaniu. Je\u015bli zamkniesz mindmap\u0119,
zegar jest reaktywowany nast\u0119pnym razem, gdy jest ona otwierana ++plugins/TimeManagement.xml_reminderNode_tooltip= Przypomnienie zaplanowane na {0,date} {0,time} ++plugins/TimeManagement.xml_reminderNode_showNode=Up\u0142yn\u0105\u0142 czas dla w\u0119z\u0142a " {0} ". Czy przypomnie\u0107 jeszcze raz za 10 minut? ++plugins/TimeManagement.xml_reminderNode_onlyOneDate= Aktualnie mo\u017ce by\u0107 tylko jedno przypomnienie dla w\u0119z\u0142a.
Aktualne przypomnienie jest zaplanowane na {0,date} {0,time}, tw\u00f3j wyb\u00f3r to {1,date} {1,time}.

Czy chcesz zmieni\u0107 przypomnienie w\u0119z\u0142a (TAK)
lub zachowa\u0107 poprzednie (NIE)? ++plugins/TimeManagement.xml_removeReminderButton=Usu\u0144 przypomnienie ++plugins/TimeManagement.xml_removeReminderButton_tooltip= Usu\u0144 wszystkie przypomnienia dla zaznaczonych w\u0119z\u0142\u00f3w ++plugins/TimeManagement.xml_minute=Minuta: ++plugins/TimeManagement.xml_hour=Godzina: ++plugins/TimeManagement.xml_WindowTitle=Wybierz dat\u0119 przypomnienia ++# fc, 18.2.2005: ++accessories/plugins/HierarchicalIcons.properties_documentation= Je\u015bli jeden z potomk\u00f3w w\u0119z\u0142a ma ikon\u0119, to zostanie ona r\u00f3wnie\u017c wy\u015bwietlona w w\u0119\u017ale (rodzicu) ++accessories/plugins/HierarchicalIcons.properties_name=Pokazuj ikony hierarchicznie ++# fc, 1.3.2005: ++icon_full-1=Priorytet 1 ++icon_full-2=Priorytet 2 ++icon_full-3=Priorytet 3 ++icon_full-4=Priorytet 4 ++icon_full-5=Priorytet 5 ++icon_full-6=Priorytet 6 ++icon_full-7=Priorytet 7 ++# fc, 11.3.2005: ++RevertAction=Otw\u00f3rz ponownie ++# the prefix for the reconstructed map (revert + undo). ++freemind_reverted=Freemind_odtworzona_ ++# fc, 5.4.2005 ++plugins/TimeManagement.xml_todayButton=Dzisiaj ++plugins/TimeList.xml_documentation= Wy\u015bwietla wszystkie zaplanowane zadania wraz z odpowiednimi w\u0119z\u0142ami ++plugins/TimeList.xml_name=Poka\u017c zaplanowane zadania... ++remove_node_background_color=Usu\u0144 kolor t\u0142a w\u0119z\u0142a ++plugins/NodeList.xml_documentation= Wy\u015bwietla daty utworzenia i modyfikacji wszystkich w\u0119z\u0142\u00f3w ++plugins/NodeList.xml_name=Poka\u017c histori\u0119 mindmapy... ++plugins/TimeList.xml_Modified=Zmieniony ++plugins/TimeList.xml_Created=Utworzony ++plugins/TimeList.xml_Date=Data ++plugins/TimeList.xml_Text=Tekst ++plugins/TimeList.xml_Icons=Ikony ++#fc, 26.4.2005: ++select_branch=Zaznacz potomk\u00f3w wybranego w\u0119z\u0142a ++select_all=Zaznacz wszystkie widoczne w\u0119z\u0142y ++change_link_arrows=Zmie\u0144 strza\u0142ki po\u0142\u0105czenia ++# fc, 27.4.2005: ++reset_node_position=Przywr\u00f3\u0107 domy\u015blne po\u0142o\u017cenie ++# fc, 2.5.2005: ++plugins/RemoveReminder.xml_documentation= Usuwa zaplanowane zadanie z w\u0119z\u0142a ++plugins/RemoveReminder.xml_name=Usu\u0144 zaplanowane zadanie ++# fc, 3.5.2005: ++plugins/TimeManagement.xml_reminderButton_tooltip= Po naci\u015bni\u0119ciu alarm jest ustawiany na podany czas. Migaj\u0105ca ikona oznacza alarm.
Je\u015bli zamkniesz mindmap\u0119, alarm zostanie odtworzony po jej ponownym otwarciu ++# fc, 10.5.2005: ++property_dialog=Preferencje... ++OptionPanel.automatic=automatyczny ++OptionPanel.de=de ++OptionPanel.dk=dk ++OptionPanel.en=en ++OptionPanel.es=es ++OptionPanel.fr=fr ++OptionPanel.hu=hu ++OptionPanel.it=it ++OptionPanel.ja=ja ++OptionPanel.kr=kr ++OptionPanel.nl=nl ++OptionPanel.pl=pl ++OptionPanel.pt_BR=pt BR ++OptionPanel.pt_PT=pt PT ++OptionPanel.ru=ru ++OptionPanel.sl=sl ++OptionPanel.zh=zh ++OptionPanel.zh_CN=zh CN ++OptionPanel.fork=bez ramki ++OptionPanel.bubble=ramka ++OptionPanel.as_parent= jak rodzic ++OptionPanel.combined=ramka/bez ramki ++OptionPanel.bezier=krzywa B\u00e9zier ++OptionPanel.linear=linia ++OptionPanel.default=domy\u015blny ++OptionPanel.metal=Metal ++OptionPanel.windows=Windows ++OptionPanel.motif=Motif ++OptionPanel.gtk=Gtk ++OptionPanel.nothing=\u017caden ++OptionPanel.relative=wzgl\u0119dny ++OptionPanel.absolute=bezwzgl\u0119dny ++OptionPanel.first=pierwsza ++OptionPanel.last=ostatnia ++OptionPanel.selection_method_direct=bezpo\u015brednio ++OptionPanel.selection_method_delayed=z op\u00f3\u017anieniem ++OptionPanel.selection_method_by_click=przez klikni\u0119cie ++OptionPanel.html_export_no_folding=bez zwijania ++OptionPanel.html_export_fold_currently_folded=zwi\u0144 obecnie zwini\u0119te ++OptionPanel.html_export_fold_all=zwi\u0144 wszystkie ++OptionPanel.html_export_based_on_headings=jako esej ++OptionPanel.Environment=\u015arodowisko ++OptionPanel.Files=Pliki ++OptionPanel.language=J\u0119zyk ++OptionPanel.language.tooltip= To jest j\u0119zyk, kt\u00f3ry powinien zosta\u0107 u\u017cyty przez program. 'automatyczny' pr\u00f3buje za\u0142adowa\u0107 j\u0119zyk systemowy ++OptionPanel.experimental_file_locking_on=Eksperymentalne blokowanie plik\u00f3w ++OptionPanel.experimental_file_locking_on.tooltip= Funkcja testowa. U\u017cywasz na w\u0142asne ryzyko ++OptionPanel.draganddrop=Przeci\u0105gnij i upu\u015b\u0107 ++OptionPanel.draganddrop.tooltip= U\u017cywaj metody 'Przeci\u0105gnij i upu\u015b\u0107' ++OptionPanel.userproperties=Plik ustawie\u0144 u\u017cytkownika ++OptionPanel.patternsfile=Plik styli ++OptionPanel.docmapurl_since_version_0_7_0=Plik dokumentacji ++OptionPanel.browsemode_initial_map=Domy\u015blna mindmapa w trybie Browse ++OptionPanel.browsemode_initial_map.tooltip= Adres mindmapy, kt\u00f3ra jest \u0142adowana po w\u0142\u0105czeniu trybu Browse ++OptionPanel.last_opened_list_length=D\u0142ugo\u015b\u0107 listy ostatnio otwieranych ++OptionPanel.time_for_automatic_save=Czas pomi\u0119dzy zapisami (ms) ++OptionPanel.time_for_automatic_save.tooltip= Czas pomi\u0119dzy kolejnymi automatycznymi zapisami. Ustaw na 2000000000, aby wy\u0142\u0105czy\u0107 ++OptionPanel.delete_automatic_saves_at_exit=Usu\u0144 automatyczne kopie po zako\u0144czeniu programu ++OptionPanel.delete_automatic_saves_at_exit.tooltip= Po normalnym zamkni\u0119ciu Freemind b\u0119dzie usuwa\u0142 wszystkie automatycznie utworzone pliki ++OptionPanel.number_of_different_files_for_automatic_save=Ilo\u015b\u0107 przechowywanych automatycznych kopii ++OptionPanel.number_of_different_files_for_automatic_save.tooltip= Liczba plik\u00f3w u\u017cywanych do przechowywania automatycznych zapis\u00f3w (n-plik\u00f3w).
Pierwsza kopia jest przechowywana w pliku 1, a\u017c do n+1-kopii, kt\u00f3ra jest zapisywana znowu w pliku 1 (cyklicznie) ++OptionPanel.path_to_automatic_saves=\u015acie\u017cka do automatycznych kopii ++OptionPanel.path_to_automatic_saves.tooltip= Aby zmieni\u0107 domy\u015blna \u015bcie\u017ck\u0119 ('java.io.tmpdir'), wprowad\u017a j\u0105 tutaj. Inne mo\u017cliwo\u015bci:
* freemind_home katalog, w kt\u00f3rym znajduj\u0119 si\u0119 plik auto.properties.
* default katalog java.io.tmpdir ++OptionPanel.Defaults=Domy\u015blne ++OptionPanel.standardnodestyle=Styl w\u0119z\u0142a ++OptionPanel.standardnodestyle.tooltip= Domy\u015blny styl nowego w\u0119z\u0142a ++OptionPanel.standardrootnodestyle=Styl korzenia ++OptionPanel.standardrootnodestyle.tooltip= Domy\u015blny styl korzenia ++OptionPanel.standardnodecolor=Kolor w\u0119z\u0142a ++OptionPanel.standardnodecolor.tooltip= Domy\u015blny kolor w\u0119z\u0142a (zapis HTML - #RRGGBB z warto\u015bciami szestnastkowymi) ++OptionPanel.standardselectednodecolor=Kolor zaznaczonego w\u0119z\u0142a ++OptionPanel.standardselectednodecolor.tooltip= Domy\u015blny kolor zaznaczonego w\u0119z\u0142a (zapis HTML - #RRGGBB z warto\u015bciami szestnastkowymi) ++OptionPanel.standardedgecolor=Kolor ga\u0142\u0119zi ++OptionPanel.standardedgecolor.tooltip= Domy\u015blny kolor ga\u0142\u0119zi (zapis HTML - #RRGGBB z warto\u015bciami szestnastkowymi) ++OptionPanel.standardlinkcolor=Kolor po\u0142\u0105cze\u0144 ++OptionPanel.standardlinkcolor.tooltip= Domy\u015blny kolor po\u0142\u0105cze\u0144 (zapis HTML - #RRGGBB z warto\u015bciami szestnastkowymi) ++OptionPanel.standardbackgroundcolor=Kolor t\u0142a ++OptionPanel.standardbackgroundcolor.tooltip= Domy\u015blny kolor t\u0142a (zapis HTML - #RRGGBB z warto\u015bciami szestnastkowymi) ++OptionPanel.standardcloudcolor=Kolor chmurki ++OptionPanel.standardcloudcolor.tooltip= Domy\u015blny kolor chmurki (zapis HTML - #RRGGBB z warto\u015bciami szestnastkowymi) ++OptionPanel.defaultfont=Czcionka ++OptionPanel.defaultfont.tooltip= Domy\u015blna czcionka w\u0119z\u0142a. Dzia\u0142a tylko je\u015bli wybrana czionka (TrueType) jest dost\u0119pna w systemie ++OptionPanel.defaultfontstyle=Styl ++OptionPanel.defaultfontsize=Rozmiar ++OptionPanel.max_node_width=Maksymalna szeroko\u015b\u0107 w\u0119z\u0142a ++OptionPanel.max_node_width.tooltip= Domy\u015blna maksymalna szeroko\u015b\u0107 w\u0119z\u0142a w pikselach ++OptionPanel.standardedgestyle=Styl ga\u0142\u0119zi ++OptionPanel.standardedgestyle.tooltip= Domy\u015blny styl ga\u0142\u0119zi ++OptionPanel.standardcloudestyle=Styl chmurki ++OptionPanel.standardcloudestyle.tooltip= Domy\u015blny styl chmurki. Obecnie tylko "Krzywa B\u00e9ziera" jest obs\u0142ugiwana ++OptionPanel.standardlinkestyle=Styl po\u0142\u0105czenia ++OptionPanel.standardlinkestyle.tooltip= Domy\u015blny styl po\u0142\u0105czenia. Obecnie tylko "Krzywa B\u00e9ziera" jest obs\u0142ugiwana ++OptionPanel.Appearance=Wygl\u0105d ++OptionPanel.lookandfeel=Look and Feel ++OptionPanel.lookandfeel.tooltip= Look&Feel - wygl\u0105d programu. Je\u015bli chcesz u\u017cy\u0107 w\u0142asnego, wprowad\u017a nazw\u0119 klasy i upewnij si\u0119, \u017ce odpowiednie pliki *.jar s\u0105 \u0142adowane.
Je\u015bli masz jaki\u015b problem z Look&Feel wybierz '\u017baden'. Dzia\u0142a r\u00f3wnie\u017c z appletami ++OptionPanel.mapxsize=Szeroko\u015b\u0107 ++OptionPanel.mapxsize.tooltip= Pocz\u0105tkowy rozmiar nowej mindmapy ++OptionPanel.mapysize=Wysoko\u015b\u0107 ++OptionPanel.links=Odno\u015bnik ++OptionPanel.links.tooltip= Tworzenie wzgl\u0119dnych lub bezwzgl\u0119dnych odno\u015bnik\u00f3w ++OptionPanel.el__buttons_position=Pozycja przycisk\u00f3w ++OptionPanel.el__buttons_position.tooltip= Mo\u017cliwe opcje: above / below ++OptionPanel.el__position_window_below_node=Umie\u015b\u0107 okno pod edytowanym w\u0119z\u0142em ++OptionPanel.el__min_default_window_height=Minimalna wysoko\u015b\u0107 okna ++OptionPanel.el__max_default_window_height=Maksymalna wysoko\u015b\u0107 okna ++OptionPanel.el__min_default_window_width=Minimalna szeroko\u015b\u0107 okna ++OptionPanel.el__max_default_window_width=Maksymalna szeroko\u015b\u0107 okna ++OptionPanel.el__enter_confirms_by_default=Enter domy\u015blnie zamyka edytorek ++OptionPanel.Keystrokes=Klawiatura ++OptionPanel.keystroke_newMap=Nowa mindmapa ++OptionPanel.keystroke_open=Otw\u00f3rz ++OptionPanel.keystroke_save=Zapisz ++OptionPanel.keystroke_saveAs=Zapisz jako ++OptionPanel.keystroke_print=Drukuj ++OptionPanel.keystroke_close=Zamknij ++OptionPanel.keystroke_quit=Zako\u0144cz ++OptionPanel.keystroke_export_to_html=Eksportuj do HTML ++OptionPanel.keystroke_export_branch_to_html=Eksportuj ga\u0142\u0105\u017a do HTML ++OptionPanel.keystroke_open_first_in_history=Otw\u00f3rz ostatnio otwarty plik ++OptionPanel.keystroke_previousMap=Poprzednia mindmapa ++OptionPanel.keystroke_nextMap=Nast\u0119pna Mindmapa ++OptionPanel.keystroke_mode_MindMap=Tryb MindMap ++OptionPanel.keystroke_mode_Browse=Tryb Browse ++OptionPanel.keystroke_mode_File=Tryb File ++OptionPanel.keystroke_node_toggle_italic=W\u0142\u0105cz/wy\u0142\u0105cz pochylenie ++OptionPanel.keystroke_node_toggle_boldface=W\u0142\u0105cz/wy\u0142\u0105cz pogrubienie ++OptionPanel.keystroke_node_toggle_underlined=W\u0142\u0105cz/wy\u0142\u0105cz podkre\u015blenie ++OptionPanel.keystroke_node_toggle_cloud=W\u0142\u0105cz/wy\u0142\u0105cz chmurk\u0119 ++OptionPanel.keystroke_undo=Cofnij ++OptionPanel.keystroke_redo=Powt\u00f3rz ++OptionPanel.keystroke_delete_child=Usu\u0144 ++OptionPanel.keystroke_select_all=Zaznacz wszystko ++OptionPanel.keystroke_select_branch=Zaznacz ga\u0142\u0105\u017a ++OptionPanel.keystroke_zoom_out=Pomniejsz ++OptionPanel.keystroke_zoom_in=Powi\u0119ksz ++OptionPanel.keystroke_cut=Wytnij ++OptionPanel.keystroke_copy=Kopiuj ++OptionPanel.keystroke_copy_single=Kopiuj bez potomk\u00f3w ++OptionPanel.keystroke_paste=Wklej ++OptionPanel.keystroke_remove=Usu\u0144 ++OptionPanel.keystroke_add_arrow_link_action=Wstaw po\u0142\u0105czenie do innego w\u0119z\u0142a ++OptionPanel.keystroke_add_local_link_action=Wstaw odno\u015bnik do innego w\u0119z\u0142a ++OptionPanel.keystroke_moveToRoot=Id\u017a do korzenia ++OptionPanel.keystroke_move_up=Przejd\u017a o w\u0119ze\u0142 w g\u00f3r\u0119 ++OptionPanel.keystroke_move_down=Przejd\u017a o w\u0119ze\u0142 w d\u00f3\u0142 ++OptionPanel.keystroke_move_left=Przejd\u017a o w\u0119ze\u0142 w lewo ++OptionPanel.keystroke_move_right=Przejd\u017a o w\u0119ze\u0142 w prawo ++OptionPanel.keystroke_follow_link=Otw\u00f3rz odno\u015bnik ++OptionPanel.keystroke_add=Dodaj nowy w\u0119ze\u0142 (poni\u017cej) ++OptionPanel.keystroke_add_child=Dodaj potomka ++OptionPanel.keystroke_add_child_mac=Dodaj potomka (Mac) ++OptionPanel.keystroke_add_sibling_before=Dodaj nowy w\u0119ze\u0142 (powy\u017cej) ++OptionPanel.keystroke_edit=Edytuj ++OptionPanel.keystroke_edit_long_node=Edycja w\u0119z\u0142a w edytorku ++OptionPanel.keystroke_join_nodes=Po\u0142\u0105cz w\u0119z\u0142y ++OptionPanel.keystroke_toggle_folded=Zwi\u0144/rozwi\u0144 w\u0119ze\u0142 ++OptionPanel.keystroke_toggle_children_folded=Zwi\u0144/rozwi\u0144 w\u0119z\u0142y potomne ++OptionPanel.keystroke_set_link_by_filechooser=Wstaw odno\u015bnik (wybierz plik) ++OptionPanel.keystroke_set_link_by_textfield=Wstaw odno\u015bnik (wprowad\u017a r\u0119cznie) ++OptionPanel.keystroke_set_image_by_filechooser=Wstaw obrazek (wybierz plik) ++OptionPanel.keystroke_node_up=Przesu\u0144 w\u0119ze\u0142 w d\u00f3\u0142 ++OptionPanel.keystroke_node_down=Przesu\u0144 w\u0119ze\u0142 w g\u00f3r\u0119 ++OptionPanel.keystroke_node_increase_font_size=Zwi\u0119ksz czcionk\u0119 ++OptionPanel.keystroke_node_decrease_font_size=Zmniejsz czcionk\u0119 ++OptionPanel.keystroke_export_branch=Eksportuj ga\u0142\u0105\u017a ++OptionPanel.keystroke_node_color=Kolor w\u0119z\u0142a ++OptionPanel.keystroke_node_color_blend=Rozja\u015bnij kolor w\u0119z\u0142a ++OptionPanel.keystroke_edge_color=Kolor ga\u0142\u0119zi ++OptionPanel.keystroke_find=Znajd\u017a... ++OptionPanel.keystroke_find_next=Znajd\u017a nast\u0119pny ++OptionPanel.keystroke_apply_pattern_1=Zastosuj styl 1 ++OptionPanel.keystroke_apply_pattern_2=Zastosuj styl 2 ++OptionPanel.keystroke_apply_pattern_3=Zastosuj styl 3 ++OptionPanel.keystroke_apply_pattern_4=Zastosuj styl 4 ++OptionPanel.keystroke_apply_pattern_5=Zastosuj styl 5 ++OptionPanel.keystroke_apply_pattern_6=Zastosuj styl 6 ++OptionPanel.keystroke_apply_pattern_7=Zastosuj styl 7 ++OptionPanel.keystroke_apply_pattern_8=Zastosuj styl 8 ++OptionPanel.keystroke_apply_pattern_9=Zastosuj styl 9 ++OptionPanel.keystroke_apply_pattern_10=Zastosuj styl 10 ++OptionPanel.keystroke_apply_pattern_11=Zastosuj styl 11 ++OptionPanel.keystroke_apply_pattern_12=Zastosuj styl 12 ++OptionPanel.keystroke_apply_pattern_13=Zastosuj styl 13 ++OptionPanel.keystroke_apply_pattern_14=Zastosuj styl 14 ++OptionPanel.keystroke_apply_pattern_15=Zastosuj styl 15 ++OptionPanel.keystroke_apply_pattern_16=Zastosuj styl 16 ++OptionPanel.keystroke_apply_pattern_17=Zastosuj styl 17 ++OptionPanel.keystroke_apply_pattern_18=Zastosuj styl 18 ++OptionPanel.Behaviour=Spos\u00f3b dzia\u0142ania ++OptionPanel.placenewbranches=Po\u0142o\u017cenie nowych ga\u0142\u0119zi ++OptionPanel.placenewbranches.tooltip= Gdzie umieszcza\u0107 nowe ga\u0142\u0119zie ++OptionPanel.disable_cursor_move_paper=Wy\u0142\u0105cz specjalny kursor podczas przewijania ++OptionPanel.disable_cursor_move_paper.tooltip= Nie wy\u015bwietlaj specjalnego kursora podczas przewijania za pomoc\u0105 przeci\u0105gania t\u0142a ++OptionPanel.enable_leaves_folding=W\u0142\u0105cz zwijanie li\u015bci (Enable leaves folding) ++OptionPanel.enable_leaves_folding.tooltip= Enable leaves folding == changing bubble/fork for fold action (although if false, you can always use node style to change it) ++OptionPanel.foldingsymbolwidth=\u015arednica symbolu zwini\u0119tych w\u0119z\u0142\u00f3w ++OptionPanel.foldingsymbolwidth.tooltip= \u015arednica okr\u0119gu obok zwini\u0119tych w\u0119z\u0142\u00f3w ++OptionPanel.disable_key_type=Wy\u0142\u0105cz natychmiastow\u0105 edycj\u0119 w\u0119z\u0142a ++OptionPanel.disable_key_type.tooltip= Po zaznaczeniu edycja w\u0119z\u0142a b\u0119dzie mo\u017cliwa jedynie po naci\u015bnieciu F2 lub Alt+Enter ++OptionPanel.key_type_adds_new=Pisanie tworzy nowy w\u0119ze\u0142 ++OptionPanel.key_type_adds_new.tooltip= Pisanie: nadpisuje zawarto\u015b\u0107 (odznaczone) / tworzy nowy w\u0119ze\u0142 (zaznaczone) (wymaga: Wy\u0142\u0105cz natychmiastow\u0105 edycj\u0119 w\u0119z\u0142a=odznaczony) ++OptionPanel.selection_method=Metoda zaznaczania ++OptionPanel.selection_method.tooltip= Bezpo\u015brednio: w\u0119ze\u0142 jest zaznaczany od razu po wskazaniu myszk\u0105
Z op\u00f3\u017anieniem: w\u0119ze\u0142 jest zaznaczany po up\u0142yni\u0119ciu okre\u015blonego czasu od wskazania myszk\u0105
Przez klikni\u0119cie: w\u0119ze\u0142 jest zaznaczany klikni\u0119ciu na nim myszk\u0105 ++OptionPanel.time_for_delayed_selection=Op\u00f3\u017anienie (ms) ++OptionPanel.time_for_delayed_selection.tooltip= Zmienia op\u00f3\u017anienie zaznaczania. Ustaw na 1, je\u015bli chcesz zaznacza\u0107 od razu po najechaniu myszk\u0105 ++OptionPanel.HTML=HTML ++OptionPanel.default_browser_command_windows_nt=Windows NT ++OptionPanel.default_browser_command_windows_nt.tooltip= Dla Windows (znaki "" s\u0105 konieczne z powodu odno\u015bnik\u00f3w, kt\u00f3re zawieraj\u0105 "=" w sobie) ++OptionPanel.default_browser_command_windows_9x=Windows 9x ++OptionPanel.default_browser_command_windows_9x.tooltip= Dla Windows (znaki "" s\u0105 konieczne z powodu odno\u015bnik\u00f3w, kt\u00f3re zawieraj\u0105 "=" w sobie) ++OptionPanel.default_browser_command_other_os=Inne systemy operacyjne ++OptionPanel.default_browser_command_other_os.tooltip= G\u0142\u00f3wnie odnosi si\u0119 do Linuxa ++OptionPanel.default_browser_command_mac=Mac ++OptionPanel.default_browser_command_mac.tooltip= Dla Mac'a: (dzi\u0119kujemy Nickowi!) ++OptionPanel.html_export_folding=Zwijanie dokument\u00f3w HTML ++OptionPanel.export_icons_in_html=Eksport ikon razem z HTML ++OptionPanel.export_icons_in_html.tooltip= Okre\u015bla czy podczas eksportu do HTML maj\u0105 by\u0107 do\u0142\u0105czane ikony. Problem z ikonami polega na tym,
\u017ce cz\u0119sto odno\u015bniki do nich przestaj\u0105 by\u0107 prawid\u0142owe po przeniesieniu na inny komputer ++OptionPanel.Cancel=Anuluj zmiany ++OptionPanel.OK=Zapisz ustawienia ++option_changes_may_require_restart=Zmiany prawdopodobnie pojawi\u0105 si\u0119 dopiero po ponownym uruchomieniu programu Freemind. ++# fc, 12.5.2005: ++GrabKeyDialog.grab-key.title=Wybierz nowy skr\u00f3t klawiaturowy ++GrabKeyDialog.grab-key.caption= ++GrabKeyDialog.grab-key.clear=Wyczy\u015b\u0107 ++GrabKeyDialog.grab-key.assigned-to.none=Obecnie nie przypisany ++GrabKeyDialog.grab-key.assigned-to=Przypisany do ++GrabKeyDialog.common.ok=OK ++GrabKeyDialog.grab-key.remove=Usu\u0144 ++GrabKeyDialog.common.cancel=Anuluj ++GrabKeyDialog.grab-key.remove-ask=Czy na pewno chcesz usun\u0105\u0107 ten skr\u00f3t klawiszowy? ++OptionPanel.separator.language=J\u0119zyk ++OptionPanel.separator.files=Pliki ++OptionPanel.separator.automatic_save=Automatyczne zapisywanie ++OptionPanel.separator.default_styles=Domy\u015blne style ++OptionPanel.separator.default_colors=Domy\u015blne kolory ++OptionPanel.separator.default_fonts=Domy\u015blne czcionki ++OptionPanel.separator.other_defaults=Inne ustawienia domy\u015blne ++OptionPanel.separator.look_and_feel=Look and Feel ++OptionPanel.separator.anti_alias=Antyaliasing ++OptionPanel.separator.initial_map_size=Pocz\u0105tkowy rozmiar mindmapy ++OptionPanel.separator.hyperlink_types=Typ odno\u015bnika ++OptionPanel.separator.edit_long_node_window=Edytorek w\u0119z\u0142\u00f3w ++OptionPanel.separator.commands_for_the_program=Polecenia programu ++OptionPanel.separator.node_editing_commands=Polecenia edycji w\u0119z\u0142\u00f3w ++OptionPanel.separator.node_navigation_commands=Polecenia nawigacyjne ++OptionPanel.separator.new_node_commands=Polecenia tworzenia nowych w\u0119z\u0142\u00f3w ++OptionPanel.separator.patterns=Style ++OptionPanel.separator.behaviour=Zachowanie ++OptionPanel.separator.key_typing=Klawiatura ++OptionPanel.separator.selection_method=Metoda wybierania ++OptionPanel.separator.browser=Domy\u015blne polecenie przegl\u0105dania ++OptionPanel.separator.html_export=Eksport HTML ++# fc, 2.6.2005: ++OptionPanel.antialias.tooltip= Okre\u015bla jako\u015b\u0107 wy\u015bwietlania mindmapy. Im wi\u0119cej antyaliasingu, tym wolniej dzia\u0142a Freemind ++OptionPanel.antialias=Antyaliasing ++OptionPanel.antialias_edges=tylko ga\u0142\u0119zie ++OptionPanel.antialias_all=wszystko ++OptionPanel.antialias_none=brak ++OptionPanel.cs=cs ++OptionPanel.no=no ++# fc, 12.6.2005: correction, please remove the other translation of "follow_link" above ++follow_link=Otw\u00f3rz odno\u015bnik ++OptionPanel.ColorProperty.ResetColor=Domy\u015blny ++# fc, 16.6.2005: ++OptionPanel.keystroke_option_dialog=Preferencje ++format_menu_edge_styles=Styl ga\u0142\u0119zi ++format_menu_edge_widths=Szeroko\u015b\u0107 ga\u0142\u0119zi ++# fc, 3.7.2005: ++accessories/plugins/ImportMindmanagerFiles.properties_name=Mindmapa programu MindManager X5... ++# fc, 5.7.2005: ++accessories/plugins/ExportToOoWriter.properties_documentation= Rozwini\u0119te ga\u0142\u0119zie tworz\u0105 struktur\u0119 dokumentu, a zwini\u0119te zawarto\u015b\u0107 ++accessories/plugins/ExportToOoWriter.properties_name= Do dokumentu OpenOffice Writer... ++# fc, 10.7.2005: ++OptionPanel.separator.undo=Cofnij zmiany ++OptionPanel.undo_levels=Ilo\u015b\u0107 zapami\u0119tanych operacji ++OptionPanel.undo_levels.tooltip= Opisuje ile ostatnich operacji mo\u017ce zosta\u0107 cofni\u0119tych ++# fc, 13.8.2005 ++OptionPanel.lt=lt diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/README.Debian /tmp/Offd2O1oj4/freemind-0.8.1/debian/README.Debian --- freemind-0.7.1/debian/README.Debian 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/debian/README.Debian 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -freemind for Debian -------------------- - -The files mm2xbel.xsl and xbel2mm.xsl in the 'accessories' directory -are meant to transform FreeMind files to and from XBEL (XML Bookmark Exchange -Language, see http://pyxml.sourceforge.net/topics/xbel/ for details). -You can use them e.g. with: - $ xsltproc mm2xbel.xsl somefile.mm > somefile.xbel - -freemind.mm is the FreeMind help file, itself in FreeMind format. -To read it, start FreeMind and call the menu point 'Help -> Documentation'. - --- Eric Lavarde , Tue, 20 Nov 2004 22:01:14 +0100 diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/rules /tmp/Offd2O1oj4/freemind-0.8.1/debian/rules --- freemind-0.7.1/debian/rules 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/debian/rules 2009-05-14 23:12:10.000000000 +0100 @@ -1,102 +1,37 @@ #!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. +# debian/rules for Commons Fileupload (uses CDBS) -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -ANT = ant -ANTFLAGS = -Ddocdir=file:/usr/share/doc/freemind -Dpropfolder=.freemind -Dbrowser_other=sensible-browser - -CFLAGS = -Wall -g - -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s -endif - -configure: configure-stamp -configure-stamp: - dh_testdir - # Add here commands to configure the package. - - touch configure-stamp - - -build: build-stamp - -build-stamp: configure-stamp - dh_testdir - - # Add here commands to compile the package. - cd freemind && $(ANT) $(ANTFLAGS) - cd freemind && $(ANT) $(ANTFLAGS) userdoc - #/usr/bin/docbook-to-man debian/freemind.sgml > freemind.1 +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/ant.mk +include /usr/share/cdbs/1/rules/simple-patchsys.mk + +#FREE JAVA (aka kaffe) +#JAVA_HOME_DIRS := /usr/lib/kaffe +#JAVACMD := /usr/lib/kaffe/bin/java +#DEB_ANT_COMPILER := jikes + +#NON-FREE JAVA (aka Sun) +#JAVA_HOME_DIRS := /usr/lib/j2sdk1.4-sun + +#OpenJDK 6 +JAVA_HOME_DIRS := /usr/lib/jvm/java-6-openjdk + +ANT_HOME := /usr/share/ant +DEB_JARS := $(ANT_HOME)/lib/ant-launcher.jar xercesImpl xmlParserAPIs +DEB_ANT_BUILD_TARGET := dist userdoc browser +DEB_BUILDDIR := freemind +DEB_COMPRESS_EXCLUDE := .mm + +build: + /usr/bin/docbook-to-man debian/freemind.sgml > freemind.1 + /usr/bin/docbook-to-man debian/urlsee.sgml > urlsee.1 # chmod +x bin/dist/freemind.sh # seems to be unnecessary convert freemind/images/FreeMindWindowIcon.png freemind/images/FreeMindWindowIcon.xpm - touch build-stamp - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - - # Add here commands to clean up after the build process. - cd freemind && $(ANT) clean - rm -f freemind/images/FreeMindWindowIcon.xpm - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/freemind. - # $(MAKE) install DESTDIR=$(CURDIR)/debian/freemind - - -# Build architecture-independent files here. -binary-indep: build install - dh_testdir - dh_testroot - dh_installchangelogs - dh_installdocs -# dh_installexamples - dh_install - dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam - dh_installmime -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman - dh_link -# dh_strip - dh_compress -X.mm - dh_fixperms -# dh_perl -# dh_python -# dh_makeshlibs - dh_installdeb -# dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -# Build architecture-dependent files here. -binary-arch: build install -# We have nothing to do by default. +clean:: + -rm -f freemind/images/FreeMindWindowIcon.xpm + -rm -f urlsee.1 freemind.1 + -rmdir bin -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure +get-orig-source: + debian/export-freemind-cvs.sh 0.8.1 FM-0-8-1 diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/TODO /tmp/Offd2O1oj4/freemind-0.8.1/debian/TODO --- freemind-0.7.1/debian/TODO 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/debian/TODO 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -- find a way to generate user documentation (there are some xsl files around -to do this, or even http://freemind.gardennanny.com/ but all without proper -license). -- migrate FreeMind to a *free* java engine. diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/urlsee /tmp/Offd2O1oj4/freemind-0.8.1/debian/urlsee --- freemind-0.7.1/debian/urlsee 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/urlsee 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,133 @@ +#!/bin/sh +# Small wrapper script around 'see' and some other commands in order to be +# able to handle URLs. +# Use the environment variables SEECMD, BROWSER, MAILER and FILEMGR +# to control which commands are used per preference respectively for local +# files, remote URLs, mailto URLs or local files URLs (i.e. file:/). +# (c) Eric Lavarde 2005, placed under GPLv2 license + +if [ -n "${DEBUG}" ] +then # due to the fact that FreeMind discards any output. + exec >${TMPDIR:=/tmp}/urlsee.log 2>&1 +fi + +_debug() { + if [ -n "${DEBUG}" ] + then + echo "DEBUG: $1" >&2 + shift + for text in "$@" + do + echo " ${text}" >&2 + done + fi +} + +_error() { + echo "ERROR: $1" >&2 + shift + for text in "$@" + do + echo " ${text}" >&2 + done +} + +try_all_cmds() { + local file cmd + file="$1" + shift + for cmd in "${@}" + do + cmd=$(which "${cmd}") + if [ -x "${cmd}" ] + then + _debug "CALLING ${cmd}" "${file}" + exec "${cmd}" "${file}" + fi + done +} + +if [ -z "$1" ] +then + _error "Parameter missing." "Usage: $0 " + exit 1 +else + FILENAME="$1" +fi + +### we start with the most generic and portable possibility ### +if [ -x "$(which xdg-open)" ] +then + _debug "exec xdg-open ${FILENAME}" + exec xdg-open "${FILENAME}" +fi + +### if this wasn't possible, we try with desktop specific commands ### + +# try KDE with kfmclient +if [ "${DESKTOP_SESSION}" = "kde" ] && [ -x "$(which kfmclient)" ] +then + _debug "CALLING KDE kfmclient exec ${FILENAME}" + exec kfmclient exec "${FILENAME}" +fi + +# try GNOME with gnome-open +if [ "${DESKTOP_SESSION}" = "gnome" ] && [ -x "$(which gnome-open)" ] +then + _debug "CALLING GNOME gnome-open ${FILENAME}" + exec gnome-open "${FILENAME}" +fi + +# try XFce with exo-open +if [ "${DESKTOP_SESSION}" = "xfc4" ] && [ -x "$(which exo-open)" ] +then + _debug "CALLING XFce4 exo-open ${FILENAME}" + exec exo-open "${FILENAME}" +fi + +### Looks like we're not using one of the standard desktops, ### +### so we just try the same commands without caring for env. ### +try_all_cmds "${FILENAME}" gnome-open exo-open +if [ -x "$(which kfmclient)" ] +then # we can't use try_all_cmds because we have 2 parameters + _debug "CALLING kfmclient exec ${FILENAME}" + exec kfmclient exec "${FILENAME}" +fi + +### And now, we need to go the messy way ### +### I might remove this part in the future ### +_debug "Going for the messy path, it might fail..." + +HTTPNAME=${FILENAME#*://} # covers all kind of url protocol +MAILNAME=${FILENAME#mailto:} # covers only mailto addresses +LOCALNAME=${FILENAME#file:/} # covers only local files URL +if [ "${FILENAME}" != "${HTTPNAME}" ] && [ "${FILENAME}" = "${LOCALNAME}" ] \ + && [ "${FILENAME}" = "${MAILNAME}" ] +then # FILENAME did start with an URL protocol not equal to file: or mailto: + try_all_cmds "${FILENAME}" ${BROWSER} sensible-browser \ + mozilla konqueror galeon firefox + _error "No browser could be found. Exiting." + exit 1 +fi + +if [ "${FILENAME}" != "${MAILNAME}" ] +then # FILENAME did start with mailto: + try_all_cmds "${FILENAME}" ${MAILER} mozilla konqueror thunderbird + _error "No mailer could be found. Exiting." + exit 1 +fi + +if [ "${LOCALNAME}" != "${FILENAME}" ] +then # FILENAME did start with file:/ # %20 is the URL expression of blanks + LOCALNAME=$(echo "/${LOCALNAME}" | sed 's/%20/ /g') +fi + +# first try commands that work best with local names +try_all_cmds "${LOCALNAME}" ${SEECMD} see + +# then try commands that work best with file:/ names +try_all_cmds "${FILENAME}" ${FILEMGR} konqueror nautilus \ + ${BROWSER} sensible-browser mozilla galeon firefox + +_error "No file manager could be found. Exiting." +exit 1 diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/urlsee.sgml /tmp/Offd2O1oj4/freemind-0.8.1/debian/urlsee.sgml --- freemind-0.7.1/debian/urlsee.sgml 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/urlsee.sgml 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,179 @@ + manpage.1'. You may view + the manual page with: `docbook-to-man manpage.sgml | nroff -man | + less'. A typical entry in a Makefile or Makefile.am is: + +manpage.1: manpage.sgml + docbook-to-man $< > $@ + + + The docbook-to-man binary is found in the docbook-to-man package. + Please remember that if you create the nroff version in one of the + debian/rules file targets (such as build), you will need to include + docbook-to-man in your Build-Depends control field. + + --> + + + Eric"> + Lavarde"> + + 2005-03-15"> + + 1"> + deb@zorglub.s.bawue.de"> + + URLSEE"> + + + Debian"> + GNU"> + GPL"> +]> + + + +
+ &dhemail; +
+ + &dhfirstname; + &dhsurname; + + + 2005 + &dhusername; + + &dhdate; +
+ + &dhucpackage; + + &dhsection; + + + &dhpackage; + + program to handle URLs and filenames + + + + &dhpackage; + + file or url + + + + + DESCRIPTION + + This manual page documents briefly the + &dhpackage; + command. + + As the name suggests, &dhpackage; is a program + meant to teach URL handling to the see + program. Depending on the kind of URL, &dhpackage; + will try to use other commands to find a way to show the file or URL given + as parameter. Using environment variables, you can define which command + should be used for which kind of file or URL. + + + + + OPTIONS + + &dhpackage; does only take a path of a file + (absolute or relative) or an URL as unique parameter. + + + ENVIRONMENT VARIABLES + + + + + + + Command to use if the parameter is an URL which is neither + mailto: nor file:. + Defaults are sensible-browser, mozilla, konqueror, galeon, firefox. + + + + + + + Command to use if the parameter is a + mailto: URL. + Defaults are mozilla, konqueror, thunderbird. + + + + + + + Command to use if the parameter is a + file: URL or a file path. Such a command will + be called with the parameter stripped of its + file: prefix. + Default is see itself. + + + + + + + Command to use if the parameter is a + file: URL or a file path. + Defaults are konqueror, nautilus, and fallbacks are + BROWSER and its defaults. + + + + + + + + SEE ALSO + + freemind(1) + + + + AUTHOR + + This manual page was written by &dhusername; &dhemail; for + the &debian; system (but may be used by others). Permission is + granted to copy, distribute and/or modify this document under + the terms of the &gnu; General Public License, Version 2 any + later version published by the Free Software Foundation. + + + On Debian systems, the complete text of the GNU General Public + License can be found in /usr/share/common-licenses/GPL. + + + +
+ + + + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/debian/watch /tmp/Offd2O1oj4/freemind-0.8.1/debian/watch --- freemind-0.7.1/debian/watch 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/debian/watch 2009-05-14 23:12:10.000000000 +0100 @@ -0,0 +1,15 @@ +version=3 +# The filename can be of one of the following forms: +# freemind-src-XX.YY.ZZ.tar.gz +# freemind-src-XX_YY_ZZ.tar.gz +# (we ignore alpha, beta and RC versions) +opts=uversionmangle=s/_/./g; \ + http://sf.net/freemind/freemind-src-(\d+[._]\d+[._]\d+)\.tar\.gz + +### IF WE'D LIKE TO "WATCH" THE ALPHA, BETA, and RC VERSIONS +# The filename can be of one of the following forms: +# freemind-src-XX.YY.ZZ.tar.gz +# freemind-src-XX_YY_ZZ.tar.gz +# freemind-src-XX_YY_ZZ-Beta_NN.tar.gz (or Alpha or RC) +#opts=uversionmangle=s/(?<=\d)_(?=\d)/./g;s/(?<=\d).([[:alpha:]]+)/~\L$1/;s/(?<=[[:alpha:]]).(?=\d)//; \ +# http://sf.net/freemind/freemind-src-(\d+[._]\d+[._]\d+.?[[:alpha:]]*_?\d*).*\.tar\.gz diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/accessories/freemind2html.css /tmp/Offd2O1oj4/freemind-0.8.1/freemind/accessories/freemind2html.css --- freemind-0.7.1/freemind/accessories/freemind2html.css 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/accessories/freemind2html.css 2005-08-29 21:08:21.000000000 +0100 @@ -0,0 +1,42 @@ +body { + background-color: #FFFFFF; +} + +div.node { + padding-bottom: 1ex; + padding-left: 2em; +} + +div.cloud { + padding-bottom: 1ex; + padding-left: 2em; + background-color: #C0C0FF; + border-width: 2px; + border-style: solid; + border-color: #A0A0FF; +} + +div.content { + border-width: 1px; + border-style: dashed; + border-color: #C0C0C0; +} + +img.hideshow { + padding-right: 1ex; +} + +img.ilink { + border-width: 0px; + padding-left: 1ex; +} + +/* for notes and image export, fc, 18.7.2005. */ +.images { + width:50%; +} + +.notes { + margin-left:10%; + color:#0000FF; +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/accessories/freemind2html.xsl /tmp/Offd2O1oj4/freemind-0.8.1/freemind/accessories/freemind2html.xsl --- freemind-0.7.1/freemind/accessories/freemind2html.xsl 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/accessories/freemind2html.xsl 2005-09-07 21:02:54.000000000 +0100 @@ -0,0 +1,268 @@ + + + + + + + + +./ + +html_export_no_folding + + + + + + + + + <xsl:value-of select="/map/node/@TEXT" /> + + + FreeMind2HTML Mindmap + + + + stylesheet + freemind2html.css + text/css + + text/javascript + freemind2html.js  + + + + + +

+ + + + + FreeMind2HTML Mindmap + +

+ +
+ + image.png + margin-bottom:10px; border: 0px; text-align:center; vertical-align:center; + Imagemap + #fm_imagemap + +
+ + + + + + +
+ + + +
+ + + + + + + + + + + cloud + background-color: + + + + cloud + + + + + node + + + + + + + + + hide.png + hideshow + hide + + img + + + + + + + + leaf.png + hideshow + leaf + + + + + + + icons/.png + + + + + + + + FMFM + + + + + + + + + + + + + + + + + + + + #FMFM + + + ilink.png + ilink + Internal Link + + + + + + + +
+ + + + +
+
+
+
+ + + + +
+

+ + + +

+
+
+
+ + + + + + + + + + + + images + + + + + + + + + + + + +
Binary files /tmp/kZ808EjPBq/freemind-0.7.1/freemind/accessories/hide.png and /tmp/Offd2O1oj4/freemind-0.8.1/freemind/accessories/hide.png differ Binary files /tmp/kZ808EjPBq/freemind-0.7.1/freemind/accessories/ilink.png and /tmp/Offd2O1oj4/freemind-0.8.1/freemind/accessories/ilink.png differ Binary files /tmp/kZ808EjPBq/freemind-0.7.1/freemind/accessories/leaf.png and /tmp/Offd2O1oj4/freemind-0.8.1/freemind/accessories/leaf.png differ diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/accessories/marktree.js /tmp/Offd2O1oj4/freemind-0.8.1/freemind/accessories/marktree.js --- freemind-0.7.1/freemind/accessories/marktree.js 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/accessories/marktree.js 2004-10-28 06:24:53.000000000 +0100 @@ -0,0 +1,475 @@ +/* MarkTree JavaScript code + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Miika Nurminen, 12.7.2004. + */ + +/* cross-browser (tested with ie5, mozilla 1 and opera 5) keypress detection */ +function get_keycode(evt) { + // IE + code = document.layers ? evt.which + : document.all ? event.keyCode // event.keyCode!=evt.keyCode! + : evt.keyCode; + + if (code==0) + code=evt.which; // for NS + return code; +} + +var lastnode=null; +var listnodes = null; +var list_index=1; +var lastnodetype=''; // determines if node is a link, input or text; + +// up, left, down, right, keypress codes +//ijkl +//var keys = new Array(105,106,107,108); +//num arrows +//var keys = new Array(56,52,50,54); +//wasd +// var press2 = new Array(119,97,115,100); + var press = new Array(47,45,42,43); + +// keydown codes + // var keys2=new Array(87,65,83,68); + var keys= new Array(38,37,40,39); + + // keyset 1 = keydown, otherwise press +function checkup(keyset,n) { + if (keyset==1) return (n==keys[0]); + return ((n==press[0]) /*|| (n==press2[0])*/) +} + +function checkdn(keyset,n) { + if (keyset==1) return (n==keys[2]); + return ((n==press[2]) /*|| (n==press2[2])*/) +} + +function checkl(keyset,n) { + if (keyset==1) return (n==keys[1]); + return ((n==press[1]) /*|| (n==press2[1])*/) +} + +function checkr(keyset,n) { + if (keyset==1) return (n==keys[3]); + return ((n==press[3]) /*|| (n==press2[3])*/) +} + + + + + +function is_exp(n) { + if (n==null) return false; + return ((n.className=='exp') || (n.className=='exp_active')); +} + +function is_col(n) { + if (n==null) return false; + return ((n.className=='col') || (n.className=='col_active')); +} + +function is_basic(n) { + if (n==null) return false; + return ((n.className=='basic') || (n.className=='basic_active')); +} + + + +/* returns i>=0 if true */ +function is_active(node) { + if (node.className==null) return false + return node.className.indexOf('_active'); +} + +function toggle_class(node) { + if ((node==null) || (node.className==null)) return; + str=node.className; + result=""; + i = str.indexOf('_active'); + if (i>0) + result= str.substr(0,i); + else + result= str+"_active"; + node.className=result; + return node; +} + +function activate(node) { + node.style.backgroundColor='#eeeeff'; +} + +function deactivate(node) { + node.style.backgroundColor='#ffffff'; +} + +function is_list_node(n) { + if (n==null) return false; + if (n.className==null) return false; + if ( (is_exp(n)) || + (is_col(n)) || + (is_basic(n)) ) + return true; else return false; +} + + +function get_href(n) { + alist=n.attributes; + if (alist!=null) { + hr = alist.getNamedItem('href'); + if (hr!=null) return hr.nodeValue; + } + if (n.childNodes.length==0) return ''; + for (var i=0; i=0) + toggle_class(lastnode); + lastnode=n; + if (!(is_active(lastnode)>=0)) + toggle_class(lastnode); + + +/*var d2 = new Date(); +var t_mil2 = d2.getMilliseconds(); + window.alert(t_mil2-t_mil);*/ +} + +function next_list_node() { + tempIndex = list_index; + while (tempIndex0) { + tempIndex--; + var x = listnodes[tempIndex]; + if (is_list_node(x)) { + list_index=tempIndex; + return; + } + } +} + + + +function getsub (li) { + if (li.childNodes.length==0) return null; + for (var c = 0; c < li.childNodes.length; c++) + if ( (li.childNodes[c].className == 'sub') || (li.childNodes[c].className == 'subexp') ) + return li.childNodes[c]; +} + +function find_listnode_recursive (li) { + if (is_list_node(li)) return li; + if (li.childNodes.length==0) return null; + result=null; + for (var c = 0; c < li.childNodes.length; c++) { + result=find_listnode_recursive(li.childNodes[c]); + if (result!=null) return result; + } + return null; +} + +function next_child_listnode(li) { + var result=null; + for (var i=0; i
+ + - - - - + +
- - + + + + + + + + + + + + + + + + + + - + manifest="${src}/MANIFEST.MF" + update="true"> + + + + @@ -101,69 +282,59 @@ + + - + + + + - + - - + - - - - - - - - - + - - - - - + + + + + - - - - - - + + + + - + + + + + + + + + + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/doc/freemind.mm /tmp/Offd2O1oj4/freemind-0.8.1/freemind/doc/freemind.mm --- freemind-0.7.1/freemind/doc/freemind.mm 2004-01-28 20:38:36.000000000 +0000 +++ freemind-0.8.1/freemind/doc/freemind.mm 2005-08-27 22:47:38.000000000 +0100 @@ -1,945 +1,875 @@ - - - - + + + + + - - - - - - - - + + + - - + + + + + - - + + + - - - - - - - + + + + + + + + + + + + - + - - + - - - + + - - + + + + + + + + + + + + - - - - + - - - + + + + + - + - - + + + - + + + + + - + + - + + - + + + + + + - - + - - - - + + + + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + + + + + + - - - - - - - + + + - - + + + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - + + + + + + - - - - - - + + + + - - + + + + + + + + + + + + + - - - - - - - - + + + - - - - - - + + + - - + + + + + + - - + + + - - - - - - - - - - - - - - - - + + + + + + - - - - - - + + + - - + + - - - - - - - - + + + + + + + + + + + + + + - - - - + + + + + + + + + + + - - - - - - + + - - + + - - + + + + - - + + - - + + + + + + - - + + + + - - - - - + + + + - - - - + + + + - - - - + + + - - - + + + + + - - - + + + - - + + - - - + + - - - - + - - + - + - - - - + + + - - - + - + - - - - + - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - + + + + - - - - - - - - - - + + + + + + + + + - - - + + + + - - - - - - - - + + + + - - - - - + - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - + + + + + + + + + + - - - - - - - - + + + - - + + + + - - - - - - + - - + + + + + + + + + + + + + + - - + + + + + + + + + - - - - - + + + - - - + + - - - - + + - - - - - - - - + + + - + + - - - - - - - - - - - - - - - - - + + + - - - - + + + + - + + + + + + + + - - - - - - - - - - - + + + + + + + - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - + + + + - - - - + + - - - - + + - - - + + + - - - - - - - - + + - - + + + + + + + - - - - + + - - + + - - + + + + + + + + + - - - - + + - - + + - - + + - - - - + + + + + + + + + - - - - + + + + + + + + - - + + - - - - - - - - + + + + + + + - - - - + + + + - - + + - - + + + + + + - - - - - - + + + + + + - - - - + + - - - - - - + + + + + + + + - - - - - - + + + + + + + + + + + - - + + + + + - - - - + + - - + + + + - - + + + + + - - + + + + + + + - - + + + + + + + + + - - - - - - - + + + + + + + + + + + - - - - + + + + + + + + + + - - - - + + + + + + - - - - - - + + + + + + - - - - + + + + + + + + + + - - - - - - + + + + + + + + - - - - - + + + + + - - - - + + + + + + + - - - + + - - - + + + + + + + + + + + + - - - - - + + - - - - + + + + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/.classpath /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/.classpath --- freemind-0.7.1/freemind/freemind/.classpath 2003-12-16 20:19:21.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/.classpath 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +0,0 @@ - - - - - - - diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/common/JaxbTools.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/common/JaxbTools.java --- freemind-0.7.1/freemind/freemind/common/JaxbTools.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/common/JaxbTools.java 2004-10-18 00:00:06.000000000 +0100 @@ -0,0 +1,87 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 23.06.2004 + */ +/*$Id: JaxbTools.java,v 1.1.4.1 2004/10/17 23:00:06 dpolivaev Exp $*/ + +package freemind.common; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.bind.Unmarshaller; + +import freemind.controller.actions.generated.instance.ObjectFactory; + +/** + * @author foltin + * Singleton + */ +public class JaxbTools { + + private static JaxbTools instance; + private static JAXBContext context; + + private JaxbTools() { + context = getJAXBContext(); + } + + public static JaxbTools getInstance() { + if(instance == null) { + instance = new JaxbTools(); + } + return instance; + } + + private static final String JAXB_CONTEXT = + "freemind.controller.actions.generated.instance"; + + + public JAXBContext getJAXBContext() { + try { + return JAXBContext.newInstance(JAXB_CONTEXT); + } catch (JAXBException e) { + e.printStackTrace(); + throw new RuntimeException("getJAXBContext failed."); + } + } + + public ObjectFactory getObjectFactory() { + return new ObjectFactory(); + } + + public Marshaller createMarshaller() { + try { + return context.createMarshaller(); + } catch (JAXBException e) { + e.printStackTrace(); + throw new RuntimeException("createMarshaller failed."); + } + } + + public Unmarshaller createUnmarshaller() { + try { + return context.createUnmarshaller(); + } catch (JAXBException e) { + e.printStackTrace(); + throw new RuntimeException("createUnmarshaller failed."); + } + } +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/actions/AbstractXmlAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/actions/AbstractXmlAction.java --- freemind-0.7.1/freemind/freemind/controller/actions/AbstractXmlAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/actions/AbstractXmlAction.java 2005-05-12 22:31:15.000000000 +0100 @@ -0,0 +1,98 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 02.05.2004 + */ +/*$Id: AbstractXmlAction.java,v 1.1.4.2 2005/05/12 21:31:15 christianfoltin Exp $*/ + +package freemind.controller.actions; + +import java.awt.event.ActionEvent; + +import javax.swing.Action; +import javax.swing.Icon; +import javax.xml.bind.JAXBException; + +import freemind.modes.ModeController; + +/** + * @author foltin + * + */ +public abstract class AbstractXmlAction extends FreemindAction { + + private ActorXml actor; + + private ModeController controller; + + + protected AbstractXmlAction(String name, Icon icon, ModeController controller) { + super(name, icon, controller); + this.controller = controller; + } + + /* (non-Javadoc) + * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) + */ + final public void actionPerformed(ActionEvent arg0) { + getActionFactory().startTransaction((String) getValue(Action.SHORT_DESCRIPTION)); + try { + xmlActionPerformed(arg0); + } catch (JAXBException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + getActionFactory().endTransaction((String) getValue(Action.SHORT_DESCRIPTION)); + } + + /** + * @param arg0 + */ + protected abstract void xmlActionPerformed(ActionEvent arg0) throws JAXBException; + + /** + * + */ + private ActionFactory getActionFactory() { + return getModeController().getActionFactory(); + } + + /** + * @return + */ + public ModeController getModeController() { + return controller; + } + + public void addActor(ActorXml actor) { + this.actor = actor; + if (actor != null) { + // registration: + getActionFactory().registerActor(actor, actor.getDoActionClass()); + } + } + + /** + * @return + */ + public ActorXml getActor() { + return actor; + } + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/actions/ActionFactory.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/actions/ActionFactory.java --- freemind-0.7.1/freemind/freemind/controller/actions/ActionFactory.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/actions/ActionFactory.java 2005-01-09 00:05:05.000000000 +0000 @@ -0,0 +1,154 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 24.04.2004 + */ +/*$Id: ActionFactory.java,v 1.1.4.4 2005/01/09 00:05:05 christianfoltin Exp $*/ + +package freemind.controller.actions; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import java.util.Vector; + +import freemind.controller.Controller; +import freemind.controller.actions.generated.instance.XmlAction; + +/** + * @author foltin + * + */ +public class ActionFactory { + + private Controller controller; + /** This Vector denotes all handler of the action to be called for each action. */ + private Vector registeredHandler; + /** This set denotes all filters for XmlActions.*/ + private Set registeredFilters; + /** HashMap of Action class -> actor instance. */ + private HashMap registeredActors; + + /** + * + */ + public ActionFactory(Controller c) { + super(); + this.controller = c; + registeredHandler = new Vector(); + registeredFilters = new HashSet(); + registeredActors = new HashMap(); + } + + /** The handler is put in front. Thus it is called before others are called. + * @param newHandler + */ + public void registerHandler(ActionHandler newHandler) { + // if it is present, put it in front: + if (!registeredHandler.contains(newHandler)) { + registeredHandler.remove(newHandler); + } + registeredHandler.add(0, newHandler); + } + + public void deregisterHandler(ActionHandler newHandler) { + registeredHandler.remove(newHandler); + } + + public void registerFilter(ActionFilter newFilter) { + registeredFilters.add(newFilter); + } + + public void deregisterFilter(ActionFilter newFilter) { + registeredFilters.remove(newFilter); + } + + public void startTransaction(String name) { + for (Iterator i = registeredHandler.iterator(); i.hasNext();) { + ActionHandler handler = (ActionHandler) i.next(); + handler.startTransaction(name); + } + } + + + public void endTransaction(String name) { + for (Iterator i = registeredHandler.iterator(); i.hasNext();) { + ActionHandler handler = (ActionHandler) i.next(); + handler.endTransaction(name); + } + } + + /** + * @param doAction + * @param undoAction + */ + public void executeAction(ActionPair pair) { + if(pair == null) + return; + ActionPair filteredPair = pair; + // first filter: + for (Iterator i = registeredFilters.iterator(); i.hasNext();) { + ActionFilter filter = (ActionFilter) i.next(); + filteredPair = filter.filterAction(filteredPair); + } + Object[] aArray = registeredHandler.toArray(); + for (int i = 0; i < aArray.length; i++) { + ActionHandler handler = (ActionHandler) aArray[i]; + try { + handler.executeAction(filteredPair); + } catch (Exception e) { + e.printStackTrace(); + } + } +// for (Iterator i = registeredHandler.iterator(); i.hasNext();) { +// ActionHandler handler = (ActionHandler) i.next(); + // the executer must not disturb the whole picture if they throw something: +// } + } + + /** + * @return + */ + public Controller getController() { + return controller; + } + + /** + * @param actor + * @param action + */ + public void registerActor(ActorXml actor, Class action) { + registeredActors.put(action, actor); + } + + public ActorXml getActor(XmlAction action) { + for (Iterator i = registeredActors.keySet().iterator(); i.hasNext();) { + Class actorClass = (Class) i.next(); + if(actorClass.isInstance(action)) { + return (ActorXml) registeredActors.get(actorClass); + } + } +// Class actionClass = action.getClass(); +// if(registeredActors.containsKey(actionClass)) { +// return (ActorXml) registeredActors.get(actionClass); +// } + throw new IllegalArgumentException("No actor present for xmlaction" + action.getClass()); + } +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/actions/ActionFilter.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/actions/ActionFilter.java --- freemind-0.7.1/freemind/freemind/controller/actions/ActionFilter.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/actions/ActionFilter.java 2004-10-18 00:00:07.000000000 +0100 @@ -0,0 +1,38 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 25.08.2004 + */ +/*$Id: ActionFilter.java,v 1.1.4.1 2004/10/17 23:00:07 dpolivaev Exp $*/ +package freemind.controller.actions; + +/** + * @author foltin + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public interface ActionFilter { + /** Each filter receives the action pair and its result is taken as the + * new action pair. + * @param pair + * @return + */ + ActionPair filterAction(ActionPair pair); +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/actions/ActionHandler.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/actions/ActionHandler.java --- freemind-0.7.1/freemind/freemind/controller/actions/ActionHandler.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/actions/ActionHandler.java 2004-10-18 00:00:07.000000000 +0100 @@ -0,0 +1,46 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 24.04.2004 + */ +/*$Id: ActionHandler.java,v 1.1.4.1 2004/10/17 23:00:07 dpolivaev Exp $*/ + +package freemind.controller.actions; + +import freemind.controller.actions.generated.instance.XmlAction; + +/** + * @author foltin + * + */ +public interface ActionHandler { + + void executeAction(ActionPair pair); + + /** + * @param name + */ + void startTransaction(String name); + + /** + * @param name + */ + void endTransaction(String name); + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/actions/ActionPair.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/actions/ActionPair.java --- freemind-0.7.1/freemind/freemind/controller/actions/ActionPair.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/actions/ActionPair.java 2004-10-18 00:00:07.000000000 +0100 @@ -0,0 +1,61 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 25.04.2004 + */ +/*$Id: ActionPair.java,v 1.1.4.1 2004/10/17 23:00:07 dpolivaev Exp $*/ + +package freemind.controller.actions; + +import freemind.controller.actions.generated.instance.XmlAction; + +/** + * @author foltin + * + */ +public class ActionPair { + private XmlAction doAction; + private XmlAction undoAction; + /** + * + */ + public ActionPair(XmlAction doAction, XmlAction undoAction) { + this.doAction = doAction; + this.undoAction = undoAction; + } + + /** + * @return + */ + public XmlAction getDoAction() { + return doAction; + } + + /** + * @return + */ + public XmlAction getUndoAction() { + return undoAction; + } + + public ActionPair reverse() { + return new ActionPair(undoAction, doAction); + } + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/actions/ActorXml.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/actions/ActorXml.java --- freemind-0.7.1/freemind/freemind/controller/actions/ActorXml.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/actions/ActorXml.java 2004-10-18 00:00:07.000000000 +0100 @@ -0,0 +1,47 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 25.04.2004 + */ +/*$Id: ActorXml.java,v 1.1.4.1 2004/10/17 23:00:07 dpolivaev Exp $*/ + +package freemind.controller.actions; + +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.MapAdapter; +import freemind.modes.mindmapmode.MindMapMapModel; +import freemind.modes.mindmapmode.MindMapNodeModel; + +/** + * @author foltin + * + */ +public interface ActorXml { + + + public void act(XmlAction action); + + /** + * @return + */ + Class getDoActionClass(); + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/actions/FreemindAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/actions/FreemindAction.java --- freemind-0.7.1/freemind/freemind/controller/actions/FreemindAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/actions/FreemindAction.java 2005-05-12 22:31:15.000000000 +0100 @@ -0,0 +1,98 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 19.07.2004 + */ +/*$Id: FreemindAction.java,v 1.1.4.3 2005/05/12 21:31:15 christianfoltin Exp $*/ + +package freemind.controller.actions; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JMenuItem; + +import freemind.controller.Controller; +import freemind.main.FreeMind; +import freemind.modes.ModeController; +import freemind.preferences.FreemindPropertyListener; + +/** + * @author foltin + * + */ +/** + * @author foltin + * + */ +public abstract class FreemindAction extends AbstractAction { + + private Icon actionIcon; + private static Icon enabledIcon; + private static final String ENABLED_ICON_PATH = "images/icons/button_ok.png"; + private final ModeController modeController; + + /** + * @param title is a fixed title (no translation is done via resources) + * @param icon + * @param modeController + */ + public FreemindAction(String title, Icon icon, ModeController modeController) { + super(title, icon); + this.actionIcon = icon; + this.modeController = modeController; + if(enabledIcon == null){ + enabledIcon = new ImageIcon(modeController.getFrame().getResource(ENABLED_ICON_PATH)); + } + + } + + /** + * @param title Title is a resource. + * @param iconPath is a path to an icon. + * @param modeController + */ + public FreemindAction(String title, String iconPath, final ModeController modeController) { + this(modeController.getController().getResourceString(title), + (iconPath==null)?null: new ImageIcon(modeController.getController().getResource(iconPath)), + modeController); + } + + protected void setSelected(JMenuItem menuItem, boolean state) { + // prevents that icons set after the construction is forgotten to + // recover. + if(actionIcon == null && menuItem.getIcon() != enabledIcon) { + actionIcon = menuItem.getIcon(); + } + if(state) { + menuItem.setIcon(enabledIcon); + } else { + menuItem.setIcon(actionIcon); + } + } + + public void addActor(ActorXml actor) { +// registration: + modeController.getActionFactory().registerActor(actor, actor.getDoActionClass()); + } + public ModeController getModeController() { + return modeController; + } +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/actions/ModeControllerActionHandler.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/actions/ModeControllerActionHandler.java --- freemind-0.7.1/freemind/freemind/controller/actions/ModeControllerActionHandler.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/actions/ModeControllerActionHandler.java 2004-10-18 00:00:07.000000000 +0100 @@ -0,0 +1,63 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 01.05.2004 + */ +/*$Id: ModeControllerActionHandler.java,v 1.1.4.1 2004/10/17 23:00:07 dpolivaev Exp $*/ + +package freemind.controller.actions; + +/** + * @author foltin + * + */ +public class ModeControllerActionHandler implements ActionHandler { + + + private ActionFactory factory; + public ModeControllerActionHandler(ActionFactory factory){ + this.factory = factory; + } + /* (non-Javadoc) + * @see freemind.controller.actions.ActionHandler#executeAction(freemind.controller.actions.ActionPair) + */ + public void executeAction(ActionPair pair) { + ActorXml actor = factory.getActor(pair.getDoAction()); + try { + actor.act(pair.getDoAction()); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /* (non-Javadoc) + * @see freemind.controller.actions.ActionHandler#startTransaction(java.lang.String) + */ + public void startTransaction(String name) { + + } + + /* (non-Javadoc) + * @see freemind.controller.actions.ActionHandler#endTransaction(java.lang.String) + */ + public void endTransaction(String name) { + + } + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/actions/NodeActorXml.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/actions/NodeActorXml.java --- freemind-0.7.1/freemind/freemind/controller/actions/NodeActorXml.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/actions/NodeActorXml.java 2004-10-18 00:00:07.000000000 +0100 @@ -0,0 +1,28 @@ +/* + * Created on 05.05.2004 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package freemind.controller.actions; + +import javax.xml.bind.JAXBException; + +import freemind.modes.MapAdapter; +import freemind.modes.MindMapNode; + +/** + * @author foltin + * + * To change the template for this generated type comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +public interface NodeActorXml extends ActorXml { + /** + * @param model + * @param selected + * @return + */ + ActionPair apply(MapAdapter model, MindMapNode selected) throws JAXBException; + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/actions/PrintActionHandler.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/actions/PrintActionHandler.java --- freemind-0.7.1/freemind/freemind/controller/actions/PrintActionHandler.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/actions/PrintActionHandler.java 2004-10-18 00:00:07.000000000 +0100 @@ -0,0 +1,73 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 24.04.2004 + */ +/*$Id: PrintActionHandler.java,v 1.1.4.1 2004/10/17 23:00:07 dpolivaev Exp $*/ + +package freemind.controller.actions; + +import freemind.modes.ModeController; + +/** + * @author foltin + * + */ +public class PrintActionHandler implements ActionHandler { + + + private ModeController c; + + + // Logging: + private static java.util.logging.Logger logger; + + /** + * + */ + public PrintActionHandler(ModeController c) { + super(); + this.c = c; + if(logger == null) + logger = c.getFrame().getLogger(this.getClass().getName()); + } + + /* (non-Javadoc) + * @see freemind.controller.actions.ActionHandler#startTransaction(java.lang.String) + */ + public void startTransaction(String name) { + + } + + /* (non-Javadoc) + * @see freemind.controller.actions.ActionHandler#endTransaction(java.lang.String) + */ + public void endTransaction(String name) { + + } + + /* (non-Javadoc) + * @see freemind.controller.actions.ActionHandler#executeAction(freemind.controller.actions.ActionPair) + */ + public void executeAction(ActionPair pair) { + String s = c.marshall(pair.getDoAction()) + "\n" + c.marshall(pair.getUndoAction()); + logger.info(s); + } + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/actions/UndoActionHandler.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/actions/UndoActionHandler.java --- freemind-0.7.1/freemind/freemind/controller/actions/UndoActionHandler.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/actions/UndoActionHandler.java 2004-10-18 00:00:07.000000000 +0100 @@ -0,0 +1,65 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 23.09.2004 + */ +/*$Id: UndoActionHandler.java,v 1.1.4.1 2004/10/17 23:00:07 dpolivaev Exp $*/ + +package freemind.controller.actions; + +import freemind.controller.actions.generated.instance.UndoXmlAction; +import freemind.modes.ModeController; +import freemind.modes.actions.RedoAction; +import freemind.modes.actions.UndoAction; + + +public class UndoActionHandler implements ActionHandler { + private ModeController controller; + private final UndoAction undo; + private final RedoAction redo; + + /** + * @param adapter + * @param redo + * @param undo + */ + public UndoActionHandler(ModeController adapter, UndoAction undo, RedoAction redo) { + this.controller = adapter; + this.undo = undo; + this.redo = redo; + } + + public void executeAction(ActionPair pair) { + if(! controller.isUndoAction() ) { + if(! (pair.getDoAction() instanceof UndoXmlAction)) { + redo.clear(); + undo.add(pair); + //undo.print(); + undo.setEnabled(true); + redo.setEnabled(false); + } + } + } + + public void startTransaction(String name) { + } + + public void endTransaction(String name) { + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/BlindIcon.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/BlindIcon.java --- freemind-0.7.1/freemind/freemind/controller/BlindIcon.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/BlindIcon.java 2004-10-18 00:00:06.000000000 +0100 @@ -0,0 +1,64 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 26.05.2004 + */ +/*$Id: BlindIcon.java,v 1.1.4.1 2004/10/17 23:00:06 dpolivaev Exp $*/ + +package freemind.controller; + +import java.awt.Component; +import java.awt.Graphics; + +import javax.swing.Icon; + +/** + * @author foltin + * + */ +public class BlindIcon implements Icon { + + private int length; + + public BlindIcon(int length) { + this.length = length; + } + + /* (non-Javadoc) + * @see javax.swing.Icon#getIconHeight() + */ + public int getIconHeight() { + return length; + } + + /* (non-Javadoc) + * @see javax.swing.Icon#getIconWidth() + */ + public int getIconWidth() { + return length; + } + + /* (non-Javadoc) + * @see javax.swing.Icon#paintIcon(java.awt.Component, java.awt.Graphics, int, int) + */ + public void paintIcon(Component arg0, Graphics arg1, int arg2, int arg3) { + + } + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/Controller.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/Controller.java --- freemind-0.7.1/freemind/freemind/controller/Controller.java 2004-01-28 20:36:09.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/controller/Controller.java 2008-01-01 17:39:37.000000000 +0000 @@ -16,38 +16,84 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: Controller.java,v 1.40 2004/01/28 20:36:09 christianfoltin Exp $*/ +/*$Id: Controller.java,v 1.40.14.16.4.1 2008/01/01 17:39:37 dpolivaev Exp $*/ package freemind.controller; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.HeadlessException; +import java.awt.Insets; +import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; import java.awt.print.PageFormat; import java.awt.print.PrinterJob; +import java.io.Serializable; +import java.io.StringReader; +import java.io.StringWriter; +import java.net.MalformedURLException; import java.net.URL; import java.text.MessageFormat; +import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; -import java.util.List; -import java.util.ListIterator; import java.util.Map; -import javax.swing.*; -import java.net.MalformedURLException; - +import java.util.Properties; +import java.util.Set; +import java.util.Vector; +import java.util.logging.Logger; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JColorChooser; +import javax.swing.JComponent; +import javax.swing.JDialog; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.JToolBar; +import javax.swing.KeyStroke; +import javax.swing.SwingUtilities; +import javax.swing.WindowConstants; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.bind.Unmarshaller; +import javax.xml.transform.stream.StreamSource; + +import freemind.common.JaxbTools; +import freemind.controller.actions.generated.instance.ObjectFactory; +import freemind.controller.actions.generated.instance.WindowConfigurationStorage; +import freemind.controller.actions.generated.instance.XmlAction; import freemind.main.FreeMind; import freemind.main.FreeMindMain; import freemind.main.Tools; import freemind.modes.MindMap; import freemind.modes.Mode; - +import freemind.modes.ModeController; import freemind.modes.ModesCreator; -import freemind.modes.browsemode.BrowseController; +import freemind.preferences.FreemindPropertyListener; +import freemind.preferences.layout.OptionPanel; +import freemind.preferences.layout.OptionPanel.OptionPanelFeedback; import freemind.view.MapModule; import freemind.view.mindmapview.MapView; @@ -57,14 +103,17 @@ */ public class Controller { - private LastOpenedList lastOpened;//A list of the pathnames of all the maps that were opened in the last time + private static Logger logger; + private ObjectFactory actionXmlFactory; + private static JColorChooser colorChooser = new JColorChooser(); + private LastOpenedList lastOpened;//A list of the pathnames of all the maps that were opened in the last time private MapModuleManager mapModuleManager;// new MapModuleManager(); private HistoryManager history = new HistoryManager(); - private Map modes; //hash of all possible modes private Mode mode; //The current mode private FreeMindMain frame; private JToolBar toolbar; private NodeMouseMotionListener nodeMouseMotionListener; + private NodeMotionListener nodeMotionListener; private NodeKeyListener nodeKeyListener; private NodeDragListener nodeDragListener; private NodeDropListener nodeDropListener; @@ -83,35 +132,38 @@ boolean toolbarVisible=true; boolean leftToolbarVisible=true; - Action close; - Action print; - Action printDirect; - Action page; + public CloseAction close; + public Action print; + public Action printDirect; + public Action page; public Action quit; - Action background; + public Action background; - Action optionAntialiasAction; - Action optionHTMLExportFoldingAction; - Action optionSelectionMechanismAction; - - Action about; - Action faq; - Action documentation; - Action license; - Action historyPreviousMap; - Action historyNextMap; - Action navigationPreviousMap; - Action navigationNextMap; - - Action moveToRoot; - Action toggleMenubar; - Action toggleToolbar; - Action toggleLeftToolbar; - - Action zoomIn; - Action zoomOut; - - private static final String[] zooms = {"25%","40%","60%","75%","100%","125%","150%","200%"}; + public OptionAntialiasAction optionAntialiasAction; + public Action optionHTMLExportFoldingAction; + public Action optionSelectionMechanismAction; + + public Action about; + public Action faq; + public Action documentation; + public Action license; + public Action historyPreviousMap; + public Action historyNextMap; + public Action navigationPreviousMap; + public Action navigationNextMap; + + public Action moveToRoot; + public Action toggleMenubar; + public Action toggleToolbar; + public Action toggleLeftToolbar; + + public Action zoomIn; + public Action zoomOut; + public PropertyAction propertyAction; + + // this values better suit at least the test purposes + private static final String[] zooms = {"25%","50%","75%","100%","150%","200%","300%","400%"}; +// private static final String[] zooms = {"25%","40%","60%","75%","100%","125%","150%","200%"}; // // Constructors @@ -121,11 +173,17 @@ checkJavaVersion(); this.frame = frame; - modes = modescreator.getAllModes(); - mapModuleManager = new MapModuleManager(this); + if(logger == null) { + logger = frame.getLogger(this.getClass().getName()); + } + // new object factory for xml actions: + actionXmlFactory = JaxbTools.getInstance().getObjectFactory(); + lastOpened = new LastOpenedList(this, getProperty("lastOpened")); + mapModuleManager = new MapModuleManager(this, history, lastOpened); nodeMouseMotionListener = new NodeMouseMotionListener(this); + nodeMotionListener = new NodeMotionListener(this); nodeKeyListener = new NodeKeyListener(this); nodeDragListener = new NodeDragListener(this); nodeDropListener = new NodeDropListener(this); @@ -157,7 +215,7 @@ zoomIn = new ZoomInAction(this); zoomOut = new ZoomOutAction(this); - + propertyAction = new PropertyAction(this); moveToRoot = new MoveToRootAction(this); @@ -176,16 +234,19 @@ // // get/set methods // - + public static final String JAVA_VERSION = System.getProperty("java.version"); public void checkJavaVersion() { - if (System.getProperty("java.version").compareTo("1.4.0") < 0) { + if (JAVA_VERSION.compareTo("1.4.0") < 0) { String message = "Warning: FreeMind requires version Java 1.4.0 or higher (your version: "+ - System.getProperty("java.version")+")."; + System.getProperty("java.version")+", installed in "+ System.getProperty("java.home")+")."; System.err.println(message); JOptionPane.showMessageDialog(null, message, "FreeMind", JOptionPane.WARNING_MESSAGE); }} - public String getProperty(String property) { - return frame.getProperty(property); } + public String getProperty(String property) { + return frame.getProperty(property); } + + public int getIntProperty(String property, int defaultValue) { + return frame.getIntProperty(property, defaultValue); } public void setProperty(String property, String value) { frame.setProperty(property, value); } @@ -199,11 +260,15 @@ } public String getResourceString(String resource) { - try { - return frame.getResources().getString(resource); } - catch (Exception ex) { - System.err.println("Warning - resource string not found:"+resource); - return resource; }} + return frame.getResourceString(resource); + } + + /** @return the current modeController. */ + public ModeController getModeController() { + return getMode().getModeController(); + } + + /**Returns the current model*/ public MindMap getModel() { @@ -222,8 +287,8 @@ return null; } - Map getModes() { - return modes; + Set getModes() { + return modescreator.getAllModes(); } public Mode getMode() { @@ -276,20 +341,104 @@ // Maybe implement handling for cases when the font is not // available on this system. - int fontSize = Integer.parseInt(getFrame().getProperty("defaultfontsize")); - int fontStyle = Integer.parseInt(getFrame().getProperty("defaultfontstyle")); - String fontFamily = getProperty("defaultfont"); + int fontSize = getDefaultFontSize(); + int fontStyle = getDefaultFontStyle(); + String fontFamily = getDefaultFontFamilyName(); return getFontThroughMap (new Font(fontFamily, fontStyle, fontSize)); } + /** + * @return + */ + public String getDefaultFontFamilyName() { + String fontFamily = getProperty("defaultfont"); + return fontFamily; + } + + /** + * @return + */ + public int getDefaultFontStyle() { + int fontStyle = Integer.parseInt(getFrame().getProperty("defaultfontstyle")); + return fontStyle; + } + + /** + * @return + */ + public int getDefaultFontSize() { + int fontSize = Integer.parseInt(getFrame().getProperty("defaultfontsize")); + return fontSize; + } + + /** Static JColorChooser to have the recent colors feature. */ + static public JColorChooser getCommonJColorChooser() { + return colorChooser; + } + + public static Color showCommonJColorChooserDialog(Component component, + String title, Color initialColor) throws HeadlessException { + + final JColorChooser pane = getCommonJColorChooser(); + pane.setColor(initialColor); + + ColorTracker ok = new ColorTracker(pane); + JDialog dialog = JColorChooser.createDialog(component, title, true, pane, ok, null); + dialog.addWindowListener(new Closer()); + dialog.addComponentListener(new DisposeOnClose()); + + dialog.show(); // blocks until user brings dialog down... + return ok.getColor(); + } + + + private static class ColorTracker implements ActionListener, Serializable { + JColorChooser chooser; + Color color; + + public ColorTracker(JColorChooser c) { + chooser = c; + } + + public void actionPerformed(ActionEvent e) { + color = chooser.getColor(); + } + + public Color getColor() { + return color; + } + } + + static class Closer extends WindowAdapter implements Serializable{ + public void windowClosing(WindowEvent e) { + Window w = e.getWindow(); + w.hide(); + } + } + + static class DisposeOnClose extends ComponentAdapter implements Serializable{ + public void componentHidden(ComponentEvent e) { + Window w = (Window)e.getComponent(); + w.dispose(); + } + } + + + + /** Creates a new mode (controller), activates the toolbars, title and deactivates all + * actions. + * + * @param mode + * @return false if the change was not successful. + */ public boolean changeToMode(String mode) { if (getMode() != null && mode.equals(getMode().toString())) { return true; } - //Check if the mode is available - Mode newmode = (Mode)modes.get(mode); + //Check if the mode is available and create ModeController. + Mode newmode = modescreator.getMode(mode); if (newmode == null) { errorMessage(getResourceString("mode_na")+": "+mode); return false; @@ -305,7 +454,6 @@ if (getMapModule() != null) { getMapModuleManager().setMapModule(null); - getMapModuleManager().mapModuleChanged(); } this.mode = newmode; @@ -324,8 +472,7 @@ setTitle(); getMode().activate(); - getFrame().getFreeMindMenuBar().updateFileMenu(); - getFrame().getFreeMindMenuBar().updateEditMenu(); + getFrame().getFreeMindMenuBar().updateMenus(); if (getMapModule() == null) { setAllActions(false); @@ -351,6 +498,12 @@ toolbar.setVisible(toolbarVisible); } + /** + * @return Returns the main toolbar. + */ + public JToolBar getToolbar() { + return toolbar; + } public void setLeftToolbarVisible(boolean visible) { if (getMode() != null && getMode().getLeftToolBar() != null) { leftToolbarVisible = visible; @@ -366,6 +519,10 @@ return nodeMouseMotionListener; } + public NodeMotionListener getNodeMotionListener() { + return nodeMotionListener; + } + public MapMouseMotionListener getMapMouseMotionListener() { return mapMouseMotionListener; } @@ -397,6 +554,15 @@ } } + /** Closes the actual map. + * @param force true= without save. + */ + public void close(boolean force) { + getMapModuleManager().close(force); + } + + + // (PN) %%% // public void select( NodeView node) { // getView().select(node,false); @@ -426,7 +592,19 @@ JOptionPane.showMessageDialog(component, message.toString(), "FreeMind", JOptionPane.INFORMATION_MESSAGE); } public void errorMessage(Object message) { - JOptionPane.showMessageDialog(getFrame().getContentPane(), message.toString(), "FreeMind", JOptionPane.ERROR_MESSAGE); } + String myMessage = ""; + + if (message != null) { + myMessage = message.toString(); + } else { + myMessage = getResourceString("undefined_error"); + if (myMessage == null) { + myMessage = "Undefined error"; + } + } + JOptionPane.showMessageDialog(getFrame().getContentPane(), myMessage, "FreeMind", JOptionPane.ERROR_MESSAGE); + + } public void errorMessage(Object message, JComponent component) { JOptionPane.showMessageDialog(component, message.toString(), "FreeMind", JOptionPane.ERROR_MESSAGE); } @@ -495,7 +673,7 @@ (getResourceString("mode_title")); String title = formatter.format(messageArguments); if (getMapModule() != null) { - title += " - " + getMapModule().toString() + + title = getMapModule().toString() + " - " + title + ( getMapModule().getModel().isReadOnly() ? " ("+getResourceString("read_only")+")" : ""); } @@ -509,7 +687,7 @@ * Manage the availabilty of all Actions dependend * of whether there is a map or not */ - private void setAllActions(boolean enabled) { + public void setAllActions(boolean enabled) { background.setEnabled(enabled); if(isPrintingAllowed) { @@ -534,7 +712,7 @@ private void quit() { String currentMapRestorable = (getModel()!=null) ? getModel().getRestoreable() : null; while (getView() != null) { - boolean closingNotCancelled = getMapModuleManager().close(); + boolean closingNotCancelled = getMapModuleManager().close(false); if (!closingNotCancelled) { return; }} @@ -563,7 +741,16 @@ catch (SecurityException ex) { isPrintingAllowed = false; return false; }} - pageFormat = (pageFormat == null) ? printerJob.defaultPage() : pageFormat; + if (pageFormat == null) { + pageFormat = printerJob.defaultPage(); + if (Tools.safeEquals(getProperty("page_orientation"), "landscape")) { + pageFormat.setOrientation(PageFormat.LANDSCAPE); + } else if (Tools.safeEquals(getProperty("page_orientation"), "portrait")) { + pageFormat.setOrientation(PageFormat.PORTRAIT); + } else if (Tools.safeEquals(getProperty("page_orientation"), "reverse_landscape")) { + pageFormat.setOrientation(PageFormat.REVERSE_LANDSCAPE); + } + } return true; } ////////////// @@ -571,171 +758,6 @@ //////////// /** - * Manages the list of MapModules. - * As this task is very complex, I exported it - * from Controller to this class to keep Controller - * simple. - */ - public class MapModuleManager { - // Variable below: The instances of mode, ie. the Model/View pairs. Normally, the - // order should be the order of insertion, but such a Map is not - // available. - private Map mapModules = new HashMap(); - - private MapModule mapModule; //reference to the current mapmodule, could be done - //with an index to mapModules, too. - // private String current; - - private Controller c; - - MapModuleManager(Controller c) { - this.c=c; } - - Map getMapModules() { - return mapModules; } - - public MapModule getMapModule() { - return mapModule; } - - public void newMapModule(MindMap map) { - MapModule mapModule = new MapModule(map, new MapView(map, c), getMode()); - setMapModule(mapModule); - addToMapModules(mapModule.toString(), mapModule); - history.mapChanged(mapModule); - updateNavigationActions(); } - - public void updateMapModuleName() { - getMapModules().remove(getMapModule().toString()); - //removeFromViews() doesn't work because MapModuleChanged() - //must not be called at this state - getMapModule().rename(); - addToMapModules(getMapModule().toString(),getMapModule()); - } - - void nextMapModule() { - List keys = new LinkedList(getMapModules().keySet()); - int index = keys.indexOf(getMapModule().toString()); - ListIterator i = keys.listIterator(index+1); - if (i.hasNext()) { - changeToMapModule((String)i.next()); } - else if (keys.iterator().hasNext()) { - // Change to the first in the list - changeToMapModule((String)keys.iterator().next()); }} - - void previousMapModule() { - List keys = new LinkedList(getMapModules().keySet()); - int index = keys.indexOf(getMapModule().toString()); - ListIterator i = keys.listIterator(index); - if (i.hasPrevious()) { - changeToMapModule((String)i.previous()); } - else { - Iterator last = keys.listIterator(keys.size()-1); - if (last.hasNext()) { - changeToMapModule((String)last.next()); }}} - - //Change MapModules - - public boolean tryToChangeToMapModule(String mapModule) { - if (mapModule != null && getMapModules().containsKey(mapModule)) { - changeToMapModule(mapModule); - return true; } - else { - return false; }} - - void changeToMapModule(String mapModule) { - MapModule map = (MapModule)(getMapModules().get(mapModule)); - history.mapChanged(map); - changeToMapModuleWithoutHistory(map); } - - void changeToMapModuleWithoutHistory(MapModule map) { - if (map.getMode() != getMode()) { - changeToMode(map.getMode().toString()); } - setMapModule(map); - mapModuleChanged(); } - - public void changeToMapOfMode(Mode mode) { - for (Iterator i = getMapModules().keySet().iterator(); i.hasNext(); ) { - String next = (String)i.next(); - if ( ((MapModule)getMapModules().get(next)).getMode() == mode ) { - changeToMapModule(next); - return; }}} - - //private - - private void mapModuleChanged() { - frame.getFreeMindMenuBar().updateMapsMenu();//to show the new map in the mindmaps menu - lastOpened.mapOpened(getMapModule()); - frame.getFreeMindMenuBar().updateLastOpenedList();//to show the new map in the file menu - // history.add(getMapModule()); - //updateNavigationActions(); - setTitle(); - updateZoomBar(); - c.obtainFocusForSelected(); } - - private void setMapModule(MapModule mapModule) { - this.mapModule = mapModule; - frame.setView(mapModule != null ? mapModule.getView() : null); } - - private void addToMapModules(String key, MapModule value) { - // begin bug fix, 20.12.2003, fc. - // check, if already present: - String extension = ""; - int count = 1; - while (mapModules.containsKey(key+extension)) { - extension = "<"+(++count)+">"; - } - // rename map: - value.setName(key+extension); - mapModules.put(key+extension,value); - // end bug fix, 20.12.2003, fc. - setAllActions(true); - moveToRoot(); // Only for the new modules move to root - mapModuleChanged(); } - - private void changeToAnotherMap(String toBeClosed) { - List keys = new LinkedList(getMapModules().keySet()); - for (ListIterator i = keys.listIterator(); i.hasNext();) { - String key = (String)i.next(); - if (!key.equals(toBeClosed)) { - changeToMapModule(key); - return; }}} - - private void updateNavigationActions() { - List keys = new LinkedList(getMapModules().keySet()); - navigationPreviousMap.setEnabled(keys.size() > 1); - navigationNextMap.setEnabled(keys.size() > 1); } - - private void updateZoomBar() { - if (getMapModule()!=null) { - ((MainToolBar)c.toolbar).setZoomComboBox(getMapModule().getView().getZoom()); }} - - - /** - * Close the currently active map, return false if closing cancelled. - */ - private boolean close() { - // (DP) The mode controller does not close the map - boolean closingNotCancelled = getMode().getModeController().close(); - if (!closingNotCancelled) { - return false; } - - String toBeClosed = getMapModule().toString(); - mapModules.remove(toBeClosed); - if (mapModules.isEmpty()) { - setAllActions(false); - setMapModule(null); - frame.setView(null); } - else { - changeToMapModule((String)mapModules.keySet().iterator().next()); - updateNavigationActions(); } - mapModuleChanged(); - return true; } - - // }} - - } - - /** * Manages the history of visited maps. * Maybe explicitly closed maps should be removed from * History too? @@ -753,7 +775,7 @@ // history instead of map modules. Another option is to remove maps from // history upon closing the maps. - private class HistoryManager { + protected class HistoryManager { private LinkedList /* of map modules */ historyList = new LinkedList(); private int current; @@ -763,7 +785,7 @@ void nextMap() { if (false) { if (current+1 < historyList.size()) { - getMapModuleManager().changeToMapModuleWithoutHistory((MapModule)historyList.get(++current)); + getMapModuleManager().setMapModule((MapModule)historyList.get(++current)); //the map is immediately added again via changeToMapModule historyPreviousMap.setEnabled(true); if ( current >= historyList.size()-1) @@ -775,7 +797,7 @@ void previousMap() { if (false) { if (current > 0) { - getMapModuleManager().changeToMapModuleWithoutHistory((MapModule)historyList.get(--current)); + getMapModuleManager().setMapModule((MapModule)historyList.get(--current)); historyNextMap.setEnabled(true); if ( current <= 0) historyPreviousMap.setEnabled(false); @@ -818,12 +840,14 @@ } /**This closes only the current map*/ - private class CloseAction extends AbstractAction { - CloseAction(Controller controller) { + public static class CloseAction extends AbstractAction { + private final Controller controller; + CloseAction(Controller controller) { super(controller.getResourceString("close")); + this.controller = controller; } public void actionPerformed(ActionEvent e) { - getMapModuleManager().close(); + controller.close(false); } } @@ -832,7 +856,7 @@ boolean isDlg; PrintAction(Controller controller, boolean isDlg) { super(controller.getResourceString("print"), - new ImageIcon(getResource("images/Print24.gif"))); + new ImageIcon(getResource("images/fileprint.png"))); this.controller = controller; setEnabled(false); this.isDlg = isDlg; @@ -844,11 +868,13 @@ printerJob.setPrintable(getView(),pageFormat); if (!isDlg || printerJob.printDialog()) { + getView().preparePrinting(); try { printerJob.print(); } catch (Exception ex) { ex.printStackTrace(); } + getView().endPrinting(); } } } @@ -925,6 +951,13 @@ // Ask user for page format (e.g., portrait/landscape) pageFormat = printerJob.pageDialog(pageFormat); + if (pageFormat.getOrientation() == PageFormat.LANDSCAPE) { + setProperty("page_orientation", "landscape"); + } else if (pageFormat.getOrientation() == PageFormat.PORTRAIT) { + setProperty("page_orientation", "portrait"); + } else if (pageFormat.getOrientation() == PageFormat.REVERSE_LANDSCAPE) { + setProperty("page_orientation", "reverse_landscape"); + } } } @@ -1005,7 +1038,7 @@ private class NavigationPreviousMapAction extends AbstractAction { NavigationPreviousMapAction(Controller controller) { super(controller.getResourceString("previous_map"), - new ImageIcon(getResource("images/Back24.gif"))); + new ImageIcon(getResource("images/1leftarrow.png"))); setEnabled(false); } public void actionPerformed(ActionEvent event) { @@ -1016,7 +1049,7 @@ private class NavigationNextMapAction extends AbstractAction { NavigationNextMapAction(Controller controller) { super(controller.getResourceString("next_map"), - new ImageIcon(getResource("images/Forward24.gif"))); + new ImageIcon(getResource("images/1rightarrow.png"))); setEnabled(false); } public void actionPerformed(ActionEvent event) { @@ -1075,48 +1108,175 @@ public ZoomInAction(Controller controller) { super(controller.getResourceString("zoom_in")); } public void actionPerformed(ActionEvent e) { + logger.info("ZoomInAction actionPerformed"); ((MainToolBar)toolbar).zoomIn(); }} protected class ZoomOutAction extends AbstractAction { public ZoomOutAction(Controller controller) { super(controller.getResourceString("zoom_out")); } public void actionPerformed(ActionEvent e) { + logger.info("ZoomOutAction actionPerformed"); ((MainToolBar)toolbar).zoomOut(); }} // // Preferences // - private class BackgroundSwatch extends ColorSwatch { + + private static Vector propertyChangeListeners = new Vector(); + + public static Collection getPropertyChangeListeners() { + return Collections.unmodifiableCollection(propertyChangeListeners); + } + public static void addPropertyChangeListener(FreemindPropertyListener listener) { + Controller.propertyChangeListeners.add(listener); + } + /** + * @author foltin + * + */ + public class PropertyAction extends AbstractAction { + + private final Controller controller; + + /** + * + */ + public PropertyAction(Controller controller) { + super(controller.getResourceString("property_dialog")); + // TODO Auto-generated constructor stub + this.controller = controller; + } + + public void actionPerformed(ActionEvent arg0) { + JDialog dialog = new JDialog(getFrame().getJFrame(), true /* modal */); + dialog.setResizable(true); + dialog.setUndecorated(false); + final OptionPanel options = new OptionPanel(getFrame(), dialog, new OptionPanelFeedback() { + + public void writeProperties(Properties props) { + Vector sortedKeys = new Vector(); + sortedKeys.addAll(props.keySet()); + Collections.sort(sortedKeys); + HashMap oldProperties = new HashMap(); + for (Iterator i = sortedKeys.iterator(); i.hasNext();) { + String key = (String) i.next(); + // save only changed keys: + String oldProperty = controller.getProperty(key); + String newProperty = props.getProperty(key); + if (!oldProperty.equals(newProperty)) { + oldProperties.put(key, oldProperty); + controller.setProperty(key, newProperty); + } + } + + for (Iterator i = Controller.getPropertyChangeListeners().iterator(); i.hasNext();) { + FreemindPropertyListener listener = (FreemindPropertyListener) i + .next(); + for (Iterator j = oldProperties.keySet().iterator(); j + .hasNext();) { + String key = (String) j.next(); + listener.propertyChanged(key, controller.getProperty(key), (String) oldProperties.get(key)); + } + } + + if (oldProperties.size() > 0) { + JOptionPane + .showMessageDialog( + getFrame().getContentPane(), + getResourceString("option_changes_may_require_restart")); + controller.getFrame().saveProperties(); + } + } + }); + options.buildPanel(); + options.setProperties(getFrame().getProperties()); + dialog.setTitle("Freemind Properties"); + dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + dialog.addWindowListener(new WindowAdapter(){ + public void windowClosing(WindowEvent event) { + options.closeWindow(); + } + }); + Action action = new AbstractAction() { + + public void actionPerformed(ActionEvent arg0) { + options.closeWindow(); + } + }; + action.putValue(Action.NAME, "end_dialog"); + // Register keystroke + dialog.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) + .put(KeyStroke.getKeyStroke("ESCAPE"), + action.getValue(Action.NAME)); + + // Register action + dialog.getRootPane().getActionMap().put(action.getValue(Action.NAME), + action); + + + dialog.pack(); + dialog.setVisible(true); + + } + + } + + private class BackgroundSwatch extends ColorSwatch { Color getColor() { return getModel().getBackgroundColor(); } } + /** Seems to be obsolete, but we add the property listener here. fc, 14.6.2005*/ private class BackgroundAction extends AbstractAction { BackgroundAction(Controller controller, Icon icon) { super(controller.getResourceString("background"),icon); + Controller.addPropertyChangeListener(new FreemindPropertyListener(){ + + public void propertyChanged(String propertyName, String newValue, String oldValue) { + if(propertyName.equals(FreeMind.RESOURCES_BACKGROUND_COLOR)) { + getModel().setBackgroundColor(Tools.xmlToColor(newValue)); + } + }}); } public void actionPerformed(ActionEvent e) { - Color color = JColorChooser.showDialog(getView(),"Choose Background Color:",getView().getBackground() ); + Color color = showCommonJColorChooserDialog(getView(),getResourceString("choose_background_color"),getView().getBackground() ); getModel().setBackgroundColor(color); } } - private class OptionAntialiasAction extends AbstractAction { - OptionAntialiasAction(Controller controller) {} + public class OptionAntialiasAction extends AbstractAction implements FreemindPropertyListener { + OptionAntialiasAction(Controller controller) { + Controller.addPropertyChangeListener(this); + } public void actionPerformed(ActionEvent e) { - if (e.getActionCommand().equals("antialias_none")) { - setAntialiasEdges(false); - setAntialiasAll(false); } - if (e.getActionCommand().equals("antialias_edges")) { - setAntialiasEdges(true); - setAntialiasAll(false); } - if (e.getActionCommand().equals("antialias_all")) { - setAntialiasEdges(false); - setAntialiasAll(true); } - if(getView() != null) - getView().repaint(); + String command = e.getActionCommand(); + changeAntialias(command); } + /** + * @param command + */ + public void changeAntialias(String command) { + if(command == null) { + return; + } + if (command.equals("antialias_none")) { + setAntialiasEdges(false); + setAntialiasAll(false); } + if (command.equals("antialias_edges")) { + setAntialiasEdges(true); + setAntialiasAll(false); } + if (command.equals("antialias_all")) { + setAntialiasEdges(false); + setAntialiasAll(true); } + if(getView() != null) + getView().repaint(); + } + public void propertyChanged(String propertyName, String newValue, String oldValue) { + if (propertyName.equals(FreeMind.RESOURCE_ANTIALIAS)) { + changeAntialias(newValue); + } + } } private class OptionHTMLExportFoldingAction extends AbstractAction { @@ -1125,19 +1285,37 @@ setProperty("html_export_folding", e.getActionCommand()); }} // switch auto properties for selection mechanism fc, 7.12.2003. - private class OptionSelectionMechanismAction extends AbstractAction { + private class OptionSelectionMechanismAction extends AbstractAction implements FreemindPropertyListener { Controller c; - OptionSelectionMechanismAction(Controller controller) { - c = controller; - } - public void actionPerformed(ActionEvent e) { - setProperty("selection_method", e.getActionCommand()); - // and update the selection method in the NodeMouseMotionListener - freemind.controller.NodeMouseMotionListener.updateSelectionMethod(c); - String statusBarString = c.getResourceString(e.getActionCommand()); - if(statusBarString != null) // should not happen - c.getFrame().out(statusBarString); - } + + OptionSelectionMechanismAction(Controller controller) { + c = controller; + Controller.addPropertyChangeListener(this); + } + + public void actionPerformed(ActionEvent e) { + String command = e.getActionCommand(); + changeSelection(command); + } + + /** + * @param command + */ + private void changeSelection(String command) { + setProperty("selection_method", command); + // and update the selection method in the NodeMouseMotionListener + freemind.controller.NodeMouseMotionListener + .updateSelectionMethod(c); + String statusBarString = c.getResourceString(command); + if (statusBarString != null) // should not happen + c.getFrame().out(statusBarString); + } + + public void propertyChanged(String propertyName, String newValue, String oldValue) { + if(propertyName.equals(FreeMind.RESOURCES_SELECTION_METHOD)) { + changeSelection(newValue); + } + } } // open faq url from freeminds page: @@ -1158,9 +1336,70 @@ } } + public WindowConfigurationStorage decorateDialog(JDialog dialog, String propertyName) { + String unmarshalled = getProperty( + propertyName); + if (unmarshalled != null) { + WindowConfigurationStorage storage = (WindowConfigurationStorage) unMarshall(unmarshalled); + if (storage != null) { + dialog.setLocation(storage.getX(), storage.getY()); + dialog.getRootPane().setPreferredSize(new Dimension(storage.getWidth(), storage.getHeight())); + } + return storage; + } + return null; + } + + /** + * @param storage + * @param propertyName + */ + public void storeDialogPositions(JDialog dialog, WindowConfigurationStorage storage, String propertyName) { + storage.setX((dialog.getX())); + storage.setY((dialog.getY())); + storage.setWidth((dialog.getWidth())); + storage.setHeight((dialog.getHeight())); + String marshalled = marshall(storage); + setProperty(propertyName, marshalled); + } + public String marshall(XmlAction action) { + try { + // marshall: + //marshal to StringBuffer: + StringWriter writer = new StringWriter(); + Marshaller m = JaxbTools.getInstance().createMarshaller(); + m.marshal(action, writer); + String result = writer.toString(); + return result; + } catch (JAXBException e) { + logger.severe(e.toString()); + e.printStackTrace(); + return ""; + } + + } + + public XmlAction unMarshall(String inputString) { + try { + // unmarshall: + Unmarshaller u = JaxbTools.getInstance().createUnmarshaller(); + StringBuffer xmlStr = new StringBuffer( inputString); + XmlAction doAction = (XmlAction) u.unmarshal( new StreamSource( new StringReader( xmlStr.toString() ) ) ); + return doAction; + } catch (JAXBException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return null; + } + } + + + public ObjectFactory getActionXmlFactory() { + return actionXmlFactory; + } }//Class Controller diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/FreeMindToolBar.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/FreeMindToolBar.java --- freemind-0.7.1/freemind/freemind/controller/FreeMindToolBar.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/FreeMindToolBar.java 2004-10-18 00:00:06.000000000 +0100 @@ -0,0 +1,69 @@ +/* + * Created on 28.03.2004 + * + */ +package freemind.controller; + +import java.awt.Insets; + +import javax.swing.Action; +import javax.swing.JButton; +import javax.swing.JToolBar; + +/** + * @author Stefan Zechmeister + */ +public class FreeMindToolBar extends JToolBar { + private static Insets nullInsets = new Insets(0,0,0,0); + + /** + * + */ + public FreeMindToolBar() { + this("", JToolBar.HORIZONTAL); + } + + /** + * @param arg0 + */ + public FreeMindToolBar(int arg0) { + this("", arg0); + } + + /** + * @param arg0 + */ + public FreeMindToolBar(String arg0) { + this(arg0, JToolBar.HORIZONTAL); + } + + /** + * @param arg0 + * @param arg1 + */ + public FreeMindToolBar(String arg0, int arg1) { + super(arg0, arg1); + this.setMargin(nullInsets); + + } + + /* (non-Javadoc) + * @see javax.swing.JToolBar#add(javax.swing.Action) + */ + public JButton add(Action arg0) { + arg0.putValue(Action.SHORT_DESCRIPTION, arg0.getValue(Action.NAME)); + JButton returnValue = super.add(arg0); + returnValue.setText(""); + returnValue.setMargin(nullInsets); + returnValue.setFocusable(false); + + // fc, 20.6.2004: try to make the toolbar looking good under Mac OS X. + if (System.getProperty("os.name").startsWith("Mac OS")) { + returnValue.setBorderPainted (false); + } + returnValue.setContentAreaFilled (false); + + return returnValue; + } + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/LastOpenedList.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/LastOpenedList.java --- freemind-0.7.1/freemind/freemind/controller/LastOpenedList.java 2003-11-09 22:09:25.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/controller/LastOpenedList.java 2004-10-18 00:00:06.000000000 +0100 @@ -16,7 +16,7 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: LastOpenedList.java,v 1.8 2003/11/09 22:09:25 christianfoltin Exp $*/ +/*$Id: LastOpenedList.java,v 1.8.18.1 2004/10/17 23:00:06 dpolivaev Exp $*/ package freemind.controller; import freemind.view.MapModule; @@ -59,6 +59,7 @@ //not needed } + /** fc, 8.8.2004: This method returns a string representation of this class. */ String save() { String str = new String(); for(ListIterator it=listIterator();it.hasNext();) { diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/MainToolBar.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/MainToolBar.java --- freemind-0.7.1/freemind/freemind/controller/MainToolBar.java 2004-01-10 18:22:25.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/controller/MainToolBar.java 2005-06-12 13:04:17.000000000 +0100 @@ -16,42 +16,51 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: MainToolBar.java,v 1.16 2004/01/10 18:22:25 christianfoltin Exp $*/ +/*$Id: MainToolBar.java,v 1.16.14.2 2005/06/12 12:04:17 christianfoltin Exp $*/ package freemind.controller; -import java.awt.event.ItemListener; import java.awt.event.ItemEvent; -import javax.swing.JToolBar; +import java.awt.event.ItemListener; +import java.util.logging.Logger; + import javax.swing.JButton; import javax.swing.JComboBox; -public class MainToolBar extends JToolBar { - JComboBox zoom; +public class MainToolBar extends FreeMindToolBar { + private JComboBox zoom; Controller c; String userDefinedZoom; - + private static Logger logger= null; + public MainToolBar(final Controller c) { + super(); this.setRollover(true); this.c = c; + if(logger == null) { + logger = c.getFrame().getLogger(this.getClass().getName()); + } userDefinedZoom = c.getResourceString("user_defined_zoom"); JButton button; button = add(c.navigationPreviousMap); - button.setText(""); button = add(c.navigationNextMap); - button.setText(""); button = add(c.printDirect); - button.setText(""); zoom = new JComboBox(c.getZooms()); zoom.setSelectedItem("100%"); zoom.addItem(userDefinedZoom); add(zoom); - zoom.addItemListener(new ItemListener(){ - public void itemStateChanged(ItemEvent e) { - // todo: dialog with user zoom value, if user zoom is chosen. - setZoomByItem(e.getItem()); }}); } + zoom.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + // todo: dialog with user zoom value, if user zoom is chosen. + // change proposed by dimitri: + if (e.getStateChange() == ItemEvent.SELECTED) { + setZoomByItem(e.getItem()); + } + } + }); + } private void setZoomByItem(Object item) { if(((String) item).equals(userDefinedZoom)) @@ -76,6 +85,7 @@ return (int)(f*100F)+"%"; } public void setZoomComboBox(float f) { + logger.info("setZoomComboBox is called with "+f+"."); String toBeFound = getItemForZoom(f); for(int i = 0; i < zoom.getItemCount(); ++i) { if(toBeFound.equals((String) zoom.getItemAt(i))) { @@ -90,4 +100,5 @@ public void setAllActions(boolean enabled) { if (zoom != null) { zoom.setEnabled(enabled); }} + } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/MapModuleManager.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/MapModuleManager.java --- freemind-0.7.1/freemind/freemind/controller/MapModuleManager.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/MapModuleManager.java 2005-03-11 22:27:28.000000000 +0000 @@ -0,0 +1,231 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 08.08.2004 + */ +/*$Id: MapModuleManager.java,v 1.1.4.3 2005/03/11 22:27:28 christianfoltin Exp $*/ + +package freemind.controller; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.ListIterator; +import java.util.Map; + +import freemind.controller.Controller.HistoryManager; +import freemind.modes.MindMap; +import freemind.modes.Mode; +import freemind.view.MapModule; +import freemind.view.mindmapview.MapView; + + +/** + * Manages the list of MapModules. + * As this task is very complex, I exported it + * from Controller to this class to keep Controller + * simple. + */ + public class MapModuleManager { + // Variable below: The instances of mode, ie. the Model/View pairs. Normally, the + // order should be the order of insertion, but such a Map is not + // available. + private Map mapModules = new HashMap(); + + private MapModule mapModule; //reference to the current mapmodule, could be done + //with an index to mapModules, too. + // private String current; + + private Controller c; + + private final LastOpenedList lastOpened; + + private final HistoryManager history; + + MapModuleManager(Controller c, HistoryManager history, LastOpenedList lastOpened) { + this.c=c; + this.history = history; + this.lastOpened = lastOpened; } + + Map getMapModules() { + return mapModules; } + + public MapModule getMapModule() { + return mapModule; } + + public void newMapModule(MindMap map) { + MapModule mapModule = new MapModule(map, new MapView(map, c), c.getMode()); + addToMapModules(mapModule.toString(), mapModule); + setMapModule(mapModule); + history.mapChanged(mapModule); + } + + public void updateMapModuleName() { + getMapModules().remove(getMapModule().toString()); + //removeFromViews() doesn't work because MapModuleChanged() + //must not be called at this state + getMapModule().rename(); + addToMapModules(getMapModule().toString(),getMapModule()); + setMapModule(getMapModule()); + } + + void nextMapModule() { + List keys = new LinkedList(getMapModules().keySet()); + int index = keys.indexOf(getMapModule().toString()); + ListIterator i = keys.listIterator(index+1); + if (i.hasNext()) { + changeToMapModule((String)i.next()); } + else if (keys.iterator().hasNext()) { + // Change to the first in the list + changeToMapModule((String)keys.iterator().next()); }} + + void previousMapModule() { + List keys = new LinkedList(getMapModules().keySet()); + int index = keys.indexOf(getMapModule().toString()); + ListIterator i = keys.listIterator(index); + if (i.hasPrevious()) { + changeToMapModule((String)i.previous()); } + else { + Iterator last = keys.listIterator(keys.size()-1); + if (last.hasNext()) { + changeToMapModule((String)last.next()); }}} + + //Change MapModules + /** This is the question whether the map is already opened. If this is the case, + * the map is automatically opened + returns true. Otherwise does nothing + returns false.*/ + public boolean tryToChangeToMapModule(String mapModule) { + if (mapModule != null && getMapModules().containsKey(mapModule)) { + changeToMapModule(mapModule); + return true; } + else { + return false; }} + + /** adds the mapModule to the history and calls changeToMapModuleWithoutHistory. */ + void changeToMapModule(String mapModule) { + MapModule map = (MapModule)(getMapModules().get(mapModule)); + history.mapChanged(map); + setMapModule(map); + } + + + public void changeToMapOfMode(Mode mode) { + for (Iterator i = getMapModules().keySet().iterator(); i.hasNext(); ) { + String next = (String)i.next(); + if ( ((MapModule)getMapModules().get(next)).getMode() == mode ) { + changeToMapModule(next); + return; }}} + + /** + * @param mapModule + * is null if the old mode should be closed. + */ + void setMapModule(MapModule mapModule) { + MapModule oldMapModule = this.mapModule; + if (oldMapModule != null) { + // shut down screens of old view + frame + c.getModeController().setVisible(false); + c.getModeController().shutdownController(); + } + + if (mapModule != null) { + // change mode ? + if (mapModule.getMode() != c.getMode()) { + // create mode + c.changeToMode(mapModule.getMode().toString()); + } + } + this.mapModule = mapModule; + List keys = new LinkedList(getMapModules().keySet()); + c.navigationPreviousMap.setEnabled(keys.size() > 1); + c.navigationNextMap.setEnabled(keys.size() > 1); + // FIXME: This is done twice (the first time was in changeToMode above), + // but we need it to update the maps menus + c.getFrame().getFreeMindMenuBar().updateMenus(); + + if (mapModule != null) { + //FIXME: This is controller code and has to be moved. + c.getFrame().setView(mapModule.getView()); + c.setAllActions(true); + if (c.getView().getSelected() == null) { + // Only for the new modules move to root + c.moveToRoot(); + } + lastOpened.mapOpened(getMapModule()); + c.setTitle(); + ((MainToolBar) c.getToolbar()).setZoomComboBox(getMapModule() + .getView().getZoom()); + c.obtainFocusForSelected(); + c.getModeController().startupController(); + c.getModeController().setVisible(true); + } else { + c.getFrame().setView(null); + + } + } + + + //private + + private void addToMapModules(String key, MapModule newMapModule) { + // begin bug fix, 20.12.2003, fc. + // check, if already present: + String extension = ""; + int count = 1; + while (mapModules.containsKey(key+extension)) { + extension = "<"+(++count)+">"; + } + // rename map: + newMapModule.setName(key+extension); + mapModules.put(key+extension,newMapModule); + // end bug fix, 20.12.2003, fc. + } + + private void changeToAnotherMap(String toBeClosed) { + List keys = new LinkedList(getMapModules().keySet()); + for (ListIterator i = keys.listIterator(); i.hasNext();) { + String key = (String)i.next(); + if (!key.equals(toBeClosed)) { + changeToMapModule(key); + return; }}} + + /** + * Close the currently active map, return false if closing cancelled. + * @param force forces the closing without any save actions. + */ + public boolean close(boolean force) { + // (DP) The mode controller does not close the map + boolean closingNotCancelled = c.getMode().getModeController().close(force); + if (!closingNotCancelled) { + return false; } + + String toBeClosed = getMapModule().toString(); + mapModules.remove(toBeClosed); + if (mapModules.isEmpty()) { + c.setAllActions(false); + setMapModule(null); + c.getFrame().setView(null); } + else { + changeToMapModule((String)mapModules.keySet().iterator().next()); + } + return true; } + + // }} + + } \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/MapMouseMotionListener.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/MapMouseMotionListener.java --- freemind-0.7.1/freemind/freemind/controller/MapMouseMotionListener.java 2003-12-02 22:50:22.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/controller/MapMouseMotionListener.java 2005-02-10 23:01:18.000000000 +0000 @@ -16,15 +16,17 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: MapMouseMotionListener.java,v 1.7 2003/12/02 22:50:22 christianfoltin Exp $*/ +/*$Id: MapMouseMotionListener.java,v 1.7.16.4 2005/02/10 23:01:18 christianfoltin Exp $*/ package freemind.controller; +import java.awt.Point; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import javax.swing.JPopupMenu; +import freemind.modes.MindMapArrowLink; import freemind.view.mindmapview.MapView; @@ -37,6 +39,11 @@ int originX = -1; int originY = -1; + MindMapArrowLink draggedLink = null; + + private Point draggedLinkOldStartPoint; + + private Point draggedLinkOldEndPoint; // |= oldX >=0 iff we are in the drag @@ -65,7 +72,17 @@ public void mouseDragged(MouseEvent e) { // Always try to get mouse to the original position in the Map. if (originX >=0) { - ((MapView)e.getComponent()).scrollBy(originX - e.getX(), originY - e.getY()); + if(draggedLink != null){ + int deltaX = (int)((e.getX()-originX)/c.getView().getZoom()); + int deltaY = (int)((e.getY()-originY)/c.getView().getZoom()); + draggedLink.changeInclination(originX, originY , deltaX, deltaY); + originX = e.getX(); + originY = e.getY(); + c.getView().repaint(); + } + else{ + ((MapView)e.getComponent()).scrollBy(originX - e.getX(), originY - e.getY(), false); + } // } else { // do the init in the mouse press } } @@ -84,12 +101,34 @@ c.getView().setMoveCursor(true); originX = e.getX(); originY = e.getY(); + draggedLink = c.getView().detectCollision(new Point(originX, originY)); + if(draggedLink != null){ + draggedLinkOldStartPoint = draggedLink.getStartInclination(); + draggedLinkOldEndPoint = draggedLink.getEndInclination(); + draggedLink.showControlPoints(true); + c.getView().repaint(); + } + } e.consume(); } public void mouseReleased( MouseEvent e ) { originX = -1; originY = -1; + if (draggedLink != null){ + draggedLink.showControlPoints(false); + // make action undoable. + + Point draggedLinkNewStartPoint = draggedLink.getStartInclination(); + Point draggedLinkNewEndPoint = draggedLink.getEndInclination(); + //restore old positions. + draggedLink.setStartInclination(draggedLinkOldStartPoint); + draggedLink.setEndInclination(draggedLinkOldEndPoint); + // and change to the new again. + c.getModeController().setArrowLinkEndPoints(draggedLink, draggedLinkNewStartPoint, draggedLinkNewEndPoint); + c.getView().repaint(); + draggedLink = null; + } handlePopup(e); e.consume(); c.getView().setMoveCursor(false); // release the cursor to default (PN) diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/MenuBar.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/MenuBar.java --- freemind-0.7.1/freemind/freemind/controller/MenuBar.java 2004-01-24 22:36:48.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/controller/MenuBar.java 2005-06-16 20:27:04.000000000 +0100 @@ -16,7 +16,7 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: MenuBar.java,v 1.24 2004/01/24 22:36:48 christianfoltin Exp $*/ +/*$Id: MenuBar.java,v 1.24.14.13 2005/06/16 19:27:04 christianfoltin Exp $*/ package freemind.controller; @@ -28,224 +28,287 @@ import java.awt.event.ActionEvent; import javax.swing.*; -/**This is the menu bar for FreeMind. Actions are defined in MenuListener. */ +/**This is the menu bar for FreeMind. Actions are defined in MenuListener. + * Moreover, the StructuredMenuHolder of all menus are hold here. + * */ public class MenuBar extends JMenuBar { - JMenu mapsmenu; + private static java.util.logging.Logger logger ; + public static final String MENU_BAR_PREFIX = "menu_bar/"; + public static final String GENERAL_POPUP_PREFIX = "popup/"; + + public static final String POPUP_MENU = GENERAL_POPUP_PREFIX+"popup/"; + + public static final String INSERT_MENU = MENU_BAR_PREFIX+"insert/"; + public static final String NAVIGATE_MENU = MENU_BAR_PREFIX+"navigate/"; + public static final String VIEW_MENU = MENU_BAR_PREFIX+"view/"; + public static final String HELP_MENU = MENU_BAR_PREFIX+"help/"; + public static final String MODES_MENU = MENU_BAR_PREFIX+"modes/"; + public static final String MINDMAP_MENU = MENU_BAR_PREFIX+"mindmaps/"; + public static final String EDIT_MENU = MENU_BAR_PREFIX+"edit/"; + public static final String FILE_MENU = MENU_BAR_PREFIX+"file/"; + public static final String FORMAT_MENU = MENU_BAR_PREFIX+"format/"; + public static final String EXTRAS_MENU = MENU_BAR_PREFIX+"extras/"; + + private StructuredMenuHolder menuHolder; + JPopupMenu mapsPopupMenu; private JMenu filemenu; private JMenu editmenu; + private JMenu mapsmenu; Controller c; - private LinkedList lastOpenedItems = new LinkedList(); ActionListener mapsMenuActionListener = new MapsMenuActionListener(); ActionListener lastOpenedActionListener = new LastOpenedActionListener(); + private JMenu formatmenu; public MenuBar(Controller controller) { - this.c = controller; - filemenu = new JMenu(c.getResourceString("file")); - editmenu = new JMenu(c.getResourceString("edit")); - this.add(filemenu); - this.add(editmenu); - - //Mapsmenu - mapsmenu = new JMenu(c.getResourceString("mindmaps")); - //mapsmenu.setMnemonic(KeyEvent.VK_M); - mapsPopupMenu = new JPopupMenu(c.getResourceString("mindmaps")); - this.add(mapsmenu); - - //Modesmenu - JMenu modesmenu = new JMenu(c.getResourceString("modes")); - this.add(modesmenu); - - ActionListener modesMenuActionListener = new ModesMenuActionListener(); - List keys = new LinkedList(c.getModes().keySet()); - for (ListIterator i = keys.listIterator(); i.hasNext();) { - String key = (String)i.next(); - JMenuItem newItem = new JMenuItem(key); - modesmenu.add(newItem); - String keystroke = c.getFrame().getProperty("keystroke_mode_"+key); - if (keystroke != null) { - newItem.setAccelerator(KeyStroke.getKeyStroke(keystroke)); - } - newItem.addActionListener(modesMenuActionListener); - //if (key.equals(c.getMode().toString())) { - // newItem.setBackground(Color.blue); - //} - } - - filemenu.setMnemonic(KeyEvent.VK_F); - mapsmenu.setMnemonic(KeyEvent.VK_M); + this.c = controller; + if(logger==null) { + logger = controller.getFrame().getLogger(this.getClass().getName()); + } + //updateMenus(); + }//Constructor - //Helpmenu - JMenu helpmenu = new JMenu(c.getResourceString("help")); - this.add(helpmenu); - - helpmenu.add(c.documentation); - helpmenu.add(c.faq); - helpmenu.add(c.license); - helpmenu.add(c.about); + /** + * This is the only public method. It restores all menus. + */ + public void updateMenus() { + this.removeAll(); + + menuHolder = new StructuredMenuHolder(); + + // filemenu + filemenu = menuHolder.addMenu(new JMenu(c.getResourceString("file")), FILE_MENU+"."); + filemenu.setMnemonic(KeyEvent.VK_F); + + menuHolder.addCategory(FILE_MENU+"open"); + menuHolder.addCategory(FILE_MENU+"close"); + menuHolder.addSeparator(FILE_MENU); + menuHolder.addCategory(FILE_MENU+"export"); + menuHolder.addSeparator(FILE_MENU); + menuHolder.addCategory(FILE_MENU+"import"); + menuHolder.addSeparator(FILE_MENU); + menuHolder.addCategory(FILE_MENU+"print"); + menuHolder.addSeparator(FILE_MENU); + menuHolder.addCategory(FILE_MENU+"last"); + menuHolder.addSeparator(FILE_MENU); + menuHolder.addCategory(FILE_MENU+"quit"); + + // editmenu + editmenu = menuHolder.addMenu(new JMenu(c.getResourceString("edit")), EDIT_MENU+"."); + menuHolder.addCategory(EDIT_MENU+"undo"); + menuHolder.addSeparator(EDIT_MENU); + menuHolder.addCategory(EDIT_MENU+"select"); + menuHolder.addSeparator(EDIT_MENU); + menuHolder.addCategory(EDIT_MENU+"paste"); + menuHolder.addSeparator(EDIT_MENU); + menuHolder.addCategory(EDIT_MENU+"edit"); + menuHolder.addSeparator(EDIT_MENU); + menuHolder.addCategory(EDIT_MENU+"find"); + + //view menu + menuHolder.addMenu(new JMenu(c.getResourceString("menu_view")), VIEW_MENU+"."); + + //insert menu + menuHolder.addMenu(new JMenu(c.getResourceString("menu_insert")), INSERT_MENU+"."); + menuHolder.addCategory(INSERT_MENU+"nodes"); + menuHolder.addSeparator(INSERT_MENU); + menuHolder.addCategory(INSERT_MENU+"icons"); + menuHolder.addSeparator(INSERT_MENU); + + //format menu + formatmenu = menuHolder.addMenu(new JMenu(c.getResourceString("menu_format")), FORMAT_MENU+"."); + menuHolder.addCategory(FORMAT_MENU+"patterns"); + menuHolder.addSeparator(FORMAT_MENU); + + //navigate menu + menuHolder.addMenu(new JMenu(c.getResourceString("menu_navigate")), NAVIGATE_MENU+"."); + + + //extras menu + menuHolder.addMenu(new JMenu(c.getResourceString("menu_extras")), EXTRAS_MENU+"."); + menuHolder.addCategory(EXTRAS_MENU+"first"); + menuHolder.addSeparator(EXTRAS_MENU); + menuHolder.addCategory(EXTRAS_MENU+"last"); + + //Mapsmenu + mapsmenu = menuHolder.addMenu(new JMenu(c.getResourceString("mindmaps")), MINDMAP_MENU+"."); + mapsmenu.setMnemonic(KeyEvent.VK_M); + menuHolder.addCategory(MINDMAP_MENU+"navigate"); + menuHolder.addSeparator(MINDMAP_MENU); + + // maps popup menu + mapsPopupMenu = new JPopupMenu(c.getResourceString("mindmaps")); + menuHolder.addCategory(POPUP_MENU+"navigate"); + //menuHolder.addSeparator(POPUP_MENU); - }//Constructor - - public void updateMapsMenu() { - mapsPopupMenu.removeAll(); - mapsmenu.removeAll(); - if (c.getMapModuleManager().getMapModules() == null) { - return; + //Modesmenu + JMenu modesmenu = menuHolder.addMenu(new JMenu(c.getResourceString("modes")), MODES_MENU+"."); + + menuHolder.addMenu(new JMenu(c.getResourceString("help")), HELP_MENU+"."); + menuHolder.addAction(c.documentation, HELP_MENU+"doc/documentation"); + menuHolder.addAction(c.faq, HELP_MENU+"doc/faq"); + menuHolder.addSeparator(HELP_MENU); + menuHolder.addAction(c.license, HELP_MENU+"about/license"); + menuHolder.addAction(c.about, HELP_MENU+"about/about"); + + updateFileMenu(); + updateEditMenu(); + updateModeMenu(); + updateMapsMenu(menuHolder, MINDMAP_MENU); + updateMapsMenu(menuHolder, POPUP_MENU); + addAdditionalPopupActions(); + // the modes: + if ((c.getMode() != null)) { + c.getMode().getModeController().updateMenus(menuHolder); + } + menuHolder.updateMenus(this, MENU_BAR_PREFIX); + menuHolder.updateMenus(mapsPopupMenu, GENERAL_POPUP_PREFIX); + } - List keys = new LinkedList(c.getMapModuleManager().getMapModules().keySet()); - Collections.sort(keys); - for (ListIterator i = keys.listIterator(); i.hasNext();) { - String key = (String)i.next(); - JMenuItem newItem = new JMenuItem(key); - JMenuItem newPopupItem = new JMenuItem(key); - newItem.addActionListener(mapsMenuActionListener); - newPopupItem.addActionListener(mapsMenuActionListener); - newItem.setMnemonic(key.charAt(0)); - newPopupItem.setMnemonic(key.charAt(0)); + private void updateModeMenu() { + ButtonGroup group = new ButtonGroup(); + ActionListener modesMenuActionListener = new ModesMenuActionListener(); + List keys = new LinkedList(c.getModes()); + for (ListIterator i = keys.listIterator(); i.hasNext();) { + String key = (String)i.next(); + JRadioButtonMenuItem newItem = (JRadioButtonMenuItem) menuHolder.addMenuItem(new JRadioButtonMenuItem(key), MODES_MENU+key); + group.add(newItem); + if (c.getMode() != null) { + newItem.setSelected(c.getMode().toString().equals(key)); + } else { + newItem.setSelected(false); + } + String keystroke = c.getFrame().getProperty("keystroke_mode_"+key); + if (keystroke != null) { + newItem.setAccelerator(KeyStroke.getKeyStroke(keystroke)); + } + newItem.addActionListener(modesMenuActionListener); + } + } - if (c.getMapModuleManager().getMapModule() != null) { - if (key.equals(c.getMapModuleManager().getMapModule().toString())) { - //This could be done more elegant - newItem.setBackground(Color.lightGray); - newPopupItem.setBackground(Color.lightGray); - } - } - mapsPopupMenu.add(newPopupItem); - mapsmenu.add(newItem); - } - mapsPopupMenu.addSeparator(); + private void addAdditionalPopupActions() { + menuHolder.addSeparator(POPUP_MENU); JMenuItem newPopupItem; - + newPopupItem = new JMenuItem(c.toggleMenubar); newPopupItem.setForeground(new Color(100,80,80)); newPopupItem.setEnabled(c.getFrame().isApplet()); // We have enabled hiding of menubar only in applets. It it because // when we hide menubar in application, the key accelerators from // menubar do not work. - mapsPopupMenu.add(newPopupItem); - + menuHolder.addMenuItem(newPopupItem, POPUP_MENU+"toggleMenubar"); + newPopupItem = new JMenuItem(c.toggleToolbar); newPopupItem.setForeground(new Color(100,80,80)); - mapsPopupMenu.add(newPopupItem); - + menuHolder.addMenuItem(newPopupItem, POPUP_MENU+"toggleToolbar"); + newPopupItem = new JMenuItem(c.toggleLeftToolbar); newPopupItem.setForeground(new Color(100,80,80)); - mapsPopupMenu.add(newPopupItem); + menuHolder.addMenuItem(newPopupItem, POPUP_MENU+"toggleLeftToolbar"); + } + + private void updateMapsMenu(StructuredMenuHolder holder, String basicKey) { + if (c.getMapModuleManager().getMapModules() == null) { + return; + } + List keys = new LinkedList(c.getMapModuleManager().getMapModules().keySet()); + Collections.sort(keys); + ButtonGroup group = new ButtonGroup(); + for (ListIterator i = keys.listIterator(); i.hasNext();) { + String key = (String)i.next(); + JRadioButtonMenuItem newItem = new JRadioButtonMenuItem(key); + newItem.setSelected(false); + group.add(newItem); + + newItem.addActionListener(mapsMenuActionListener); + newItem.setMnemonic(key.charAt(0)); + + if (c.getMapModuleManager().getMapModule() != null) { + if (key.equals(c.getMapModuleManager().getMapModule().toString())) { + newItem.setSelected(true); + } + } + holder.addMenuItem(newItem, basicKey+key); + } } - public void updateFileMenu() { - filemenu.removeAll(); - if ((c.getMode() != null) && (c.getMode().getModeFileMenu() != null)) { - copyMenuItems(c.getMode().getModeFileMenu(), filemenu); - } - - filemenu.addSeparator(); - JMenuItem page = filemenu.add(c.page); - JMenuItem print = filemenu.add(c.print); - print.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_print"))); - filemenu.addSeparator(); - JMenuItem close = filemenu.add(c.close); - close.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_close"))); + private void updateFileMenu() { + + menuHolder.addAction(c.page, FILE_MENU+"print/pageSetup"); + JMenuItem print = menuHolder.addAction(c.print, FILE_MENU+"print/print"); + print.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_print"))); - JMenuItem quit = filemenu.add(c.quit); - quit.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_quit"))); - filemenu.addSeparator(); - updateLastOpenedList(); + JMenuItem close = menuHolder.addAction(c.close, FILE_MENU+"close/close"); + close.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_close"))); + + JMenuItem quit = menuHolder.addAction(c.quit, FILE_MENU+"quit/quit"); + quit.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_quit"))); + updateLastOpenedList(); } - public void updateLastOpenedList() { - for(ListIterator it=lastOpenedItems.listIterator();it.hasNext();) { - filemenu.remove((JMenuItem)it.next()); - } - lastOpenedItems.clear(); - boolean firstElement = true; - LastOpenedList lst = c.getLastOpenedList(); - for(ListIterator it=lst.listIterator();it.hasNext();) { - JMenuItem item = new JMenuItem((String)it.next()); - if(firstElement) { + private void updateLastOpenedList() { + menuHolder.addMenu(new JMenu(c.getResourceString("most_recent_files")), FILE_MENU+"last/."); + boolean firstElement = true; + LastOpenedList lst = c.getLastOpenedList(); + for (ListIterator it = lst.listIterator(); it.hasNext();) { + String key = (String) it.next(); + JMenuItem item = new JMenuItem(key); + if (firstElement) { firstElement = false; - item.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_open_first_in_history"))); + item.setAccelerator( + KeyStroke.getKeyStroke( + c.getFrame().getProperty( + "keystroke_open_first_in_history"))); } - item.addActionListener(lastOpenedActionListener); - lastOpenedItems.add(item); - filemenu.add(item); - } - } - - public void updateEditMenu() { - editmenu.removeAll(); - - if ((c.getMode() != null) && (c.getMode().getModeEditMenu() != null)) { - copyMenuItems(c.getMode().getModeEditMenu(), editmenu); - } - - editmenu.addSeparator(); - - JMenuItem zoomIn = editmenu.add(c.zoomIn); - zoomIn.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_zoom_in"))); - - JMenuItem zoomOut = editmenu.add(c.zoomOut); - zoomOut.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_zoom_out"))); - - editmenu.addSeparator(); - - JMenuItem moveToRoot = editmenu.add(c.moveToRoot); - moveToRoot.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_moveToRoot"))); - - JMenuItem previousMap = editmenu.add(c.navigationPreviousMap); - previousMap.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_previousMap"))); - - JMenuItem nextMap = editmenu.add(c.navigationNextMap); - nextMap.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_nextMap"))); - - //JMenuItem historyPreviousMap = editmenu.add(c.historyPreviousMap); - //JMenuItem historyNextMap = editmenu.add(c.historyNextMap); - // ^ Daniel: This does not work as expected. - - editmenu.addSeparator(); - - JMenu preferences = new JMenu(c.getResourceString("preferences")); - editmenu.add(preferences); - - if (false) { - preferences.add(c.background); - // Background is disabled from preferences, because it has no real function. - // To complete the function, one would either make sure that the color is - // saved and read from auto.properties or think about storing the background - // color into map (just like ). + item.addActionListener(lastOpenedActionListener); + + menuHolder.addMenuItem(item, FILE_MENU+"last/"+(key.replace('/', '_'))); } + } - // Daniel: The way antialias option is represented now is not nice, - // there should be only one variable controlling it. Fix it if you - // have time, this kind of classical quality is low pri now. - String antialiasSelected = c.getAntialiasAll() ? "antialias_all" : - ( c.getAntialiasEdges() ? "antialias_edges" : "antialias_none" ); - addOptionSet( c.optionAntialiasAction, - new String[]{ "antialias_none", - "antialias_edges", - "antialias_all" }, - preferences, antialiasSelected ); - preferences.addSeparator(); - addOptionSet( c.optionHTMLExportFoldingAction, - new String[]{ "html_export_no_folding", - "html_export_fold_currently_folded", - "html_export_fold_all", - "html_export_based_on_headings" }, - preferences, c.getProperty("html_export_folding") ); - - preferences.addSeparator(); - addOptionSet( c.optionSelectionMechanismAction, - new String[]{ "selection_method_direct", - "selection_method_by_click"}, - preferences, c.getProperty("selection_method") ); + private void updateEditMenu() { + JMenuItem toggleToolbar = menuHolder.addAction(c.toggleToolbar, VIEW_MENU+"toolbars/toggleToolbar"); + JMenuItem toggleLeftToolbar = menuHolder.addAction(c.toggleLeftToolbar, VIEW_MENU+"toolbars/toggleLeftToolbar"); + + menuHolder.addSeparator(VIEW_MENU); + + JMenuItem zoomIn = menuHolder.addAction(c.zoomIn, VIEW_MENU+"zoom/zoomIn"); + zoomIn.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_zoom_in"))); + + JMenuItem zoomOut = menuHolder.addAction(c.zoomOut, VIEW_MENU+"zoom/zoomOut"); + zoomOut.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_zoom_out"))); + + JMenuItem moveToRoot = menuHolder.addAction(c.moveToRoot, NAVIGATE_MENU+"nodes/moveToRoot"); + moveToRoot.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_moveToRoot"))); + + JMenuItem previousMap = menuHolder.addAction(c.navigationPreviousMap, MINDMAP_MENU+"navigate/navigationPreviousMap"); + previousMap.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_previousMap"))); + + JMenuItem nextMap = menuHolder.addAction(c.navigationNextMap, MINDMAP_MENU+"navigate/navigationNextMap"); + nextMap.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_nextMap"))); + + +// JMenu preferences = menuHolder.addMenu(new JMenu(c.getResourceString("preferences")), EXTRAS_MENU+"last/options/."); + JMenuItem prefDialog = menuHolder.addAction(c.propertyAction, EXTRAS_MENU+"last/option_dialog"); + prefDialog.setAccelerator(KeyStroke.getKeyStroke(c.getFrame().getProperty("keystroke_option_dialog"))); + +// if (false) { +// preferences.add(c.background); +// // Background is disabled from preferences, because it has no real function. +// // To complete the function, one would either make sure that the color is +// // saved and read from auto.properties or think about storing the background +// // color into map (just like ). +// } + + } private void addOptionSet(Action action, String[] textIDs, JMenu menu, String selectedTextID) { @@ -282,20 +345,29 @@ } private class MapsMenuActionListener implements ActionListener { - public void actionPerformed(ActionEvent e) { - c.getMapModuleManager().changeToMapModule(e.getActionCommand()); - } + public void actionPerformed(ActionEvent e) { + c.getMapModuleManager().changeToMapModule(e.getActionCommand()); + } } private class LastOpenedActionListener implements ActionListener { - public void actionPerformed(ActionEvent e) { - c.getLastOpenedList().open(e.getActionCommand()); - } + public void actionPerformed(ActionEvent e) { + c.getLastOpenedList().open(e.getActionCommand()); + } } private class ModesMenuActionListener implements ActionListener { - public void actionPerformed(ActionEvent e) { - c.changeToMode(e.getActionCommand()); - } + public void actionPerformed(ActionEvent e) { + c.changeToMode(e.getActionCommand()); + } + } + + + /** + * @return + */ + public StructuredMenuHolder getMenuHolder() { + return menuHolder; } + } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/MenuItemEnabledListener.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/MenuItemEnabledListener.java --- freemind-0.7.1/freemind/freemind/controller/MenuItemEnabledListener.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/MenuItemEnabledListener.java 2004-10-18 00:00:07.000000000 +0100 @@ -0,0 +1,31 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 15.07.2004 + */ +/*$Id: MenuItemEnabledListener.java,v 1.1.4.1 2004/10/17 23:00:07 dpolivaev Exp $*/ +package freemind.controller; + +import javax.swing.Action; +import javax.swing.JMenuItem; + + +public interface MenuItemEnabledListener { + boolean isEnabled(JMenuItem item, Action action); +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/MenuItemSelectedListener.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/MenuItemSelectedListener.java --- freemind-0.7.1/freemind/freemind/controller/MenuItemSelectedListener.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/MenuItemSelectedListener.java 2004-10-18 00:00:07.000000000 +0100 @@ -0,0 +1,31 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 15.07.2004 + */ +/*$Id: MenuItemSelectedListener.java,v 1.1.4.1 2004/10/17 23:00:07 dpolivaev Exp $*/ +package freemind.controller; + +import javax.swing.Action; +import javax.swing.JCheckBoxMenuItem; + + +public interface MenuItemSelectedListener { + boolean isSelected(JCheckBoxMenuItem checkItem, Action action); +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/MindMapNodesSelection.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/MindMapNodesSelection.java --- freemind-0.7.1/freemind/freemind/controller/MindMapNodesSelection.java 2003-11-03 10:28:52.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/controller/MindMapNodesSelection.java 2005-04-24 19:49:12.000000000 +0100 @@ -1,6 +1,29 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on ??? + */ +/*$Id: MindMapNodesSelection.java,v 1.2.18.2 2005/04/24 18:49:12 christianfoltin Exp $*/ package freemind.controller; import java.awt.datatransfer.*; import java.io.*; +import java.util.List; public class MindMapNodesSelection implements Transferable, ClipboardOwner { @@ -8,12 +31,16 @@ private String stringContent; private String rtfContent; private String dropActionContent; + private final String htmlContent; + private final List fileList; public static DataFlavor mindMapNodesFlavor = null; public static DataFlavor rtfFlavor = null; public static DataFlavor htmlFlavor = null; public static DataFlavor fileListFlavor = null; + /** fc, 7.8.2004: This is a quite interisting flavor, but how does it works???*/ public static DataFlavor dropActionFlavor = null; + static { try { mindMapNodesFlavor = new DataFlavor("text/freemind-nodes; class=java.lang.String"); @@ -28,11 +55,16 @@ // - public MindMapNodesSelection(String nodesContent, String stringContent, String rtfContent, String dropActionContent) { - this.nodesContent = nodesContent; - this.rtfContent = rtfContent; - this.stringContent = stringContent; - this.dropActionContent = dropActionContent; } + public MindMapNodesSelection(String nodesContent, String stringContent, + String rtfContent, String dropActionContent, String htmlContent, + List fileList) { + this.nodesContent = nodesContent; + this.rtfContent = rtfContent; + this.stringContent = stringContent; + this.dropActionContent = dropActionContent; + this.htmlContent = htmlContent; + this.fileList = fileList; + } public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException { if (flavor.equals(DataFlavor.stringFlavor)) { @@ -47,14 +79,32 @@ // System.out.println(byteArray[i]); } return new ByteArrayInputStream(byteArray); } + if(flavor.equals(htmlFlavor)) { + return htmlContent; + } + if(flavor.equals(fileListFlavor)) { + return fileList; + } throw new UnsupportedFlavorException(flavor); } public DataFlavor[] getTransferDataFlavors() { return new DataFlavor[] { DataFlavor.stringFlavor, mindMapNodesFlavor, rtfFlavor, dropActionFlavor}; } public boolean isDataFlavorSupported(DataFlavor flavor) { - return flavor.equals(DataFlavor.stringFlavor) || flavor.equals(mindMapNodesFlavor) - || flavor.equals(rtfFlavor) || flavor.equals(dropActionFlavor); } + if(flavor.equals(DataFlavor.stringFlavor) && stringContent != null) + return true; + if(flavor.equals(mindMapNodesFlavor) && nodesContent != null) + return true; + if(flavor.equals(rtfFlavor) && rtfContent != null) + return true; + if(flavor.equals(dropActionFlavor) && dropActionContent != null) + return true; + if(flavor.equals(htmlFlavor) && htmlContent != null) + return true; + if(flavor.equals(fileListFlavor) && (fileList != null) && fileList.size()> 0) + return true; + return false; + } public void lostOwnership(Clipboard clipboard, Transferable contents) {} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/NodeDropListener.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/NodeDropListener.java --- freemind-0.7.1/freemind/freemind/controller/NodeDropListener.java 2004-01-17 23:20:57.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/controller/NodeDropListener.java 2004-11-28 21:37:46.000000000 +0000 @@ -19,11 +19,6 @@ package freemind.controller; -import freemind.view.mindmapview.NodeView; -import freemind.modes.MindMapNode; -import freemind.modes.mindmapmode.MindMapNodeModel; -import freemind.modes.mindmapmode.MindMapMapModel; -// For Drag&Drop import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.DnDConstants; @@ -31,8 +26,16 @@ import java.awt.dnd.DropTargetDropEvent; import java.awt.dnd.DropTargetEvent; import java.awt.dnd.DropTargetListener; +import java.util.List; import java.util.ListIterator; + import javax.swing.JOptionPane; +import javax.swing.tree.TreePath; + +import freemind.modes.MindMapNode; +import freemind.modes.mindmapmode.MindMapMapModel; +import freemind.modes.mindmapmode.MindMapNodeModel; +import freemind.view.mindmapview.NodeView; //import ublic class MindMapNodesSelection implements Transferable, ClipboardOwner { // public static DataFlavor fileListFlavor = null; @@ -98,7 +101,7 @@ if (!dtde.isLocalTransfer()) { //if (dtde.isDataFlavorSupported(MindMapNodesSelection.fileListFlavor)) { //System.err.println("filelist"); - c.getModel().paste (t, targetNode, + c.getModeController().paste (t, targetNode, targetNodeView.dropAsSibling(dtde.getLocation().getX()), targetNodeView.dropPosition (dtde.getLocation().getX())); dtde.dropComplete(true); @@ -140,17 +143,42 @@ MindMapNodeModel selectedNodeModel = (MindMapNodeModel)((NodeView)it.next()).getModel(); // mindMapMapModel.setNodeColor(selectedNodeModel,targetNode.getColor()); // mindMapMapModel.setNodeFont(selectedNodeModel,targetNode.getFont()); - mindMapMapModel.addLink(selectedNodeModel, targetNodeModel); + c.getModeController().addLink(selectedNodeModel, targetNodeModel); } } } else { - c.getModel().paste (dropAction == DnDConstants.ACTION_MOVE - ? c.getModel().cut() : c.getModel().copy(), - targetNode, - targetNodeView.dropAsSibling(dtde.getLocation().getX()), - targetNodeView.dropPosition (dtde.getLocation().getX())); } - c.getView().selectAsTheOnlyOneSelected(targetNodeModel.getViewer()); } + Transferable trans = null; + // if move, verify, that the target is not a son of the sources. + if (DnDConstants.ACTION_MOVE == dropAction) { + List selecteds = c.getModeController().getSelecteds(); + MindMapNode actualNode = targetNode; + do { + if (selecteds.contains(actualNode)) { + String message = c.getResourceString("cannot_move_to_child"); + JOptionPane.showMessageDialog(c.getFrame().getContentPane(), + message,"Freemind", JOptionPane.WARNING_MESSAGE); + dtde.dropComplete(true); + return; + } + actualNode = (actualNode.isRoot())?null:actualNode.getParentNode(); + } while(actualNode != null); + trans = c.getModeController().cut(); + } else { + trans = c.getModel().copy(); + } + + c.getView().selectAsTheOnlyOneSelected( + targetNodeModel.getViewer()); + c.getModeController().paste( + trans, + targetNode, + targetNode.getViewer().dropAsSibling( + dtde.getLocation().getX()), + targetNode.getViewer().dropPosition( + dtde.getLocation().getX())); + } + } catch (Exception e) { System.err.println("Drop exception:"+e); e.printStackTrace(); diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/NodeKeyListener.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/NodeKeyListener.java --- freemind-0.7.1/freemind/freemind/controller/NodeKeyListener.java 2003-11-09 22:09:25.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/controller/NodeKeyListener.java 2004-10-18 00:00:07.000000000 +0100 @@ -16,7 +16,7 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: NodeKeyListener.java,v 1.16 2003/11/09 22:09:25 christianfoltin Exp $*/ +/*$Id: NodeKeyListener.java,v 1.16.18.1 2004/10/17 23:00:07 dpolivaev Exp $*/ package freemind.controller; @@ -62,10 +62,11 @@ public void keyTyped( KeyEvent e ) { } - public void keyPressed( KeyEvent e ) { + public void keyPressed(KeyEvent e) { - if (e.isAltDown() || e.isControlDown()) { - return; + // add to check meta keydown by koh 2004.04.16 + if (e.isAltDown() || e.isControlDown() || e.isMetaDown()) { + return; } switch ( e.getKeyCode() ) { @@ -76,6 +77,9 @@ case KeyEvent.VK_DELETE: case KeyEvent.VK_SPACE: case KeyEvent.VK_INSERT: + // fc, 20.6.2004: to enable tab for insert. + case KeyEvent.VK_TAB: + // end change. return; // processed by Adapters ActionListener // explicitly what is not catched in e.isActionKey() diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/NodeMotionListener.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/NodeMotionListener.java --- freemind-0.7.1/freemind/freemind/controller/NodeMotionListener.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/NodeMotionListener.java 2005-04-27 22:45:30.000000000 +0100 @@ -0,0 +1,276 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2001 Joerg Mueller + *See COPYING for Details + * + *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. + */ +/*$Id: NodeMotionListener.java,v 1.1.4.2 2005/04/27 21:45:30 christianfoltin Exp $*/ + +package freemind.controller; + +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.geom.Point2D; +import java.util.Timer; +import java.util.TimerTask; + +import javax.swing.SwingUtilities; + +import freemind.main.Tools; +import freemind.modes.MindMapNode; +import freemind.view.mindmapview.NodeMotionListenerView; +import freemind.view.mindmapview.NodeView; +import freemind.view.mindmapview.RootNodeView; + +/** + * The MouseMotionListener which belongs to every NodeView + */ +public class NodeMotionListener extends MouseAdapter implements + MouseMotionListener, MouseListener { + + private final Controller c; + private Point originalStartingPoint; + + // Logging: + private static java.util.logging.Logger logger; + + public NodeMotionListener(Controller controller) { + c = controller; + if (logger == null) + logger = c.getFrame().getLogger(this.getClass().getName()); + } + + public void mouseMoved(MouseEvent e) { + } + + private Point dragStartingPoint = null; + private int originalHGap; + private int originalVGap; + private int originalShiftY; + private int originalParentHGap; + private int originalParentVGap; + private int originalParentShiftY; + + /** Invoked when a mouse button is pressed on a component and then dragged. */ + public void mouseDragged(MouseEvent e) { + logger.fine("Event: mouseDragged"); + if ((e.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) == (InputEvent.BUTTON1_DOWN_MASK)) { + NodeView nodeV = getNodeView(e); + + Point point = e.getPoint(); + SwingUtilities.convertPointToScreen(point, nodeV); + if (!isActive()) { + setDragStartingPoint(point,nodeV.getModel()); + } else { + Point dragNextPoint = point; + if ((e.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) == 0) { + MindMapNode node = nodeV.getModel(); + node.setShiftY(getNodeShiftY(dragNextPoint, node, originalStartingPoint)); + node.setHGap(getHGap(dragNextPoint, node, originalStartingPoint)); + // Bad hack for keeping root node unmoved + nodeV.setLocation(0, 0); + //FIXME: Replace by nodeRefresh(). + c.getModeController().nodeChanged(node); + } else { + MindMapNode parentNode = nodeV.getModel().getParentNode(); + parentNode.setVGap(getVGap(dragNextPoint, parentNode, originalStartingPoint)); + //FIXME: Replace by nodeRefresh(). + c.getModel().nodeChanged(parentNode); + } + } + } + } + + /** + * @param dragNextPoint + * @param node + * @param dragStartingPoint TODO + * @return + */ + private int getVGap(Point dragNextPoint, MindMapNode node, Point dragStartingPoint) { + int oldVGap = originalParentVGap; + int vGapChange = (int) ((dragNextPoint.y - dragStartingPoint.y) / c + .getView().getZoom()); + oldVGap = Math.max(0, oldVGap - vGapChange); + return oldVGap; + } + + /** + * @param dragNextPoint + * @param node + * @param dragStartingPoint TODO + * @return + */ + private int getHGap(Point dragNextPoint, MindMapNode node, Point dragStartingPoint) { + int oldHGap = originalHGap; + int hGapChange = (int) ((dragNextPoint.x - dragStartingPoint.x) / c + .getView().getZoom()); + if (node.isLeft() != null && node.isLeft().getValue() == true) + hGapChange = -hGapChange; + oldHGap += +hGapChange; + return oldHGap; + } + + /** + * @param dragNextPoint + * @param node + * @param dragStartingPoint TODO + * @return + */ + private int getNodeShiftY(Point dragNextPoint, MindMapNode node, Point dragStartingPoint) { + int shiftY = originalShiftY; + int shiftYChange = (int) ((dragNextPoint.y - dragStartingPoint.y) / c + .getView().getZoom()); + shiftY += shiftYChange; + return shiftY; + } + + public void mouseClicked(MouseEvent e) { + if (e.getButton() == 1 && e.getClickCount() == 2) { + if (e.getModifiersEx() == 0) { + NodeView nodeV = getNodeView(e); + MindMapNode node = nodeV.getModel(); + nodeV.setLocation(0, 0); + c.getModeController().moveNodePosition(node, node.getVGap(), 0, 0); + return; + } + if (e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK) { + NodeView nodeV = getNodeView(e); + MindMapNode node = nodeV.getModel().getParentNode(); + c.getModeController().moveNodePosition(node, MindMapNode.AUTO, node.getHGap(), node.getShiftY()); + return; + } + } + } + + /** + * @param e + * @return + */ + private NodeView getNodeView(MouseEvent e) { + return ((NodeMotionListenerView) e.getSource()).getMovedView(); + } + + public void mouseEntered(MouseEvent e) { + logger.fine("Event: mouseEntered"); + if (!isActive()) { + NodeMotionListenerView v = (NodeMotionListenerView) e.getSource(); + v.setMouseEntered(); + } + } + + public void mouseExited(MouseEvent e) { + logger.fine("Event: mouseExited"); + if (!isActive()) { + NodeMotionListenerView v = (NodeMotionListenerView) e.getSource(); + v.setMouseExited(); + } + } + + private void stopDrag() { + setDragStartingPoint(null,null); + } + + public void mouseReleased(MouseEvent e) { + logger.fine("Event: mouseReleased"); + NodeMotionListenerView v = (NodeMotionListenerView) e.getSource(); + if (!v.contains(e.getX(), e.getY())) + v.setMouseExited(); + if(!isActive()) + return; + NodeView nodeV = getNodeView(e); + Point point = e.getPoint(); + SwingUtilities.convertPointToScreen(point, nodeV); + // reset node to orignial position: + // move node to end position. + if ((e.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) == 0) { + MindMapNode node = nodeV.getModel(); + MindMapNode parentNode = nodeV.getModel().getParentNode(); + resetPositions(node, parentNode); + c.getModeController().moveNodePosition(node, + node.getVGap(), + getHGap(point, node, originalStartingPoint), + getNodeShiftY(point, node, originalStartingPoint)); + c.getModeController().moveNodePosition(parentNode, + parentNode.getVGap(), + parentNode.getHGap(), + parentNode.getShiftY()); + } else { + MindMapNode node = nodeV.getModel(); + MindMapNode parentNode = nodeV.getModel().getParentNode(); + resetPositions(node, parentNode); + c.getModeController().moveNodePosition(node, + node.getVGap(), + node.getHGap(), + node.getShiftY()); + c.getModeController().moveNodePosition(parentNode, + getVGap(point, parentNode, originalStartingPoint), + parentNode.getHGap(), + parentNode.getShiftY()); + } + stopDrag(); + } + + /** + * @param node + * @param parentNode + */ + private void resetPositions(MindMapNode node, MindMapNode parentNode) { + node.setVGap(originalVGap); + node.setHGap(originalHGap); + node.setShiftY(originalShiftY); + parentNode.setVGap(originalParentVGap); + parentNode.setHGap(originalParentHGap); + parentNode.setShiftY(originalParentShiftY); + } + + public boolean isActive() { + return getDragStartingPoint() != null; + } + + void setDragStartingPoint(Point point, MindMapNode node) { + if(this.dragStartingPoint == null) { + // store old values: + originalStartingPoint = new Point(point); + originalHGap = node.getHGap(); + originalVGap = node.getVGap(); + originalShiftY = node.getShiftY(); + if (!node.isRoot()) { + originalParentHGap = node.getParentNode().getHGap(); + originalParentVGap = node.getParentNode().getVGap(); + originalParentShiftY =node.getParentNode().getShiftY(); + } + } else if (point == null) { + originalStartingPoint = null; + originalHGap = 0; + originalVGap = 0; + originalShiftY = 0; + originalParentHGap = 0; + originalParentVGap = 0; + originalParentShiftY = 0; + } + this.dragStartingPoint = point; + } + + Point getDragStartingPoint() { + return dragStartingPoint; + } + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/NodeMouseMotionListener.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/NodeMouseMotionListener.java --- freemind-0.7.1/freemind/freemind/controller/NodeMouseMotionListener.java 2004-01-25 22:13:46.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/controller/NodeMouseMotionListener.java 2004-10-28 06:24:53.000000000 +0100 @@ -16,24 +16,20 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: NodeMouseMotionListener.java,v 1.15 2004/01/25 22:13:46 christianfoltin Exp $*/ +/*$Id: NodeMouseMotionListener.java,v 1.15.14.2 2004/10/28 05:24:53 christianfoltin Exp $*/ package freemind.controller; +import java.awt.Rectangle; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; -import java.awt.Rectangle; -import java.awt.geom.Rectangle2D; -import java.awt.Point; import java.awt.geom.Point2D; -import java.util.TimerTask; import java.util.Timer; -import freemind.view.mindmapview.NodeView; -import freemind.main.Tools; +import java.util.TimerTask; -// -import java.lang.Integer; +import freemind.main.Tools; +import freemind.view.mindmapview.NodeView; /** * The MouseMotionListener which belongs to every @@ -72,22 +68,30 @@ public NodeMouseMotionListener(Controller controller) { c = controller; if(logger == null) - logger = c.getFrame().getLogger("freemind.controller.NodeMouseMotionListener"); + logger = c.getFrame().getLogger(this.getClass().getName()); if(delayedSelectionEnabled == null) updateSelectionMethod(c); } public void mouseMoved(MouseEvent e) { logger.finest("Event: mouseMoved"); - // Invoked when the mouse button has been moved on a component (with no buttons down). - ((NodeView)e.getComponent()).updateCursor(e.getX()); - // test if still in selection region: - if(controlRegionForDelayedSelection != null && delayedSelectionEnabled.getValue()) { - if(!controlRegionForDelayedSelection.contains(e.getPoint())) { - // point is not in the region. start timer again and adjust region to the current point: - createTimer(e); - } - } + // Invoked when the mouse button has been moved on a component (with no + // buttons down). + NodeView node = (NodeView) e.getComponent(); + boolean isLink = (node).updateCursor(e.getX()); + // links are displayed in the status bar: + if (isLink) { + c.getFrame().out(c.getModeController().getLinkShortText(node.getModel())); + } + // test if still in selection region: + if (controlRegionForDelayedSelection != null + && delayedSelectionEnabled.getValue()) { + if (!controlRegionForDelayedSelection.contains(e.getPoint())) { + // point is not in the region. start timer again and adjust + // region to the current point: + createTimer(e); + } + } } /** Invoked when a mouse button is pressed on a component and then dragged. */ diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/StructuredMenuHolder.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/StructuredMenuHolder.java --- freemind-0.7.1/freemind/freemind/controller/StructuredMenuHolder.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/StructuredMenuHolder.java 2005-06-16 20:27:04.000000000 +0100 @@ -0,0 +1,492 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 21.05.2004 + */ +/*$Id: StructuredMenuHolder.java,v 1.1.4.7 2005/06/16 19:27:04 christianfoltin Exp $*/ + +package freemind.controller; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.Vector; + +import javax.swing.Action; +import javax.swing.Icon; +import javax.swing.JCheckBoxMenuItem; +import javax.swing.JLabel; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPopupMenu; +import javax.swing.JSeparator; +import javax.swing.JToolBar; +import javax.swing.SwingConstants; +import javax.swing.event.MenuEvent; +import javax.swing.event.MenuListener; + + +/** + * @author foltin + * + */ +public class StructuredMenuHolder { + +// Logging: + //private static java.util.logging.Logger logger = getFrame().getLogger(this.getClass().getName()); + + public static final int ICON_SIZE = 16; + private String mOutputString; + private static Icon blindIcon = new BlindIcon(ICON_SIZE); + + + private static final String SEPARATOR_TEXT = "000"; + private static final String ORDER_NAME = "/order"; + Map menuMap; + + private int mIndent; + public StructuredMenuHolder() { + menuMap = new HashMap(); + Vector order = new Vector(); + menuMap.put(ORDER_NAME, order); + } + + /** + * @param item + * @param category + * @return + */ + public JMenu addMenu(JMenu item, String category) { + StringTokenizer tokens = new StringTokenizer(category, "/"); + return (JMenu) addMenu(item, tokens); + } + + /** + * @param item + * @param category + * @return + */ + public JMenuItem addMenuItem(JMenuItem item, String category) { + StringTokenizer tokens = new StringTokenizer(category, "/"); + StructuredMenuItemHolder holder = new StructuredMenuItemHolder(); + holder.setAction(item.getAction()); + holder.setMenuItem(item); + addMenu(holder, tokens); + return item; + } + + /** + * @param item + * @param category + * @return + */ + public JMenuItem addAction(Action item, String category) { + StringTokenizer tokens = new StringTokenizer(category, "/"); + StructuredMenuItemHolder holder = new StructuredMenuItemHolder(); + holder.setAction(item); + holder.setMenuItem(new JMenuItem(item)); + addMenu(holder, tokens); + return holder.getMenuItem(); + } + + public void addCategory(String category) { + StringTokenizer tokens = new StringTokenizer(category+"/blank", "/"); + // with this call, the category is created. + MapTokenPair categoryPair = getCategoryMap(tokens, menuMap); + } + + public void addSeparator(String category) { + String sep = category; + if (!sep.endsWith("/")) { + sep += "/"; + } + sep += SEPARATOR_TEXT; + StringTokenizer tokens = new StringTokenizer(sep, "/"); + // separators can occur as doubles. + MapTokenPair categoryPair = getCategoryMap(tokens, menuMap); + // add an separator + categoryPair.map.put(categoryPair.token, new SeparatorHolder()); + categoryPair.order.add(categoryPair.token); + } + /** + * @param item + * @param category + * @param menuMap + */ + private Object addMenu(Object item, StringTokenizer tokens) { + MapTokenPair categoryPair = getCategoryMap(tokens, menuMap); + // add the item: + categoryPair.map.put(categoryPair.token, item); + categoryPair.order.add(categoryPair.token); + return item; + } + + private final class PrintMenuAdder implements MenuAdder { + public void addMenuItem(StructuredMenuItemHolder holder) { + print("JMenuItem '"+holder.getMenuItem().getActionCommand()+"'"); + } + public void addSeparator() { + print("Separator '"+"'"); + } +// public void addAction(Action action) { +// print("Action '"+action.getValue(Action.NAME)+"'"); +// } + public void addCategory(String category) { + print("Category: '"+category+"'"); + } + } + + private class MapTokenPair { + Map map; + String token; + Vector order; + MapTokenPair(Map map, String token, Vector order) { + this.map = map; + this.token = token; + this.order = order; + } + } + + private MapTokenPair getCategoryMap(StringTokenizer tokens, Map thisMap) { + if (tokens.hasMoreTokens()) { + String nextToken = tokens.nextToken(); + if(tokens.hasMoreTokens()) { + if(!thisMap.containsKey(nextToken)) { + Map newMap = new HashMap(); + Vector newOrder = new Vector(); + newMap.put(ORDER_NAME, newOrder); + thisMap.put(nextToken, newMap); + } + Map nextMap = (Map) thisMap.get(nextToken); + Vector order = (Vector) thisMap.get(ORDER_NAME); + if (!order.contains(nextToken)) { + order.add(nextToken); + } + return getCategoryMap(tokens, nextMap); + } else { + Vector order = (Vector)thisMap.get(ORDER_NAME); + return new MapTokenPair(thisMap, nextToken, order); + } + } + // error case? + return null; + } + + + public void updateMenus(final JMenuBar myItem, String prefix) { + + MapTokenPair pair = getCategoryMap(new StringTokenizer(prefix, "/"), menuMap); + Map myMap = (Map) pair.map.get(pair.token); + updateMenus(new MenuAdder() { + + public void addMenuItem(StructuredMenuItemHolder holder) { + myItem.add(holder.getMenuItem()); + } + + public void addSeparator() { + throw new NoSuchMethodError("addSeparator for JMenuBar"); + } + +// public void addAction(Action action) { +// throw new NoSuchMethodError("addAction for JMenuBar"); +// } + + public void addCategory(String category) { + }}, myMap, new DefaultMenuAdderCreator()); + } + + public void updateMenus(final JPopupMenu myItem, String prefix) { + MapTokenPair pair = getCategoryMap(new StringTokenizer(prefix, "/"), menuMap); + Map myMap = (Map) pair.map.get(pair.token); + updateMenus(new MenuAdder() { + + StructuredMenuListener listener = new StructuredMenuListener(); + + public void addMenuItem(StructuredMenuItemHolder holder) { + JMenuItem menuItem = holder.getMenuItem(); + adjustMenuItem(menuItem); + myItem.add(menuItem); + if (myItem instanceof MenuEventSupplier) { + MenuEventSupplier receiver = (MenuEventSupplier) myItem; + receiver.addMenuListener(listener); + listener.addItem(holder); + } + + } + + public void addSeparator() { + if(lastItemIsASeparator(myItem)) + return; + myItem.addSeparator(); + } + +// public void addAction(Action action) { +// myItem.add(action); +// } + + public void addCategory(String category) { + }}, myMap, new DefaultMenuAdderCreator()); + } + + /** + * @param bar + */ + public void updateMenus(final JToolBar bar, String prefix) { + MapTokenPair pair = getCategoryMap(new StringTokenizer(prefix, "/"), menuMap); + Map myMap = (Map) pair.map.get(pair.token); + updateMenus(new MenuAdder() { + + public void addMenuItem(StructuredMenuItemHolder holder) { + bar.add(holder.getAction()); + } + + public void addSeparator() { + // no separators to save place. But they look good. fc, 16.6.2005. + bar.addSeparator(); + } + +// public void addAction(Action action) { +// bar.add(action); +// } + + public void addCategory(String category) { + }}, myMap, new DefaultMenuAdderCreator()); + } + + + + private interface MenuAdder { + void addMenuItem(StructuredMenuItemHolder holder); + void addSeparator(); +// void addAction(Action action); + void addCategory(String category); + } + + private static class MenuItemAdder implements MenuAdder { + + private JMenu myItem; + + private StructuredMenuListener listener; + + public MenuItemAdder(JMenu myItem) { + this.myItem = myItem; + listener = new StructuredMenuListener(); + myItem.addMenuListener(listener); + } + + public void addMenuItem(StructuredMenuItemHolder holder) { + JMenuItem item = holder.getMenuItem(); + adjustMenuItem(item); + listener.addItem(holder); + myItem.add(item); + } + + public void addSeparator() { + if(lastItemIsASeparator(myItem)) { + return; + } + myItem.addSeparator(); + } + + // public void addAction(Action action) { + // myItem.add(action); + // } + + public void addCategory(String category) { + } + } + + /** + * @param item + */ + static private void adjustMenuItem(JMenuItem item) { + if (item.getIcon() == null) { + item.setIcon(blindIcon); + } else { + // align + if (item.getIcon().getIconWidth() < ICON_SIZE) { + item.setIconTextGap(item.getIconTextGap() + + (ICON_SIZE - item.getIcon().getIconWidth())); + } + } + } + + + private interface MenuAdderCreator { + MenuAdder createAdder(JMenu baseObject); + } + + private class DefaultMenuAdderCreator implements MenuAdderCreator { + + /* (non-Javadoc) + * @see freemind.controller.StructuredMenuHolder.MenuAdderCreator#createAdder(javax.swing.JMenu) + */ + public MenuAdder createAdder(JMenu baseObject) { + return new MenuItemAdder(baseObject); + } + } + + private class SeparatorHolder { + public SeparatorHolder() { + } + } + + private void updateMenus(MenuAdder menuAdder, Map thisMap, MenuAdderCreator factory) { + //System.out.println(thisMap); + // iterate through maps and do the changes: + Vector myVector = (Vector) thisMap.get(ORDER_NAME); + for (Iterator i = myVector.iterator(); i.hasNext();) { + String category = (String) i.next(); + // The "." target was handled earlier. + if(category.equals(".")) + continue; + Object nextObject = thisMap.get(category); + if(nextObject instanceof SeparatorHolder ) { + menuAdder.addSeparator(); + continue; + } + if (nextObject instanceof StructuredMenuItemHolder) { + StructuredMenuItemHolder holder = (StructuredMenuItemHolder) nextObject; + menuAdder.addMenuItem(holder); + }/*if(nextObject instanceof JMenuItem) { + menuAdder.addMenuItem((JMenuItem) nextObject); + } */ /*else if(nextObject instanceof Action){ + menuAdder.addAction((Action) nextObject); + } */ else if( nextObject instanceof Map) { + menuAdder.addCategory(category); + Map nextMap = (Map) nextObject; + MenuAdder nextItem ; + if(nextMap.containsKey(".")) { + // add this item to the current place: + JMenu baseObject = (JMenu) nextMap.get("."); + StructuredMenuItemHolder holder = new StructuredMenuItemHolder(); + holder.setMenuItem(baseObject); + menuAdder.addMenuItem(holder); + nextItem = factory.createAdder(baseObject); + } else { + nextItem = menuAdder; + } + mIndent++; + updateMenus(nextItem, nextMap, factory); + mIndent--; + } + } + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + public String toString() { + mIndent = 0; + mOutputString = ""; + updateMenus(new PrintMenuAdder(), menuMap, new PrintMenuAdderCreator()); + + return mOutputString; + } + + private class PrintMenuAdderCreator implements MenuAdderCreator { + + /* (non-Javadoc) + * @see freemind.controller.StructuredMenuHolder.MenuAdderCreator#createAdder(javax.swing.JMenu) + */ + public MenuAdder createAdder(JMenu baseObject) { + return new PrintMenuAdder(); + } + } + + + + private void print(String string) { + for(int i=0; i < mIndent; ++i) { + mOutputString+=(" "); + } + mOutputString += (string)+"\n"; + } + + public interface MenuEventSupplier { + void addMenuListener(MenuListener listener); + void removeMenuListener(MenuListener listener); + + } + public static class StructuredMenuListener implements + javax.swing.event.MenuListener { + private Vector menuItemHolder = new Vector(); + + public StructuredMenuListener() { + } + + public void menuSelected(MenuEvent arg0) { + //System.out.println("Selected menu items " + item); + for (Iterator i = menuItemHolder.iterator(); i.hasNext();) { + StructuredMenuItemHolder holder = (StructuredMenuItemHolder) i.next(); + if(holder.getEnabledListener() != null) { + boolean isEnabled = false; + try { + isEnabled = holder.getEnabledListener().isEnabled( + holder.getMenuItem(), holder.getAction()); + } catch (Exception e) { + // TODO: handle exception + } + holder.getMenuItem().setEnabled(isEnabled); + } + if(holder.getSelectedListener() != null) { + if (holder.getMenuItem() instanceof JCheckBoxMenuItem) { + JCheckBoxMenuItem checkItem = (JCheckBoxMenuItem) holder.getMenuItem(); + checkItem.setSelected(holder.getSelectedListener().isSelected(checkItem, holder.getAction())); + } + } + } + } + + public void menuDeselected(MenuEvent arg0) { + } + + public void menuCanceled(MenuEvent arg0) { + } + + public void addItem(StructuredMenuItemHolder holder) { + menuItemHolder.add(holder); + } + } + + public static boolean lastItemIsASeparator(JMenu menu) { + if(menu.getItemCount() >0){ + if(menu.getMenuComponents()[menu.getItemCount()-1] instanceof JSeparator) { + // no separator, if the last was such. + return true; + } + } + return false; + } + + public static boolean lastItemIsASeparator(JPopupMenu menu) { + if(menu.getComponentCount() >0){ + if(menu.getComponent(menu.getComponentCount()-1) instanceof JPopupMenu.Separator) { + // no separator, if the last was such. + return true; + } + } + return false; + } + + + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/controller/StructuredMenuItemHolder.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/controller/StructuredMenuItemHolder.java --- freemind-0.7.1/freemind/freemind/controller/StructuredMenuItemHolder.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/controller/StructuredMenuItemHolder.java 2004-10-18 00:00:07.000000000 +0100 @@ -0,0 +1,71 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 15.07.2004 + */ +/*$Id: StructuredMenuItemHolder.java,v 1.1.4.1 2004/10/17 23:00:07 dpolivaev Exp $*/ +package freemind.controller; + +import javax.swing.Action; +import javax.swing.JMenuItem; + + +public class StructuredMenuItemHolder { + private JMenuItem menuItem; + private Action action; + private MenuItemEnabledListener enabledListener; + private MenuItemSelectedListener selectedListener; + + public StructuredMenuItemHolder() { + } + public Action getAction() { + return action; + } + public void setAction(Action action) { + this.action = action; + if (action instanceof MenuItemEnabledListener) { + MenuItemEnabledListener listener = (MenuItemEnabledListener) action; + setEnabledListener(listener); + } + if (action instanceof MenuItemSelectedListener) { + MenuItemSelectedListener listener = (MenuItemSelectedListener) action; + setSelectedListener(listener); + } + } + public MenuItemEnabledListener getEnabledListener() { + return enabledListener; + } + public void setEnabledListener( + MenuItemEnabledListener enabledListener) { + this.enabledListener = enabledListener; + } + public JMenuItem getMenuItem() { + return menuItem; + } + public void setMenuItem(JMenuItem menuItem) { + this.menuItem = menuItem; + } + public MenuItemSelectedListener getSelectedListener() { + return selectedListener; + } + public void setSelectedListener( + MenuItemSelectedListener selectedListener) { + this.selectedListener = selectedListener; + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/extensions/ExportHook.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/extensions/ExportHook.java --- freemind-0.7.1/freemind/freemind/extensions/ExportHook.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/extensions/ExportHook.java 2005-07-03 00:19:38.000000000 +0100 @@ -0,0 +1,147 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 16.10.2004 + */ +/*$Id: ExportHook.java,v 1.1.4.5 2005/07/02 23:19:38 christianfoltin Exp $*/ + +package freemind.extensions; + +import java.awt.Container; +import java.awt.Graphics; +import java.awt.Rectangle; +import java.awt.image.BufferedImage; +import java.io.File; +import java.text.MessageFormat; + +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; +import javax.swing.filechooser.FileFilter; + +import freemind.main.Tools; +import freemind.modes.NodeAdapter; +import freemind.view.mindmapview.MapView; + +/** + * @author foltin + * + */ +public class ExportHook extends ModeControllerHookAdapter { + private MapView view; + + /** + * @param type + * @param description + * @return + */ + protected File chooseFile(String type, String description) { + Container component = getController().getFrame().getContentPane(); + JFileChooser chooser = null; + chooser = new JFileChooser(); + File mmFile = getController().getMap().getFile(); + if (mmFile!=null) { + String proposedName = mmFile.getAbsolutePath().replaceFirst( + "\\.[^.]*?$", "") + + "." + type; + chooser.setSelectedFile(new File(proposedName)); + } + + chooser.addChoosableFileFilter(new ImageFilter(type, description)); + // chooser.setDialogTitle(label); + int returnVal = chooser.showSaveDialog(component); + if (returnVal != JFileChooser.APPROVE_OPTION) { // not ok pressed + return null; + } + + // |= Pressed O.K. + File chosenFile = chooser.getSelectedFile(); + String ext = Tools.getExtension(chosenFile.getName()); + if (!Tools.safeEqualsIgnoreCase(ext, type)) { + chosenFile = new File(chosenFile.getParent(), chosenFile.getName() + "." + type); + } + + if (chosenFile.exists()) { // If file exists, ask before overwriting. + String overwriteText= MessageFormat.format(getController().getText("file_already_exists"), + new Object[] {chosenFile.toString()}); + int overwriteMap = JOptionPane.showConfirmDialog(component, overwriteText, overwriteText, JOptionPane.YES_NO_OPTION); + if (overwriteMap != JOptionPane.YES_OPTION) { + return null; + } + } + return chosenFile; + } + + public static class ImageFilter extends FileFilter { + private String type; + private final String description; + public ImageFilter(String type, String description) { + this.type = type; + this.description = description; + } + + public boolean accept(File f) { + if (f.isDirectory()) { + return true; + } + String extension = Tools.getExtension(f.getName()); + return Tools.safeEqualsIgnoreCase(extension, type); + } + + public String getDescription() { + return description==null?type:description; + } + } + + + public BufferedImage createBufferedImage() { + view = getController().getView(); + if (view == null) + return null; + + //Determine which part of the view contains the nodes of the map: + //(Needed to eliminate areas of whitespace around the actual rendering of the map) + + NodeAdapter root = (NodeAdapter) getController().getMap().getRoot(); + Rectangle innerBounds = view.getInnerBounds(root.getViewer()); + + //Create an image containing the map: + BufferedImage myImage = (BufferedImage) view.createImage(view.getWidth(), view.getHeight() ); + + //Render the mind map nodes on the image: + Graphics g = myImage.getGraphics(); + g.clipRect(innerBounds.x, innerBounds.y, innerBounds.width, innerBounds.height); + view.print(g); + myImage = myImage.getSubimage(innerBounds.x, innerBounds.y, innerBounds.width, innerBounds.height); + return myImage; +// NodeAdapter root = (NodeAdapter) getController().getMap().getRoot(); +// Rectangle rect = view.getInnerBounds(root.getViewer()); +// +// BufferedImage image = +// new BufferedImage( +// rect.width, +// rect.height, +// BufferedImage.TYPE_INT_RGB); +// Graphics2D g = (Graphics2D) image.createGraphics(); +// g.translate(-rect.getMinX(), -rect.getMinY()); +// view.update(g); +// return image; + } + + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/extensions/HookAdapter.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/extensions/HookAdapter.java --- freemind-0.7.1/freemind/freemind/extensions/HookAdapter.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/extensions/HookAdapter.java 2005-04-08 22:37:30.000000000 +0100 @@ -0,0 +1,124 @@ +/* + * Created on 29.02.2004 + * + */ +package freemind.extensions; + +import java.net.URL; +import java.util.Properties; + +import freemind.modes.ControllerAdapter; +import freemind.modes.MindMap; +import freemind.modes.ModeController; + +/** Implments MindMapHook as an Adapter class. + * Implementation is straight forward. + * + * @author foltin + * + */ +public class HookAdapter implements MindMapHook { + + private String name; + private Properties properties; + private ModeController controller; + + // Logging: + protected java.util.logging.Logger logger; + /** + * Stores the plugin base class as declared by the plugin_registration/isBaseClass + * attribute. + */ + private Object baseClass; + + /** + */ + public HookAdapter() { + baseClass=null; + } + /* (non-Javadoc) + * @see freemind.modes.NodeHook#getName() + */ + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + /* (non-Javadoc) + * @see freemind.modes.NodeHook#startupMapHook(java.lang.String) + */ + public void startupMapHook() { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see freemind.modes.NodeHook#shutdownMapHook() + */ + public void shutdownMapHook() { + controller = null; + } + + /** + * @return + */ + protected ModeController getController() { + return controller; + } + + /** + * @return + */ + protected Properties getProperties() { + return properties; + } + + /** + * @param properties + */ + public void setProperties(Properties properties) { + this.properties = properties; + } + + + /** + * @param controller + */ + public void setController(ModeController controller) { + this.controller = controller; + if(logger == null) + logger = ((ControllerAdapter)getController()).getFrame().getLogger(this.getClass().getName()); + } + /* (non-Javadoc) + * @see freemind.extensions.MindMapHook#getResourceString(java.lang.String) + */ + public String getResourceString(String property) { + String result = properties.getProperty(property); + if(result == null) { + result = getController().getText(property); + } + if(result == null) { + logger.warning("The following property was not found:"+property); + } + return result; + } + + public URL getResource(String resourceName) { + return this.getClass().getClassLoader().getResource(resourceName); + } + /* (non-Javadoc) + * @see freemind.extensions.MindMapHook#getPluginBaseClass() + */ + public Object getPluginBaseClass() { + return baseClass; + } + /* (non-Javadoc) + * @see freemind.extensions.MindMapHook#setPluginBaseClass(java.lang.Object) + */ + public void setPluginBaseClass(Object baseClass) { + this.baseClass = baseClass; + } + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/extensions/HookDescriptor.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/extensions/HookDescriptor.java --- freemind-0.7.1/freemind/freemind/extensions/HookDescriptor.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/extensions/HookDescriptor.java 2004-11-16 16:42:35.000000000 +0000 @@ -0,0 +1,132 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 22.07.2004 + */ +/*$Id: HookDescriptor.java,v 1.1.4.2 2004/11/16 16:42:35 christianfoltin Exp $*/ +package freemind.extensions; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Properties; +import java.util.Vector; + +import freemind.controller.actions.generated.instance.Plugin; +import freemind.controller.actions.generated.instance.PluginActionType; +import freemind.controller.actions.generated.instance.PluginMenuType; +import freemind.controller.actions.generated.instance.PluginModeType; +import freemind.controller.actions.generated.instance.PluginPropertyType; +import freemind.main.FreeMindMain; + + +class HookDescriptor { + private Properties properties; + public Vector menuPositions; + private Vector modes; + private PluginActionType pluginAction; + private final Plugin pluginBase; + private final FreeMindMain frame; + public HookDescriptor(FreeMindMain frame, PluginActionType pluginAction, Plugin pluginBase) { + this.frame = frame; + this.pluginAction = pluginAction; + this.pluginBase = pluginBase; + if (pluginAction.getName() == null) { + pluginAction.setName(pluginAction.getLabel()); + } + menuPositions = new Vector(); + for (Iterator i = pluginAction.getPluginMenu().iterator(); i.hasNext();) { + PluginMenuType menu = (PluginMenuType) i.next(); + menuPositions.add(menu.getLocation()); + } + properties = new Properties(); + for (Iterator i = pluginAction.getPluginProperty().iterator(); i.hasNext();) { + PluginPropertyType property = (PluginPropertyType) i.next(); + properties.put(property.getName(), property.getValue()); + } + modes = new Vector(); + for (Iterator i = pluginAction.getPluginMode().iterator(); i.hasNext();) { + PluginModeType mode = (PluginModeType) i.next(); + modes.add(mode.getClassName()); + } + } + public String toString() { + return "[HookDescriptor props=" + + properties + + ", menu positions=" + + menuPositions + + "]"; + } + public HookInstanciationMethod getInstanciationMethod() { + if (pluginAction.getInstanciation() != null) { + HashMap allInstMethods = HookInstanciationMethod + .getAllInstanciationMethods(); + for (Iterator i = allInstMethods.keySet().iterator(); i.hasNext();) { + String name = (String) i.next(); + if (pluginAction.getInstanciation().equalsIgnoreCase(name)) { + return (HookInstanciationMethod) allInstMethods.get(name); + } + } + } + // this is an error case? + return HookInstanciationMethod.Other; + } + public Vector getModes() { + return modes; + } + public String getBaseClass() { + return pluginAction.getBase(); + } + public String getName() { + return getFromResourceIfNecessary(pluginAction.getName()); + } + /** + * @param name + * @return + */ + private String getFromResourceIfNecessary(String string) { + if(string==null) { + return string; + } + if(string.startsWith("%")) { + return frame.getController().getResourceString(string.substring(1)); + } + return string; + } + public String getClassName() { + return pluginAction.getClassName(); + } + public String getDocumentation() { + return getFromResourceIfNecessary(pluginAction.getDocumentation()); + } + public String getIconPath() { + return pluginAction.getIconPath(); + } + public String getKeyStroke() { + return pluginAction.getKeyStroke(); + } + public Plugin getPluginBase(){ + return pluginBase; + } + /** + * @return + */ + public Properties getProperties() { + return properties; + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/extensions/HookFactory.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/extensions/HookFactory.java --- freemind-0.7.1/freemind/freemind/extensions/HookFactory.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/extensions/HookFactory.java 2005-04-17 09:29:06.000000000 +0100 @@ -0,0 +1,503 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2001 Joerg Mueller + *See COPYING for Details + * + *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. + */ +/*$Id: HookFactory.java,v 1.1.4.8 2005/04/17 08:29:06 christianfoltin Exp $*/ +package freemind.extensions; + +import java.io.File; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Vector; + +import javax.swing.AbstractAction; +import javax.swing.ImageIcon; +import javax.swing.JMenuItem; +import javax.swing.KeyStroke; +import javax.xml.bind.Unmarshaller; + +import freemind.common.JaxbTools; +import freemind.controller.actions.generated.instance.Plugin; +import freemind.controller.actions.generated.instance.PluginActionType; +import freemind.controller.actions.generated.instance.PluginClasspathType; +import freemind.controller.actions.generated.instance.PluginModeType; +import freemind.controller.actions.generated.instance.PluginRegistrationType; +import freemind.main.FreeMindMain; +import freemind.modes.MindMapNode; + +/** + * @author christianfoltin + * + * @file HookFactory.java + * @package freemind.modes + */ +/** + * @author foltin + * + */ +public class HookFactory { + /** + * Match xml files in the accessories/plugin directory and not in its + * subdirectories. + */ + private static final String pluginPrefixRegEx = "(accessories\\.|)plugins\\.[^.]*"; + + private FreeMindMain frame; + + // Logging: + private java.util.logging.Logger logger; + + private HashMap pluginInfo; + + private Vector allPlugins; + + /** Contains PluginRegistrationType -> PluginType relations. */ + private HashMap allRegistrations; + + /** Contains PluginType -> Object (baseClass) relations. */ + private HashMap allRegistrationInstances; + + private ImportWizard importWizard; + + /** + * + */ + public HookFactory(FreeMindMain frame) { + this.frame = frame; + logger = frame.getLogger(this.getClass().getName()); + allRegistrationInstances = new HashMap(); + } + + /** + * @return a string vector with representatives for plugins. + */ + public Vector getPossibleNodeHooks(Class mode) { + return searchFor(NodeHook.class, mode); + } + + /** + * @return a string vector with representatives for plugins. + */ + public Vector getPossibleModeControllerHooks(Class mode) { + return searchFor(ModeControllerHook.class, mode); + } + + /** + * @param class1 + * @param mode + * @return a string vector with representatives for plugins. + */ + private Vector searchFor(Class baseClass, Class mode) { + actualizePlugins(); + Vector returnValue = new Vector(); + for (Iterator i = allPlugins.iterator(); i.hasNext();) { + String label = (String) i.next(); + HookDescriptor descriptor = getHookDescriptor(label); + //Properties prop = descriptor.properties; + try { + logger.finest("Loading: " + label); + if (baseClass.isAssignableFrom(Class.forName(descriptor + .getBaseClass()))) { + // the plugin inherits from the baseClass, we carry on to + // look for the mode + for (Iterator j = descriptor.getModes().iterator(); j + .hasNext();) { + String pmode = (String) j.next(); + if (pmode.equals(mode.getPackage().getName())) { + // add the class: + returnValue.add(label); + } + + } + } + } catch (ClassNotFoundException e) { + logger.severe("Class not found."); + e.printStackTrace(); + } + } + return returnValue; + } + + /** + * + */ + private void actualizePlugins() { + if (importWizard == null) { + importWizard = new ImportWizard(); + importWizard.CLASS_LIST.clear(); + importWizard.buildClassList(); + } + pluginInfo = new HashMap(); + allPlugins = new Vector(); + allRegistrations = new HashMap(); + // the unmarshaller: + Unmarshaller unmarshaller = JaxbTools.getInstance() + .createUnmarshaller(); + // the loop + for (Iterator i = importWizard.CLASS_LIST.iterator(); i.hasNext();) { + String xmlPluginFile = (String) i.next(); + if (xmlPluginFile.matches(pluginPrefixRegEx)) { + // make file name: + xmlPluginFile = xmlPluginFile.replace('.', '/') /* + * Here, this is + * not the + * File.separatorChar!!! + */ + + importWizard.lookFor; + // this is one of our plugins: + URL pluginURL = getClassLoader(Collections.EMPTY_LIST) + .getResource(xmlPluginFile); + // unmarshal xml: + Plugin plugin = null; + try { + logger.finest("Reading: " + xmlPluginFile + " from " + + pluginURL); + InputStream in = pluginURL.openStream(); + unmarshaller.setValidating(true); + plugin = (Plugin) unmarshaller.unmarshal(in); + } catch (Exception e) { + // error case + logger.severe(e.getLocalizedMessage()); + e.printStackTrace(); + continue; + } + // plugin is loaded. + for (Iterator j = plugin.getPluginAction().iterator(); j + .hasNext();) { + PluginActionType action = (PluginActionType) j.next(); + pluginInfo.put(action.getLabel(), new HookDescriptor(frame, + action, plugin)); + allPlugins.add(action.getLabel()); + } + for (Iterator k = plugin.getPluginRegistration().iterator(); k + .hasNext();) { + PluginRegistrationType registration = (PluginRegistrationType) k + .next(); + allRegistrations.put(registration, plugin); + + } + } + } + } + + public ModeControllerHook createModeControllerHook(String hookName) { + HookDescriptor descriptor = getHookDescriptor(hookName); + return (ModeControllerHook) createJavaHook(hookName, descriptor); + } + + private MindMapHook createJavaHook(String hookName, + HookDescriptor descriptor) { + try { + // construct class loader: + List pluginClasspathList = descriptor.getPluginBase() + .getPluginClasspath(); + ClassLoader loader = getClassLoader(pluginClasspathList); + // constructed. + Class hookClass = Class.forName(descriptor.getClassName(), true, + loader); + MindMapHook hook = (MindMapHook) hookClass.newInstance(); + decorateHook(hookName, descriptor, hook); + return hook; + } catch (Exception e) { + logger + .severe("Error occurred loading hook: " + + descriptor.getClassName() + "\nException:" + + e.toString()); + return null; + } + } + + private HashMap classLoaderCache = new HashMap(); + + /** + * @param pluginClasspathList + * @return + * @throws MalformedURLException + */ + private ClassLoader getClassLoader(List pluginClasspathList) { + String key = createPluginClasspathString(pluginClasspathList); + if (classLoaderCache.containsKey(key)) + return (ClassLoader) classLoaderCache.get(key); + try { + URL[] urls = new URL[pluginClasspathList.size() + 1]; + int j = 0; + //logger.info("freemind.base.dir is " + getFreemindBaseDir()); + urls[j++] = new File(getFreemindBaseDir()).toURL(); + for (Iterator i = pluginClasspathList.iterator(); i.hasNext();) { + PluginClasspathType classPath = (PluginClasspathType) i.next(); + // new version of classpath resolution suggested by ewl under + // patch [ 1154510 ] Be able to give absolute classpath entries in plugin.xml + File file = new File(classPath.getJar()); + if (! file.isAbsolute()) { + file = new File(getFreemindBaseDir(), + classPath.getJar()); + } + // end new version by ewl. +// File file = new File(getFreemindBaseDir() + File.separator +// + classPath.getJar()); + logger.info("file " + file.toString() + " exists = " + + file.exists()); + urls[j++] = file.toURL(); + } + ClassLoader loader = new URLClassLoader(urls, this.getClass() + .getClassLoader()); + classLoaderCache.put(key, loader); + return loader; + } catch (MalformedURLException e) { + logger.severe(e.getMessage()); + return this.getClass().getClassLoader(); + } + } + + /** This string is used to identify known classloaders as they + * are cached. + * + * @param pluginClasspathList + * @return + */ + private String createPluginClasspathString(List pluginClasspathList) { + String result = ""; + for (Iterator i = pluginClasspathList.iterator(); i.hasNext();) { + PluginClasspathType type = (PluginClasspathType) i.next(); + result += type.getJar() + ","; + } + return result; + } + + /** + * @return + */ + public static String getFreemindBaseDir() { + return System.getProperty("freemind.base.dir", "."); + } + + /** + * Do not call this method directly. Call ModeController.createNodeHook + * instead. + */ + public NodeHook createNodeHook(String hookName) { + logger.finest("CreateNodeHook: " + hookName); + HookDescriptor descriptor = getHookDescriptor(hookName); + return (NodeHook) createJavaHook(hookName, descriptor); + } + + /** + * @param node + * @param hookName + * @return null if not present, the hook otherwise. + */ + public PermanentNodeHook getHookInNode(MindMapNode node, String hookName) { + // search for already instanciated hooks of this type: + for (Iterator i = node.getActivatedHooks().iterator(); i.hasNext();) { + PermanentNodeHook otherHook = (PermanentNodeHook) i.next(); + if (otherHook.getName().equals(hookName)) { + // there is already one instance. + return otherHook; + } + } + return null; + } + + private void decorateHook(String hookName, HookDescriptor descriptor, + MindMapHook hook) { + hook.setProperties(descriptor.getProperties()); + hook.setName(hookName); + Object baseClass = getPluginBaseClass(descriptor); + hook.setPluginBaseClass(baseClass); + } + + /** + * @param descriptor + * @return + */ + private Object getPluginBaseClass(HookDescriptor descriptor) { + // test if registration is present: + Object baseClass = null; + if(allRegistrationInstances.containsKey(descriptor.getPluginBase())){ + baseClass = allRegistrationInstances.get(descriptor.getPluginBase()); + } + return baseClass; + } + + /** + * @return + */ + protected FreeMindMain getFrame() { + return frame; + } + + public String getProperty(String hookName, String prop) { + HookDescriptor descriptor = getHookDescriptor(hookName); + return descriptor.getProperties().getProperty(prop); + } + + /** + * @param action + */ + public void decorateAction(String hookName, AbstractAction action) { + HookDescriptor descriptor = getHookDescriptor(hookName); + String name = descriptor.getName(); + if (name != null) { + action.putValue(AbstractAction.NAME, name); + } else { + action.putValue(AbstractAction.NAME, descriptor.getClassName()); + } + String docu = descriptor.getDocumentation(); + if (docu != null) { + action.putValue(AbstractAction.SHORT_DESCRIPTION, docu); + action.putValue(AbstractAction.LONG_DESCRIPTION, docu); + } + String icon = descriptor.getIconPath(); + if (icon != null) { + ImageIcon imageIcon = new ImageIcon(getClassLoader( + Collections.EMPTY_LIST).getResource(icon)); + action.putValue(AbstractAction.SMALL_ICON, imageIcon); + } + String key = descriptor.getKeyStroke(); + if (key != null) + action.putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke + .getKeyStroke(key)); + + } + + /** + * @return returns a list of menu position strings for the + * StructuredMenuHolder. + */ + public List getHookMenuPositions(String hookName) { + HookDescriptor descriptor = getHookDescriptor(hookName); + return descriptor.menuPositions; + } + + /** + * This method takes into account, that there are on off hooks that need a + * special treatment for their menues like adjusting the checkbox. + * + * @param hookAction + * @return returns a new JMenuItem for the given hookAction. + */ + public JMenuItem getHookMenuItem(String hookName, AbstractAction hookAction) { + return new JMenuItem(hookAction); + } + + /** + * @param permHook + * @return + */ + public HookInstanciationMethod getInstanciationMethod(String hookName) { + HookDescriptor descriptor = getHookDescriptor(hookName); + return descriptor.getInstanciationMethod(); + } + + public static class RegistrationContainer { + public Class hookRegistrationClass; + + public boolean isPluginBase; + + public Plugin correspondingPlugin; + + RegistrationContainer() { + // package protected constructor. + } + } + + /** + * Each Plugin can have a list of HookRegistrations that are called after + * the corresponding mode is enabled. (Like singletons.) One of these can + * operate as the pluginBase that is accessible to every normal + * plugin_action via the getPluginBaseClass method. + * + * @return A list of RegistrationContainer elements. The field + * hookRegistrationClass of RegistrationContainer is a class that is + * (probably) of HookRegistration type. You have to register every + * registration via the registerRegistrationContainer method when + * instanciated (this is typically done in the ModeController). + */ + public List getRegistrations(Class mode) { + actualizePlugins(); + Vector returnValue = new Vector(); + for (Iterator i = allRegistrations.keySet().iterator(); i.hasNext();) { + PluginRegistrationType registration = (PluginRegistrationType) i + .next(); + boolean modeFound = false; + for (Iterator j = (registration.getPluginMode()).iterator(); j + .hasNext();) { + PluginModeType possibleMode = (PluginModeType) j.next(); + if (mode.getPackage().getName().equals( + possibleMode.getClassName())) { + modeFound = true; + } + } + if (!modeFound) + continue; + try { + Plugin plugin = (Plugin) allRegistrations.get(registration); + ClassLoader loader = getClassLoader(plugin.getPluginClasspath()); + RegistrationContainer container = new RegistrationContainer(); + Class hookRegistrationClass = Class.forName(registration + .getClassName(), true, loader); + container.hookRegistrationClass = hookRegistrationClass; + container.correspondingPlugin = plugin; + container.isPluginBase = registration.isIsPluginBase(); + returnValue.add(container); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + } + return returnValue; + } + + /** See getRegistrations. + * @param container + * @param instanciatedRegistrationObject + */ + public void registerRegistrationContainer(RegistrationContainer container, + HookRegistration instanciatedRegistrationObject) { + // registration only for pluginBases. + if (container.isPluginBase) { + allRegistrationInstances.put(container.correspondingPlugin, + instanciatedRegistrationObject); + } + } + + /** + * @param hookName + * @return the base class if declared and successfully instanciated + * or NULL. + */ + public Object getPluginBaseClass(String hookName) { + logger.finest("getPluginBaseClass: " + hookName); + HookDescriptor descriptor = getHookDescriptor(hookName); + return getPluginBaseClass(descriptor); + } + + /** + * @param hookName + */ + private HookDescriptor getHookDescriptor(String hookName) { + HookDescriptor descriptor = (HookDescriptor) pluginInfo.get(hookName); + if (hookName == null || descriptor == null) + throw new IllegalArgumentException("Unknown hook name " + hookName); + return descriptor; + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/extensions/HookInstanciationMethod.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/extensions/HookInstanciationMethod.java --- freemind-0.7.1/freemind/freemind/extensions/HookInstanciationMethod.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/extensions/HookInstanciationMethod.java 2004-10-18 00:00:07.000000000 +0100 @@ -0,0 +1,158 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 22.07.2004 + */ +/*$Id: HookInstanciationMethod.java,v 1.1.4.1 2004/10/17 23:00:07 dpolivaev Exp $*/ +package freemind.extensions; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Vector; + +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; + + +public class HookInstanciationMethod { + private static interface DestinationNodesGetter { + Collection getDestinationNodes(ModeController controller, MindMapNode focussed, List selecteds); + MindMapNode getCenterNode(ModeController controller, MindMapNode focussed, List selecteds); + } + private static class DefaultDestinationNodesGetter implements DestinationNodesGetter { + public Collection getDestinationNodes(ModeController controller, MindMapNode focussed, List selecteds) { + return selecteds; + } + + public MindMapNode getCenterNode(ModeController controller, MindMapNode focussed, List selecteds) { + return focussed; + } + } + private static class RootDestinationNodesGetter implements DestinationNodesGetter { + public Collection getDestinationNodes(ModeController controller, MindMapNode focussed, List selecteds) { + Vector returnValue = new Vector(); + returnValue.add(controller.getMap().getRoot()); + return returnValue; + } + public MindMapNode getCenterNode(ModeController controller, MindMapNode focussed, List selecteds) { + return (MindMapNode) controller.getMap().getRoot(); + } + } + private static class AllDestinationNodesGetter implements DestinationNodesGetter { + private void addChilds(MindMapNode node, Collection allNodeCollection) { + allNodeCollection.add(node); + for (Iterator i = node.childrenFolded(); i.hasNext();) { + MindMapNode child = (MindMapNode) i.next(); + addChilds(child, allNodeCollection); + } + } + public Collection getDestinationNodes(ModeController controller, MindMapNode focussed, List selecteds) { + Vector returnValue = new Vector(); + addChilds((MindMapNode) controller.getMap().getRoot(), returnValue); + return returnValue; + } + public MindMapNode getCenterNode(ModeController controller, MindMapNode focussed, List selecteds) { + return focussed; + } + + } + private boolean isSingleton; + private DestinationNodesGetter getter; + private final boolean isPermanent; + private final boolean isUndoable; + + public boolean isSingleton() { + return isSingleton; + } + /** + * @return Returns the isPermanent. + */ + public boolean isPermanent() { + return isPermanent; + } + private HookInstanciationMethod(boolean isPermanent, boolean isSingleton, DestinationNodesGetter getter, boolean isUndoable){ + this.isPermanent = isPermanent; + this.isSingleton = isSingleton; + this.getter = getter; + this.isUndoable = isUndoable; + } + static final public HookInstanciationMethod Once = new HookInstanciationMethod(true, true, new DefaultDestinationNodesGetter(), true); + /** The hook should only be added/removed to the root node. */ + static final public HookInstanciationMethod OnceForRoot = new HookInstanciationMethod(true, true, new RootDestinationNodesGetter(), true); + /** Each (or none) node should have the hook. */ + static final public HookInstanciationMethod OnceForAllNodes = new HookInstanciationMethod(true, true, new AllDestinationNodesGetter(), true); + /** This is for MindMapHooks in general. + * Here, no undo- or redoaction are performed, the undo information is given by the actions + * the hook performs.*/ + static final public HookInstanciationMethod Other = new HookInstanciationMethod(false, false, new DefaultDestinationNodesGetter(), false); + /** This is for MindMapHooks that wish to be applied to root, whereevery they are called from. + * Here, no undo- or redoaction are performed, the undo information is given by the actions + * the hook performs.*/ + static final public HookInstanciationMethod ApplyToRoot = new HookInstanciationMethod(false, false, new RootDestinationNodesGetter(), false); + static final public HashMap getAllInstanciationMethods() { + HashMap res = new HashMap(); + res.put("Once", Once); + res.put("OnceForRoot", OnceForRoot); + res.put("OnceForAllNodes", OnceForAllNodes); + res.put("Other", Other); + res.put("ApplyToRoot", ApplyToRoot); + return res; + } + /** + * @param focussed + * @param selecteds + * @return + */ + public Collection getDestinationNodes(ModeController controller, MindMapNode focussed, List selecteds) { + return getter.getDestinationNodes(controller, focussed, selecteds); + } + /** + * @param controller + * @param hookName + * @param adaptedFocussedNode + * @param destinationNodes + * @return + */ + public boolean isAlreadyPresent(ModeController controller, String hookName, MindMapNode focussed, Collection destinationNodes) { + for (Iterator i = focussed.getActivatedHooks().iterator(); i.hasNext();) { + PermanentNodeHook hook = (PermanentNodeHook) i.next(); + if(hookName.equals(hook.getName())) { + return true; + } + } + return false; + } + /** + * @param controller + * @param focussed + * @param selecteds + * @return + */ + public MindMapNode getCenterNode(ModeController controller, MindMapNode focussed, List selecteds) { + return getter.getCenterNode(controller, focussed, selecteds); + } + /** + * @return + */ + public boolean isUndoable() { + return isUndoable; + } +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/extensions/HookRegistration.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/extensions/HookRegistration.java --- freemind-0.7.1/freemind/freemind/extensions/HookRegistration.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/extensions/HookRegistration.java 2004-10-18 00:00:07.000000000 +0100 @@ -0,0 +1,36 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 12.08.2004 + */ +/*$Id: HookRegistration.java,v 1.1.4.1 2004/10/17 23:00:07 dpolivaev Exp $*/ + +package freemind.extensions; + + +/** + * @author foltin + * + */ +public interface HookRegistration { + + void register(); + void deRegister(); + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/extensions/ImportWizard.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/extensions/ImportWizard.java --- freemind-0.7.1/freemind/freemind/extensions/ImportWizard.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/extensions/ImportWizard.java 2005-04-12 22:12:14.000000000 +0100 @@ -0,0 +1,222 @@ +/* + * ImportWizard.java + * Copyright (C) 1999 Len Trigg (trigg@cs.waikato.ac.nz) + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +// adapted to freemind by christianfoltin, 29.2.2004. +// taken from /usr/share/xemacs/xemacs-packages/etc/jde/java/src/jde/wizards/ImportWizard.java +// changed: package name, commented out the static method. +// if (current.toLowerCase().endsWith(".properties")) { +// // formerly ".class" +// and related changes. +// commented out: // For Java 2! ... + +package freemind.extensions; + +import java.io.File; +import java.util.Enumeration; +import java.util.StringTokenizer; +import java.util.Vector; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +/** + * Converts an unqualified class name to import statements by scanning + * through the classpath. + * + * @author Len Trigg (trigg@cs.waikato.ac.nz) + * @version 1.0 - 6 May 1999 + */ +public class ImportWizard { + + public final String lookFor = ".xml"; + /** Stores the list of all classes in the classpath */ + public Vector CLASS_LIST = new Vector(500); + + /** Build the list of classes */ + // static { + // + // // System.err.println("Making class list"); + // buildClassList(); + // + // // System.err.println("Done (" + CLASS_LIST.size() + " classes)"); + // + // } + + public void buildClassList() { + String classPath = System.getProperty("java.class.path"); + String classPathSeparator = File.pathSeparator; + // add the current dir to find more plugins + classPath=HookFactory.getFreemindBaseDir()+classPathSeparator+classPath; + + StringTokenizer st = new StringTokenizer(classPath, classPathSeparator); + while (st.hasMoreTokens()) { + String classPathEntry = st.nextToken(); + File classPathFile = new File(classPathEntry); + if (classPathFile.exists()) { + if (classPathEntry.toLowerCase().endsWith(".jar")) { + addClassesFromZip(CLASS_LIST, classPathFile); + } else if (classPathEntry.toLowerCase().endsWith(".zip")) { + addClassesFromZip(CLASS_LIST, classPathFile); + } else if (classPathFile.isDirectory()) { + addClassesFromDir(CLASS_LIST, classPathFile, classPathFile); + } + } + } + + } + + /** + * Adds the classes from the supplied Zip file to the class list. + * + * @param classList the Vector to add the classes to + * @param classPathFile the File to scan as a zip file + */ + public void addClassesFromZip( + Vector classList, + File classPathFile) { + // System.out.println("Processing jar/zip file: " + classPathFile); + + try { + ZipFile zipFile = new ZipFile(classPathFile); + Enumeration enumeration = zipFile.entries(); + while (enumeration.hasMoreElements()) { + ZipEntry zipEntry = (ZipEntry) enumeration.nextElement(); + String current = zipEntry.getName(); + if (current.toLowerCase().endsWith(lookFor)) { + current = + current.substring( + 0, + current.length() - lookFor.length()); + current = current.replace('/', '.'); + current = current.replace('\\', '.'); + classList.addElement(current); + } + } + } catch (Exception ex) { + System.err.println( + "Problem opening " + classPathFile + " with zip."); + } + } + + /** + * Adds the classes from the supplied directory to the class list. + * + * @param classList the Vector to add the classes to + * @param classPathFile the File to recursively scan as a directory + */ + public void addClassesFromDir( + Vector classList, + File rootDir, + File currentDir) { + + String[] files = currentDir.list(); + for (int i = 0; i < files.length; i++) { + String current = files[i]; + if (current.toLowerCase().endsWith(lookFor)) { + String rootPath = rootDir.getPath(); + String currentPath = currentDir.getPath(); + if (! currentPath.startsWith(rootPath)) { + System.err.println( + "currentPath doesn't start with rootPath!\n" + + "rootPath: " + + rootPath + + "\n" + + "currentPath: " + + currentPath + + "\n"); + } else { + current = + current.substring( + 0, + current.length() - lookFor.length()); + String packageName = + currentPath.substring(rootPath.length()); + if (packageName.length() > 0) { + // Not the current directory + packageName = packageName.replace('\\', '.'); + packageName = packageName.replace('/', '.'); + classList.addElement( + packageName.substring(1) + '.' + current); + } else { + // The current directory + classList.addElement(current); + } + } + } else { + // Check if it's a directory to recurse into + File currentFile = new File(currentDir, current); + if (currentFile.isDirectory()) { + addClassesFromDir(classList, rootDir, currentFile); + } + } + } + } + +} // ImportWizard + +/* + * $Log: ImportWizard.java,v $ + * Revision 1.1.4.5 2005/04/12 21:12:14 christianfoltin + * * New feature: Time Scheduler list added. + * + * * Bug fix: revision plugin shutdown implemented. + * * Storage of creation/modification times moved to tag. This times are always updated, even if its display is turned off. + * * Bug fix: removal of node background colors introduced. + * + * * Moved personal freemind folder to '.freemind' to hide it under Linux and MacOSX. The old folder is moved the first time. + * + * Revision 1.1.4.4 2005/03/10 20:50:13 christianfoltin + * * New feature: Collaboration mode (alpha version) + * * Bug fix: java 1.5 compiler changes (thanks to Dimitri and to brcha) + * * Bug fix: Typing into the node gulps the first letter. Due to Dimitri. + * + * Revision 1.1.4.3 2005/01/09 00:05:05 christianfoltin + * * Bug fix: Show revisions in yellow. Thanks to michaelschwarz. + * * Bug fix: packaging under linux. + * * Bug fix: Quit and Cancel under Macintosh. + * * Bug fix: Toggle encrypted nodes for unencrypted nodes give an error message. + * + * Revision 1.1.4.2 2004/11/16 16:42:35 christianfoltin + * * merged from fm_040228_jython again. + * + * Revision 1.1.2.5 2004/11/13 08:28:35 christianfoltin + * Startuptime reduced + * + * Revision 1.1.2.4 2004/09/05 19:56:39 christianfoltin + * added jarbundler for mac os x. Application image added. TODO: Plugins must be packed. + * + * Revision 1.1.2.3 2004/08/29 15:18:21 christianfoltin + * * Changed several occurences of setFolded to the undoable method. + * * Changed the plugin class loader behaviour completely. + * + * Revision 1.1.2.2 2004/07/15 19:41:55 christianfoltin + * plugins are referred by xml now + * menus support check box entries + * + * Revision 1.1.2.1 2004/03/04 20:26:19 christianfoltin + * Plugin mechanisms added + * + * Revision 1.6 2003/01/18 05:48:41 andyp + * sync to jde 2.3.2 + * + * Revision 1.4 1999/06/17 17:49:27 paulk + * Added change log to end of file. + * + */ + +// End of ImportWizard.java diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/extensions/MindMapHook.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/extensions/MindMapHook.java --- freemind-0.7.1/freemind/freemind/extensions/MindMapHook.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/extensions/MindMapHook.java 2005-04-08 22:37:30.000000000 +0100 @@ -0,0 +1,85 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2001 Joerg Mueller + *See COPYING for Details + * + *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. + */ +/*$Id: MindMapHook.java,v 1.1.4.3 2005/04/08 21:37:30 christianfoltin Exp $*/ +package freemind.extensions; + +import java.util.Properties; + +import freemind.modes.ModeController; + +/** + * @author foltin + * + */ +public interface MindMapHook { + /** + * @return The name of the hook. In the xml description, this is the unique label. + */ + String getName(); + void setName(String name); + + + /** + * @param properties the properties of the property file belonging to the hook are passed. + */ + void setProperties(Properties properties); + + /**looks for a property in the plugin properties file. + * @param string + */ + String getResourceString(String property); + + void setController(ModeController controller); + + /** If a base class is specified in the plugin declaration + * via a plugin_registration entry with isPluginBase==true, + * this object is returned here. You can use it to realize something + * like the state of a plugin (eg. is the plugin switched on or off?). + * + * An example is the menu status of the encrypted nodes. If the node is not + * encrypted, the encryption state cannot be toggled (see EncryptNode.java). + * + * Another example arises from the collaboration mode. The state (connected, + * wait for second party, map sharing etc.) can be stored in the plugin base. + * + * Remember, that it is most likely that you havn't specified + * the base class and that you get NULL here. + * @return The object returned is of HookRegistration type but has to be + * casted anyway. + */ + Object getPluginBaseClass(); + + void setPluginBaseClass(Object baseClass); + + /* Hooks */ + + /** + * This method is also called, if the hook is created in the map. + * @param persistentStateString every hook can be equipped by a persistent state, + * which is here given. It is stored in the xml of FM. + */ + void startupMapHook(); + + /** + * This method is also called, if the node, this hook belongs to, is removed from the map. + */ + void shutdownMapHook(); + + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/extensions/ModeControllerHookAdapter.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/extensions/ModeControllerHookAdapter.java --- freemind-0.7.1/freemind/freemind/extensions/ModeControllerHookAdapter.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/extensions/ModeControllerHookAdapter.java 2004-10-28 06:24:53.000000000 +0100 @@ -0,0 +1,33 @@ +/* + * Created on 29.02.2004 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package freemind.extensions; + + +/** + * @author foltin + * + * To change the template for this generated type comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +public class ModeControllerHookAdapter extends HookAdapter implements ModeControllerHook { + + + // Logging: + // private static java.util.logging.Logger logger; + + /** + * @param map + * @param controller + */ + public ModeControllerHookAdapter() { + super(); +// if(logger == null) +// logger = ((ControllerAdapter)getController()).getFrame().getLogger(this.getClass().getName()); + } + + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/extensions/ModeControllerHook.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/extensions/ModeControllerHook.java --- freemind-0.7.1/freemind/freemind/extensions/ModeControllerHook.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/extensions/ModeControllerHook.java 2004-10-18 00:00:07.000000000 +0100 @@ -0,0 +1,18 @@ +/* + * Created on 29.02.2004 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package freemind.extensions; + +import javax.swing.JMenu; + +/** + * @author foltin + * + * To change the template for this generated type comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +public interface ModeControllerHook extends MindMapHook { +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/extensions/NodeHookAdapter.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/extensions/NodeHookAdapter.java --- freemind-0.7.1/freemind/freemind/extensions/NodeHookAdapter.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/extensions/NodeHookAdapter.java 2005-04-12 22:12:14.000000000 +0100 @@ -0,0 +1,111 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2001 Joerg Mueller + *See COPYING for Details + * + *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. + */ +/*$Id: NodeHookAdapter.java,v 1.1.4.3 2005/04/12 21:12:14 christianfoltin Exp $*/ +package freemind.extensions; + +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +import freemind.modes.MindMap; +import freemind.modes.MindMapNode; + +/** + * @author christianfoltin + * + * @file NodeHookAdapter.java + * @package freemind.modes + * */ +public abstract class NodeHookAdapter extends HookAdapter implements NodeHook { + + private boolean selfUpdateExpected; + + private MindMap map; + + private MindMapNode node; + + /** + * + */ + public NodeHookAdapter() { + super(); + } + + /* (non-Javadoc) + * @see freemind.modes.NodeHook#invoke() + */ + public void invoke(MindMapNode node) { + logger.finest("invoke(node) called."); + } + + /** + * @return + */ + protected MindMapNode getNode() { + return node; + } + + /** + * @param node + */ + public void setNode(MindMapNode node) { + this.node = node; + } + + /** + * @return + */ + protected MindMap getMap() { + return map; + } + + /** + * @param node + */ + protected void nodeChanged(MindMapNode node) { +// if(node == getNode()) { +// setSelfUpdate(true); +// } + // fc, 29.2.2004 (yes, this day exists!) + // this is not nice. The node should know itself, if it is updateable, but... + if(node.getViewer() != null) + getController().nodeChanged(node); +// setSelfUpdate(false); + } + + /** + * @param value + */ + protected void setToolTip(String key, String value) { + setToolTip(getNode(), key, value); + } + protected void setToolTip(MindMapNode node, String key, String value) { + getController().setToolTip(node, key, value); + } + + + + /** + * @param map + */ + public void setMap(MindMap map) { + this.map = map; + } + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/extensions/NodeHook.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/extensions/NodeHook.java --- freemind-0.7.1/freemind/freemind/extensions/NodeHook.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/extensions/NodeHook.java 2004-10-18 00:00:07.000000000 +0100 @@ -0,0 +1,40 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2001 Joerg Mueller + *See COPYING for Details + * + *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. + */ +/*$Id: NodeHook.java,v 1.1.4.1 2004/10/17 23:00:07 dpolivaev Exp $*/ + +package freemind.extensions; + +import java.util.Collection; +import java.util.List; + +import freemind.modes.MindMap; +import freemind.modes.MindMapNode; + +public interface NodeHook extends MindMapHook { + + void setMap(MindMap map); + void setNode(MindMapNode node); + + /* hooks */ + /** + * Is called after creation: + */ + void invoke(MindMapNode node); +} + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/extensions/PermanentNodeHookAdapter.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/extensions/PermanentNodeHookAdapter.java --- freemind-0.7.1/freemind/freemind/extensions/PermanentNodeHookAdapter.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/extensions/PermanentNodeHookAdapter.java 2005-07-26 21:52:34.000000000 +0100 @@ -0,0 +1,175 @@ +/* + * Created on 06.03.2004 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package freemind.extensions; + +import java.util.HashMap; +import java.util.Iterator; + +import freemind.main.XMLElement; +import freemind.modes.MindMapNode; + +/** + * @author foltin + * + * To change the template for this generated type comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +public class PermanentNodeHookAdapter + extends NodeHookAdapter + implements PermanentNodeHook { + + // Logging: + // private static java.util.logging.Logger logger; + + /** + * @param node + * @param map + * @param controller + */ + public PermanentNodeHookAdapter() { + super(); +// if(logger == null) +// logger = ((ControllerAdapter)getController()).getFrame().getLogger(this.getClass().getName()); + } + + /** + * @param child the child node the hook should be propagated to. + * @return returns the new hook or null if there is already such a hook. + */ + protected PermanentNodeHook propagate(MindMapNode child) { + PermanentNodeHook hook = (PermanentNodeHook) getController().createNodeHook(getName(), child, getMap()); + // invocation: + child.invokeHook(hook); + return hook; + } + + /* + * (non-Javadoc) + * + * @see freemind.modes.NodeHook#shutdownMapHook() + */ + public void shutdownMapHook() { + logger.finest("shutdownMapHook"); + setNode(null); + setMap(null); + super.shutdownMapHook(); + } + + /* (non-Javadoc) + * @see freemind.modes.NodeHook#onMouseOverHook() + */ + public void onMouseOverHook() { + } + + /* (non-Javadoc) + * @see freemind.modes.NodeHook#onUpdateNodeHook() + */ + public void onUpdateNodeHook() { + logger.finest("onUpdateNodeHook"); + } + + /* (non-Javadoc) + * @see freemind.modes.NodeHook#onUpdateChildrenHook() + */ + public void onUpdateChildrenHook(MindMapNode updatedNode) { + logger.finest("onUpdateChildrenHook"); + } + + /* (non-Javadoc) + * @see freemind.modes.NodeHook#onAddChild(freemind.modes.MindMapNode) + */ + public void onAddChild(MindMapNode newChildNode) { + logger.finest("onAddChild"); + } + + public void onNewChild(MindMapNode newChildNode) { + logger.finest("onNewChild"); + } + /* (non-Javadoc) + * @see freemind.extensions.PermanentNodeHook#onRemoveChild(freemind.modes.MindMapNode) + */ + public void onRemoveChild(MindMapNode oldChildNode) { + logger.finest("onRemoveChild"); + } + + /* (non-Javadoc) + * @see freemind.extensions.PermanentNodeHook#save(freemind.main.XMLElement) + */ + public void save(XMLElement xml) { + String saveName = getName(); + //saveName=saveName.replace(File.separatorChar, '/'); + xml.setAttribute("name", saveName); + } + + /* (non-Javadoc) + * @see freemind.extensions.PermanentNodeHook#loadFrom(freemind.main.XMLElement) + */ + public void loadFrom(XMLElement child) { + } + + /* (non-Javadoc) + * @see freemind.modes.NodeHook#onReceiveFocusHook() + */ + public void onReceiveFocusHook() { + logger.finest("onReceiveFocusHook"); + + } + + /* (non-Javadoc) + * @see freemind.extensions.PermanentNodeHook#onLooseFocusHook() + */ + public void onLooseFocusHook() { + logger.finest("onLooseFocusHook"); + } + + /* (non-Javadoc) + * @see freemind.extensions.PermanentNodeHook#onAddChildren(freemind.modes.MindMapNode) + */ + public void onAddChildren(MindMapNode addedChild) { + logger.finest("onAddChildren"); + } + + public static final String PARAMETERS = "Parameters"; + + /** + * @param child + */ + protected HashMap loadNameValuePairs(XMLElement xml) { + HashMap result = new HashMap(); + XMLElement child = (XMLElement) xml.getChildren().get(0); + if (child != null && PARAMETERS.equals(child.getName())) { + for (Iterator i = child.enumerateAttributeNames(); i.hasNext();) { + String name = (String) i.next(); + result.put(name, child.getStringAttribute(name)); + } + } + return result; + } + + /** + * @param nameValuePairs + * @param xml + */ + protected void saveNameValuePairs(HashMap nameValuePairs, XMLElement xml) { + XMLElement child = new XMLElement(); + child.setName(PARAMETERS); + for (Iterator i = nameValuePairs.keySet().iterator(); i.hasNext();) { + String key = (String) i.next(); + Object value = nameValuePairs.get(key); + child.setAttribute(key, value); + } + xml.addChild(child); + + } + + public void onRemoveChildren(MindMapNode oldChildNode, MindMapNode oldDad) { + logger.finest("onRemoveChildren"); + } + + + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/extensions/PermanentNodeHook.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/extensions/PermanentNodeHook.java --- freemind-0.7.1/freemind/freemind/extensions/PermanentNodeHook.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/extensions/PermanentNodeHook.java 2005-07-26 21:52:34.000000000 +0100 @@ -0,0 +1,78 @@ +/* + * Created on 06.03.2004 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package freemind.extensions; + +import freemind.main.XMLElement; +import freemind.modes.MindMapNode; + +/** + * @author foltin + * + * To change the template for this generated type comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +public interface PermanentNodeHook extends NodeHook { + + void onReceiveFocusHook(); + void onMouseOverHook(); + /** + * If the node I belong to is changed, I get this notification. + * */ + void onUpdateNodeHook(); + + /** Is called if the addedChildNode is inserted as a direct child of the node, + * this hook is attached to. + * The cases in which this method is called contain new nodes, paste, move, etc. + * + * Ah, don't call propagate in this method, as paste introduces nodes with the + * hook and you'll have them twice, ... + * @see onNewChild + * @param addedChildNode + */ + void onAddChild(MindMapNode addedChildNode); + + /** Is only called, if a new nodes is inserted as a child. + * Remark: In this case onAddChild is called too and moreover *before* this method. + * @see onAddChild. + * @param newChildNode + */ + void onNewChild(MindMapNode newChildNode); + + /** This method is called, if a child is added to me or to any of my children. + * (See onUpdateChildrenHook) + * @param addedChild + */ + void onAddChildren(MindMapNode addedChild); + + void onRemoveChild(MindMapNode oldChildNode); + /** This method is called, if a child is removed to me or to any of my children. + * (See onUpdateChildrenHook) + * @param oldChildNode + * @param oldDad TODO + */ + void onRemoveChildren(MindMapNode oldChildNode, MindMapNode oldDad); + + /** + * If any of my children is updated, I get this notification. + */ + void onUpdateChildrenHook(MindMapNode updatedNode); + + /** + * @param hookElement + */ + void save(XMLElement hookElement); + /** + * @param child + */ + void loadFrom(XMLElement child); + /** + * + */ + void onLooseFocusHook(); + + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/extensions/PermanentNodeHookSubstituteUnknown.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/extensions/PermanentNodeHookSubstituteUnknown.java --- freemind-0.7.1/freemind/freemind/extensions/PermanentNodeHookSubstituteUnknown.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/extensions/PermanentNodeHookSubstituteUnknown.java 2005-02-13 22:39:56.000000000 +0000 @@ -0,0 +1,55 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2001 Joerg Mueller + *See COPYING for Details + * + *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. + */ +/*$Id: PermanentNodeHookSubstituteUnknown.java,v 1.1.2.1 2005/02/13 22:39:56 christianfoltin Exp $*/ + +package freemind.extensions; + +import java.util.Iterator; + +import freemind.main.XMLElement; + +/** Class saves xml data in case that the corresponding node hook is not present. */ +public class PermanentNodeHookSubstituteUnknown extends + PermanentNodeHookAdapter { + + private final String hookName; + public PermanentNodeHookSubstituteUnknown(String name){ + super(); + hookName = name; + } + + private XMLElement child; + public void loadFrom(XMLElement child) { + this.child = child; + super.loadFrom(child); + + } + public void save(XMLElement xml) { + super.save(xml); + for (Iterator i = child.getChildren().iterator(); i.hasNext();) { + XMLElement childchild = (XMLElement) i.next(); + xml.addChild(childchild); + } + } + public String getName() { + return hookName; + } + +} + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/extensions/UndoEventReceiver.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/extensions/UndoEventReceiver.java --- freemind-0.7.1/freemind/freemind/extensions/UndoEventReceiver.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/extensions/UndoEventReceiver.java 2005-02-13 22:39:56.000000000 +0000 @@ -0,0 +1,38 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 21.09.2004 + */ +/*$Id: UndoEventReceiver.java,v 1.1.4.2 2005/02/13 22:39:56 christianfoltin Exp $*/ + +package freemind.extensions; + +/** This is a marker interface for hooks. If a PermanentNodeHook implements + * this interface (which is easy), it receives onUpdateNodeHook, onUpdateChildrenHook, + * even when the action issuing this update is caused by an undo action. + * + * Normally, on undo, no event are generated. + * + * The onAddChild, onAddChildren events are not implemented yet. They are generated in any case. + * @author foltin + * + */ +public interface UndoEventReceiver { + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/main/FreeMindApplet.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/main/FreeMindApplet.java --- freemind-0.7.1/freemind/freemind/main/FreeMindApplet.java 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/main/FreeMindApplet.java 2008-01-01 17:43:07.000000000 +0000 @@ -16,28 +16,41 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: FreeMindApplet.java,v 1.18 2004/02/02 21:25:24 christianfoltin Exp $*/ +/*$Id: FreeMindApplet.java,v 1.18.14.12.4.1 2008/01/01 17:43:07 dpolivaev Exp $*/ package freemind.main; -import freemind.view.mindmapview.MapView; -import freemind.controller.MenuBar; -import freemind.controller.Controller; -import java.io.InputStream; +import java.awt.BorderLayout; +import java.awt.Container; +import java.awt.Cursor; +import java.awt.EventQueue; import java.io.File; +import java.io.InputStream; +import java.lang.reflect.InvocationTargetException; import java.net.URL; +import java.util.Enumeration; import java.util.Properties; -import java.util.ResourceBundle; import java.util.PropertyResourceBundle; -import java.util.Enumeration; -import java.awt.BorderLayout; -import java.awt.Container; -import java.awt.Cursor; -import javax.swing.*; +import java.util.ResourceBundle; + +import javax.swing.JApplet; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JRootPane; +import javax.swing.JScrollPane; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; + +import freemind.controller.Controller; +import freemind.controller.MenuBar; +import freemind.extensions.HookFactory; +import freemind.view.mindmapview.MapView; public class FreeMindApplet extends JApplet implements FreeMindMain { - public static final String version = "0.7.1"; + private HookFactory nodeHookFactory; + public static final String version = FreeMind.version; // public static final String defaultPropsURL; public URL defaultPropsURL; public static Properties defaultProps; @@ -112,10 +125,34 @@ return resources; } + public String getResourceString(String resource) { + try { + return getResources().getString(resource); + } catch (Exception ex) { + System.err.println("Warning - resource string not found:" + + resource); + return resource; + } + } + public String getProperty(String key) { return userProps.getProperty(key); } + public int getIntProperty(String key, int defaultValue){ + try{ + return Integer.parseInt(getProperty(key)); + } + catch(NumberFormatException nfe){ + return defaultValue; + } + } + + + public Properties getProperties() { + return userProps; + } + public void setProperty(String key, String value) { } @@ -228,11 +265,14 @@ } else if (lookAndFeel.equals("metal")) { UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } else if (lookAndFeel.equals("gtk")) { - UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); - } else if (lookAndFeel.equals("nothing")) { - } else if (lookAndFeel.indexOf('.') != -1) { // string contains a dot - UIManager.setLookAndFeel(lookAndFeel); // we assume class name - } else { + UIManager + .setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); + } else if (lookAndFeel.equals("nothing")) { + } else if (lookAndFeel.indexOf('.') != -1) { // string contains a + // dot + UIManager.setLookAndFeel(lookAndFeel); + // we assume class name + } else { // default. UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } @@ -263,6 +303,40 @@ SwingUtilities.updateComponentTreeUI(this); // Propagate LookAndFeel to JComponents + // wait until AWT thread starts + if (! EventQueue.isDispatchThread()){ + try { + EventQueue.invokeAndWait(new Runnable() {public void run(){};}); + } catch (InterruptedException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } + } c.changeToMode(getProperty("initial_mode")); } + /* (non-Javadoc) + * @see freemind.main.FreeMindMain#getHookFactory() + */ + public HookFactory getHookFactory() { + if(nodeHookFactory == null) { + nodeHookFactory = new HookFactory(this); + } + return nodeHookFactory; + } + + /* (non-Javadoc) + * @see freemind.main.FreeMindMain#getSouthPanel() + */ + public JPanel getSouthPanel() { + return null; + } + + /* (non-Javadoc) + * @see freemind.main.FreeMindMain#getJFrame() + */ + public JFrame getJFrame() { + throw new IllegalArgumentException("The applet has no frames"); + } + } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/main/FreeMind.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/main/FreeMind.java --- freemind-0.7.1/freemind/freemind/main/FreeMind.java 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/main/FreeMind.java 2008-01-01 17:43:07.000000000 +0000 @@ -16,7 +16,7 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: FreeMind.java,v 1.32 2004/02/02 21:25:24 christianfoltin Exp $*/ +/*$Id: FreeMind.java,v 1.32.14.25.4.1 2008/01/01 17:43:07 dpolivaev Exp $*/ package freemind.main; @@ -24,43 +24,68 @@ import java.awt.Container; import java.awt.Cursor; import java.awt.Dimension; +import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import java.io.BufferedReader; +import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; -import java.io.OutputStream; -import java.io.BufferedReader; -import java.io.BufferedWriter; import java.io.InputStreamReader; +import java.io.OutputStream; import java.io.OutputStreamWriter; import java.net.URL; +import java.text.MessageFormat; import java.util.HashMap; +import java.util.Locale; import java.util.Map; import java.util.Properties; import java.util.PropertyResourceBundle; import java.util.ResourceBundle; import java.util.StringTokenizer; -import java.text.MessageFormat; +import java.util.logging.Logger; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; +import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.SwingUtilities; import javax.swing.UIManager; import freemind.controller.Controller; import freemind.controller.MenuBar; +import freemind.extensions.HookFactory; import freemind.modes.ModeController; +import freemind.preferences.FreemindPropertyListener; import freemind.view.mindmapview.MapView; public class FreeMind extends JFrame implements FreeMindMain { - public static final String version = "0.7.1"; + public static final String RESOURCE_LOOKANDFEEL = "lookandfeel"; + public static final String RESOURCE_ANTIALIAS = "antialias"; + public static final String RESOURCE_LANGUAGE = "language"; + public static final String RESOURCES_SELECTION_METHOD = "selection_method"; + public static final String RESOURCES_NODE_STYLE = "standardnodestyle"; + public static final String RESOURCES_ROOT_NODE_STYLE = "standardrootnodestyle"; + public static final String RESOURCES_NODE_COLOR = "standardnodecolor"; + public static final String RESOURCES_SELECTED_NODE_COLOR = "standardselectednodecolor"; + public static final String RESOURCES_EDGE_COLOR = "standardedgecolor"; + public static final String RESOURCES_EDGE_STYLE = "standardedgestyle"; + public static final String RESOURCES_CLOUD_COLOR = "standardcloudcolor"; + public static final String RESOURCES_LINK_COLOR = "standardlinkcolor"; + public static final String RESOURCES_BACKGROUND_COLOR = "standardbackgroundcolor"; + + + private static Logger logger =null; + + private static final String DEFAULT_LANGUAGE = "en"; + private HookFactory nodeHookFactory; + public static final String version = "0.8.1"; // public static final String defaultPropsURL = "freemind.properties"; public URL defaultPropsURL; // public static Properties defaultProps; @@ -74,9 +99,19 @@ Controller c;//the one and only controller - public FreeMind() { + private JPanel southPanel; + private static PropertyResourceBundle languageResources; + + private PropertyResourceBundle defaultResources; + public FreeMind() { super("FreeMind"); - + if(logger == null) { + logger = getLogger(FreeMind.class.getName()); + } + FreeMindSplash splash = new FreeMindSplash(this); + splash.setVisible(true); + /* This is only for apple but does not harm for the others. */ + System.setProperty("apple.laf.useScreenMenuBar", "true"); String propsLoc = "freemind.properties"; defaultPropsURL = ClassLoader.getSystemResource(propsLoc); @@ -103,8 +138,21 @@ autoPropertiesFile = new File (userPropertiesFolder,def.getProperty("autoproperties")); patternsFile = new File (userPropertiesFolder,def.getProperty("patternsfile")); try { + // move freemind to .freemind: + if (getProperty("properties_folder").startsWith(".")) { + String oldFolderName = System.getProperty("user.home") + + System.getProperty("file.separator") + + getProperty("properties_folder").substring(1); + File oldFolder = new File(oldFolderName); + if (oldFolder.exists() && !userPropertiesFolder.exists()) { + System.out + .println("Try to move the properties folder to .properties folder."); + oldFolder.renameTo(userPropertiesFolder); + } + } if (!userPropertiesFolder.exists()) { - userPropertiesFolder.mkdir(); } + userPropertiesFolder.mkdir(); + } System.out.println(); System.out.println("Looking for user properties:"); @@ -168,31 +216,7 @@ //even close() fails. what now? } - //set Look&Feel - try { - String lookAndFeel = props.getProperty("lookandfeel"); - if (lookAndFeel.equals("windows")) { - UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); - } else if (lookAndFeel.equals("motif")) { - UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel"); - } else if (lookAndFeel.equals("mac")) { - //Only available on macOS - UIManager.setLookAndFeel("javax.swing.plaf.mac.MacLookAndFeel"); - } else if (lookAndFeel.equals("metal")) { - UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); - } else if (lookAndFeel.equals("gtk")) { - UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); - } else if (lookAndFeel.equals("nothing")) { - } else if (lookAndFeel.indexOf('.') != -1) { // string contains a dot - UIManager.setLookAndFeel(lookAndFeel); // we assume class name - } else { - // default. - System.out.println("Default (System) Look & Feel: "+UIManager.getSystemLookAndFeelClassName()); - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } - } catch (Exception ex) { - System.err.println("Unable to set Look & Feel."); - } + updateLookAndFeel(); ImageIcon icon = new ImageIcon(getResource("images/FreeMindWindowIcon.png")); setIconImage(icon.getImage()); @@ -201,11 +225,33 @@ getContentPane().setLayout( new BorderLayout() ); c = new Controller(this); + // add a listener for the controller, resource bundle: + Controller.addPropertyChangeListener(new FreemindPropertyListener() { + + public void propertyChanged(String propertyName, String newValue, + String oldValue) { + if (propertyName.equals(RESOURCE_LANGUAGE)) { + // re-read resources: + languageResources = null; + getResources(); + } + } + }); + //fc, disabled with purpose (see java look and feel styleguides). + //http://java.sun.com/products/jlf/ed2/book/index.html +// // add a listener for the controller, look and feel: +// Controller.addPropertyChangeListener(new FreemindPropertyListener() { +// +// public void propertyChanged(String propertyName, String newValue, +// String oldValue) { +// if (propertyName.equals(RESOURCE_LOOKANDFEEL)) { +// updateLookAndFeel(); +// } +// } +// }); - if (Tools.safeEquals(getProperty("antialiasEdges"),"true")) { - c.setAntialiasEdges(true); } - if (Tools.safeEquals(getProperty("antialiasAll"),"true")) { - c.setAntialiasAll(true); } + + c.optionAntialiasAction.changeAntialias(getProperty(RESOURCE_ANTIALIAS)); //Create the MenuBar menuBar = new MenuBar(c); @@ -222,9 +268,18 @@ getContentPane().add( scrollPane, BorderLayout.CENTER ); +// status = new JLabel(); +// getContentPane().add( status, BorderLayout.SOUTH ); + // taken from Lukasz Pekacki, NodeText version: + southPanel = new JPanel(new BorderLayout()); + + status = new JLabel(); - getContentPane().add( status, BorderLayout.SOUTH ); - + southPanel.add( status, BorderLayout.SOUTH ); + + getContentPane().add( southPanel, BorderLayout.SOUTH ); + // end taken. + //Disable the default close button, instead use windowListener setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); @@ -243,9 +298,45 @@ SwingUtilities.updateComponentTreeUI(this); // Propagate LookAndFeel to JComponents c.changeToMode(getProperty("initial_mode")); + splash.setVisible(false); }//Constructor + /** + * + */ + private void updateLookAndFeel() { + //set Look&Feel + try { + String lookAndFeel = props.getProperty(RESOURCE_LOOKANDFEEL); + if (lookAndFeel.equals("windows")) { + UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); + } else if (lookAndFeel.equals("motif")) { + UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel"); + } else if (lookAndFeel.equals("mac")) { + //Only available on macOS + UIManager.setLookAndFeel("javax.swing.plaf.mac.MacLookAndFeel"); + } else if (lookAndFeel.equals("metal")) { + UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); + } else if (lookAndFeel.equals("gtk")) { + UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); + } else if (lookAndFeel.equals("nothing")) { + } else if (lookAndFeel.indexOf('.') != -1) { // string contains a + // dot + UIManager.setLookAndFeel(lookAndFeel); + // we assume class name + } else { + // default. + System.out.println("Default (System) Look & Feel: " + + UIManager.getSystemLookAndFeelClassName()); + UIManager.setLookAndFeel(UIManager + .getSystemLookAndFeelClassName()); + } + } catch (Exception ex) { + System.err.println("Unable to set Look & Feel."); + } + } + public boolean isApplet() { return false; } @@ -280,6 +371,20 @@ return props.getProperty(key); } + public int getIntProperty(String key, int defaultValue){ + try{ + return Integer.parseInt(getProperty(key)); + } + catch(NumberFormatException nfe){ + return defaultValue; + } + } + + public Properties getProperties() { + return props; + } + + public void setProperty(String key, String value) { props.setProperty(key,value); } @@ -330,6 +435,14 @@ * Open url in WWW browser. This method hides some differences between operating systems. */ public void openDocument(URL url) throws Exception { + // build string for default browser: + String correctedUrl = new String(url.toExternalForm()); + if (url.getProtocol().equals("file")) { + correctedUrl = correctedUrl.replace('\\','/').replaceAll(" ","%20"); + // ^ This is more of a heuristic than a "logical" code + // and due to a java bug: + // http://forum.java.sun.com/thread.jsp?forum=31&thread=363990 + } // Originally, this method determined external application, with which the document // should be opened. Which application should open which document type was // configured in FreeMind properties file. As a result, FreeMind tried to solve the @@ -393,16 +506,10 @@ System.err.println("Caught: " + x); } } else if (osName.startsWith("Mac OS")) { -// String urlString = url.toString(); -// if (url.getProtocol().equals("file")) { -// urlString = urlString.replace('\\','/').replaceAll(" ","%20"); } -// // ^ This is more of a heuristic than a "logical" code // System.out.println("Opening URL "+urlString); String browser_command=new String(); try { - // build string for default browser: - String correctedUrl = new String(url.toExternalForm()); // ask for property about browser: fc, 26.11.2003. Object[] messageArguments = { correctedUrl, url.toString() }; MessageFormat formatter = new MessageFormat(getProperty("default_browser_command_mac")); @@ -417,16 +524,8 @@ // above). Putting '"' around does not work on Linux - instead, the '"' // becomes part of URL, which is malformed, as a result. -// String urlString = url.toString(); -// if (url.getProtocol().equals("file")) { -// urlString = urlString.replace('\\','/').replaceAll(" ","%20"); } -// // ^ This is more of a heuristic than a "logical" code - - // System.out.println("Opening URL "+urlString); String browser_command=new String(); try { - // build string for default browser: - String correctedUrl = new String(url.toExternalForm()); // ask for property about browser: fc, 26.11.2003. Object[] messageArguments = { correctedUrl, url.toString() }; MessageFormat formatter = new MessageFormat(getProperty("default_browser_command_other_os")); @@ -477,19 +576,67 @@ return (String)filetypes.get(type.trim().toLowerCase()); } - /**Returns the ResourceBundle with the current language*/ + /** Returns the ResourceBundle with the current language */ public ResourceBundle getResources() { - String lang = getProperty("language"); - try { - InputStream in = ClassLoader.getSystemResource("Resources_"+lang+".properties").openStream(); - PropertyResourceBundle resources = new PropertyResourceBundle(in); - in.close(); - return resources; - } catch (Exception ex) { - System.err.println("Error loading Resources"); - return null; - } - // return ResourceBundle.getBundle("Resources",locale); + if (languageResources == null) { + try { + String lang = getProperty(RESOURCE_LANGUAGE); + if(lang == null || lang.equals("automatic")) { + lang = Locale.getDefault().getLanguage() + "_" + Locale.getDefault().getCountry(); + if(getLanguageResources(lang)== null) { + lang = Locale.getDefault().getLanguage(); + if(getLanguageResources(lang)== null) { + // default is english. + lang=DEFAULT_LANGUAGE; + } + } + } + languageResources = getLanguageResources(lang); + defaultResources = getLanguageResources(DEFAULT_LANGUAGE); + } catch (Exception ex) { + ex.printStackTrace(); + System.err.println("Error loading Resources"); + return null; + } + } + return languageResources; + } + + public String getResourceString(String resource) { + try { + return getResources().getString(resource); + } catch (Exception ex) { + System.err.println("Warning - resource string not found:" + + resource); + try{ + return defaultResources.getString(resource)+"[translate me]"; + } catch(Exception e) { + System.err.println("Warning - resource string not found (even in english):" + + resource); + return resource; + } + } + } + + + /** + * @param lang + * @return + * @throws IOException + */ + private PropertyResourceBundle getLanguageResources(String lang) throws IOException { + URL systemResource = ClassLoader.getSystemResource( + "Resources_" + lang + ".properties"); + if(systemResource == null) { + return null; + } + InputStream in = systemResource.openStream(); + if(in == null) { + return null; + } + PropertyResourceBundle bundle = new PropertyResourceBundle(in); + in.close(); + return bundle; } public java.util.logging.Logger getLogger(String forClass) { @@ -511,10 +658,8 @@ if (args[i].toLowerCase().endsWith(".mm")) { if (!Tools.isAbsolutePath(args[i])) { - // args[i] = System.getProperty("user.dir") + System.getProperty("file.separator") + args[i]; - // } //fin = ; try { @@ -527,13 +672,17 @@ } } } - if (!fileLoaded && frame.getProperty("onStartIfNotSpecified") != null) { - frame.c.getLastOpenedList().open(frame.getProperty("onStartIfNotSpecified")); } + if (!fileLoaded && frame.getProperty("onStartIfNotSpecified") != null) { + frame.c.getLastOpenedList().open(frame.getProperty("onStartIfNotSpecified")); } frame.pack(); try { if (frame.getView() != null) { + // wait until AWT thread starts + if (! EventQueue.isDispatchThread()){ + EventQueue.invokeAndWait(new Runnable() {public void run(){};}); + } frame.getView().moveToRoot(); }} catch (Exception e) { e.printStackTrace(); } @@ -558,5 +707,29 @@ win_state = ((win_state & ICONIFIED) != 0) ? NORMAL : win_state; frame.setExtendedState(win_state); - }//main() + } + + /* (non-Javadoc) + * @see freemind.main.FreeMindMain#getHookFactory() + */ + public HookFactory getHookFactory() { + if(nodeHookFactory == null) { + nodeHookFactory = new HookFactory(this); + } + return nodeHookFactory; + } + /** + * @return + */ + public JPanel getSouthPanel() { + return southPanel; + } + + /* (non-Javadoc) + * @see freemind.main.FreeMindMain#getJFrame() + */ + public JFrame getJFrame() { + return this; + } + } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/main/FreeMindMain.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/main/FreeMindMain.java --- freemind-0.7.1/freemind/freemind/main/FreeMindMain.java 2004-02-02 21:25:24.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/main/FreeMindMain.java 2005-04-26 22:41:00.000000000 +0100 @@ -16,22 +16,28 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: FreeMindMain.java,v 1.12 2004/02/02 21:25:24 christianfoltin Exp $*/ +/*$Id: FreeMindMain.java,v 1.12.14.4 2005/04/26 21:41:00 christianfoltin Exp $*/ package freemind.main; import java.awt.Container; import java.io.File; import java.net.URL; +import java.util.Properties; import java.util.ResourceBundle; +import javax.swing.JFrame; import javax.swing.JLayeredPane; +import javax.swing.JPanel; import freemind.controller.Controller; import freemind.controller.MenuBar; +import freemind.extensions.HookFactory; import freemind.view.mindmapview.MapView; public interface FreeMindMain { + public JFrame getJFrame(); + public boolean isApplet(); public MapView getView(); @@ -49,6 +55,9 @@ /**Returns the ResourceBundle with the current language*/ public ResourceBundle getResources(); + public String getResourceString(String key) ; + + public Container getContentPane(); public void out (String msg); @@ -65,6 +74,10 @@ public URL getResource(String name); + public int getIntProperty(String key, int defaultValue); + /** @return returns the list of all properties. */ + public Properties getProperties(); + public String getProperty(String key); public void setProperty(String key, String value); @@ -90,4 +103,11 @@ /* To obtain a logging element, ask here. */ public java.util.logging.Logger getLogger(String forClass); + + /** + * @return + */ + public HookFactory getHookFactory(); + + public JPanel getSouthPanel(); } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/main/FreeMindSplash.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/main/FreeMindSplash.java --- freemind-0.7.1/freemind/freemind/main/FreeMindSplash.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/main/FreeMindSplash.java 2005-08-27 21:35:25.000000000 +0100 @@ -0,0 +1,95 @@ +/*************************************************************************** + FreeMindSplash, taken from GanttSplash.java - description + ------------------- + begin : dec 2002 + copyright : (C) 2002 by Thomas Alexandre + email : alexthomas(at)ganttproject.org + ***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +package freemind.main; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.Toolkit; + +import javax.swing.ImageIcon; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JRootPane; + + + +/** + * Class to put a splash before lunch the soft + */ + +class FreeMindSplash extends JFrame { + + private final FreeMindMain frame; + + + public FreeMindSplash(final FreeMindMain frame){ + super("FreeMind"); + this.frame = frame; + + ImageIcon icon = new ImageIcon(frame.getResource( + "images/FreeMindWindowIcon.png")); + setIconImage(icon.getImage()); //set the ganttproject icon + setDefaultLookAndFeelDecorated(false); + setUndecorated(true); + getRootPane().setWindowDecorationStyle(JRootPane.NONE); //set no border + + ImageIcon splashImage = new ImageIcon(frame.getResource("images/splash.JPG")); + JLabel l = new JLabel(splashImage) { + public void paint (Graphics g) { + super.paint(g); + Graphics2D g2 = (Graphics2D) g; + g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + Font font = new Font("Arial", Font.BOLD, 16); + g2.setFont(font); + // determine width of string to center it. + String freemindVersion = frame.getFreemindVersion(); + int width = g2.getFontMetrics().stringWidth(freemindVersion); + int yCoordinate = (int)(getSize().getHeight())-14; + int xCoordinate = (int)(getSize().getWidth()/2-width/2); + g2.setColor(Color.YELLOW); + g2.drawString(freemindVersion, xCoordinate , yCoordinate); + g2.setColor(Color.WHITE); + g2.drawString(freemindVersion, xCoordinate+1 , yCoordinate+1); + } + }; + + + getContentPane().add(l, BorderLayout.CENTER); + pack(); + + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + Dimension labelSize = l.getPreferredSize(); + + // Put image at the middle of the screen + setLocation(screenSize.width/2 - (labelSize.width/2), + screenSize.height/2 - (labelSize.height/2)); + + } + + + public void close() { + setVisible(false); + dispose(); + } + +} + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/main/Tools.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/main/Tools.java --- freemind-0.7.1/freemind/freemind/main/Tools.java 2003-12-17 21:04:52.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/main/Tools.java 2008-01-01 17:39:37.000000000 +0000 @@ -1,71 +1,105 @@ -/*FreeMind - A Program for creating and viewing Mindmaps - *Copyright (C) 2000-2001 Joerg Mueller - *See COPYING for Details - * - *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. +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2001 Joerg Mueller See COPYING for Details + * + * 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. */ -/*$Id: Tools.java,v 1.17 2003/12/17 21:04:52 christianfoltin Exp $*/ +/* $Id: Tools.java,v 1.17.18.5.10.1 2008/01/01 17:39:37 dpolivaev Exp $ */ package freemind.main; + //maybe move this class to another package like tools or something... +import java.awt.Color; +import java.awt.GraphicsEnvironment; +import java.awt.Point; +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; -import java.util.*; +import java.io.UnsupportedEncodingException; import java.net.URL; -import java.awt.Color; -import java.awt.Point; -import java.awt.GraphicsEnvironment; -import java.lang.Thread; +import java.util.Arrays; +import java.util.Date; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.ListIterator; +import java.util.Set; +import java.util.StringTokenizer; +import java.util.Vector; +import java.util.zip.DataFormatException; +import java.util.zip.Deflater; +import java.util.zip.Inflater; public class Tools { - //public static final Set executableExtensions = new HashSet ({ "exe", "com", "vbs" }); + //public static final Set executableExtensions = new HashSet ({ "exe", + // "com", "vbs" }); + //The Java programming language provides a shortcut syntax for creating and + // initializing an array. Here's an example of this syntax: + //boolean[] answers = { true, false, true, true, false }; - //The Java programming language provides a shortcut syntax for creating and initializing an array. Here's an example of this syntax: - //boolean[] answers = { true, false, true, true, false }; + public static final Set executableExtensions = new HashSet(Arrays + .asList(new String[] { "exe", "com", "vbs", "bat", "lnk" })); - public static final Set executableExtensions = new HashSet - (Arrays.asList(new String[]{ "exe", "com", "vbs", "bat", "lnk" })); + private static Set availableFontFamilyNames = null; // Keep set of platform + + // fonts - private static Set availableFontFamilyNames = null; // Keep set of platform fonts - public static boolean executableByExtension(String file) { - return executableExtensions.contains(getExtension(file)); } + return executableExtensions.contains(getExtension(file)); + } public static String colorToXml(Color col) { - if (col == null) throw new IllegalArgumentException("Color was null"); - String red = Integer.toHexString(col.getRed()); - if (col.getRed()<16) red = "0"+red; - String green = Integer.toHexString(col.getGreen()); - if (col.getGreen()<16) green = "0"+green; - String blue = Integer.toHexString(col.getBlue()); - if (col.getBlue()<16) blue = "0"+blue; - return "#"+red+green+blue; + // if (col == null) throw new IllegalArgumentException("Color was + // null"); + if (col == null) + return null; + String red = Integer.toHexString(col.getRed()); + if (col.getRed() < 16) + red = "0" + red; + String green = Integer.toHexString(col.getGreen()); + if (col.getGreen() < 16) + green = "0" + green; + String blue = Integer.toHexString(col.getBlue()); + if (col.getBlue() < 16) + blue = "0" + blue; + return "#" + red + green + blue; } public static Color xmlToColor(String string) { - int red = Integer.parseInt(string.substring(1,3),16); - int green = Integer.parseInt(string.substring(3,5),16); - int blue = Integer.parseInt(string.substring(5,7),16); - return new Color(red,green,blue); + if (string == null) + return null; + string = string.trim(); + if (string.length() == 7) { + + int red = Integer.parseInt(string.substring(1, 3), 16); + int green = Integer.parseInt(string.substring(3, 5), 16); + int blue = Integer.parseInt(string.substring(5, 7), 16); + return new Color(red, green, blue); + } else { + throw new IllegalArgumentException("No xml color given by '" + + string + "'."); + } } public static String PointToXml(Point col) { - if (col == null) throw new IllegalArgumentException("Point was null"); + if (col == null) + return null; //throw new IllegalArgumentException("Point was + // null"); Vector l = new Vector(); l.add(Integer.toString(col.x)); l.add(Integer.toString(col.y)); @@ -73,344 +107,579 @@ } public static Point xmlToPoint(String string) { + if (string == null) + return null; + // fc, 3.11.2004: bug fix for alpha release of FM + if (string.startsWith("java.awt.Point")) { + string = string.replaceAll( + "java\\.awt\\.Point\\[x=([0-9]*),y=([0-9]*)\\]", "$1;$2"); + System.out.println("new String: " + string); + } List l = stringToList(string); ListIterator it = l.listIterator(0); - if(l.size() != 2) - throw new IllegalArgumentException("A point must consist of two numbers (and not: '"+ string+"')."); + if (l.size() != 2) + throw new IllegalArgumentException( + "A point must consist of two numbers (and not: '" + string + + "')."); int x = Integer.parseInt((String) it.next()); int y = Integer.parseInt((String) it.next()); - return new Point(x,y); + return new Point(x, y); } public static String BooleanToXml(boolean col) { - return (col)?"true":"false"; + return (col) ? "true" : "false"; } public static boolean xmlToBoolean(String string) { + if(string == null) + return false; if(string.equals("true")) return true; return false; } /** - * Converts a String in the format "value;value;value" to - * a List with the values (as strings) + * Converts a String in the format "value;value;value" to a List with the + * values (as strings) */ public static List stringToList(String string) { - StringTokenizer tok = new StringTokenizer(string,";"); - List list = new LinkedList(); - while (tok.hasMoreTokens()) { - list.add(tok.nextToken()); - } - return list; + StringTokenizer tok = new StringTokenizer(string, ";"); + List list = new LinkedList(); + while (tok.hasMoreTokens()) { + list.add(tok.nextToken()); + } + return list; } public static String listToString(List list) { - ListIterator it = list.listIterator(0); - String str = new String(); - while (it.hasNext()) { - str.concat(it.next().toString() + ";"); - } - return str; + ListIterator it = list.listIterator(0); + String str = new String(); + while (it.hasNext()) { + str += it.next().toString() + ";"; + } + return str; } /** * Replaces a ~ in a filename with the users home directory */ public static String expandFileName(String file) { - //replace ~ with the users home dir - if (file.startsWith("~")) { - file = System.getProperty("user.home") + file.substring(1); - } - return file; + //replace ~ with the users home dir + if (file.startsWith("~")) { + file = System.getProperty("user.home") + file.substring(1); + } + return file; } public static Set getAvailableFontFamilyNames() { - if (availableFontFamilyNames == null) { - GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment(); - String envFonts[] = gEnv.getAvailableFontFamilyNames(); - availableFontFamilyNames = new HashSet(); - for (int i=0; i0 && i 0 && i < s.length() - 1) ? s.substring(i + 1).toLowerCase() + .trim() : ""; } public static String removeExtension(String s) { int i = s.lastIndexOf('.'); - return (i>0 && i 0 && i < s.length() - 1) ? s.substring(0, i) : ""; + } + + public static String toXMLEscapedText(String text) { + return text.replaceAll("&", "&").replaceAll("<", "<") + .replaceAll(">", ">").replaceAll("\"", """); } - public static String toXMLEscapedText (String text) { - return text. - replaceAll("&","&"). - replaceAll("<","<"). - replaceAll(">",">"). - replaceAll("\"","""); - } - public static String toXMLUnescapedText (String text) { - return text. - replaceAll("<","<"). - replaceAll(">",">"). - replaceAll(""","\""). - replaceAll("&","&"); + public static String toXMLUnescapedText(String text) { + return text.replaceAll("<", "<").replaceAll(">", ">").replaceAll( + """, "\"").replaceAll("&", "&"); } public static String toXMLEscapedTextWithNBSPizedSpaces(String text) { - int len = text.length(); - StringBuffer result = new StringBuffer(len); - int intValue; - char myChar; - boolean previousSpace = false; - boolean spaceOccured = false; - for (int i = 0; i < len; ++i) { - myChar = text.charAt(i); - spaceOccured = false; - switch (myChar) { - case '&': - result.append("&"); - break; - case '<': - result.append("<"); - break; - case '>': - result.append(">"); - break; - case ' ': - spaceOccured = true; - if (previousSpace) { - result.append(" "); } - else { - result.append(" "); } - break; - default: - result.append(myChar); } - previousSpace = spaceOccured; } - return result.toString(); } + int len = text.length(); + StringBuffer result = new StringBuffer(len); + int intValue; + char myChar; + boolean previousSpace = false; + boolean spaceOccured = false; + for (int i = 0; i < len; ++i) { + myChar = text.charAt(i); + spaceOccured = false; + switch (myChar) { + case '&': + result.append("&"); + break; + case '<': + result.append("<"); + break; + case '>': + result.append(">"); + break; + case ' ': + spaceOccured = true; + if (previousSpace) { + result.append(" "); + } else { + result.append(" "); + } + break; + default: + result.append(myChar); + } + previousSpace = spaceOccured; + } + return result.toString(); + } public static boolean isAbsolutePath(String path) { - // On Windows, we cannot just ask if the file name starts with file separator. - // If path contains ":" at the second position, then it is not relative, I guess. - // However, if it starts with separator, then it is absolute too. - - // Possible problems: Not tested on Macintosh, but should work. - - String osNameStart = System.getProperty("os.name").substring(0,3); - String fileSeparator = System.getProperty("file.separator"); - if (osNameStart.equals("Win")) { - return ((path.length() > 1) && path.substring(1,2).equals(":")) || path.startsWith(fileSeparator); - } else if (osNameStart.equals("Mac")) { - return !path.startsWith(fileSeparator); - } else { - return path.startsWith(fileSeparator); - } + // On Windows, we cannot just ask if the file name starts with file + // separator. + // If path contains ":" at the second position, then it is not relative, + // I guess. + // However, if it starts with separator, then it is absolute too. + + // Possible problems: Not tested on Macintosh, but should work. + // Koh, 1.4.2004: Resolved problem: I tested on Mac OS X 10.3.3 and + // worked. + + String osNameStart = System.getProperty("os.name").substring(0, 3); + String fileSeparator = System.getProperty("file.separator"); + if (osNameStart.equals("Win")) { + return ((path.length() > 1) && path.substring(1, 2).equals(":")) + || path.startsWith(fileSeparator); + } else if (osNameStart.equals("Mac")) { + //Koh:Panther (or Java 1.4.2) may change file path rule + return path.startsWith(fileSeparator); + } else { + return path.startsWith(fileSeparator); + } } /** - * This is a correction of a method getFile of a class URL. Namely, on Windows it - * returned file paths like /C: etc., which are not valid on Windows. This correction - * is heuristic to a great extend. One of the reasons is that file:// is basically no - * protocol at all, but rather something every browser and every system uses slightly - * differently. + * This is a correction of a method getFile of a class URL. Namely, on + * Windows it returned file paths like /C: etc., which are not valid on + * Windows. This correction is heuristic to a great extend. One of the + * reasons is that file:// is basically no protocol at all, but rather + * something every browser and every system uses slightly differently. */ public static String urlGetFile(URL url) { - String osNameStart = System.getProperty("os.name").substring(0,3); - String fileSeparator = System.getProperty("file.separator"); - if (osNameStart.equals("Win") && url.getProtocol().equals("file")) { - String fileName = url.toString().replaceFirst("^file:","").replace('/','\\'); - return (fileName.indexOf(':') >= 0) ? - fileName.replaceFirst("^\\\\*","") : - fileName; } // Network path - else { - return url.getFile(); }} - - /** - * This method converts an absolute url to an url relative to a given base-url. - * The algorithm is somewhat chaotic, but it works (Maybe rewrite it). - * Be careful, the method is ".mm"-specific. Something like this should be included - * in the librarys, but I couldn't find it. You can create a new absolute url with - * "new URL(URL context, URL relative)". + String osNameStart = System.getProperty("os.name").substring(0, 3); + String fileSeparator = System.getProperty("file.separator"); + if (osNameStart.equals("Win") && url.getProtocol().equals("file")) { + String fileName = url.toString().replaceFirst("^file:", "") + .replace('/', '\\'); + return (fileName.indexOf(':') >= 0) ? fileName.replaceFirst( + "^\\\\*", "") : fileName; + } // Network path + else { + return url.getFile(); + } + } + + /** + * This method converts an absolute url to an url relative to a given + * base-url. The algorithm is somewhat chaotic, but it works (Maybe rewrite + * it). Be careful, the method is ".mm"-specific. Something like this should + * be included in the librarys, but I couldn't find it. You can create a new + * absolute url with "new URL(URL context, URL relative)". */ public static String toRelativeURL(URL base, URL target) { - // Precondition: If URL is a path to folder, then it must end with '/' character. - if( (base.getProtocol().equals(target.getProtocol())) && - (base.getHost().equals(target.getHost()))) { - - String baseString = base.getFile(); - String targetString = target.getFile(); - String result = ""; - - //remove filename from URL - baseString = baseString.substring(0, baseString.lastIndexOf("/")+1); - - //remove filename from URL - targetString = targetString.substring(0, targetString.lastIndexOf("/")+1); - - StringTokenizer baseTokens = new StringTokenizer(baseString,"/");//Maybe this causes problems under windows - StringTokenizer targetTokens = new StringTokenizer(targetString,"/");//Maybe this causes problems under windows - - String nextBaseToken = "", nextTargetToken = ""; - - //Algorithm - - while(baseTokens.hasMoreTokens() && targetTokens.hasMoreTokens()) { - nextBaseToken = baseTokens.nextToken(); - nextTargetToken = targetTokens.nextToken(); - if (!(nextBaseToken.equals(nextTargetToken))) { - while(true) { - result = result.concat("../"); - if (!baseTokens.hasMoreTokens()) { - break; - } - nextBaseToken = baseTokens.nextToken(); - } - while(true) { - result = result.concat(nextTargetToken+"/"); - if (!targetTokens.hasMoreTokens()) { - break; - } - nextTargetToken = targetTokens.nextToken(); - } - String temp = target.getFile(); - result = result.concat(temp.substring(temp.lastIndexOf("/")+1,temp.length())); - return result; - } - } - - while(baseTokens.hasMoreTokens()) { - result = result.concat("../"); - baseTokens.nextToken(); - } - - while(targetTokens.hasMoreTokens()) { - nextTargetToken = targetTokens.nextToken(); - result = result.concat(nextTargetToken + "/"); - } - - String temp = target.getFile(); - result = result.concat(temp.substring(temp.lastIndexOf("/")+1,temp.length())); - return result; - } - return target.toString(); - } - - public static boolean safeEquals(String string1, String string2) { - return (string1 != null && string2 != null && string1.equals(string2)); } - - public static String firstLetterCapitalized(String text) { - if (text == null || text.length() == 0) { - return text; } - return text.substring(0,1).toUpperCase() + text.substring(1,text.length()); } - - public static void setHidden(File file, boolean hidden, boolean synchronously) { - // According to Web articles, UNIX systems do not have attribute hidden - // in general, rather, they consider files starting with . as hidden. - String osNameStart = System.getProperty("os.name").substring(0,3); - if (osNameStart.equals("Win")) { - try { - Runtime.getRuntime().exec("attrib "+(hidden?"+":"-")+"H \""+file.getAbsolutePath()+"\""); - // Synchronize the effect, because it is asynchronous in general. - if (!synchronously) { - return; } - int timeOut = 10; - while (file.isHidden() != hidden && timeOut > 0) { - Thread.sleep(10/*miliseconds*/); - timeOut--; }} - catch (Exception e) {e.printStackTrace(); }}} - - /** - * Example: expandPlaceholders("Hello $1.","Dolly"); => "Hello Dolly." - */ - public static String expandPlaceholders(String message, String s1) { - String result = message; - if (s1 != null) { - s1 = s1.replaceAll("\\\\","\\\\\\\\"); // Replace \ with \\ - result = result.replaceAll("\\$1",s1); } - return result; } - - public static String expandPlaceholders(String message, String s1, String s2) { - String result = message; - if (s1 != null) { - result = result.replaceAll("\\$1",s1); } - if (s2 != null) { - result = result.replaceAll("\\$2",s2); } - return result; } - - public static String expandPlaceholders(String message, String s1, String s2, String s3) { - String result = message; - if (s1 != null) { - result = result.replaceAll("\\$1",s1); } - if (s2 != null) { - result = result.replaceAll("\\$2",s2); } - if (s3 != null) { - result = result.replaceAll("\\$3",s3); } - return result; } - - public static class IntHolder { - private int value; - public IntHolder () {} - public IntHolder (int value) {this.value = value;} - public void setValue(int value) { - this.value = value; } - public int getValue() { - return value; } - public String toString() { - return new String("IntHolder(")+value+")"; - } - } - - public static class BooleanHolder { - private boolean value; - public BooleanHolder () {} - public void setValue(boolean value) { - this.value = value; } - public boolean getValue() { - return value; }} - - public static class ObjectHolder { - Object object; - public ObjectHolder () {} - public void setObject(Object object) { - this.object = object; } - public Object getObject() { - return object; }} - - public static class Pair { - Object first; - Object second; - public Pair (Object first, Object second) { - this.first = first; - this.second = second; } - public Object getFirst() { - return first; } - public Object getSecond() { - return second; }} + // Precondition: If URL is a path to folder, then it must end with '/' + // character. + if ((base.getProtocol().equals(target.getProtocol())) + && (base.getHost().equals(target.getHost()))) { + + String baseString = base.getFile(); + String targetString = target.getFile(); + String result = ""; + + //remove filename from URL + baseString = baseString.substring(0, + baseString.lastIndexOf("/") + 1); + + //remove filename from URL + targetString = targetString.substring(0, targetString + .lastIndexOf("/") + 1); + + StringTokenizer baseTokens = new StringTokenizer(baseString, "/");//Maybe + // this + // causes + // problems + // under + // windows + StringTokenizer targetTokens = new StringTokenizer(targetString, + "/");//Maybe this causes problems under windows + + String nextBaseToken = "", nextTargetToken = ""; + + //Algorithm + + while (baseTokens.hasMoreTokens() && targetTokens.hasMoreTokens()) { + nextBaseToken = baseTokens.nextToken(); + nextTargetToken = targetTokens.nextToken(); + if (!(nextBaseToken.equals(nextTargetToken))) { + while (true) { + result = result.concat("../"); + if (!baseTokens.hasMoreTokens()) { + break; + } + nextBaseToken = baseTokens.nextToken(); + } + while (true) { + result = result.concat(nextTargetToken + "/"); + if (!targetTokens.hasMoreTokens()) { + break; + } + nextTargetToken = targetTokens.nextToken(); + } + String temp = target.getFile(); + result = result.concat(temp.substring( + temp.lastIndexOf("/") + 1, temp.length())); + return result; + } + } + + while (baseTokens.hasMoreTokens()) { + result = result.concat("../"); + baseTokens.nextToken(); + } + + while (targetTokens.hasMoreTokens()) { + nextTargetToken = targetTokens.nextToken(); + result = result.concat(nextTargetToken + "/"); + } + + String temp = target.getFile(); + result = result.concat(temp.substring(temp.lastIndexOf("/") + 1, + temp.length())); + return result; + } + return target.toString(); + } + + public static boolean safeEquals(String string1, String string2) { + return (string1 != null && string2 != null && string1.equals(string2)) + || (string1 == null && string2 == null); + } + + public static boolean safeEqualsIgnoreCase(String string1, String string2) { + return (string1 != null && string2 != null && string1.toLowerCase() + .equals(string2.toLowerCase())) + || (string1 == null && string2 == null); + } + + public static boolean safeEquals(Color color1, Color color2) { + return (color1 != null && color2 != null && color1.equals(color2)) + || (color1 == null && color2 == null); + } + + public static String firstLetterCapitalized(String text) { + if (text == null || text.length() == 0) { + return text; + } + return text.substring(0, 1).toUpperCase() + + text.substring(1, text.length()); + } + + public static void setHidden(File file, boolean hidden, + boolean synchronously) { + // According to Web articles, UNIX systems do not have attribute hidden + // in general, rather, they consider files starting with . as hidden. + String osNameStart = System.getProperty("os.name").substring(0, 3); + if (osNameStart.equals("Win")) { + try { + Runtime.getRuntime().exec( + "attrib " + (hidden ? "+" : "-") + "H \"" + + file.getAbsolutePath() + "\""); + // Synchronize the effect, because it is asynchronous in + // general. + if (!synchronously) { + return; + } + int timeOut = 10; + while (file.isHidden() != hidden && timeOut > 0) { + Thread.sleep(10/* miliseconds */); + timeOut--; + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + /** + * Example: expandPlaceholders("Hello $1.","Dolly"); => "Hello Dolly." + */ + public static String expandPlaceholders(String message, String s1) { + String result = message; + if (s1 != null) { + s1 = s1.replaceAll("\\\\", "\\\\\\\\"); // Replace \ with \\ + result = result.replaceAll("\\$1", s1); + } + return result; + } + + public static String expandPlaceholders(String message, String s1, String s2) { + String result = message; + if (s1 != null) { + result = result.replaceAll("\\$1", s1); + } + if (s2 != null) { + result = result.replaceAll("\\$2", s2); + } + return result; + } + + public static String expandPlaceholders(String message, String s1, + String s2, String s3) { + String result = message; + if (s1 != null) { + result = result.replaceAll("\\$1", s1); + } + if (s2 != null) { + result = result.replaceAll("\\$2", s2); + } + if (s3 != null) { + result = result.replaceAll("\\$3", s3); + } + return result; + } + + public static class IntHolder { + private int value; + + public IntHolder() { + } + + public IntHolder(int value) { + this.value = value; + } + + public void setValue(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + + public String toString() { + return new String("IntHolder(") + value + ")"; + } + } + + public static class BooleanHolder { + private boolean value; + + public BooleanHolder() { + } + + public void setValue(boolean value) { + this.value = value; + } + + public boolean getValue() { + return value; + } + } + + public static class ObjectHolder { + Object object; + + public ObjectHolder() { + } + + public void setObject(Object object) { + this.object = object; + } + + public Object getObject() { + return object; + } + } + + public static class Pair { + Object first; + + Object second; + + public Pair(Object first, Object second) { + this.first = first; + this.second = second; + } + + public Object getFirst() { + return first; + } + + public Object getSecond() { + return second; + } + } + + /** + * @param byteBuffer + * @return + */ + public static String toBase64(byte[] byteBuffer) { + return (new sun.misc.BASE64Encoder()).encode(byteBuffer); + } + + /** + * @param base64String + * @return + * @throws IOException + */ + public static byte[] fromBase64(String base64String) { + try { + return new sun.misc.BASE64Decoder().decodeBuffer(base64String); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException("Base64 unpacking not allowed"); + } + } + + public static String compress(String message) { + byte[] input = uTF8StringToByteArray(message); + // Create the compressor with highest level of compression + Deflater compressor = new Deflater(); + compressor.setLevel(Deflater.BEST_COMPRESSION); + + // Give the compressor the data to compress + compressor.setInput(input); + compressor.finish(); + + // Create an expandable byte array to hold the compressed data. + // You cannot use an array that's the same size as the orginal because + // there is no guarantee that the compressed data will be smaller than + // the uncompressed data. + ByteArrayOutputStream bos = new ByteArrayOutputStream(input.length); + + // Compress the data + byte[] buf = new byte[1024]; + while (!compressor.finished()) { + int count = compressor.deflate(buf); + bos.write(buf, 0, count); + } + try { + bos.close(); + } catch (IOException e) { + } + + // Get the compressed data + byte[] compressedData = bos.toByteArray(); + return toBase64(compressedData); + } + + public static String decompress(String compressedMessage) { + byte[] compressedData = fromBase64(compressedMessage); + // Create the decompressor and give it the data to compress + Inflater decompressor = new Inflater(); + decompressor.setInput(compressedData); + + // Create an expandable byte array to hold the decompressed data + ByteArrayOutputStream bos = new ByteArrayOutputStream( + compressedData.length); + + // Decompress the data + byte[] buf = new byte[1024]; + while (!decompressor.finished()) { + try { + int count = decompressor.inflate(buf); + bos.write(buf, 0, count); + } catch (DataFormatException e) { + } + } + try { + bos.close(); + } catch (IOException e) { + } + + // Get the decompressed data + byte[] decompressedData = bos.toByteArray(); + return byteArrayToUTF8String(decompressedData); + } + /** + * @param compressedData + * @return + */ + public static String byteArrayToUTF8String(byte[] compressedData) { + // Decode using utf-8 + try { + return new String(compressedData, "UTF8"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("UTF8 packing not allowed"); + } + } + /** + * @param uncompressedData + * @return + */ + public static byte[] uTF8StringToByteArray(String uncompressedData) { + // Code using utf-8 + try { + return uncompressedData.getBytes("UTF8"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("UTF8 packing not allowed"); + } + } + + /** Extracts a long from xml. Only useful for dates. + * @param xmlString + * @return + */ + public static Date xmlToDate(String xmlString) { + try { + return new Date(Long.valueOf(xmlString).longValue()); + } catch (Exception e) { + return new Date(System.currentTimeMillis()); + } + } + + + public static String dateToString(Date date) { + return Long.toString(date.getTime()); + } + } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/main/XMLElement.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/main/XMLElement.java --- freemind-0.7.1/freemind/freemind/main/XMLElement.java 2009-05-14 23:12:10.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/main/XMLElement.java 2005-02-10 23:01:20.000000000 +0000 @@ -1,8 +1,8 @@ /* XMLElement.java * - * $Revision: 1.7 $ - * $Date: 2003/11/03 11:00:10 $ - * $Name: $ + * $Revision: 1.7.18.3 $ + * $Date: 2005/02/10 23:01:20 $ + * $Name: FM-0-8-1 $ * * This file is part of NanoXML 2 Lite. * Copyright (C) 2000-2002 Marc De Scheemaecker, All Rights Reserved. @@ -28,6 +28,7 @@ /* * This version of XMLElement has been *altered* for the purposes of FreeMind + * toUpperCase(Locale.ENGLISH) for turkish added. */ package freemind.main; @@ -41,6 +42,9 @@ import java.io.Writer; import java.util.Enumeration; import java.util.Hashtable; +import java.util.Iterator; +import java.util.Locale; +import java.util.TreeMap; import java.util.Vector; @@ -100,7 +104,7 @@ * * @author Marc De Scheemaecker * <cyberelf@mac.com> - * @version $Name: $, $Revision: 1.7 $ + * @version $Name: FM-0-8-1 $, $Revision: 1.7.18.3 $ */ public class XMLElement { @@ -142,7 +146,7 @@ *
  • The keys and the values are strings. * */ - private Hashtable attributes; + private TreeMap attributes; /** @@ -476,7 +480,7 @@ this.ignoreCase = ignoreCase; this.name = null; this.contents = ""; - this.attributes = new Hashtable(); + this.attributes = new TreeMap(); this.children = new Vector(); this.entities = entities; this.lineNr = 0; @@ -579,7 +583,7 @@ Object value) { if (this.ignoreCase) { - name = name.toUpperCase(); + name = name.toUpperCase(Locale.ENGLISH); } this.attributes.put(name, value.toString()); } @@ -642,7 +646,7 @@ int value) { if (this.ignoreCase) { - name = name.toUpperCase(); + name = name.toUpperCase(Locale.ENGLISH); } this.attributes.put(name, Integer.toString(value)); } @@ -705,7 +709,7 @@ double value) { if (this.ignoreCase) { - name = name.toUpperCase(); + name = name.toUpperCase(Locale.ENGLISH); } this.attributes.put(name, Double.toString(value)); } @@ -802,9 +806,9 @@ * java.lang.String, boolean) * getBooleanAttribute(String, String, String, boolean) */ - public Enumeration enumerateAttributeNames() + public Iterator enumerateAttributeNames() { - return this.attributes.keys(); + return this.attributes.keySet().iterator(); } @@ -814,7 +818,7 @@ * @deprecated Use {@link #enumerateAttributeNames() * enumerateAttributeNames} instead. */ - public Enumeration enumeratePropertyNames() + public Iterator enumeratePropertyNames() { return this.enumerateAttributeNames(); } @@ -963,7 +967,7 @@ Object defaultValue) { if (this.ignoreCase) { - name = name.toUpperCase(); + name = name.toUpperCase(Locale.ENGLISH); } Object value = this.attributes.get(name); if (value == null) { @@ -1016,7 +1020,7 @@ boolean allowLiterals) { if (this.ignoreCase) { - name = name.toUpperCase(); + name = name.toUpperCase(Locale.ENGLISH); } Object key = this.attributes.get(name); Object result; @@ -1198,7 +1202,7 @@ int defaultValue) { if (this.ignoreCase) { - name = name.toUpperCase(); + name = name.toUpperCase(Locale.ENGLISH); } String value = (String) this.attributes.get(name); if (value == null) { @@ -1256,7 +1260,7 @@ boolean allowLiteralNumbers) { if (this.ignoreCase) { - name = name.toUpperCase(); + name = name.toUpperCase(Locale.ENGLISH); } Object key = this.attributes.get(name); Integer result; @@ -1335,7 +1339,7 @@ double defaultValue) { if (this.ignoreCase) { - name = name.toUpperCase(); + name = name.toUpperCase(Locale.ENGLISH); } String value = (String) this.attributes.get(name); if (value == null) { @@ -1394,7 +1398,7 @@ boolean allowLiteralNumbers) { if (this.ignoreCase) { - name = name.toUpperCase(); + name = name.toUpperCase(Locale.ENGLISH); } Object key = this.attributes.get(name); Double result; @@ -1454,7 +1458,7 @@ boolean defaultValue) { if (this.ignoreCase) { - name = name.toUpperCase(); + name = name.toUpperCase(Locale.ENGLISH); } Object value = this.attributes.get(name); if (value == null) { @@ -2028,7 +2032,7 @@ public void removeAttribute(String name) { if (this.ignoreCase) { - name = name.toUpperCase(); + name = name.toUpperCase(Locale.ENGLISH); } this.attributes.remove(name); } @@ -2194,10 +2198,10 @@ writer.write('<'); writer.write(this.name); if (! this.attributes.isEmpty()) { - Enumeration enumerator = this.attributes.keys(); - while (enumerator.hasMoreElements()) { + Iterator enumerator = this.attributes.keySet().iterator(); + while (enumerator.hasNext()) { writer.write(' '); - String key = (String) enumerator.nextElement(); + String key = (String) enumerator.next(); String value = (String) this.attributes.get(key); writer.write(key); writer.write('='); writer.write('"'); @@ -2207,7 +2211,7 @@ } if ((this.contents != null) && (this.contents.length() > 0)) { writer.write('>'); - writer.write('\n'); + //writer.write('\n'); this.writeEncoded(writer, this.contents); if (withClosingTag) { writer.write('<'); writer.write('/'); diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/main/XMLParseException.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/main/XMLParseException.java --- freemind-0.7.1/freemind/freemind/main/XMLParseException.java 2003-11-03 11:00:10.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/main/XMLParseException.java 2003-11-03 11:00:10.000000000 +0000 @@ -2,7 +2,7 @@ * * $Revision: 1.7 $ * $Date: 2003/11/03 11:00:10 $ - * $Name: $ + * $Name: FM-0-8-1 $ * * This file is part of NanoXML 2 Lite. * Copyright (C) 2000-2002 Marc De Scheemaecker, All Rights Reserved. @@ -44,7 +44,7 @@ * @see nanoxml.XMLElement * * @author Marc De Scheemaecker - * @version $Name: $, $Revision: 1.7 $ + * @version $Name: FM-0-8-1 $, $Revision: 1.7 $ */ public class XMLParseException extends RuntimeException diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/AddArrowLinkAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/AddArrowLinkAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/AddArrowLinkAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/AddArrowLinkAction.java 2004-10-18 00:00:08.000000000 +0100 @@ -0,0 +1,161 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 07.10.2004 + */ +/*$Id: AddArrowLinkAction.java,v 1.1.4.1 2004/10/17 23:00:08 dpolivaev Exp $*/ + +package freemind.modes.actions; + +import java.awt.event.ActionEvent; +import java.util.List; + +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.FreemindAction; +import freemind.controller.actions.generated.instance.AddArrowLinkXmlAction; +import freemind.controller.actions.generated.instance.RemoveArrowLinkXmlAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.main.Tools; +import freemind.modes.MindMapLinkRegistry; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; +import freemind.modes.mindmapmode.MindMapArrowLinkModel; + +/** + * @author foltin + * + */ +public class AddArrowLinkAction extends FreemindAction implements ActorXml{ + + private final ModeController modeController; + + private RemoveArrowLinkAction removeAction; + /** + * @param removeAction The removeAction to set. + */ + public void setRemoveAction(RemoveArrowLinkAction removeAction) { + this.removeAction = removeAction; + } + /** + * @param title + * @param iconPath + * @param modeController + */ + public AddArrowLinkAction(ModeController modeController) { + super("add_link", "images/designer.png", modeController); + this.modeController = modeController; + addActor(this); + } + + public void actionPerformed(ActionEvent e) { + // assert that at least two nodes are selected. draw an arrow link in between. + List selecteds = modeController.getSelecteds(); + if(selecteds.size()< 2) { + modeController.getController().errorMessage(modeController.getText("less_than_two_selected_nodes")); + return; + } + for (int i = 1; i < selecteds.size(); i++) { + addLink((MindMapNode) selecteds.get(i), (MindMapNode) selecteds.get(0)); + } + } + + public void act(XmlAction action) { + if (action instanceof AddArrowLinkXmlAction) { + AddArrowLinkXmlAction arrowAction = (AddArrowLinkXmlAction) action; + MindMapNode source = modeController.getNodeFromID(arrowAction.getNode()); + MindMapNode target = modeController.getNodeFromID(arrowAction.getDestination()); + String proposedId = arrowAction.getNewId(); + + if(getLinkRegistry().getLabel(target) == null) { + // call registry to give new label + getLinkRegistry().registerLinkTarget(target); + } + MindMapArrowLinkModel linkModel = new MindMapArrowLinkModel(source, target, modeController.getFrame()); + linkModel.setDestinationLabel(getLinkRegistry().getLabel(target)); + // give label: + linkModel.setUniqueID(getLinkRegistry().generateUniqueLinkID(proposedId)); + // check for other attributes: + if(arrowAction.getColor()!= null) { + linkModel.setColor(Tools.xmlToColor(arrowAction.getColor())); + } + if(arrowAction.getEndArrow()!= null) { + linkModel.setEndArrow(arrowAction.getEndArrow()); + } + if(arrowAction.getEndInclination()!= null) { + linkModel.setEndInclination(Tools.xmlToPoint(arrowAction.getEndInclination())); + } + if(arrowAction.getStartArrow()!= null) { + linkModel.setStartArrow(arrowAction.getStartArrow()); + } + if(arrowAction.getStartInclination()!= null) { + linkModel.setStartInclination(Tools.xmlToPoint(arrowAction.getStartInclination())); + } + // register link. + getLinkRegistry().registerLink(linkModel); + modeController.nodeChanged(target); + modeController.nodeChanged(source); + + } + } + + public Class getDoActionClass() { + return AddArrowLinkXmlAction.class; + } + + private ActionPair getActionPair(MindMapNode source, MindMapNode target) { + AddArrowLinkXmlAction doAction = createAddArrowLinkXmlAction(source, target,getLinkRegistry().generateUniqueLinkID(null)); + // now, the id is clear: + RemoveArrowLinkXmlAction undoAction = removeAction.createRemoveArrowLinkXmlAction(doAction.getNewId()); + return new ActionPair(doAction, undoAction); + } + + public AddArrowLinkXmlAction createAddArrowLinkXmlAction(MindMapNode source, MindMapNode target, String proposedID) { + try { + AddArrowLinkXmlAction action = modeController.getActionXmlFactory() + .createAddArrowLinkXmlAction(); + action.setNode(source.getObjectId(modeController)); + action.setDestination(target.getObjectId(modeController)); + action.setNewId(proposedID); + return action; + } catch (JAXBException e) { + e.printStackTrace(); + return null; + } + } + /** Source holds the MindMapArrowLinkModel and points to the id placed in target.*/ + public void addLink(MindMapNode source, MindMapNode target) { + modeController.getActionFactory().startTransaction( + (String) getValue(NAME)); + modeController.getActionFactory().executeAction( + getActionPair(source,target)); + modeController.getActionFactory().endTransaction( + (String) getValue(NAME)); + } + + /** + * @return + */ + private MindMapLinkRegistry getLinkRegistry() { + return modeController.getMap().getLinkRegistry(); + } + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/AddLocalLinkAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/AddLocalLinkAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/AddLocalLinkAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/AddLocalLinkAction.java 2004-10-18 00:00:08.000000000 +0100 @@ -0,0 +1,64 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 07.10.2004 + */ +/*$Id: AddLocalLinkAction.java,v 1.1.4.1 2004/10/17 23:00:08 dpolivaev Exp $*/ + +package freemind.modes.actions; + +import java.awt.event.ActionEvent; +import java.util.List; + +import freemind.controller.actions.FreemindAction; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; + +/** + * @author foltin + * + */ +public class AddLocalLinkAction extends FreemindAction { + + private final ModeController modeController; + + /** + * @param title + * @param iconPath + * @param modeController + */ + public AddLocalLinkAction(ModeController modeController) { + super("add_local_link", "images/LinkLocal.png", modeController); + this.modeController = modeController; + } + + public void actionPerformed(ActionEvent e) { + // assert that at least two nodes are selected. draw an arrow link in between. + List selecteds = modeController.getSelecteds(); + if(selecteds.size()< 2) { + modeController.getController().errorMessage(modeController.getText("less_than_two_selected_nodes")); + return; + } + for (int i = 1; i < selecteds.size(); i++) { + modeController.setLink((MindMapNode) selecteds.get(i), "#"+((MindMapNode) selecteds.get(0)).getObjectId(modeController)); + } + } + + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/ApplyPatternAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/ApplyPatternAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/ApplyPatternAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/ApplyPatternAction.java 2005-04-14 21:37:23.000000000 +0100 @@ -0,0 +1,123 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + * See COPYING for Details + * + * 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. + * + * Created on 05.10.2004 + */ +/* + * $Id: ApplyPatternAction.java,v 1.16.10.1 05.10.2004 11:32:42 christianfoltin + * Exp $ + */ + +package freemind.modes.actions; + +import java.util.ListIterator; + +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; +import freemind.modes.NodeAdapter; +import freemind.modes.StylePattern; +import freemind.modes.mindmapmode.MindMapMapModel; +import freemind.modes.mindmapmode.MindMapNodeModel; + +public class ApplyPatternAction extends NodeGeneralAction implements + SingleNodeOperation { + private StylePattern mpattern; + + public ApplyPatternAction(ModeController controller, StylePattern pattern) { + super(controller, null /* no text */, null /* = no icon */); + setName(pattern.getName()); + this.mpattern = pattern; + setSingleNodeOperation(this); + } + + public void apply(MindMapMapModel map, MindMapNodeModel node) { + applyPattern(node, mpattern); + } + + public void applyPattern(MindMapNode node, StylePattern pattern) { + if (pattern.getAppliesToNode()) { + if (pattern.getText() != null) { + getModeController().setNodeText(node, pattern.getText()); + } + getModeController().setNodeColor(node, pattern.getNodeColor()); + getModeController().setNodeBackgroundColor(node, pattern.getNodeBackgroundColor()); + //FIXME: fc, 3.1.2004: setting the style to "null" causes strange behaviour. + // see https://sourceforge.net/tracker/?func=detail&atid=107118&aid=1094623&group_id=7118 + if (pattern.getNodeStyle() != null) { + getModeController().setNodeStyle(node, pattern.getNodeStyle()); + } + if (pattern.getAppliesToNodeIcon()) { + if (pattern.getNodeIcon() == null) { + while (getModeController().removeLastIcon(node) > 0) { + } + } else { + getModeController().addIcon(node, pattern.getNodeIcon()); + } + } // fc, 28.9.2003 + if (pattern.getAppliesToNodeFont()) { + String nodeFontFamily = pattern.getNodeFontFamily(); + if (nodeFontFamily == null) { + nodeFontFamily = getModeController().getController().getDefaultFontFamilyName(); + } + getModeController().setFontFamily(node, + nodeFontFamily); + Integer nodeFontSize = pattern.getNodeFontSize(); + if (nodeFontSize == null) { + nodeFontSize = new Integer(getModeController().getController().getDefaultFontSize()); + } + getModeController().setFontSize(node, + String.valueOf(nodeFontSize)); + if (pattern.getNodeFontItalic() != null) { + getModeController().setItalic(node, + pattern.getNodeFontItalic().booleanValue()); + } else { + getModeController().setItalic(node,false); + + } + if (pattern.getNodeFontBold() != null) { + getModeController().setBold(node, + pattern.getNodeFontBold().booleanValue()); + } else { + getModeController().setBold(node,false); + } + } + } + + if (pattern.getAppliesToEdge()) { + getModeController().setEdgeColor(node, pattern.getEdgeColor()); + getModeController().setEdgeStyle(node, pattern.getEdgeStyle()); + getModeController().setEdgeWidth(node, pattern.getEdgeWidth()); + } + + if (pattern.getAppliesToChildren()) { + for (ListIterator i = node.childrenUnfolded(); i.hasNext();) { + NodeAdapter child = (NodeAdapter) i.next(); + applyPattern(child, pattern.getChildrenStylePattern()); + } + } + } + + /** + * @return Returns the pattern. + */ + public StylePattern getPattern() { + return mpattern; + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/BoldAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/BoldAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/BoldAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/BoldAction.java 2004-10-18 00:00:08.000000000 +0100 @@ -0,0 +1,86 @@ +/* + * Created on 05.05.2004 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package freemind.modes.actions; + +import javax.swing.Action; +import javax.swing.JMenuItem; +import javax.xml.bind.JAXBException; + +import freemind.controller.MenuItemEnabledListener; +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.NodeActorXml; +import freemind.controller.actions.generated.instance.BoldNodeAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.ControllerAdapter; +import freemind.modes.MapAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.NodeAdapter; + + +public class BoldAction extends NodeGeneralAction implements NodeActorXml, MenuItemEnabledListener{ + /** + * @param textID + * @param iconPath + * @param actor + */ + public BoldAction(ControllerAdapter modeController) { + super(modeController, "bold", "images/Bold16.gif"); + addActor(this); + } + + public void act(XmlAction action) { + if (action instanceof BoldNodeAction) { + BoldNodeAction boldact = (BoldNodeAction) action; + NodeAdapter node = getNodeFromID(boldact.getNode()); + if (node.isBold() != boldact.isBold()) { + node.setBold(boldact.isBold()); + modeController.nodeChanged(node); + } + } + } + + + public Class getDoActionClass() { + return BoldNodeAction.class; + } + + public ActionPair apply(MapAdapter model, MindMapNode selected) throws JAXBException { + // every node is set to the inverse of the focussed node. + boolean bold = modeController.getSelected().isBold(); + return getActionPair(selected, !bold); + } + + private ActionPair getActionPair(MindMapNode selected, boolean bold) + throws JAXBException { + BoldNodeAction boldAction = toggleBold(selected, bold); + BoldNodeAction undoBoldAction = toggleBold(selected, selected.isBold()); + return new ActionPair(boldAction, undoBoldAction); + } + + private BoldNodeAction toggleBold(MindMapNode selected, boolean bold) + throws JAXBException { + BoldNodeAction boldAction = getActionXmlFactory().createBoldNodeAction(); + boldAction.setNode(getNodeID(selected)); + boldAction.setBold(bold); + return boldAction; + } + + public void setBold(MindMapNode node, boolean bold) { + try { + execute(getActionPair(node, bold)); + } catch (JAXBException e) { + e.printStackTrace(); + } + } + + public boolean isEnabled(JMenuItem item, Action action) { + setSelected(item, modeController.getSelected().isBold()); + return true; + } + + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/ChangeArrowLinkEndPoints.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/ChangeArrowLinkEndPoints.java --- freemind-0.7.1/freemind/freemind/modes/actions/ChangeArrowLinkEndPoints.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/ChangeArrowLinkEndPoints.java 2005-01-10 07:29:07.000000000 +0000 @@ -0,0 +1,130 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2005 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 09.01.2005 + */ +/*$Id: ChangeArrowLinkEndPoints.java,v 1.1.2.1 2005/01/10 07:29:07 christianfoltin Exp $*/ +package freemind.modes.actions; + +import java.awt.Point; +import java.awt.event.ActionEvent; + +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.FreemindAction; +import freemind.controller.actions.generated.instance.ArrowLinkPointXmlAction; +import freemind.controller.actions.generated.instance.ArrowLinkPointXmlAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.main.Tools; +import freemind.modes.ArrowLinkAdapter; +import freemind.modes.MindMapArrowLink; +import freemind.modes.MindMapLink; +import freemind.modes.MindMapLinkRegistry; +import freemind.modes.ModeController; +import freemind.modes.mindmapmode.MindMapArrowLinkModel; + +/** + * @author foltin + * + */ +public class ChangeArrowLinkEndPoints extends FreemindAction implements ActorXml { + private ModeController controller; + + public ChangeArrowLinkEndPoints(ModeController modeController) { + //fixme: icon wrong + super("change_link_arrows", "images/designer.png", modeController); + this.controller = modeController; + addActor(this); + } + + public void setArrowLinkEndPoints(MindMapArrowLink link, Point startPoint, + Point endPoint){ + controller.getActionFactory().startTransaction( + (String) getValue(NAME)); + controller.getActionFactory().executeAction( + getActionPair(link, startPoint, endPoint)); + controller.getActionFactory().endTransaction( + (String) getValue(NAME)); + + } + + /** + * @param link + * @param startPoint + * @param endPoint + * @return + */ + private ActionPair getActionPair(MindMapArrowLink link, Point startPoint, Point endPoint) { + return new ActionPair(createArrowLinkPointXmlAction(link, startPoint, endPoint), + createArrowLinkPointXmlAction(link, link.getStartInclination(), link.getEndInclination())); + } + + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#act(freemind.controller.actions.generated.instance.XmlAction) + */ + public void act(XmlAction action) { + if (action instanceof ArrowLinkPointXmlAction) { + ArrowLinkPointXmlAction pointAction = (ArrowLinkPointXmlAction) action; + MindMapArrowLink link = (MindMapArrowLink) getLinkRegistry().getLinkForID(pointAction.getId()); + link.setStartInclination(Tools.xmlToPoint(pointAction.getStartPoint())); + link.setEndInclination(Tools.xmlToPoint(pointAction.getEndPoint())); + controller.nodeChanged(link.getSource()); + controller.nodeChanged(link.getTarget()); + } + + } + + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#getDoActionClass() + */ + public Class getDoActionClass() { + return ArrowLinkPointXmlAction.class; + } + + /* (non-Javadoc) + * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) + */ + public void actionPerformed(ActionEvent arg0) { + // TODO Auto-generated method stub + + } + private ArrowLinkPointXmlAction createArrowLinkPointXmlAction(MindMapArrowLink arrowLink, + Point startPoint, Point endPoint){ + try { + ArrowLinkPointXmlAction action = controller.getActionXmlFactory().createArrowLinkPointXmlAction(); + action.setStartPoint(Tools.PointToXml(startPoint)); + action.setEndPoint(Tools.PointToXml(endPoint)); + action.setId(arrowLink.getUniqueID()); + return action; + } catch (JAXBException e) { + e.printStackTrace(); + return null; + } + } + /** + * @return + */ + private MindMapLinkRegistry getLinkRegistry() { + return controller.getMap().getLinkRegistry(); + } + + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/ChangeArrowsInArrowLinkAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/ChangeArrowsInArrowLinkAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/ChangeArrowsInArrowLinkAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/ChangeArrowsInArrowLinkAction.java 2005-01-10 07:29:07.000000000 +0000 @@ -0,0 +1,131 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + * See COPYING for Details + * + * 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. + * + * Created on 08.10.2004 + */ +/* + * $Id: ChangeArrowsInArrowLinkAction.java,v 1.16.10.1 08.10.2004 23:12:57 + * christianfoltin Exp $ + */ + +package freemind.modes.actions; + +import java.awt.event.ActionEvent; + +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.FreemindAction; +import freemind.controller.actions.generated.instance.ArrowLinkArrowXmlAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.ArrowLinkAdapter; +import freemind.modes.MindMapLink; +import freemind.modes.MindMapLinkRegistry; +import freemind.modes.ModeController; +import freemind.modes.mindmapmode.MindMapArrowLinkModel; + +public class ChangeArrowsInArrowLinkAction extends FreemindAction implements + ActorXml { + MindMapArrowLinkModel arrowLink; + + boolean hasStartArrow; + + boolean hasEndArrow; + + private final ModeController controller; + + public ChangeArrowsInArrowLinkAction(ModeController controller, + String text, String iconPath, MindMapArrowLinkModel arrowLink, + boolean hasStartArrow, boolean hasEndArrow) { + super("change_arrows_in_arrow_link", iconPath, controller); + this.controller = controller; + this.arrowLink = arrowLink; + this.hasStartArrow = hasStartArrow; + this.hasEndArrow = hasEndArrow; + addActor(this); + } + + public void actionPerformed(ActionEvent e) { + changeArrowsOfArrowLink(arrowLink, hasStartArrow, hasEndArrow); + } + + public void changeArrowsOfArrowLink(MindMapArrowLinkModel arrowLink, + boolean hasStartArrow, boolean hasEndArrow) { + controller.getActionFactory().startTransaction( + (String) getValue(NAME)); + controller.getActionFactory().executeAction( + getActionPair(arrowLink, hasStartArrow, hasEndArrow)); + controller.getActionFactory().endTransaction( + (String) getValue(NAME)); + } + + /** + * @param arrowLink2 + * @param hasStartArrow2 + * @param hasEndArrow2 + * @return + */ + private ActionPair getActionPair(MindMapArrowLinkModel arrowLink2, boolean hasStartArrow2, boolean hasEndArrow2) { + return new ActionPair(createArrowLinkArrowXmlAction(arrowLink2, hasStartArrow2, hasEndArrow2), + createArrowLinkArrowXmlAction(arrowLink2, arrowLink2.getStartArrow(), arrowLink2.getEndArrow())); + } + + public void act(XmlAction action) { + if (action instanceof ArrowLinkArrowXmlAction) { + ArrowLinkArrowXmlAction arrowAction = (ArrowLinkArrowXmlAction) action; + MindMapLink link = getLinkRegistry().getLinkForID(arrowAction.getId()); + ((ArrowLinkAdapter) link).setStartArrow(arrowAction.getStartArrow()); + ((ArrowLinkAdapter) link).setEndArrow(arrowAction.getEndArrow()); + controller.nodeChanged(link.getSource()); + controller.nodeChanged(link.getTarget()); + } + } + + public Class getDoActionClass() { + return ArrowLinkArrowXmlAction.class; + } + private ArrowLinkArrowXmlAction createArrowLinkArrowXmlAction(MindMapArrowLinkModel arrowLink, + boolean hasStartArrow, boolean hasEndArrow){ + return createArrowLinkArrowXmlAction(arrowLink, (hasStartArrow) ? "Default" : "None", (hasEndArrow) ? "Default" : "None"); + } + + private ArrowLinkArrowXmlAction createArrowLinkArrowXmlAction(MindMapArrowLinkModel arrowLink, + String hasStartArrow, String hasEndArrow){ + try { + ArrowLinkArrowXmlAction action = controller.getActionXmlFactory().createArrowLinkArrowXmlAction(); + action.setStartArrow(hasStartArrow); + action.setEndArrow(hasEndArrow); + action.setId(arrowLink.getUniqueID()); + return action; + } catch (JAXBException e) { + e.printStackTrace(); + return null; + } + } + /** + * @return + */ + private MindMapLinkRegistry getLinkRegistry() { + return controller.getMap().getLinkRegistry(); + } + + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/CloudAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/CloudAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/CloudAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/CloudAction.java 2005-06-06 21:14:57.000000000 +0100 @@ -0,0 +1,122 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 06.10.2004 + */ +/*$Id: CloudAction.java,v 1.1.4.2 2005/06/06 20:14:57 christianfoltin Exp $*/ + +package freemind.modes.actions; + +import java.awt.Color; + +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.NodeActorXml; +import freemind.controller.actions.generated.instance.AddCloudXmlAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.main.Tools; +import freemind.modes.MapAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; +import freemind.modes.mindmapmode.MindMapCloudModel; + +/** + * @author foltin + * + */ +public class CloudAction extends NodeGeneralAction implements NodeActorXml { + + public CloudAction(ModeController controller) { + super(controller, "cloud", "images/Cloud24.gif"); + addActor(this); + } + + public Class getDoActionClass() { + return AddCloudXmlAction.class; + } + + public ActionPair apply(MapAdapter model, MindMapNode selected) + throws JAXBException { + ActionPair pair = getActionPair(selected, selected.getCloud() == null); + return pair; + } + + public void setCloud(MindMapNode node, boolean enable) { + try { + modeController.getActionFactory().startTransaction( + (String) getValue(NAME)); + modeController.getActionFactory().executeAction( + getActionPair(node, enable)); + modeController.getActionFactory().endTransaction( + (String) getValue(NAME)); + } catch (JAXBException e) { + e.printStackTrace(); + } + + } + + private ActionPair getActionPair(MindMapNode selected, boolean enable) + throws JAXBException { + AddCloudXmlAction cloudAction = createAddCloudXmlAction(selected, + enable, null); + AddCloudXmlAction undocloudAction = null; + if (selected.getCloud() != null) { + undocloudAction = createAddCloudXmlAction( + selected, true, selected.getCloud().getColor()); + } else { + undocloudAction = createAddCloudXmlAction( + selected, false, null); + + } + return new ActionPair(cloudAction, undocloudAction); + } + + private AddCloudXmlAction createAddCloudXmlAction(MindMapNode selected, + boolean enable, Color color) throws JAXBException { + AddCloudXmlAction nodecloudAction = getActionXmlFactory() + .createAddCloudXmlAction(); + nodecloudAction.setNode(getNodeID(selected)); + nodecloudAction.setEnabled(enable); + nodecloudAction.setColor(Tools.colorToXml(color)); + return nodecloudAction; + } + + public void act(XmlAction action) { + if (action instanceof AddCloudXmlAction) { + AddCloudXmlAction nodecloudAction = (AddCloudXmlAction) action; + MindMapNode node = getNodeFromID(nodecloudAction.getNode()); + if ((node.getCloud() == null) == nodecloudAction.isEnabled()) { + if (nodecloudAction.isEnabled()) { + node.setCloud(new MindMapCloudModel(node, + getModeController().getFrame())); + if (nodecloudAction.getColor() != null) { + Color color = Tools.xmlToColor(nodecloudAction + .getColor()); + ((MindMapCloudModel)node.getCloud()).setColor(color); + } + } else { + node.setCloud(null); + } + modeController.nodeChanged(node); + } + } + } + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/CloudColorAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/CloudColorAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/CloudColorAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/CloudColorAction.java 2004-10-18 00:00:08.000000000 +0100 @@ -0,0 +1,126 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + * See COPYING for Details + * + * 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. + * + * Created on 19.09.2004 + */ +/* $Id: CloudColorAction.java,v 1.1.4.1 2004/10/17 23:00:08 dpolivaev Exp $ */ + +package freemind.modes.actions; + +import java.awt.Color; +import java.awt.event.ActionEvent; +import java.util.ListIterator; + +import javax.swing.Action; +import javax.swing.JMenuItem; +import javax.xml.bind.JAXBException; + +import freemind.controller.Controller; +import freemind.controller.MenuItemEnabledListener; +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.FreemindAction; +import freemind.controller.actions.generated.instance.CloudColorXmlAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.main.Tools; +import freemind.modes.LineAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; +import freemind.modes.mindmapmode.MindMapNodeModel; + +public class CloudColorAction extends FreemindAction implements ActorXml , MenuItemEnabledListener{ + private final ModeController controller; + + public CloudColorAction(ModeController controller) { + super("cloud_color", "images/Colors24.gif", controller); + this.controller = controller; + controller.getActionFactory().registerActor(this, getDoActionClass()); + } + + public void actionPerformed(ActionEvent e) { + Color selectedColor = null; + if(controller.getSelected().getCloud() != null) { + selectedColor = controller.getSelected().getCloud().getColor(); + } + Color color = Controller.showCommonJColorChooserDialog(controller + .getView().getSelected(), controller.getText("choose_cloud_color"), selectedColor); + if (color == null) { + return; + } + for (ListIterator it = controller.getSelecteds().listIterator(); it + .hasNext();) { + MindMapNodeModel selected = (MindMapNodeModel) it.next(); + setCloudColor(selected, color); + } + } + + public void setCloudColor(MindMapNode node, Color color) { + try { + CloudColorXmlAction doAction = createCloudColorXmlAction(node, color); + CloudColorXmlAction undoAction = createCloudColorXmlAction(node, + (node.getCloud()==null)?null:node.getCloud().getColor()); + controller.getActionFactory().startTransaction(this.getClass().getName()); + controller.getActionFactory().executeAction(new ActionPair(doAction, undoAction)); + controller.getActionFactory().endTransaction(this.getClass().getName()); + } catch (JAXBException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public CloudColorXmlAction createCloudColorXmlAction(MindMapNode node, Color color) throws JAXBException { + CloudColorXmlAction nodeAction = controller.getActionXmlFactory().createCloudColorXmlAction(); + nodeAction.setNode(node.getObjectId(controller)); + nodeAction.setColor(Tools.colorToXml(color)); + return nodeAction; + } + + public void act(XmlAction action) { + if (action instanceof CloudColorXmlAction) { + CloudColorXmlAction nodeColorAction = (CloudColorXmlAction) action; + Color color = Tools.xmlToColor(nodeColorAction.getColor()); + MindMapNode node = controller.getNodeFromID(nodeColorAction.getNode()); + // this is not necessary, as this action is not enabled if there is no cloud. + if(node.getCloud()==null) { + controller.setCloud(node, true); + } + Color selectedColor = null; + if(node.getCloud() != null) { + selectedColor = node.getCloud().getColor(); + } + if (!Tools.safeEquals(color, selectedColor)) { + ((LineAdapter) node.getCloud()).setColor(color); // null + controller.nodeChanged(node); + } + } + } + + public Class getDoActionClass() { + return CloudColorXmlAction.class; + } + /** + * + */ + + public boolean isEnabled(JMenuItem item, Action action) { + return (controller != null) &&(controller.getSelected() != null) && (controller.getSelected().getCloud() != null); + } + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/ColorArrowLinkAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/ColorArrowLinkAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/ColorArrowLinkAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/ColorArrowLinkAction.java 2004-10-18 00:00:08.000000000 +0100 @@ -0,0 +1,125 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + * See COPYING for Details + * + * 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. + * + * Created on 08.10.2004 + */ +/* + * $Id: ColorArrowLinkAction.java,v 1.16.10.1 08.10.2004 22:45:36 + * christianfoltin Exp $ + */ + +package freemind.modes.actions; + +import java.awt.Color; +import java.awt.event.ActionEvent; + +import javax.swing.Action; +import javax.xml.bind.JAXBException; + +import freemind.controller.Controller; +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.FreemindAction; +import freemind.controller.actions.generated.instance.ArrowLinkColorXmlAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.main.Tools; +import freemind.modes.LineAdapter; +import freemind.modes.MindMapLink; +import freemind.modes.MindMapLinkRegistry; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; +import freemind.modes.mindmapmode.MindMapArrowLinkModel; + +public class ColorArrowLinkAction extends FreemindAction implements ActorXml{ + + MindMapArrowLinkModel arrowLink; + + private final ModeController controller; + + public ColorArrowLinkAction(ModeController controller, + MindMapArrowLinkModel arrowLink) { + super("arrow_link_color", "images/Colors24.gif", controller); + this.controller = controller; + this.arrowLink = arrowLink; + addActor(this); + } + + public void actionPerformed(ActionEvent e) { + Color selectedColor = arrowLink.getColor(); + Color color = Controller.showCommonJColorChooserDialog(controller + .getView().getSelected(), (String) this.getValue(Action.NAME), + selectedColor); + if (color == null) + return; + setArrowLinkColor(arrowLink, color); + } + + public void setArrowLinkColor(MindMapLink arrowLink, Color color) { + controller.getActionFactory().startTransaction( + (String) getValue(NAME)); + controller.getActionFactory().executeAction( + getActionPair(arrowLink, color)); + controller.getActionFactory().endTransaction( + (String) getValue(NAME)); + } + + /** + * @param arrowLink + * @param color + * @return + */ + private ActionPair getActionPair(MindMapLink arrowLink, Color color) { + return new ActionPair(createArrowLinkColorXmlAction(arrowLink, color), + createArrowLinkColorXmlAction(arrowLink, arrowLink.getColor())); + } + + public void act(XmlAction action) { + if (action instanceof ArrowLinkColorXmlAction) { + ArrowLinkColorXmlAction colorAction = (ArrowLinkColorXmlAction) action; + MindMapLink link = getLinkRegistry().getLinkForID(colorAction.getId()); + ((LineAdapter) link).setColor(Tools.xmlToColor(colorAction.getColor())); + controller.nodeChanged(link.getSource()); + } + } + + public Class getDoActionClass() { + return ArrowLinkColorXmlAction.class; + } + + + private ArrowLinkColorXmlAction createArrowLinkColorXmlAction(MindMapLink arrowLink, Color color) { + try { + ArrowLinkColorXmlAction action = controller.getActionXmlFactory().createArrowLinkColorXmlAction(); + action.setColor(Tools.colorToXml(color)); + action.setId(arrowLink.getUniqueID()); + return action; + } catch (JAXBException e) { + e.printStackTrace(); + return null; + } + } + /** + * @return + */ + private MindMapLinkRegistry getLinkRegistry() { + return controller.getMap().getLinkRegistry(); + } + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/CompoundActionHandler.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/CompoundActionHandler.java --- freemind-0.7.1/freemind/freemind/modes/actions/CompoundActionHandler.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/CompoundActionHandler.java 2004-11-25 05:45:07.000000000 +0000 @@ -0,0 +1,79 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 09.05.2004 + */ +/*$Id: CompoundActionHandler.java,v 1.1.4.2 2004/11/25 05:45:07 christianfoltin Exp $*/ + +package freemind.modes.actions; + +import java.awt.event.ActionEvent; +import java.util.Collections; +import java.util.Iterator; + +import javax.swing.AbstractAction; + +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.generated.instance.CompoundAction; +import freemind.controller.actions.generated.instance.CompoundActionType; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.ControllerAdapter; + +/** + * @author foltin + * + */ +public class CompoundActionHandler extends AbstractAction implements ActorXml { + + private ControllerAdapter c; + public CompoundActionHandler(ControllerAdapter c) { + this.c = c; + this.c.getActionFactory().registerActor(this, getDoActionClass()); + } + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#act(freemind.controller.actions.generated.instance.XmlAction) + */ + public void act(XmlAction action) { + CompoundAction compound = (CompoundAction) action; + Object[] actions = compound.getCompoundActionOrSelectNodeActionOrCutNodeAction().toArray(); + for (int i = 0; i < actions.length; i++) { + Object obj = actions[i]; + if (obj instanceof XmlAction) { + XmlAction xmlAction = (XmlAction) obj; + ActorXml actor = c.getActionFactory().getActor(xmlAction); + actor.act(xmlAction); + } + } + } + + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#getDoActionClass() + */ + public Class getDoActionClass() { + return CompoundAction.class; + } + + /* (non-Javadoc) + * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) + */ + public void actionPerformed(ActionEvent arg0) { + + } + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/CopyAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/CopyAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/CopyAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/CopyAction.java 2005-01-02 08:37:54.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + * See COPYING for Details + * + * 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. + * + * Created on 25.08.2004 + */ +/* $Id: CopyAction.java,v 1.1.4.2 2005/01/02 08:37:54 christianfoltin Exp $ */ +package freemind.modes.actions; + +import java.awt.datatransfer.Transferable; +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; +import javax.swing.ImageIcon; + +import freemind.modes.ControllerAdapter; + +public class CopyAction extends AbstractAction { + private final ControllerAdapter controller; + + public CopyAction(ControllerAdapter controller) { + super(controller.getText("copy"), new ImageIcon(controller + .getResource("images/editcopy.png"))); + this.controller = controller; + setEnabled(false); + } + + public void actionPerformed(ActionEvent e) { + if (controller.getMap() != null) { + Transferable copy = controller.getMap().copy(); + if (copy != null) { + controller.getClipboard().setContents(copy, null); + } + } + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/CopySingleAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/CopySingleAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/CopySingleAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/CopySingleAction.java 2004-10-18 00:00:08.000000000 +0100 @@ -0,0 +1,44 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 25.08.2004 + */ +/*$Id: CopySingleAction.java,v 1.1.4.1 2004/10/17 23:00:08 dpolivaev Exp $*/ +package freemind.modes.actions; + +import java.awt.datatransfer.Transferable; +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; + +import freemind.modes.ControllerAdapter; + + +public class CopySingleAction extends AbstractAction { +private final ControllerAdapter controller; +public CopySingleAction(ControllerAdapter controller) { + super(controller.getText("copy_single")); +this.controller = controller; + setEnabled(false); +} +public void actionPerformed(ActionEvent e) { + if(controller.getMap() != null) { + Transferable copy = controller.getModel().copySingle(); + if (copy != null) { + controller.getClipboard().setContents(copy,null); }}}} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/CutAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/CutAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/CutAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/CutAction.java 2005-06-16 20:54:35.000000000 +0100 @@ -0,0 +1,203 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 09.05.2004 + */ +/*$Id: CutAction.java,v 1.1.4.7 2005/06/16 19:54:35 christianfoltin Exp $*/ + +package freemind.modes.actions; + +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.awt.event.ActionEvent; +import java.io.File; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; + +import javax.swing.AbstractAction; +import javax.swing.ImageIcon; +import javax.xml.bind.JAXBException; + +import freemind.controller.MindMapNodesSelection; +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.generated.instance.CompoundAction; +import freemind.controller.actions.generated.instance.CutNodeAction; +import freemind.controller.actions.generated.instance.PasteNodeAction; +import freemind.controller.actions.generated.instance.TransferableContentType; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.ControllerAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.actions.PasteAction.NodeCoordinate; + +public class CutAction extends AbstractAction implements ActorXml { + private String text; + private final ControllerAdapter c; + public CutAction(ControllerAdapter c) { + super( + c.getText("cut"), + new ImageIcon(c.getResource("images/editcut.png"))); + this.c = c; + this.text = c.getText("cut"); + setEnabled(false); + this.c.getActionFactory().registerActor(this, getDoActionClass()); + } + public void actionPerformed(ActionEvent e) { + Transferable copy = c.cut(); + // and set it. + c.getClipboard().setContents(copy, null); + c.getController().obtainFocusForSelected(); + } + + public CutNodeAction getCutNodeAction(Transferable t, MindMapNode node) throws JAXBException { + return getCutNodeAction(t, new NodeCoordinate(node, node.isLeft().getValue())); + } + + + /** + */ + public CutNodeAction getCutNodeAction(Transferable t, NodeCoordinate coord) + throws JAXBException { + CutNodeAction cutAction = + c.getActionXmlFactory().createCutNodeAction(); + cutAction.setTransferableContent(getTransferableContent(t)); + cutAction.setNode(c.getNodeID(coord.target)); + cutAction.setAsSibling(coord.asSibling); + cutAction.setIsLeft(coord.isLeft); + + return cutAction; + } + + public Transferable cut(List nodeList) { + c.sortNodesByDepth(nodeList); + Transferable totalCopy = c.getModel().copy(nodeList, null); + try { + // Do-action + CompoundAction doAction = c.getActionXmlFactory().createCompoundAction(); + // Undo-action + CompoundAction undo= c.getActionXmlFactory().createCompoundAction(); + // sort selectedNodes list by depth, in order to guarantee that sons are deleted first: + for (Iterator i = nodeList.iterator(); i.hasNext();) { + MindMapNode node = (MindMapNode) i.next(); + if(node.getParentNode() == null) continue; + Transferable copy = c.getModel().copy(node); + NodeCoordinate coord = new NodeCoordinate(node, node.isLeft().getValue()); + CutNodeAction cutNodeAction = getCutNodeAction( copy, coord); + doAction.getCompoundActionOrSelectNodeActionOrCutNodeAction().add(cutNodeAction); + + PasteNodeAction pasteNodeAction=null; + pasteNodeAction = c.paste.getPasteNodeAction(copy, coord); + // The paste actions are reversed because of the strange coordinates. + undo.getCompoundActionOrSelectNodeActionOrCutNodeAction().add(0,pasteNodeAction); + + } + if (doAction.getCompoundActionOrSelectNodeActionOrCutNodeAction().size() > 0){ + c.getActionFactory().startTransaction(text); + c.getActionFactory().executeAction(new ActionPair(doAction, undo)); + c.getActionFactory().endTransaction(text); + } + return totalCopy; + } catch (JAXBException e) { + e.printStackTrace(); + } + return totalCopy; + } + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#act(freemind.controller.actions.generated.instance.XmlAction) + */ + public void act(XmlAction action) { + CutNodeAction cutAction = (CutNodeAction) action; + // clear all recently cutted links from the registry: + c.getModel().getLinkRegistry().clearCuttedNodeBuffer(); + NodeCoordinate coord = new NodeCoordinate(c.getNodeFromID(cutAction.getNode()), cutAction.isAsSibling(), cutAction.isIsLeft()); + MindMapNode selectedNode = coord.getNode(); + c.getModel().getLinkRegistry().cutNode(selectedNode); + c.deleteChild.deleteWithoutUndo(selectedNode); + } + + public TransferableContentType getTransferableContent( + Transferable t) throws JAXBException { + + try { + TransferableContentType trans = + c.getActionXmlFactory().createTransferableContentType(); + if (t.isDataFlavorSupported(MindMapNodesSelection.mindMapNodesFlavor)) { + String textFromClipboard; + textFromClipboard = + (String) t.getTransferData(MindMapNodesSelection.mindMapNodesFlavor); + trans.setTransferable(textFromClipboard); + } + if (t.isDataFlavorSupported(DataFlavor.stringFlavor)) { + String textFromClipboard; + textFromClipboard = + (String) t.getTransferData(DataFlavor.stringFlavor); + trans.setTransferableAsPlainText(textFromClipboard); + } + if (t.isDataFlavorSupported(MindMapNodesSelection.rtfFlavor)) { +// byte[] textFromClipboard = (byte[]) t.getTransferData(MindMapNodesSelection.rtfFlavor); +// trans.setTransferableAsRTF(textFromClipboard.toString()); + } + if(t.isDataFlavorSupported(MindMapNodesSelection.htmlFlavor)) { + String textFromClipboard; + textFromClipboard = + (String) t.getTransferData(MindMapNodesSelection.htmlFlavor); + trans.setTransferableAsHtml(textFromClipboard); + } + if(t.isDataFlavorSupported(MindMapNodesSelection.fileListFlavor)) { + /* Since the JAXB-generated interface TransferableContentType doesn't supply + a setTranserableAsFileList method, we have to get the fileList, clear it, + and then set it to the new value. + */ + List fileList = (List)t.getTransferData(MindMapNodesSelection.fileListFlavor); + List listCopy = trans.getTransferableAsFileList(); + listCopy.clear(); + listCopy.addAll(fileList); + } + return trans; + } catch (UnsupportedFlavorException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + + public Transferable getTransferable(TransferableContentType trans) { + // create Transferable: + //URGENT: Add file list to this selection. + Transferable copy = + new MindMapNodesSelection( + trans.getTransferable(), + trans.getTransferableAsPlainText(), + trans.getTransferableAsRTF(), + trans.getTransferableAsDrop(), + trans.getTransferableAsHtml(), + trans.getTransferableAsFileList()); + return copy; + } + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#getDoActionClass() + */ + public Class getDoActionClass() { + return CutNodeAction.class; + } + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/DeleteChildAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/DeleteChildAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/DeleteChildAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/DeleteChildAction.java 2005-02-02 22:16:21.000000000 +0000 @@ -0,0 +1,124 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 05.05.2004 + */ +/*$Id: DeleteChildAction.java,v 1.1.4.5 2005/02/02 22:16:21 christianfoltin Exp $*/ + +package freemind.modes.actions; + +import java.awt.datatransfer.Transferable; +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; +import javax.swing.ImageIcon; +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.generated.instance.DeleteNodeAction; +import freemind.controller.actions.generated.instance.PasteNodeAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.extensions.PermanentNodeHook; +import freemind.modes.ControllerAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.NodeAdapter; +import freemind.modes.actions.PasteAction.NodeCoordinate; + + +public class DeleteChildAction extends AbstractAction implements ActorXml { + private final ControllerAdapter c; + private String text; + public DeleteChildAction(ControllerAdapter modeController) { + super(modeController.getText("remove_node"), new ImageIcon( + modeController.getResource("images/editdelete.png"))); + text = modeController.getText("remove_node"); + this.c = modeController; + this.c.getActionFactory().registerActor(this, getDoActionClass()); + } + + public void actionPerformed(ActionEvent e) { + // because of multiple selection, cut is better. + c.cut(); + //this.c.deleteNode(c.getSelected()); + } + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#act(freemind.controller.actions.generated.instance.XmlAction) + */ + public void act(XmlAction action) { + DeleteNodeAction deleteNodeAction = (DeleteNodeAction) action; + MindMapNode selectedNode = this.c.getNodeFromID(deleteNodeAction.getNode()); + deleteWithoutUndo(selectedNode); + } + /** + * @param selectedNode + */ + public void deleteWithoutUndo(MindMapNode selectedNode) { + // deregister node: + c.getModel().getLinkRegistry().deregisterLinkTarget(selectedNode); + // remove hooks: + long currentRun = 0; + // determine timeout: + long timeout = selectedNode.getActivatedHooks().size() * 2 + 2; + while(selectedNode.getActivatedHooks().size() > 0) { + PermanentNodeHook hook = (PermanentNodeHook) selectedNode.getActivatedHooks().iterator().next(); + selectedNode.removeHook(hook); + if(currentRun++ > timeout) { + throw new IllegalStateException("Timeout reached shutting down the hooks."); + } + } + c.getModel().removeNodeFromParent( selectedNode); + } + + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#getDoActionClass() + */ + public Class getDoActionClass() { + return DeleteNodeAction.class; + } + + public void deleteNode(MindMapNode selectedNode){ + try { + String newId = c.getNodeID(selectedNode); + c.getActionFactory().startTransaction(text); + MindMapNode parent = selectedNode.getParentNode(); + + Transferable copy = c.getModel().copy(selectedNode); + NodeCoordinate coord = new NodeCoordinate(selectedNode, selectedNode.isLeft().getValue()); + // Undo-action + PasteNodeAction pasteNodeAction=null; + pasteNodeAction = c.paste.getPasteNodeAction(copy, coord); + + DeleteNodeAction deleteAction = getDeleteNodeAction(newId); + c.getActionFactory().executeAction(new ActionPair(deleteAction, pasteNodeAction)); + c.getActionFactory().endTransaction(text); + } catch (JAXBException e) { + e.printStackTrace(); + } + } + + public DeleteNodeAction getDeleteNodeAction(String newId) + throws JAXBException { + DeleteNodeAction deleteAction = c.getActionXmlFactory().createDeleteNodeAction(); + deleteAction.setNode(newId); + return deleteAction; + } + + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/EdgeColorAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/EdgeColorAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/EdgeColorAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/EdgeColorAction.java 2004-10-18 00:00:09.000000000 +0100 @@ -0,0 +1,113 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + * See COPYING for Details + * + * 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. + * + * Created on 25.08.2004 + */ +/* $Id: EdgeColorAction.java,v 1.1.4.1 2004/10/17 23:00:09 dpolivaev Exp $ */ +package freemind.modes.actions; + +import java.awt.Color; +import java.awt.event.ActionEvent; +import java.util.ListIterator; + +import javax.swing.AbstractAction; +import javax.xml.bind.JAXBException; + +import freemind.controller.Controller; +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.generated.instance.EdgeColorFormatAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.main.Tools; +import freemind.modes.EdgeAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; +import freemind.modes.mindmapmode.MindMapEdgeModel; +import freemind.modes.mindmapmode.MindMapNodeModel; + +public class EdgeColorAction extends AbstractAction implements ActorXml { + private final ModeController controller; + + public EdgeColorAction(ModeController controller) { + super(controller.getText("edge_color")); + this.controller = controller; + controller.getActionFactory().registerActor(this, getDoActionClass()); + } + + public void actionPerformed(ActionEvent e) { + Color color = Controller.showCommonJColorChooserDialog(controller + .getView().getSelected(), controller.getText("choose_edge_color"), controller + .getSelected().getEdge().getColor()); + if (color == null) + return; + for (ListIterator it = controller.getSelecteds().listIterator(); it + .hasNext();) { + MindMapNodeModel selected = (MindMapNodeModel) it.next(); + setEdgeColor(selected, color); + } + } + + public void setEdgeColor(MindMapNode node, Color color) { + try { + EdgeColorFormatAction doAction = createEdgeColorFormatAction(node, color); + EdgeColorFormatAction undoAction = createEdgeColorFormatAction(node, ((EdgeAdapter) node.getEdge()).getRealColor()); + controller.getActionFactory().startTransaction(this.getClass().getName()); + controller.getActionFactory().executeAction(new ActionPair(doAction, undoAction)); + controller.getActionFactory().endTransaction(this.getClass().getName()); + } catch (JAXBException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#act(freemind.controller.actions.generated.instance.XmlAction) + */ + public void act(XmlAction action) { + if (action instanceof EdgeColorFormatAction) { + EdgeColorFormatAction edgeAction = (EdgeColorFormatAction) action; + Color color = Tools.xmlToColor(edgeAction.getColor()); + MindMapNode node = controller.getNodeFromID(edgeAction.getNode()); + Color oldColor = ((EdgeAdapter) node.getEdge()).getRealColor() ; + if (!Tools.safeEquals(color, oldColor)) { + ((MindMapEdgeModel) node.getEdge()).setColor(color); + controller.nodeChanged(node); + } + } + } + + public EdgeColorFormatAction createEdgeColorFormatAction(MindMapNode node, Color color) throws JAXBException { + EdgeColorFormatAction edgeAction = controller.getActionXmlFactory().createEdgeColorFormatAction(); + edgeAction.setNode(node.getObjectId(controller)); + if (color != null) { + edgeAction.setColor(Tools.colorToXml(color)); + } + return edgeAction; + } + + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#getDoActionClass() + */ + public Class getDoActionClass() { + return EdgeColorFormatAction.class; + } + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/EdgeStyleAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/EdgeStyleAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/EdgeStyleAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/EdgeStyleAction.java 2005-06-16 20:27:04.000000000 +0100 @@ -0,0 +1,100 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + * See COPYING for Details + * + * 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. + * + * Created on 05.10.2004 + */ +/* $Id: EdgeStyleAction.java,v 1.1.4.2 2005/06/16 19:27:04 christianfoltin Exp $ */ + +package freemind.modes.actions; + +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.NodeActorXml; +import freemind.controller.actions.generated.instance.EdgeStyleFormatAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.main.Tools; +import freemind.modes.EdgeAdapter; +import freemind.modes.MapAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; + +public class EdgeStyleAction extends NodeGeneralAction implements NodeActorXml { + private String mStyle; + + public EdgeStyleAction(ModeController controller, String style) { + super(controller, null, null); + setName(/*controller.getText("edge_style") +*/ controller.getText(style)); + this.mStyle = style; + addActor(this); + } + + public ActionPair apply(MapAdapter model, MindMapNode selected) + throws JAXBException { + return getActionPair(selected, mStyle); + } + + public Class getDoActionClass() { + return EdgeStyleFormatAction.class; + } + + public void setEdgeStyle(MindMapNode node, String style) { + try { + modeController.getActionFactory().startTransaction( + (String) getValue(NAME)); + modeController.getActionFactory().executeAction( + getActionPair(node, style)); + modeController.getActionFactory().endTransaction( + (String) getValue(NAME)); + } catch (JAXBException e) { + e.printStackTrace(); + } + + } + + private ActionPair getActionPair(MindMapNode selected, String style) + throws JAXBException { + EdgeStyleFormatAction styleAction = createNodeStyleFormatAction( + selected, style); + EdgeStyleFormatAction undoStyleAction = createNodeStyleFormatAction( + selected, selected.getEdge().getStyle()); + return new ActionPair(styleAction, undoStyleAction); + } + + private EdgeStyleFormatAction createNodeStyleFormatAction( + MindMapNode selected, String style) throws JAXBException { + EdgeStyleFormatAction edgeStyleAction = getActionXmlFactory() + .createEdgeStyleFormatAction(); + edgeStyleAction.setNode(getNodeID(selected)); + edgeStyleAction.setStyle(style); + return edgeStyleAction; + } + + public void act(XmlAction action) { + if (action instanceof EdgeStyleFormatAction) { + EdgeStyleFormatAction edgeStyleAction = (EdgeStyleFormatAction) action; + MindMapNode node = getNodeFromID(edgeStyleAction.getNode()); + if (!Tools.safeEquals(node.getEdge().getStyle(), edgeStyleAction.getStyle())) { + ((EdgeAdapter) node.getEdge()).setStyle(edgeStyleAction.getStyle()); + modeController.nodeStructureChanged(node); + } + } + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/EdgeWidthAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/EdgeWidthAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/EdgeWidthAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/EdgeWidthAction.java 2005-06-16 20:27:05.000000000 +0100 @@ -0,0 +1,115 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + * See COPYING for Details + * + * 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. + * + * Created on 05.10.2004 + */ +/* $Id: EdgeWidthAction.java,v 1.1.4.2 2005/06/16 19:27:05 christianfoltin Exp $ */ + +package freemind.modes.actions; + +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.NodeActorXml; +import freemind.controller.actions.generated.instance.EdgeWidthFormatAction; +import freemind.controller.actions.generated.instance.EdgeWidthFormatAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.main.Tools; +import freemind.modes.EdgeAdapter; +import freemind.modes.MapAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; + +public class EdgeWidthAction extends NodeGeneralAction implements NodeActorXml { + private int mWidth; + + public EdgeWidthAction(ModeController controller, int width) { + super(controller, null, null); + this.mWidth = width; + setName(getWidthTitle(controller, width)); + addActor(this); + } + + public ActionPair apply(MapAdapter model, MindMapNode selected) + throws JAXBException { + return getActionPair(selected, mWidth); + } + + public Class getDoActionClass() { + return EdgeWidthFormatAction.class; + } + + public void setEdgeWidth(MindMapNode node, int width) { + try { + modeController.getActionFactory().startTransaction( + (String) getValue(NAME)); + modeController.getActionFactory().executeAction( + getActionPair(node, width)); + modeController.getActionFactory().endTransaction( + (String) getValue(NAME)); + } catch (JAXBException e) { + e.printStackTrace(); + } + + } + + private ActionPair getActionPair(MindMapNode selected, int width) + throws JAXBException { + EdgeWidthFormatAction styleAction = createEdgeWidthFormatAction( + selected, width); + EdgeWidthFormatAction undoStyleAction = createEdgeWidthFormatAction( + selected, ((EdgeAdapter) selected.getEdge()).getRealWidth()); + return new ActionPair(styleAction, undoStyleAction); + } + + private EdgeWidthFormatAction createEdgeWidthFormatAction( + MindMapNode selected, int width) throws JAXBException { + EdgeWidthFormatAction edgeWidthAction = getActionXmlFactory() + .createEdgeWidthFormatAction(); + edgeWidthAction.setNode(getNodeID(selected)); + edgeWidthAction.setWidth(width); + return edgeWidthAction; + } + + public void act(XmlAction action) { + if (action instanceof EdgeWidthFormatAction) { + EdgeWidthFormatAction edgeWithAction = (EdgeWidthFormatAction) action; + MindMapNode node = getNodeFromID(edgeWithAction.getNode()); + int width = edgeWithAction.getWidth(); + if (((EdgeAdapter) node.getEdge()).getRealWidth() != width) { + ((EdgeAdapter) node.getEdge()).setWidth(width); + modeController.nodeChanged(node); + } + } + } + + private static String getWidthTitle(ModeController controller, int width) { + String returnValue; + if (width == EdgeAdapter.WIDTH_PARENT) { + returnValue = controller.getText("edge_width_parent"); + } else if (width == EdgeAdapter.WIDTH_THIN) { + returnValue = controller.getText("edge_width_thin"); + } else { + returnValue = Integer.toString(width); + } + return /*controller.getText("edge_width") +*/ returnValue; + } + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/EditAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/EditAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/EditAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/EditAction.java 2005-02-02 21:33:10.000000000 +0000 @@ -0,0 +1,226 @@ +/* + * Created on 05.05.2004 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package freemind.modes.actions; + +import java.awt.EventQueue; +import java.awt.event.ActionEvent; +import java.awt.event.KeyEvent; + +import javax.swing.AbstractAction; +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.generated.instance.EditNodeAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.ControllerAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.NodeAdapter; +import freemind.view.mindmapview.EditNodeBase; +import freemind.view.mindmapview.EditNodeDialog; +import freemind.view.mindmapview.EditNodeTextField; +import freemind.view.mindmapview.NodeView; + + +// +// Node editing +// + +public class EditAction extends AbstractAction implements ActorXml { + private final ControllerAdapter c; + public EditAction(ControllerAdapter modeController) { + super(modeController.getText("edit_node")); + this.c = modeController; + this.c.getActionFactory().registerActor(this, getDoActionClass()); + } + public void actionPerformed(ActionEvent arg0) { + MindMapNode selected = this.c.getSelected(); + this.c.edit(null, false, false); + } + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#act(freemind.controller.actions.generated.instance.XmlAction) + */ + public void act(XmlAction action) { + EditNodeAction editAction = (EditNodeAction) action; + NodeAdapter node = this.c.getNodeFromID(editAction.getNode()); + if(!node.toString().equals(editAction.getText())) { + node.setUserObject(editAction.getText()); + this.c.nodeChanged(node); + } + } + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#getDoActionClass() + */ + public Class getDoActionClass() { + return EditNodeAction.class; + } + + // edit begins with home/end or typing (PN 6.2) + public void edit(KeyEvent e, boolean addNew, boolean editLong) { + if (c.getView().getSelected() != null) { + if (e == null || !addNew) { + edit(c.getView().getSelected(),c.getView().getSelected(), e, false, false, editLong); + } + else if (!c.isBlocked()) { + c.addNew(c.getSelected(), ControllerAdapter.NEW_SIBLING_BEHIND, e); + } + if (e != null) { + e.consume(); + } + } + } + + + /** + * @param node + * @param prevSelected when new->esc: node be selected + * @param firstEvent + * @param isNewNode when new->esc: cut the node + * @param parentFolded when new->esc: fold prevSelected + * @param editLong + */ + public void editLater( + final NodeView node, + final NodeView prevSelected, + final KeyEvent firstEvent, + final boolean isNewNode, + final boolean parentFolded, + final boolean editLong) { + class DelayedEditor implements Runnable { + + /* (non-Javadoc) + * @see java.lang.Runnable#run() + */ + final NodeView node; + final NodeView prevSelected; + final KeyEvent firstEvent; + final boolean isNewNode; + final boolean parentFolded; + final boolean editLong; + DelayedEditor( + final NodeView node, + final NodeView prevSelected, + final KeyEvent firstEvent, + final boolean isNewNode, + final boolean parentFolded, + final boolean editLong){ + this.node = node; + this.prevSelected = prevSelected; + this.firstEvent = firstEvent; + this.isNewNode = isNewNode; + this.parentFolded = parentFolded; + this.editLong = editLong; + } + public void run() { + edit(node, prevSelected, firstEvent, isNewNode, parentFolded, editLong); + } + }; + EventQueue.invokeLater(new DelayedEditor(node, prevSelected, firstEvent, isNewNode, parentFolded, editLong)); + } + + public void edit( + final NodeView node, + final NodeView prevSelected, + final KeyEvent firstEvent, + final boolean isNewNode, + final boolean parentFolded, + final boolean editLong) { + if (node == null) { + return; + } + + //EditNodeBase.closeEdit(); + c.setBlocked(true); // locally "modal" stated + + String text = node.getModel().toString(); + if (node.getIsLong() || editLong) { + EditNodeDialog nodeEditDialog = + new EditNodeDialog( + node, + text, + firstEvent, + c, + new EditNodeBase.EditControl() { + + public void cancel() { + } + + public void ok(String newText) { + setNodeText(node.getModel(), newText); + } + + public void split(String newText, int position) { + c.splitNode(node.getModel(), position, newText); + c.getController().obtainFocusForSelected(); // focus fix + } + }); + ; + nodeEditDialog.show(); + c.setBlocked(false); + return; + } + // inline editing: + EditNodeTextField textfield = + new EditNodeTextField(node, text, firstEvent, c, new EditNodeBase.EditControl(){ + + public void cancel() { + if (isNewNode) { // delete also the node and set focus to the parent + c.getView().selectAsTheOnlyOneSelected(node); + c.cut(); + c.select(prevSelected); + // include max level for navigation + if (parentFolded) { + c.setFolded(prevSelected.getModel(), true); + } + } + endEdit(); + } + + public void ok(String newText) { + setNodeText(node.getModel(), newText); + endEdit(); + } + + private void endEdit() { + c.getController().obtainFocusForSelected(); + c.setBlocked(false); + } + + public void split(String newText, int position) { + }}); + textfield.show(); + + } + + public void setNodeText(MindMapNode selected, String newText){ + String oldText = selected.toString(); + + try { + c.getActionFactory().startTransaction(c.getText("edit_node")); + EditNodeAction EditAction = c.getActionXmlFactory().createEditNodeAction(); + EditAction.setNode(c.getNodeID(selected)); + EditAction.setText(newText); + + EditNodeAction undoEditAction = c.getActionXmlFactory().createEditNodeAction(); + undoEditAction.setNode(c.getNodeID(selected)); + undoEditAction.setText(oldText); + + c.getActionFactory().executeAction(new ActionPair(EditAction, undoEditAction)); + c.getActionFactory().endTransaction(c.getText("edit_node")); + } catch (JAXBException e) { + e.printStackTrace(); + } + + } + + protected ControllerAdapter getModeController() { + return c; + } + + + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/FindAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/FindAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/FindAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/FindAction.java 2005-04-17 09:29:06.000000000 +0100 @@ -0,0 +1,204 @@ +package freemind.modes.actions; + +import java.awt.event.ActionEvent; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.ListIterator; + +import javax.swing.AbstractAction; +import javax.swing.ImageIcon; +import javax.swing.JOptionPane; + +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; + +public class FindAction extends AbstractAction { + private final ModeController controller; + + private ArrayList findNodesUnfoldedByLastFind; + + private MindMapNode findFromNode; + + private String findWhat; + + /** + * @return Returns the findWhat. + */ + public String getFindWhat() { + return findWhat; + } + + public String getFindFromText() { + return findFromNode.toString(); + } + + private boolean findCaseSensitive; + + private LinkedList findNodeQueue; + + public FindAction(ModeController controller) { + super(controller.getText("find"), new ImageIcon(controller + .getController().getResource("images/filefind.png"))); + this.controller = controller; + } + + public void actionPerformed(ActionEvent e) { + String what = JOptionPane.showInputDialog(controller.getView() + .getSelected(), controller.getText("find_what")); + if (what == null || what.equals("")) { + return; + } + boolean found = find(controller.getSelected(), what, /* caseSensitive= */ + false); + controller.getView().repaint(); + if (!found) { + controller.getController().informationMessage( + controller.getText("no_found_from") + .replaceAll("\\$1", what).replaceAll("\\$2", + getFindFromText()), + controller.getView().getSelected()); + } + } + + public static class FindNextAction extends AbstractAction { + private final ModeController controller; + + private final FindAction find; + + public FindNextAction(ModeController controller, FindAction find) { + super(controller.getText("find_next")); + this.controller = controller; + this.find = find; + } + + public void actionPerformed(ActionEvent e) { + String what = find.getFindWhat(); + if (what == null) { + controller.getController().informationMessage( + controller.getText("no_previous_find"), + controller.getView().getSelected()); + return; + } + boolean found = find.findNext(); + controller.getView().repaint(); + if (!found) { + controller.getController().informationMessage( + controller.getText("no_more_found_from").replaceAll( + "\\$1", what).replaceAll("\\$2", + find.getFindFromText()), + controller.getView().getSelected()); + } + } + } + + public boolean find(MindMapNode node, String what, boolean caseSensitive) { + findNodesUnfoldedByLastFind = new ArrayList(); + LinkedList nodes = new LinkedList(); + nodes.addFirst(node); + findFromNode = node; + if (!caseSensitive) { + what = what.toLowerCase(); + } + return find(nodes, what, caseSensitive); + } + + private boolean find(LinkedList /* queue of MindMapNode */nodes, + String what, boolean caseSensitive) { + // Precondition: if !caseSensitive then >>what<< is in lowercase. + + // Fold the path of previously found node + boolean thereWereNodesToBeFolded = !findNodesUnfoldedByLastFind + .isEmpty(); + if (!findNodesUnfoldedByLastFind.isEmpty()) { + + //if (false) { + ListIterator i = findNodesUnfoldedByLastFind + .listIterator(findNodesUnfoldedByLastFind.size()); + while (i.hasPrevious()) { + MindMapNode node = (MindMapNode) i.previous(); + try { + controller.setFolded(node, true); + } catch (Exception e) { + } + } + findNodesUnfoldedByLastFind = new ArrayList(); + } + + // We implement width-first search. + while (!nodes.isEmpty()) { + MindMapNode node = (MindMapNode) nodes.removeFirst(); + // Add children to the queue + for (ListIterator i = node.childrenUnfolded(); i.hasNext();) { + nodes.addLast(i.next()); + } + + String nodeText = caseSensitive ? node.toString() : node.toString() + .toLowerCase(); + if (nodeText.indexOf(what) >= 0) { // Found + displayNode(node, findNodesUnfoldedByLastFind); + centerNode(node); + + // Save the state for find next + findWhat = what; + findCaseSensitive = caseSensitive; + findNodeQueue = nodes; + + return true; + } + } + + centerNode(findFromNode); + return false; + } + + /** + * Display a node in the display (used by find and the goto action by arrow + * link actions). + */ + public void displayNode(MindMapNode node, ArrayList nodesUnfoldedByDisplay) { + // Unfold the path to the node + Object[] path = controller.getMap().getPathToRoot(node); + // Iterate the path with the exception of the last node + for (int i = 0; i < path.length - 1; i++) { + MindMapNode nodeOnPath = (MindMapNode) path[i]; + //System.out.println(nodeOnPath); + if (nodeOnPath.isFolded()) { + if (nodesUnfoldedByDisplay != null) + nodesUnfoldedByDisplay.add(nodeOnPath); + controller.setFolded(nodeOnPath, false); + } + } + + } + + public boolean findNext() { + // Precodition: findWhat != null. We check the precodition but give no + // message. + + // The logic of find next is vulnerable. find next relies on the queue + // of nodes from previous find / find next. However, between previous + // find / find next and this find next, nodes could have been deleted + // or moved. The logic expects that no changes happened, even that no + // node has been folded / unfolded. + + // You may want to come with more correct solution, but this one + // works for most uses, and does not cause any big trouble except + // perhaps for some uncaught exceptions. As a result, it is not very + // nice, but far from critical and working quite fine. + + if (findWhat != null) { + return find(findNodeQueue, findWhat, findCaseSensitive); + } + return false; + } + + /** + * @param node + */ + private void centerNode(MindMapNode node) { + // Select the node and scroll to it. + controller.centerNode(node); + } + +} + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/FontFamilyAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/FontFamilyAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/FontFamilyAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/FontFamilyAction.java 2004-10-18 00:00:10.000000000 +0100 @@ -0,0 +1,122 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 27.08.2004 + */ +/*$Id: FontFamilyAction.java,v 1.1.4.1 2004/10/17 23:00:10 dpolivaev Exp $*/ + +package freemind.modes.actions; + +import java.awt.Font; + +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.NodeActorXml; +import freemind.controller.actions.generated.instance.FontNodeAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.main.Tools; +import freemind.modes.ControllerAdapter; +import freemind.modes.MapAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.NodeAdapter; + +/** + * @author foltin + * + */ +public class FontFamilyAction extends NodeGeneralAction implements NodeActorXml { + /** This action is used for all fonts, which have to be set first.*/ + private String actionFont; + /** + * @param modeController + * @param textID + * @param iconPath + * @param actor + */ + public FontFamilyAction(ControllerAdapter modeController) { + super(modeController, "font_family", null, (NodeActorXml) null); + addActor(this); + // default value: + actionFont = modeController.getFrame().getProperty("defaultfont"); + } + + public void actionPerformed(String font) { + this.actionFont = font; + super.actionPerformed(null); + } + + public ActionPair apply(MapAdapter model, MindMapNode selected) throws JAXBException { + return getActionPair(selected, actionFont); + } + + public Class getDoActionClass() { + return FontNodeAction.class; + } + + /** + * @param node + * @param fontValue + */ + public void setFontFamily(MindMapNode node, String fontFamilyValue) { + try { + modeController.getActionFactory().startTransaction( + (String) getValue(NAME)); + modeController.getActionFactory().executeAction( + getActionPair(node, fontFamilyValue)); + modeController.getActionFactory().endTransaction( + (String) getValue(NAME)); + } catch (JAXBException e) { + e.printStackTrace(); + } + } + + private ActionPair getActionPair(MindMapNode node, String fontFamilyValue) + throws JAXBException { + FontNodeAction fontFamilyAction = createFontNodeAction(node, fontFamilyValue); + FontNodeAction undoFontFamilyAction = createFontNodeAction(node, node.getFontFamilyName()); + return new ActionPair(fontFamilyAction, undoFontFamilyAction); + } + + private FontNodeAction createFontNodeAction(MindMapNode node, String fontValue) throws JAXBException { + FontNodeAction fontFamilyAction = getActionXmlFactory().createFontNodeAction(); + fontFamilyAction.setNode(getNodeID(node)); + fontFamilyAction.setFont(fontValue); + return fontFamilyAction; + + } + + /** + * + */ + + public void act(XmlAction action) { + if (action instanceof FontNodeAction) { + FontNodeAction fontFamilyAction = (FontNodeAction) action; + MindMapNode node = getNodeFromID(fontFamilyAction.getNode()); + String fontFamily = fontFamilyAction.getFont(); + if(!Tools.safeEquals(node.getFontFamilyName(),fontFamily)) { + ((NodeAdapter) node).estabilishOwnFont(); + node.setFont(modeController.getController().getFontThroughMap + (new Font(fontFamily,node.getFont().getStyle(),node.getFont().getSize()))); + modeController.nodeChanged(node); + } + } + } +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/FontSizeAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/FontSizeAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/FontSizeAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/FontSizeAction.java 2004-10-18 00:00:10.000000000 +0100 @@ -0,0 +1,125 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 27.08.2004 + */ +/*$Id: FontSizeAction.java,v 1.1.4.1 2004/10/17 23:00:10 dpolivaev Exp $*/ + +package freemind.modes.actions; + +import javax.xml.bind.JAXBException; + +import sun.java2d.loops.FontInfo; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.NodeActorXml; +import freemind.controller.actions.generated.instance.BoldNodeAction; +import freemind.controller.actions.generated.instance.FontSizeNodeAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.ControllerAdapter; +import freemind.modes.MapAdapter; +import freemind.modes.MindMapNode; + +/** + * @author foltin + * + */ +public class FontSizeAction extends NodeGeneralAction implements NodeActorXml { + + /** This action is used for all sizes, which have to be set first.*/ + private String actionSize; + /** + * @param modeController + * @param textID + * @param iconPath + * @param actor + */ + public FontSizeAction(ControllerAdapter modeController) { + super(modeController, "font_size", null, (NodeActorXml) null); + addActor(this); + // default value: + actionSize = modeController.getFrame().getProperty("defaultfontsize"); + } + + public void actionPerformed(String size) { + this.actionSize = size; + super.actionPerformed(null); + } + + public ActionPair apply(MapAdapter model, MindMapNode selected) throws JAXBException { + return getActionPair(selected, actionSize); + } + + public Class getDoActionClass() { + return FontSizeNodeAction.class; + } + + /** + * @param node + * @param fontSizeValue + */ + public void setFontSize(MindMapNode node, String fontSizeValue) { + try { + modeController.getActionFactory().startTransaction( + (String) getValue(NAME)); + modeController.getActionFactory().executeAction( + getActionPair(node, fontSizeValue)); + modeController.getActionFactory().endTransaction( + (String) getValue(NAME)); + } catch (JAXBException e) { + e.printStackTrace(); + } + + } + + private ActionPair getActionPair(MindMapNode node, String fontSizeValue) + throws JAXBException { + FontSizeNodeAction fontSizeAction = createFontSizeNodeAction(node, fontSizeValue); + FontSizeNodeAction undoFontSizeAction = createFontSizeNodeAction(node, node.getFontSize()); + return new ActionPair(fontSizeAction, undoFontSizeAction); + } + + private FontSizeNodeAction createFontSizeNodeAction(MindMapNode node, String fontSizeValue) throws JAXBException { + FontSizeNodeAction fontSizeAction = getActionXmlFactory().createFontSizeNodeAction(); + fontSizeAction.setNode(getNodeID(node)); + fontSizeAction.setSize(fontSizeValue); + return fontSizeAction; + + } + + /** + * + */ + + public void act(XmlAction action) { + if (action instanceof FontSizeNodeAction) { + FontSizeNodeAction fontSizeAction = (FontSizeNodeAction) action; + MindMapNode node = getNodeFromID(fontSizeAction.getNode()); + try { + int size = Integer.valueOf(fontSizeAction.getSize()).intValue(); + if(!node.getFontSize().equals(fontSizeAction.getSize())) { + node.setFontSize(size); + modeController.nodeChanged(node); + } + } catch (NumberFormatException e) { + return; + } + } + } +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/GotoLinkNodeAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/GotoLinkNodeAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/GotoLinkNodeAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/GotoLinkNodeAction.java 2005-04-17 09:29:06.000000000 +0100 @@ -0,0 +1,70 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 16.10.2004 + */ +/*$Id: GotoLinkNodeAction.java,v 1.1.4.3 2005/04/17 08:29:06 christianfoltin Exp $*/ + +package freemind.modes.actions; + +import java.awt.event.ActionEvent; + +import javax.swing.Action; + +import freemind.controller.actions.FreemindAction; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; + + +public class GotoLinkNodeAction extends FreemindAction { + MindMapNode source; + private final ModeController controller; + public GotoLinkNodeAction(ModeController controller, MindMapNode source) { + super("goto_link_node_action", "images/Link.png", controller); + this.controller = controller; + // only display a reasonable part of the string. the rest is available via the short description (tooltip). + this.source = source; + // source is for the controllerAdapter == null, + if (source!=null) { + String adaptedText = source.getShortText(controller); + putValue(Action.NAME, controller.getText("follow_link") + + adaptedText); + putValue(Action.SHORT_DESCRIPTION, source.toString()); + } + } + + public void actionPerformed(ActionEvent e) { + controller.centerNode(source); + } + + public String getShortTextForLink(MindMapNode node) { + String adaptedText = node.getLink(); + if(adaptedText== null) + return null; + if ( adaptedText.startsWith("#")) { + try { + MindMapNode dest = controller.getNodeFromID(adaptedText.substring(1)); + return dest.getShortText(controller); + } catch(Exception e) { + return controller.getText("link_not_available_any_more"); + } + } + return adaptedText; + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/IconAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/IconAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/IconAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/IconAction.java 2005-05-03 06:29:50.000000000 +0100 @@ -0,0 +1,109 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 29.09.2004 + */ +/*$Id: IconAction.java,v 1.1.4.2 2005/05/03 05:29:50 christianfoltin Exp $*/ + +package freemind.modes.actions; + +import java.awt.event.ActionEvent; +import java.util.ListIterator; + +import javax.swing.Action; +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.FreemindAction; +import freemind.controller.actions.generated.instance.AddIconAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.MindIcon; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; +import freemind.modes.mindmapmode.MindMapNodeModel; + + +public class IconAction extends FreemindAction implements ActorXml{ + public MindIcon icon; + private final ModeController modeController; + private final RemoveLastIconAction removeLastIconAction; + public IconAction(ModeController controller, MindIcon _icon, RemoveLastIconAction removeLastIconAction) { + super(_icon.getDescription(controller.getFrame()), _icon.getIcon(controller.getFrame()), controller); + this.modeController = controller; + this.removeLastIconAction = removeLastIconAction; + putValue(Action.SHORT_DESCRIPTION, _icon.getDescription(controller.getFrame())); + this.icon = _icon; + controller.getActionFactory().registerActor(this, getDoActionClass()); + } + + public void actionPerformed(ActionEvent e) { + for (ListIterator it = modeController.getSelecteds().listIterator();it.hasNext();) { + MindMapNodeModel selected = (MindMapNodeModel)it.next(); + addIcon(selected, icon); + } + } + + public void addIcon(MindMapNode node, MindIcon icon) { + try { + modeController.getActionFactory().startTransaction( + (String) getValue(NAME)); + modeController.getActionFactory().executeAction( + getActionPair(node, icon)); + modeController.getActionFactory().endTransaction( + (String) getValue(NAME)); + } catch (JAXBException e) { + e.printStackTrace(); + } + } + + /** + * @param node + * @param icon + * @return + * @throws JAXBException + */ + private ActionPair getActionPair(MindMapNode node, MindIcon icon) throws JAXBException { + AddIconAction doAction = createAddIconAction(node, icon); + XmlAction undoAction = removeLastIconAction.createRemoveLastIconXmlAction(node); + return new ActionPair(doAction, undoAction); + } + + public void act(XmlAction action) { + if (action instanceof AddIconAction) { + AddIconAction iconAction = (AddIconAction) action; + MindMapNode node = modeController.getNodeFromID(iconAction.getNode()); + String iconName = iconAction.getIconName(); + MindIcon icon = MindIcon.factory(iconName); + node.addIcon(icon); + modeController.nodeChanged(node); + } + } + + public Class getDoActionClass() { + return AddIconAction.class; + } + public AddIconAction createAddIconAction(MindMapNode node, MindIcon icon) throws JAXBException { + AddIconAction action = modeController.getActionXmlFactory().createAddIconAction(); + action.setNode(node.getObjectId(modeController)); + action.setIconName(icon.getName()); + return action; + } + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/ImportExplorerFavoritesAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/ImportExplorerFavoritesAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/ImportExplorerFavoritesAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/ImportExplorerFavoritesAction.java 2004-12-19 09:00:39.000000000 +0000 @@ -0,0 +1,109 @@ +package freemind.modes.actions; + +import java.awt.event.ActionEvent; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; + +import javax.swing.AbstractAction; +import javax.swing.JFileChooser; + +import freemind.main.Tools; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; + +public class ImportExplorerFavoritesAction extends AbstractAction { + private final ModeController controller; + + public ImportExplorerFavoritesAction(ModeController controller) { + super(controller.getText("import_explorer_favorites")); + this.controller = controller; + } + + public void actionPerformed(ActionEvent e) { + JFileChooser chooser = new JFileChooser(); + chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + chooser.setDialogTitle(controller.getText("select_favorites_folder")); + int returnVal = chooser.showOpenDialog(controller.getFrame() + .getContentPane()); + if (returnVal == JFileChooser.APPROVE_OPTION) { + File folder = chooser.getSelectedFile(); + controller.getFrame().out("Importing Favorites ..."); + //getFrame().repaint(); // Refresh the frame, namely hide dialog + // and show status + //getView().updateUI(); + // Problem: the frame should be refreshed here, but I don't know how + // to do it + importExplorerFavorites(folder, controller.getSelected(),/* redisplay= */ + true); + controller.getFrame().out("Favorites imported."); + } + } + + public boolean importExplorerFavorites(File folder, MindMapNode target, + boolean redisplay) { + // Returns true iff any favorites found + boolean favoritesFound = false; + if (folder.isDirectory()) { + File[] list = folder.listFiles(); + // Go recursively to subfolders + for (int i = 0; i < list.length; i++) { + if (list[i].isDirectory()) { + // Insert a new node + String nodeContent = list[i].getName(); + MindMapNode node = addNode(target, nodeContent); + // + boolean favoritesFoundInSubfolder = importExplorerFavorites( + list[i], node, false); + if (favoritesFoundInSubfolder) { + favoritesFound = true; + } else { + controller.deleteNode(node); + } + } + } + + // For each .url file: add it + for (int i = 0; i < list.length; i++) { + if (!list[i].isDirectory() + && Tools.getExtension(list[i]).equals("url")) { + favoritesFound = true; + try { + MindMapNode node = addNode(target, Tools + .removeExtension(list[i].getName())); + // For each line: Is it URL? => Set it as link + BufferedReader in = new BufferedReader(new FileReader( + list[i])); + while (in.ready()) { + String line = in.readLine(); + if (line.startsWith("URL=")) { + node.setLink(line.substring(4)); + break; + } + } + + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } + if (redisplay) { + controller.nodeChanged(target); + } + return favoritesFound; + } + + /** + * @param target + * @param nodeContent + * @return + */ + private MindMapNode addNode(MindMapNode target, String nodeContent) { + MindMapNode node = controller.addNewNode(target, target.getChildCount(), target.isLeft()); + controller.setNodeText(node, nodeContent); + return node; + } + +} + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/ImportFolderStructureAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/ImportFolderStructureAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/ImportFolderStructureAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/ImportFolderStructureAction.java 2005-07-03 21:53:50.000000000 +0100 @@ -0,0 +1,92 @@ +package freemind.modes.actions; + +import java.awt.event.ActionEvent; +import java.io.File; +import java.net.MalformedURLException; + +import javax.swing.AbstractAction; +import javax.swing.JFileChooser; + +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; +import freemind.modes.mindmapmode.MindMapNodeModel; + +public class ImportFolderStructureAction extends AbstractAction { + // Logging: + private static java.util.logging.Logger logger; + private final ModeController controller; + + public ImportFolderStructureAction(ModeController controller) { + super(controller.getText("import_folder_structure")); + this.controller = controller; + if(logger == null) + logger = controller.getFrame().getLogger(this.getClass().getName()); + } + + public void actionPerformed(ActionEvent e) { + JFileChooser chooser = new JFileChooser(); + chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + chooser.setDialogTitle(controller + .getText("select_folder_for_importing")); + int returnVal = chooser.showOpenDialog(controller.getFrame() + .getContentPane()); + if (returnVal == JFileChooser.APPROVE_OPTION) { + File folder = chooser.getSelectedFile(); + controller.getFrame().out("Importing folder structure ..."); + //getFrame().repaint(); // Refresh the frame, namely hide dialog + // and show status + //getView().updateUI(); + // Problem: the frame should be refreshed here, but I don't know how + // to do it + try { + importFolderStructure(folder, controller.getSelected(),/* redisplay= */ + true); + } catch (Exception ex) { + ex.printStackTrace(); + } + controller.getFrame().out("Folder structure imported."); + } + } + + public void importFolderStructure(File folder, MindMapNode target, + boolean redisplay) throws MalformedURLException { + logger.warning("Entering folder: "+folder); + + if (folder.isDirectory()) { + File[] list = folder.listFiles(); + // Go recursively to subfolders + for (int i = 0; i < list.length; i++) { + if (list[i].isDirectory()) { + // Insert a new node + + MindMapNode node = addNode(target, list[i].getName(), list[i].toURL().toString()); + importFolderStructure(list[i], node, false); + } + } + + // For each file: add it + for (int i = 0; i < list.length; i++) { + if (!list[i].isDirectory()) { + addNode(target, list[i].getName(), list[i].toURL().toString()); + } + } + } + controller.setFolded(target, true); + + } + + /** + * @param target + * @param nodeContent + * @return + */ + private MindMapNode addNode(MindMapNode target, String nodeContent, String link) { + MindMapNode node = controller.addNewNode(target, + target.getChildCount(), target.isLeft()); + controller.setNodeText(node, nodeContent); + controller.setLink(node, link); + return node; + } + +} + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/ItalicAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/ItalicAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/ItalicAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/ItalicAction.java 2004-10-18 00:00:10.000000000 +0100 @@ -0,0 +1,104 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + * See COPYING for Details + * + * 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. + * + * Created on 25.08.2004 + */ +/* $Id: ItalicAction.java,v 1.1.4.1 2004/10/17 23:00:10 dpolivaev Exp $ */ +package freemind.modes.actions; + +import javax.swing.Action; +import javax.swing.JMenuItem; +import javax.xml.bind.JAXBException; + +import freemind.controller.MenuItemEnabledListener; +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.NodeActorXml; +import freemind.controller.actions.generated.instance.ItalicNodeAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.ControllerAdapter; +import freemind.modes.MapAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.NodeAdapter; + + +public class ItalicAction extends NodeGeneralAction implements NodeActorXml, MenuItemEnabledListener{ + private final ControllerAdapter modeController; + /** + * @param textID + * @param iconPath + * @param actor + */ + public ItalicAction(ControllerAdapter modeController) { + super(modeController, "italic", "images/Italic16.gif"); + this.modeController = modeController; + addActor(this); + } + + public void act(XmlAction action) { + ItalicNodeAction italicact = (ItalicNodeAction) action; + NodeAdapter node = getNodeFromID(italicact.getNode()); + if(node.isItalic() != italicact.isItalic()) { + node.setItalic(italicact.isItalic()); + this.modeController.nodeChanged(node); + } + } + + + public Class getDoActionClass() { + return ItalicNodeAction.class; + } + + public ActionPair apply(MapAdapter model, MindMapNode selected) throws JAXBException { + // every node is set to the inverse of the focussed node. + boolean italic = modeController.getSelected().isItalic(); + return getActionPair(selected, !italic); + } + + private ActionPair getActionPair(MindMapNode selected, boolean italic) + throws JAXBException { + ItalicNodeAction italicAction = toggleItalic(selected, italic); + ItalicNodeAction undoItalicAction = toggleItalic(selected, selected.isItalic()); + return new ActionPair(italicAction, undoItalicAction); + } + + private ItalicNodeAction toggleItalic(MindMapNode selected, boolean italic) + throws JAXBException { + ItalicNodeAction italicAction = getActionXmlFactory().createItalicNodeAction(); + italicAction.setNode(getNodeID(selected)); + italicAction.setItalic(italic); + return italicAction; + } + + public void setItalic(MindMapNode node, boolean italic) { + try { + execute(getActionPair(node, italic)); + } catch (JAXBException e) { + e.printStackTrace(); + } + } + + public boolean isEnabled(JMenuItem item, Action action) { + boolean italic = modeController.getSelected().isItalic(); + setSelected(item, italic); + return true; + } + + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/JoinNodesAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/JoinNodesAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/JoinNodesAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/JoinNodesAction.java 2004-12-19 09:00:39.000000000 +0000 @@ -0,0 +1,64 @@ +package freemind.modes.actions; + +import java.awt.event.ActionEvent; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import javax.swing.AbstractAction; +import javax.swing.JOptionPane; + +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; + +public class JoinNodesAction extends AbstractAction { + private final ModeController controller; + + public JoinNodesAction(ModeController controller) { + super(controller.getText("join_nodes")); + this.controller = controller; + } + + public void actionPerformed(ActionEvent e) { + MindMapNode selectedNode = controller.getView().getSelected() + .getModel(); + ArrayList selectedNodes = controller.getView() + .getSelectedNodesSortedByY(); + joinNodes(selectedNode, selectedNodes); + } + + public void joinNodes(MindMapNode selectedNode, List selectedNodes) { + String newContent = ""; + boolean firstLoop = true; + + // Make sure the selected node do not have children + for (Iterator it = selectedNodes.iterator(); it.hasNext();) { + MindMapNode node = (MindMapNode) it.next(); + if (node.hasChildren()) { + JOptionPane.showMessageDialog(node.getViewer(), controller + .getText("cannot_join_nodes_with_children"), + "FreeMind", JOptionPane.WARNING_MESSAGE); + return; + } + } + + // Join + for (Iterator it = selectedNodes.iterator(); it.hasNext();) { + if (firstLoop) { + firstLoop = false; + } else { + newContent += " "; + } + MindMapNode node = (MindMapNode) it.next(); + newContent += node.toString(); + if (node != selectedNode) { + controller.deleteNode(node); + } + } + + controller.getView().selectAsTheOnlyOneSelected( + selectedNode.getViewer()); + controller.setNodeText(selectedNode, newContent); + } +} + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/MindMapActions.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/MindMapActions.java --- freemind-0.7.1/freemind/freemind/modes/actions/MindMapActions.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/MindMapActions.java 2005-07-03 00:19:38.000000000 +0100 @@ -0,0 +1,211 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2001 Joerg Mueller + *See COPYING for Details + * + *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. + * Created on 05.05.2004 + */ +/*$Id: MindMapActions.java,v 1.1.4.15 2005/07/02 23:19:38 christianfoltin Exp $*/ +package freemind.modes.actions; + +import java.awt.Color; +import java.awt.Point; +import java.awt.datatransfer.Transferable; +import java.awt.event.KeyEvent; +import java.util.Collection; +import java.util.List; + +import freemind.modes.MindIcon; +import freemind.modes.MindMapArrowLink; +import freemind.modes.MindMapLink; +import freemind.modes.MindMapNode; +import freemind.modes.StylePattern; +import freemind.modes.mindmapmode.MindMapArrowLinkModel; +import freemind.view.mindmapview.NodeView; + +/** This is the central method interface of actions that can be undertaken on + * nodes. Whenever you want to change the mindmap choose one of these actions + * as they do proper redisplay, inform others about the actions, the actions are + * all undoable etc.etc. + * + * All these methods do redisplay, because they are offered from the ModeController for use. + * + * @author foltin + * @see freemind.modes.ModeController + * */ +public interface MindMapActions { + /** Call this method, if you changed anything at a node. This method makes the map dirty. + * @param node + */ + public void nodeChanged(MindMapNode node); + /** This is nodeChanged without making the map dirty. + * @param node + */ + public void nodeRefresh(MindMapNode node); + public void nodeStructureChanged(MindMapNode node); + /** The following modes are present: + * public final int NEW_CHILD_WITHOUT_FOCUS = 1; // old model of insertion + * public final int NEW_CHILD = 2; + * public final int NEW_SIBLING_BEHIND = 3; + * public final int NEW_SIBLING_BEFORE = 4; + * @see freemind.modes.ControllerAdapter + * */ + public void edit(KeyEvent e, boolean addNew, boolean editLong); + public void setNodeText(MindMapNode selected, String newText); + public MindMapNode addNew(final MindMapNode target, final int newNodeMode, final KeyEvent e); + /** Another variant of addNew. If the index of the new node as a child of parent is known, + * this method is easier to use. Moreover, it does not automatically start an editor. + * @param newNodeIsLeft here, normally parent.isLeft() or null is used. + * @return returns the new node. */ + MindMapNode addNewNode(MindMapNode parent, int index, freemind.main.Tools.BooleanHolder newNodeIsLeft); + public void deleteNode(MindMapNode selectedNode); + public Transferable cut(); + public Transferable cut(List nodeList); + /** + * moves selected and selecteds (if they are child of the same parent and adjacent) + * in the direction specified (up = -1, down = 1). + * */ + void moveNodes(MindMapNode selected, List selecteds, int direction); + + /** + * @param node + * @param folded + */ + void setFolded(MindMapNode node, boolean folded); + /** + * Switches the folding state of all selected nodes. In fact, + * it determines one action (fold or unfold) and applies this action to every + * selected node. + */ + void toggleFolded(); + + /** Unfolds a node if necessary. + * @param node + */ + void displayNode(MindMapNode node); + /** Node is displayed and selected as the only one selected. It is moved to the center of the + * screen. + * @param node + */ + void centerNode(MindMapNode node); + String getLinkShortText(MindMapNode node); + + public void setBold(MindMapNode node, boolean bolded); + public void setItalic(MindMapNode node, boolean isItalic); + public void setNodeColor(MindMapNode node, Color color); + public void setNodeBackgroundColor(MindMapNode node, Color color); + + public void blendNodeColor(MindMapNode node); + public void setFontFamily( + MindMapNode node, + String fontFamily); + public void setFontSize(MindMapNode node, String fontSizeValue); + /** This method is nice, but how to get a MindIcon ? */ + public void addIcon(MindMapNode node, MindIcon icon); + public int removeLastIcon(MindMapNode node); + public void removeAllIcons(MindMapNode node); + /** @param patternName is one of the names. They can be received using + * the patterns list of ApplyPatternActions from the ControllerAdapter. Each action + * has a getPattern() method and the pattern has a getName() method ... */ + public void applyPattern(MindMapNode node, String patternName); + public void applyPattern(MindMapNode node, StylePattern pattern); + public void setNodeStyle(MindMapNode node, String style); + public void setEdgeColor(MindMapNode node, Color color); + /** The widths range from -1 (for equal to parent) to 0 (thin), 1, 2, 4, 8. */ + public void setEdgeWidth(MindMapNode node, int width); + public void setEdgeStyle(MindMapNode node, String style); + public void setCloud(MindMapNode node, boolean enable); + public void setCloudColor(MindMapNode node, Color color); +// public void setCloudWidth(MindMapNode node, int width); +// public void setCloudStyle(MindMapNode node, String style); + /** Source holds the MindMapArrowLinkModel and points to the id placed in target.*/ + public void addLink( + MindMapNode source, + MindMapNode target); + public void removeReference(MindMapLink arrowLink); + public void changeArrowsOfArrowLink( + MindMapArrowLinkModel arrowLink, + boolean hasStartArrow, + boolean hasEndArrow); + public void setArrowLinkColor( + MindMapLink arrowLink, + Color color); + public void setArrowLinkEndPoints(MindMapArrowLink link, Point startPoint, Point endPoint); + /** Adds a textual hyperlink to a node (e.g. http:/freemind.sourceforge.net) + * @param node + * @param link + */ + public void setLink(MindMapNode node, String link); +// public void setUnderlined(MindMapNode node); +// public void setNormalFont(MindMapNode node); + public void increaseFontSize(MindMapNode node, int increment); + public void splitNode(MindMapNode node, int caretPosition, String newText); + public void joinNodes(MindMapNode selectedNode, List selectedNodes); + + public void paste(Transferable t, MindMapNode parent); + /** @param isLeft determines, whether or not the node is placed on the left or right. */ + public void paste(Transferable t, MindMapNode target, boolean asSibling, boolean isLeft); + public void paste(MindMapNode node, MindMapNode parent); + + public void addHook(MindMapNode focussed, List selecteds, String hookName); + public MindMapNode getRootNode(); + + /** + * @param node + * @param key key value patterns is used to ensure, that more than one tooltip can be displayed. + * @param value null if you want to delete this tooltip. + */ + public void setToolTip(MindMapNode node, String key, String value); + + /** Single selection: the node is the only one selected after calling this method. + * @param node + */ + public void select( NodeView node) ; + + /**Single selection: the node is the only one selected after calling this method. + * @param selected + */ + public void select( MindMapNode selected); + + /** Multiple selection. + * @param focussed will be focussed afterwards + * @param selecteds are all nodes that are selected (the focussed has not to be contained). + */ + public void selectMultipleNodes(MindMapNode focussed, Collection selecteds) ; + + /** The branch that starts from selected is added to the selection. + * + * On extend = false clear up the previous selection. + * if extend is false, the past selection will be empty. + * if yes, the selection will extended with this node and its children + */ + public void selectBranch( MindMapNode selected, boolean extend); + + + /** Moves the node to a new position. + * @param node + * @param vGap + * @param hGap + * @param shiftY + */ + public void moveNodePosition(MindMapNode node, int vGap, int hGap, + int shiftY); + + /** Load the given map (as String) instead of the currently opened map. + * @param xmlMapContents + */ + void load(String xmlMapContents); + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/MoveNodeAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/MoveNodeAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/MoveNodeAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/MoveNodeAction.java 2005-04-27 22:45:30.000000000 +0100 @@ -0,0 +1,106 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + * See COPYING for Details + * + * 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. + * + * Created on 25.08.2004 + */ +/* $Id: MoveNodeAction.java,v 1.1.4.2 2005/04/27 21:45:30 christianfoltin Exp $ */ +package freemind.modes.actions; + +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.NodeActorXml; +import freemind.controller.actions.generated.instance.MoveNodeXmlAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.ControllerAdapter; +import freemind.modes.MapAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.NodeAdapter; + +public class MoveNodeAction extends NodeGeneralAction implements NodeActorXml { + private final ControllerAdapter modeController; + + /** + * @param textID + * @param iconPath + * @param actor + */ + public MoveNodeAction(ControllerAdapter modeController) { + super(modeController, "reset_node_position", (String) null); + this.modeController = modeController; + addActor(this); + } + + public void act(XmlAction action) { + MoveNodeXmlAction moveAction = (MoveNodeXmlAction) action; + NodeAdapter node = getNodeFromID(moveAction.getNode()); + if (node.getHGap() != moveAction.getHGap() + || node.getVGap() != moveAction.getVGap() + || node.getShiftY() != moveAction.getShiftY()) { + node.setHGap(moveAction.getHGap()); + node.setVGap(moveAction.getVGap()); + node.setShiftY(moveAction.getShiftY()); + this.modeController.nodeChanged(node); + } + } + + public Class getDoActionClass() { + return MoveNodeXmlAction.class; + } + + public ActionPair apply(MapAdapter model, MindMapNode selected) + throws JAXBException { + // reset position + return getActionPair(selected, MindMapNode.AUTO, 0, 0); + } + + private ActionPair getActionPair(MindMapNode selected, int vGap, int hGap, + int shiftY) throws JAXBException { + MoveNodeXmlAction moveAction = moveNode(selected, vGap, hGap, shiftY); + MoveNodeXmlAction undoItalicAction = moveNode(selected, selected + .getVGap(), selected.getHGap(), selected.getShiftY()); + return new ActionPair(moveAction, undoItalicAction); + } + + private MoveNodeXmlAction moveNode(MindMapNode selected, int vGap, + int hGap, int shiftY) throws JAXBException { + MoveNodeXmlAction moveNodeAction = getActionXmlFactory() + .createMoveNodeXmlAction(); + moveNodeAction.setNode(getNodeID(selected)); + moveNodeAction.setHGap(hGap); + moveNodeAction.setVGap(vGap); + moveNodeAction.setShiftY(shiftY); + return moveNodeAction; + } + + public void moveNodeTo(MindMapNode node, int vGap, int hGap, int shiftY) { + try { + modeController.getActionFactory().startTransaction( + (String) getValue(NAME)); + modeController.getActionFactory().executeAction( + getActionPair(node, vGap, hGap, shiftY)); + modeController.getActionFactory().endTransaction( + (String) getValue(NAME)); + } catch (JAXBException e) { + e.printStackTrace(); + } + } + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/NewChildAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/NewChildAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/NewChildAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/NewChildAction.java 2005-07-06 07:00:03.000000000 +0100 @@ -0,0 +1,181 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 05.05.2004 + */ +/*$Id: NewChildAction.java,v 1.1.4.9 2005/07/06 06:00:03 christianfoltin Exp $*/ + +package freemind.modes.actions; + +import java.awt.event.ActionEvent; +import java.awt.event.KeyEvent; +import java.util.Date; +import java.util.Iterator; +import java.util.logging.Logger; + +import javax.swing.AbstractAction; +import javax.swing.ImageIcon; +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.generated.instance.DeleteNodeAction; +import freemind.controller.actions.generated.instance.NewNodeAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.extensions.PermanentNodeHook; +import freemind.modes.ControllerAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.NodeAdapter; +import freemind.modes.MindMapLinkRegistry.ID_Registered; + + +public class NewChildAction extends AbstractAction implements ActorXml { + private final ControllerAdapter c; + private static Logger logger=null; + public NewChildAction(ControllerAdapter modeController) { + super(modeController.getText("new_child"), new ImageIcon(modeController.getResource("images/idea.png"))); + this.c = modeController; + this.c.getActionFactory().registerActor(this, getDoActionClass()); + if(logger == null) { + logger = c.getFrame().getLogger(NewChildAction.class.getName()); + } + + } + + public void actionPerformed(ActionEvent e) { + this.c.addNew(c.getSelected(), ControllerAdapter.NEW_CHILD, null); + } + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#act(freemind.controller.actions.generated.instance.XmlAction) + */ + public void act(XmlAction action) { + NewNodeAction addNodeAction = (NewNodeAction) action; + NodeAdapter parent = this.c.getNodeFromID(addNodeAction.getNode()); + int index = addNodeAction.getIndex(); + MindMapNode newNode = c.newNode(""); + String newId = addNodeAction.getNewId(); + ID_Registered reg = c.getModel().getLinkRegistry().registerLinkTarget(newNode,newId); + if(!reg.getID().equals(newId)) { + throw new IllegalArgumentException("Designated id '"+newId+"' was not given to the node. It received '"+reg.getID()+"'."); + } + if(addNodeAction.getPosition()!= null) { + newNode.setLeft(addNodeAction.getPosition().equals("left")); + } + c.getModel().insertNodeInto(newNode, parent, index); + // call hooks: + for (Iterator i = parent.getActivatedHooks().iterator(); i.hasNext();) { + PermanentNodeHook hook = (PermanentNodeHook) i.next(); + hook.onNewChild(newNode); + } + // done. + c.getFrame().repaint(); + } + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#getDoActionClass() + */ + public Class getDoActionClass() { + return NewNodeAction.class; + } + + + public MindMapNode addNew(final MindMapNode target, final int newNodeMode, final KeyEvent e) { + final MindMapNode targetNode = target; + MindMapNode newNode = null; + + boolean targetIsLeft = true; + switch (newNodeMode) { + case ControllerAdapter.NEW_SIBLING_BEFORE: + case ControllerAdapter.NEW_SIBLING_BEHIND: + if (targetNode.isRoot()) { + c.getController().errorMessage(c.getText("new_node_as_sibling_not_possible_for_the_root")); + c.setBlocked(false); + return null; + } + MindMapNode parent = targetNode.getParentNode(); + int childPosition = parent.getChildPosition(targetNode); + if (newNodeMode == ControllerAdapter.NEW_SIBLING_BEHIND) { + childPosition++; + } + newNode = addNewNode(parent, childPosition, target.isLeft()); + c.select(newNode.getViewer()); + c.edit.editLater(newNode.getViewer(), target.getViewer(), e, true, false, false); + break; + + case ControllerAdapter.NEW_CHILD: + case ControllerAdapter.NEW_CHILD_WITHOUT_FOCUS: + final boolean parentFolded = targetNode.isFolded(); + if (parentFolded) { + c.setFolded(targetNode,false); + } + int position = c.getFrame().getProperty("placenewbranches").equals("last") ? + targetNode.getChildCount() : 0; + // Here the NodeView is created for the node. +// getModel().insertNodeInto(newNode, targetNode, position); +// getFrame().repaint(); // getLayeredPane().repaint(); + newNode = addNewNode(targetNode, position, null); + if (newNodeMode == ControllerAdapter.NEW_CHILD) { + c.select(newNode.getViewer()); + } + c.edit.editLater(newNode.getViewer(), target.getViewer(), e, true, parentFolded, false); + break; + } + return newNode; + } + + public MindMapNode addNewNode(MindMapNode parent, int index, freemind.main.Tools.BooleanHolder newNodeIsLeft){ + try { + // bug fix from Dimitri. + c.getModel().getLinkRegistry().registerLinkTarget(parent); + String newId = c.getModel().getLinkRegistry().generateUniqueID("_"); + c.getActionFactory().startTransaction(c.getText("new_child")); + NewNodeAction newNodeAction = + getAddNodeAction(parent, index, newId, newNodeIsLeft); + // Undo-action + DeleteNodeAction deleteAction = c.deleteChild.getDeleteNodeAction(newId); + c.getActionFactory().executeAction(new ActionPair(newNodeAction, deleteAction)); + c.getActionFactory().endTransaction(c.getText("new_child")); + return (MindMapNode) parent.getChildAt(index); + } catch (JAXBException e) { + e.printStackTrace(); + } + return null; + } + + + public NewNodeAction getAddNodeAction( + MindMapNode parent, + int index, + String newId, + freemind.main.Tools.BooleanHolder newNodeIsLeft) + throws JAXBException { + String pos = null; + + if (newNodeIsLeft!= null) { + pos = newNodeIsLeft.getValue() ? "left" : "right"; + } + NewNodeAction newNodeAction = c.getActionXmlFactory().createNewNodeAction(); + newNodeAction.setNode(c.getNodeID(parent)); + newNodeAction.setPosition(pos); + newNodeAction.setIndex(index); + newNodeAction.setNewId(newId); + return newNodeAction; + } + + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/NewMapAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/NewMapAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/NewMapAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/NewMapAction.java 2005-01-02 08:37:55.000000000 +0000 @@ -0,0 +1,35 @@ +/* + * Created on 05.05.2004 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package freemind.modes.actions; + +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; +import javax.swing.ImageIcon; + +import freemind.modes.ControllerAdapter; + + +//////////// +// Actions +/////////// + +public class NewMapAction extends AbstractAction { + private final ControllerAdapter modeController; + ControllerAdapter c; + public NewMapAction(ControllerAdapter modeController, ControllerAdapter controller) { + super(modeController.getText("new"), new ImageIcon(modeController.getResource("images/filenew.png"))); + this.modeController = modeController; + c = controller; + //Workaround to get the images loaded in jar file. + //they have to be added to jar manually with full path from root + //I really don't like this, but it's a bug of java + } + public void actionPerformed(ActionEvent e) { + c.newMap(); + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/NewPreviousSiblingAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/NewPreviousSiblingAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/NewPreviousSiblingAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/NewPreviousSiblingAction.java 2004-10-18 00:00:10.000000000 +0100 @@ -0,0 +1,41 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 25.08.2004 + */ +/*$Id: NewPreviousSiblingAction.java,v 1.1.4.1 2004/10/17 23:00:10 dpolivaev Exp $*/ +package freemind.modes.actions; + +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; + +import freemind.modes.ControllerAdapter; + + +public class NewPreviousSiblingAction extends AbstractAction { + private final ControllerAdapter controller; + public NewPreviousSiblingAction(ControllerAdapter controller) { + super(controller.getText("new_sibling_before")); + this.controller = controller; + } + public void actionPerformed(ActionEvent e) { + controller.addNew(controller.getSelected(), ControllerAdapter.NEW_SIBLING_BEFORE, null); + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/NewSiblingAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/NewSiblingAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/NewSiblingAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/NewSiblingAction.java 2004-10-18 00:00:10.000000000 +0100 @@ -0,0 +1,41 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 25.08.2004 + */ +/*$Id: NewSiblingAction.java,v 1.1.4.1 2004/10/17 23:00:10 dpolivaev Exp $*/ +package freemind.modes.actions; + +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; + +import freemind.modes.ControllerAdapter; + + +public class NewSiblingAction extends AbstractAction { + private final ControllerAdapter controller; + public NewSiblingAction(ControllerAdapter controller) { + super(controller.getText("new_sibling_behind")); + this.controller = controller; + } + public void actionPerformed(ActionEvent e) { + controller.addNew(controller.getSelected(), ControllerAdapter.NEW_SIBLING_BEHIND, null); + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/NodeBackgroundColorAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/NodeBackgroundColorAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/NodeBackgroundColorAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/NodeBackgroundColorAction.java 2005-04-14 21:37:23.000000000 +0100 @@ -0,0 +1,121 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + * See COPYING for Details + * + * 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. + * + * Created on 19.09.2004 + */ +/* $Id: NodeBackgroundColorAction.java,v 1.1.4.3 2005/04/14 20:37:23 christianfoltin Exp $ */ + +package freemind.modes.actions; + +import java.awt.Color; +import java.awt.event.ActionEvent; +import java.util.ListIterator; + +import javax.xml.bind.JAXBException; + +import freemind.controller.Controller; +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.FreemindAction; +import freemind.controller.actions.generated.instance.NodeBackgroundColorFormatAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.main.Tools; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; +import freemind.modes.mindmapmode.MindMapMapModel; +import freemind.modes.mindmapmode.MindMapNodeModel; + +public class NodeBackgroundColorAction extends FreemindAction implements ActorXml { + private final ModeController controller; + + public NodeBackgroundColorAction(ModeController controller) { + super("node_background_color", (String)null, controller); + this.controller = controller; + addActor(this); + } + + + + public void actionPerformed(ActionEvent e) { + Color color = Controller.showCommonJColorChooserDialog(controller + .getView().getSelected(), controller.getText("choose_node_background_color"), controller.getSelected() + .getBackgroundColor()); + if (color == null) { + return; + } + for (ListIterator it = controller.getSelecteds().listIterator(); it + .hasNext();) { + MindMapNodeModel selected = (MindMapNodeModel) it.next(); + setNodeBackgroundColor(selected, color); + } + } + + public static class RemoveNodeBackgroundColorAction extends NodeGeneralAction { + + private final ModeController controller; + public RemoveNodeBackgroundColorAction(final ModeController controller) { + super(controller, "remove_node_background_color", (String)null); + this.controller = controller; + setSingleNodeOperation(new SingleNodeOperation(){ + + public void apply(MindMapMapModel map, MindMapNodeModel node) { + controller.setNodeBackgroundColor(node, null); + }}); + } + + } + public void setNodeBackgroundColor(MindMapNode node, Color color) { + try { + NodeBackgroundColorFormatAction doAction = createNodeBackgroundColorFormatAction(node, color); + NodeBackgroundColorFormatAction undoAction = createNodeBackgroundColorFormatAction(node, node.getBackgroundColor()); + controller.getActionFactory().startTransaction(this.getClass().getName()); + controller.getActionFactory().executeAction(new ActionPair(doAction, undoAction)); + controller.getActionFactory().endTransaction(this.getClass().getName()); + } catch (JAXBException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public NodeBackgroundColorFormatAction createNodeBackgroundColorFormatAction(MindMapNode node, Color color) throws JAXBException { + NodeBackgroundColorFormatAction nodeAction = controller.getActionXmlFactory().createNodeBackgroundColorFormatAction(); + nodeAction.setNode(node.getObjectId(controller)); + nodeAction.setColor(Tools.colorToXml(color)); + return nodeAction; + } + + public void act(XmlAction action) { + if (action instanceof NodeBackgroundColorFormatAction) { + NodeBackgroundColorFormatAction nodeColorAction = (NodeBackgroundColorFormatAction) action; + Color color = Tools.xmlToColor(nodeColorAction.getColor()); + MindMapNode node = controller.getNodeFromID(nodeColorAction.getNode()); + Color oldColor = node.getBackgroundColor() ; + if (!Tools.safeEquals(color, oldColor)) { + node.setBackgroundColor(color); // null + controller.nodeChanged(node); + } + } + } + + public Class getDoActionClass() { + return NodeBackgroundColorFormatAction.class; + } + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/NodeColorAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/NodeColorAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/NodeColorAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/NodeColorAction.java 2004-10-18 00:00:10.000000000 +0100 @@ -0,0 +1,106 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + * See COPYING for Details + * + * 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. + * + * Created on 19.09.2004 + */ +/* $Id: NodeColorAction.java,v 1.1.4.1 2004/10/17 23:00:10 dpolivaev Exp $ */ + +package freemind.modes.actions; + +import java.awt.Color; +import java.awt.event.ActionEvent; +import java.util.ListIterator; + +import javax.xml.bind.JAXBException; + +import freemind.controller.Controller; +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.FreemindAction; +import freemind.controller.actions.generated.instance.EdgeColorFormatAction; +import freemind.controller.actions.generated.instance.NodeColorFormatAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.main.Tools; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; +import freemind.modes.mindmapmode.MindMapEdgeModel; +import freemind.modes.mindmapmode.MindMapNodeModel; + +public class NodeColorAction extends FreemindAction implements ActorXml { + private final ModeController controller; + + public NodeColorAction(ModeController controller) { + super("node_color", (String)null, controller); + this.controller = controller; + controller.getActionFactory().registerActor(this, getDoActionClass()); + } + + public void actionPerformed(ActionEvent e) { + Color color = Controller.showCommonJColorChooserDialog(controller + .getView().getSelected(), controller.getText("choose_node_color"), controller.getSelected() + .getColor()); + if (color == null) { + return; + } + for (ListIterator it = controller.getSelecteds().listIterator(); it + .hasNext();) { + MindMapNodeModel selected = (MindMapNodeModel) it.next(); + setNodeColor(selected, color); + } + } + + public void setNodeColor(MindMapNode node, Color color) { + try { + NodeColorFormatAction doAction = createNodeColorFormatAction(node, color); + NodeColorFormatAction undoAction = createNodeColorFormatAction(node, node.getColor()); + controller.getActionFactory().startTransaction(this.getClass().getName()); + controller.getActionFactory().executeAction(new ActionPair(doAction, undoAction)); + controller.getActionFactory().endTransaction(this.getClass().getName()); + } catch (JAXBException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public NodeColorFormatAction createNodeColorFormatAction(MindMapNode node, Color color) throws JAXBException { + NodeColorFormatAction nodeAction = controller.getActionXmlFactory().createNodeColorFormatAction(); + nodeAction.setNode(node.getObjectId(controller)); + nodeAction.setColor(Tools.colorToXml(color)); + return nodeAction; + } + + public void act(XmlAction action) { + if (action instanceof NodeColorFormatAction) { + NodeColorFormatAction nodeColorAction = (NodeColorFormatAction) action; + Color color = Tools.xmlToColor(nodeColorAction.getColor()); + MindMapNode node = controller.getNodeFromID(nodeColorAction.getNode()); + Color oldColor = node.getColor() ; + if (!Tools.safeEquals(color, oldColor)) { + node.setColor(color); // null + controller.nodeChanged(node); + } + } + } + + public Class getDoActionClass() { + return NodeColorFormatAction.class; + } + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/NodeColorBlendAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/NodeColorBlendAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/NodeColorBlendAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/NodeColorBlendAction.java 2004-10-18 00:00:10.000000000 +0100 @@ -0,0 +1,46 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 29.09.2004 + */ +/*$Id: NodeColorBlendAction.java,v 1.1.4.1 2004/10/17 23:00:10 dpolivaev Exp $*/ + +package freemind.modes.actions; + +import freemind.modes.ControllerAdapter; +import freemind.modes.mindmapmode.MindMapMapModel; +import freemind.modes.mindmapmode.MindMapNodeModel; + +/** + * @author foltin + * + */ +public class NodeColorBlendAction extends NodeGeneralAction { + /** + * + */ + public NodeColorBlendAction(final ControllerAdapter modeController) { + super( modeController, "blend_color", null, new SingleNodeOperation(){ + + public void apply(MindMapMapModel map, MindMapNodeModel node) { + modeController.blendNodeColor(node); + }}); + } + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/NodeGeneralAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/NodeGeneralAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/NodeGeneralAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/NodeGeneralAction.java 2005-05-12 22:31:15.000000000 +0100 @@ -0,0 +1,188 @@ +/* + * Created on 05.05.2004 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package freemind.modes.actions; + +import java.awt.event.ActionEvent; +import java.util.ListIterator; +import java.util.logging.Logger; + +import javax.swing.Action; +import javax.swing.ImageIcon; +import javax.xml.bind.JAXBException; + +import freemind.controller.Controller; +import freemind.controller.actions.AbstractXmlAction; +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.FreemindAction; +import freemind.controller.actions.NodeActorXml; +import freemind.controller.actions.generated.instance.CompoundAction; +import freemind.controller.actions.generated.instance.ObjectFactory; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.main.FreeMind; +import freemind.modes.ControllerAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; +import freemind.modes.NodeAdapter; +import freemind.modes.mindmapmode.MindMapMapModel; +import freemind.modes.mindmapmode.MindMapNodeModel; +import freemind.preferences.FreemindPropertyListener; + +public class NodeGeneralAction extends AbstractXmlAction { + protected final ModeController modeController; + + private freemind.controller.actions.NodeActorXml actor; + + SingleNodeOperation singleNodeOperation; + + protected static Logger logger; + + /** + * @param modeController + * @param textID + * null if you cannot provide a title that is present in the + * resources. Use the setName method to set your not translateble + * title after that. + * @param iconPath + * give a resource name for the icon. + */ + protected NodeGeneralAction(ModeController modeController, + final String textID, String iconPath) { + super(null, iconPath != null ? new ImageIcon(modeController + .getController().getResource(iconPath)) : null, modeController); + this.modeController = modeController; + if (textID != null) { + setName(modeController.getText(textID)); + } + + this.singleNodeOperation = null; + this.actor = null; + if (logger == null) { + logger = modeController.getFrame().getLogger( + this.getClass().getName()); + } + } + + protected void setName(String name) { + if (name != null) { + putValue(Action.NAME, name); + putValue(Action.SHORT_DESCRIPTION, name); + } + + } + + public NodeGeneralAction(ModeController modeController, String textID, + String iconPath, SingleNodeOperation singleNodeOperation) { + this(modeController, textID, iconPath); + this.singleNodeOperation = singleNodeOperation; + } + + public NodeGeneralAction(ModeController modeController, String textID, + String iconPath, freemind.controller.actions.NodeActorXml actor) { + this(modeController, textID, iconPath); + addActor(actor); + } + + public void addActor(NodeActorXml actor) { + this.actor = actor; + if (actor != null) { + super.addActor(actor); + } + } + + /** + * @param singleNodeOperation + * The singleNodeOperation to set. + */ + public void setSingleNodeOperation(SingleNodeOperation singleNodeOperation) { + this.singleNodeOperation = singleNodeOperation; + } + + public void xmlActionPerformed(ActionEvent e) { + if (singleNodeOperation != null) { + for (ListIterator it = modeController.getSelecteds().listIterator(); it + .hasNext();) { + MindMapNodeModel selected = (MindMapNodeModel) it.next(); + singleNodeOperation.apply((MindMapMapModel) this.modeController + .getMap(), selected); + } + } else { + // xml action: + try { + // Do-action + CompoundAction doAction = modeController.getActionXmlFactory() + .createCompoundAction(); + // Undo-action + CompoundAction undo = modeController.getActionXmlFactory() + .createCompoundAction(); + // sort selectedNodes list by depth, in order to guarantee that + // sons are deleted first: + for (ListIterator it = modeController.getSelecteds() + .listIterator(); it.hasNext();) { + MindMapNodeModel selected = (MindMapNodeModel) it.next(); + ActionPair pair = actor.apply(this.modeController.getMap(), + selected); + if (pair != null) { + doAction + .getCompoundActionOrSelectNodeActionOrCutNodeAction() + .add(pair.getDoAction()); + undo + .getCompoundActionOrSelectNodeActionOrCutNodeAction() + .add(0, pair.getUndoAction()); + } + } + modeController.getActionFactory().startTransaction( + (String) getValue(NAME)); + modeController.getActionFactory().executeAction( + new ActionPair(doAction, undo)); + modeController.getActionFactory().endTransaction( + (String) getValue(NAME)); + } catch (JAXBException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + + } + + protected void execute(ActionPair pair) { + modeController.getActionFactory().executeAction(pair); + } + + /* + * (non-Javadoc) + * + * @see freemind.controller.actions.FreeMindAction#act(freemind.controller.actions.generated.instance.XmlAction) + */ + public void act(XmlAction action) { + } + + /** + * @param string + * @return + */ + protected NodeAdapter getNodeFromID(String string) { + return modeController.getNodeFromID(string); + } + + /** + * @param selected + * @return + */ + protected String getNodeID(MindMapNode selected) { + // TODO Auto-generated method stub + return modeController.getNodeID(selected); + } + + /** + * + */ + protected ObjectFactory getActionXmlFactory() { + // TODO Auto-generated method stub + return modeController.getActionXmlFactory(); + } + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/NodeHookAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/NodeHookAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/NodeHookAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/NodeHookAction.java 2005-04-08 22:37:30.000000000 +0100 @@ -0,0 +1,279 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 26.07.2004 + */ +/*$Id: NodeHookAction.java,v 1.1.4.2 2005/04/08 21:37:30 christianfoltin Exp $*/ +package freemind.modes.actions; + +import java.awt.event.ActionEvent; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Vector; +import java.util.logging.Logger; + +import javax.swing.Action; +import javax.swing.ImageIcon; +import javax.swing.JMenuItem; +import javax.xml.bind.JAXBException; + +import freemind.controller.MenuItemEnabledListener; +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.FreemindAction; +import freemind.controller.actions.generated.instance.HookNodeAction; +import freemind.controller.actions.generated.instance.NodeListMember; +import freemind.controller.actions.generated.instance.NodeListMemberType; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.extensions.HookFactory; +import freemind.extensions.HookInstanciationMethod; +import freemind.extensions.NodeHook; +import freemind.extensions.PermanentNodeHook; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; + + +public class NodeHookAction extends FreemindAction implements ActorXml, MenuItemEnabledListener { + String _hookName; + ModeController controller; + public ModeController getController() { + return controller; + } + private static Logger logger; + public NodeHookAction(String hookName, ModeController controller) { + //URGENT: hookName must be translated!! + super(hookName, (ImageIcon) null, null); + this._hookName = hookName; + this.controller = controller; + if(logger == null) + logger = controller.getFrame().getLogger(this.getClass().getName()); + controller.getActionFactory().registerActor(this, getDoActionClass()); + } + + public void actionPerformed(ActionEvent arg0) { + // check, which method of invocation: + // + controller.getFrame().setWaitingCursor(true); + invoke(controller.getSelected(), controller.getSelecteds()); + controller.getFrame().setWaitingCursor(false); + } + + + + public void addHook(MindMapNode focussed, List selecteds, String hookName) { + HookNodeAction doAction = createHookNodeAction(focussed, selecteds, hookName); + + XmlAction undoAction=null; + try { + // this is the non operation: + undoAction = controller.getActionXmlFactory() + .createCompoundAction(); + } catch (JAXBException e) { + e.printStackTrace(); + } + if (getInstanciationMethod(hookName).isPermanent()) { + // double application = remove. + undoAction = createHookNodeAction(focussed, + selecteds, hookName); + } + if (getInstanciationMethod(hookName).isUndoable()) { + getController().getActionFactory().startTransaction((String) getValue(NAME)); + getController().getActionFactory().executeAction(new ActionPair(doAction, undoAction)); + getController().getActionFactory().endTransaction((String) getValue(NAME)); + } else { + // direct invocation without undo and such stuff. + invoke(focussed, selecteds, hookName); + } + } + + public void invoke(MindMapNode focussed, List selecteds) { + addHook(focussed, selecteds, _hookName); + } + + private void invoke(MindMapNode focussed, List selecteds, String hookName) { + logger.finest("invoke(selecteds) called."); + HookInstanciationMethod instMethod = getInstanciationMethod(hookName); + // get destination nodes + Collection destinationNodes = instMethod.getDestinationNodes(controller, focussed, selecteds); + MindMapNode adaptedFocussedNode = instMethod.getCenterNode(controller, focussed, selecteds); + // test if hook already present + if(instMethod.isAlreadyPresent(controller, hookName, adaptedFocussedNode, destinationNodes)){ + // remove the hook: + for (Iterator i = destinationNodes.iterator(); i.hasNext();) { + MindMapNode currentDestinationNode = (MindMapNode) i.next(); + // find the hook ini the current node, if present: + for (Iterator j = currentDestinationNode.getActivatedHooks().iterator(); j + .hasNext();) { + PermanentNodeHook hook = (PermanentNodeHook) j.next(); + if(hook.getName().equals(hookName)) { + currentDestinationNode.removeHook(hook); + /* fc, 30.7.2004: + * we have to break. otherwise the collection is modified + * at two points (i.e., the collection is not valid anymore after removing + * one element). + * But this is no problem, as there exist only "once" plugins currently. + */ + break; + } + } + } + } else { + // add the hook + for (Iterator it = destinationNodes.iterator(); it.hasNext();) { + MindMapNode currentDestinationNode = (MindMapNode) it.next(); + NodeHook hook = controller + .createNodeHook(hookName, currentDestinationNode, controller.getMap()); + logger.finest("created hook "+hookName); + // call invoke. + currentDestinationNode.invokeHook(hook); + if (hook instanceof PermanentNodeHook) { + PermanentNodeHook permHook = (PermanentNodeHook) hook; + logger.finest("This is a permanent hook "+ hookName); + // the focussed receives the focus: + if (currentDestinationNode == adaptedFocussedNode) { + permHook.onReceiveFocusHook(); + } + // using this method, the map is dirty now. This is important to + // guarantee, that the hooks are saved. + controller.nodeChanged(currentDestinationNode); + } + } + finishInvocation(focussed, selecteds, adaptedFocussedNode, destinationNodes); + } + } + + + /** + * @param focussed The real focussed node + * @param selecteds The list of selected nodes + * @param adaptedFocussedNode The calculated focussed node (if the hook specifies, that + * the hook should apply to root, then this is the root node). + * @param destinationNodes The calculated list of selected nodes (see last) + */ + private void finishInvocation(MindMapNode focussed, List selecteds, + MindMapNode adaptedFocussedNode, Collection destinationNodes) { + // select all destination nodes: + // fc, 25.8.2004: The following code snippet should be moved to a more general place. + if (focussed.getViewer() != null) { + getController().getView().selectAsTheOnlyOneSelected( + focussed.getViewer()); + getController().getView().scrollNodeToVisible( + focussed.getViewer()); + for (Iterator i = selecteds.iterator(); i.hasNext();) { + MindMapNode node = (MindMapNode) i.next(); + if(node.getViewer() != null) { + getController().getView().makeTheSelected(node.getViewer()); + } + } + } + } + + + + /** + * @return + */ + private HookInstanciationMethod getInstanciationMethod(String hookName) { + HookFactory factory = getHookFactory(); + // determine instanciation method + HookInstanciationMethod instMethod = factory.getInstanciationMethod(hookName); + return instMethod; + } + + /** + * @return + */ + private HookFactory getHookFactory() { + HookFactory factory = controller.getFrame().getHookFactory(); + return factory; + } + + /* (non-Javadoc) + * @see freemind.controller.MenuItemEnabledListener#isEnabled(javax.swing.JMenuItem, javax.swing.Action) + */ + public boolean isEnabled(JMenuItem item, Action action) { + // test if plugin has its own method: + HookFactory factory = getHookFactory(); + Object baseClass = factory.getPluginBaseClass(_hookName); + if(baseClass != null) { + if (baseClass instanceof MenuItemEnabledListener) { + MenuItemEnabledListener listener = (MenuItemEnabledListener) baseClass; + return listener.isEnabled(item, this); + } + } + MindMapNode focussed = controller.getSelected(); + List selecteds = controller.getSelecteds(); + HookInstanciationMethod instMethod = getInstanciationMethod(_hookName); + // get destination nodes + Collection destinationNodes = instMethod.getDestinationNodes(controller, focussed, selecteds); + MindMapNode adaptedFocussedNode = instMethod.getCenterNode(controller, focussed, selecteds); + // test if hook already present + boolean isActionSelected = instMethod.isAlreadyPresent(controller, _hookName, adaptedFocussedNode, destinationNodes); + setSelected(item, isActionSelected); + + return true; + } + + public HookNodeAction createHookNodeAction(MindMapNode focussed, List selecteds, String hookName) { + try { + HookNodeAction hookNodeAction = getController() + .getActionXmlFactory().createHookNodeAction(); + hookNodeAction.setNode(focussed.getObjectId(getController())); + hookNodeAction.setHookName(hookName); + // selectedNodes list + for (Iterator i = selecteds.iterator(); i.hasNext();) { + MindMapNode node = (MindMapNode) i.next(); + NodeListMember nodeListMember = getController() + .getActionXmlFactory().createNodeListMember(); + nodeListMember.setNode(node.getObjectId(getController())); + hookNodeAction.getNodeListMember().add(nodeListMember); + } + return hookNodeAction; + } catch (JAXBException e) { + e.printStackTrace(); + return null; + } + } + + public void act(XmlAction action) { + if (action instanceof HookNodeAction) { + HookNodeAction hookNodeAction = (HookNodeAction) action; + MindMapNode selected = getController().getNodeFromID(hookNodeAction.getNode()); + Vector selecteds = new Vector(); + for (Iterator i = hookNodeAction.getNodeListMember().iterator(); i.hasNext();) { + NodeListMemberType node = (NodeListMemberType) i.next(); + selecteds.add(getController().getNodeFromID(node.getNode())); + } + invoke(selected, selecteds, hookNodeAction.getHookName()); + } + } + + public Class getDoActionClass() { + return HookNodeAction.class; + } + + /** + * @return + */ + public String getHookName() { + return _hookName; + } + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/NodeStyleAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/NodeStyleAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/NodeStyleAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/NodeStyleAction.java 2005-01-03 22:49:56.000000000 +0000 @@ -0,0 +1,99 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + * See COPYING for Details + * + * 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. + * + * Created on 05.10.2004 + */ +/* $Id: NodeStyleAction.java,v 1.1.4.2 2005/01/03 22:49:56 christianfoltin Exp $ */ + +package freemind.modes.actions; + +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.NodeActorXml; +import freemind.controller.actions.generated.instance.NodeStyleFormatAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.main.Tools; +import freemind.modes.MapAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; + +public class NodeStyleAction extends NodeGeneralAction implements NodeActorXml { + private final String mStyle; + + + public NodeStyleAction(ModeController controller, String style) { + super(controller, style, null); + this.mStyle = style; + addActor(this); + } + + public ActionPair apply(MapAdapter model, MindMapNode selected) + throws JAXBException { + return getActionPair(selected, mStyle); + } + + public Class getDoActionClass() { + return NodeStyleFormatAction.class; + } + + public void setStyle(MindMapNode node, String style) { + try { + modeController.getActionFactory().startTransaction( + (String) getValue(NAME)); + modeController.getActionFactory().executeAction( + getActionPair(node, style)); + modeController.getActionFactory().endTransaction( + (String) getValue(NAME)); + } catch (JAXBException e) { + e.printStackTrace(); + } + + } + + private ActionPair getActionPair(MindMapNode targetNode, String style) + throws JAXBException { + NodeStyleFormatAction styleAction = createNodeStyleFormatAction(targetNode, style); + NodeStyleFormatAction undoStyleAction = createNodeStyleFormatAction(targetNode, targetNode.getStyle()); + return new ActionPair(styleAction, undoStyleAction); + } + + private NodeStyleFormatAction createNodeStyleFormatAction(MindMapNode selected, String style) + throws JAXBException { + NodeStyleFormatAction nodeStyleAction = getActionXmlFactory() + .createNodeStyleFormatAction(); + nodeStyleAction.setNode(getNodeID(selected)); + nodeStyleAction.setStyle(style); + return nodeStyleAction; + } + + public void act(XmlAction action) { + if (action instanceof NodeStyleFormatAction) { + NodeStyleFormatAction nodeStyleAction = (NodeStyleFormatAction) action; + MindMapNode node = getNodeFromID(nodeStyleAction.getNode()); + String style = nodeStyleAction.getStyle(); + if(!Tools.safeEquals(node.getStyle(), style)) { + logger.info("Setting style of " + node + " to "+ style); + node.setStyle(style); + modeController.nodeStructureChanged(node); + } + } + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/NodeUpAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/NodeUpAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/NodeUpAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/NodeUpAction.java 2005-01-02 07:57:27.000000000 +0000 @@ -0,0 +1,222 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 21.08.2004 + */ +/*$Id: NodeUpAction.java,v 1.1.4.3 2005/01/02 07:57:27 christianfoltin Exp $*/ + +package freemind.modes.actions; + +import java.awt.event.ActionEvent; +import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.TreeSet; +import java.util.Vector; +import java.util.logging.Logger; + +import javax.swing.AbstractAction; +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.generated.instance.CompoundAction; +import freemind.controller.actions.generated.instance.FoldAction; +import freemind.controller.actions.generated.instance.MoveNodesAction; +import freemind.controller.actions.generated.instance.NodeListMember; +import freemind.controller.actions.generated.instance.NodeListMemberType; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.ControllerAdapter; +import freemind.modes.MapAdapter; +import freemind.modes.MindMapNode; + + +public class NodeUpAction extends AbstractAction implements ActorXml{ + private final ControllerAdapter modeController; + private static Logger logger; + public NodeUpAction(ControllerAdapter modeController) { + super(modeController.getText("node_up")); + this.modeController = modeController; + modeController.getActionFactory().registerActor(this, getDoActionClass()); + if(logger == null) { + logger = modeController.getFrame().getLogger(this.getClass().getName()); + } + } + public void actionPerformed(ActionEvent e) { + moveNodes(modeController.getSelected(), modeController.getSelecteds(), -1); + } + /** + * @param selected + * @param selecteds + * @param i + */ + public void moveNodes(MindMapNode selected, List selecteds, int direction) { + MoveNodesAction doAction = createMoveNodesAction(selected, selecteds, direction); + MoveNodesAction undoAction = createMoveNodesAction(selected, selecteds, -direction); + modeController.getActionFactory().startTransaction((String) getValue(NAME)); + modeController.getActionFactory().executeAction(new ActionPair(doAction, undoAction)); + modeController.getActionFactory().endTransaction((String) getValue(NAME)); + } + public void _moveNodes(MindMapNode selected, List selecteds, int direction) { + Comparator comparator = (direction==-1)?null:new Comparator(){ + + public int compare(Object o1, Object o2) { + int i1 = ((Integer) o1).intValue(); + int i2 = ((Integer) o2).intValue(); + return i2 - i1; + } + }; + if(!selected.isRoot()) { + MindMapNode parent = selected.getParentNode(); + // multiple move: + Vector sortedChildren = getSortedSiblings(parent); + TreeSet range = new TreeSet(comparator); + for (Iterator i = selecteds.iterator(); i.hasNext();) { + MindMapNode node = (MindMapNode) i.next(); + if(node.getParent() != parent) { + logger.warning("Not all selected nodes have the same parent."); + return; + } + range.add(new Integer(sortedChildren.indexOf(node))); + } + // test range for adjacent nodes: + Integer last = (Integer) range.iterator().next(); + for (Iterator i = range.iterator(); i.hasNext();) { + Integer newInt = (Integer) i.next(); + if(Math.abs(newInt.intValue() - last.intValue()) > 1) { + logger.warning("Not adjacent nodes. Skipped. "); + return; + } + last = newInt; + } + for (Iterator i = range.iterator(); i.hasNext();) { + Integer position = (Integer) i.next(); + // from above: + MindMapNode node = (MindMapNode) sortedChildren.get(position.intValue()); + moveNodeTo(node, parent, direction); + } + modeController.getView().selectAsTheOnlyOneSelected( + selected.getViewer()); + modeController.getView().scrollNodeToVisible( + selected.getViewer()); + for (Iterator i = range.iterator(); i.hasNext();) { + Integer position = (Integer) i.next(); + // from above: + MindMapNode node = (MindMapNode) sortedChildren.get(position.intValue()); + modeController.getView().makeTheSelected(node.getViewer()); + } + modeController.getController().obtainFocusForSelected(); // focus fix + } + } + /** + * The direction is used if side left and right are present. then the next suitable place on the same side# + is searched. if there is no such place, then the side is changed. + @return returns the new index. + */ + public int moveNodeTo(MindMapNode newChild, MindMapNode parent, int direction){ + MapAdapter model = modeController.getModel(); + int index = model.getIndexOfChild(parent, newChild); + int newIndex = index; + if(newChild.isLeft() != null) { + int maxIndex = parent.getChildCount(); + Vector sortedNodesIndices = getSortedSiblings(parent); + int newPositionInVector = sortedNodesIndices.indexOf(newChild) + direction; + if(newPositionInVector < 0) { + newPositionInVector = maxIndex-1; + } + if(newPositionInVector >= maxIndex) { + newPositionInVector = 0; + } + MindMapNode destinationNode =(MindMapNode) sortedNodesIndices.get(newPositionInVector); + newIndex = model.getIndexOfChild(parent, destinationNode); + newChild.setLeft(destinationNode.isLeft().getValue()); + model.removeNodeFromParent(newChild); + model.insertNodeInto(newChild,parent,newIndex); + modeController.nodeStructureChanged(parent); + } + return newIndex; + } + + /** Sorts nodes by their left/right status. The left are first. + * @param node + * @return + */ + private Vector getSortedSiblings(MindMapNode node) { + Vector nodes = new Vector(); + for (Iterator i = node.childrenUnfolded(); i.hasNext();) { + nodes.add(i.next()); + } + Collections.sort(nodes, new Comparator(){ + + public int compare(Object o1, Object o2) { + if (o1 instanceof MindMapNode) { + MindMapNode n1 = (MindMapNode) o1; + if (o2 instanceof MindMapNode) { + MindMapNode n2 = (MindMapNode) o2; + if(n1.isLeft() != null && n2.isLeft()!= null) { + // left is less than right + int b1 = (n1.isLeft().getValue())?0:1; + int b2 = (n2.isLeft().getValue())?0:1; + return b1 - b2; + } + } + } + throw new IllegalArgumentException("Elements in LeftRightComparator are not comparable."); + } + }); + //logger.finest("Sorted nodes "+ nodes); + return nodes; + } + public void act(XmlAction action) { + if (action instanceof MoveNodesAction) { + MoveNodesAction moveAction = (MoveNodesAction) action; + MindMapNode selected = modeController.getNodeFromID(moveAction.getNode()); + Vector selecteds = new Vector(); + for (Iterator i = moveAction.getNodeListMember().iterator(); i.hasNext();) { + NodeListMemberType node = (NodeListMemberType) i.next(); + selecteds.add(modeController.getNodeFromID(node.getNode())); + } + _moveNodes(selected, selecteds, moveAction.getDirection()); + } + } + public Class getDoActionClass() { + return MoveNodesAction.class; + } + private MoveNodesAction createMoveNodesAction(MindMapNode selected, List selecteds, int direction) { + try { + MoveNodesAction moveAction = modeController.getActionXmlFactory().createMoveNodesAction(); + moveAction.setDirection(direction); + moveAction.setNode(selected.getObjectId(modeController)); + // selectedNodes list + for (Iterator i = selecteds.iterator(); i.hasNext();) { + MindMapNode node = (MindMapNode) i.next(); + NodeListMember nodeListMember = modeController.getActionXmlFactory().createNodeListMember(); + nodeListMember.setNode(node.getObjectId(modeController)); + moveAction.getNodeListMember().add(nodeListMember); + } + return moveAction; + } catch (JAXBException e) { + e.printStackTrace(); + } + return null; + + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/PasteAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/PasteAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/PasteAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/PasteAction.java 2005-02-02 21:23:24.000000000 +0000 @@ -0,0 +1,577 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 09.05.2004 + */ +/*$Id: PasteAction.java,v 1.1.4.4 2005/02/02 21:23:24 christianfoltin Exp $*/ + +package freemind.modes.actions; + +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.awt.event.ActionEvent; +import java.io.File; +import java.io.IOException; +import java.io.StringReader; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.swing.AbstractAction; +import javax.swing.ImageIcon; +import javax.swing.JOptionPane; +import javax.xml.bind.JAXBException; + +import freemind.controller.MindMapNodesSelection; +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.generated.instance.CompoundAction; +import freemind.controller.actions.generated.instance.CutNodeAction; +import freemind.controller.actions.generated.instance.PasteNodeAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.main.Tools; +import freemind.main.XMLParseException; +import freemind.modes.ControllerAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.NodeAdapter; +import freemind.modes.mindmapmode.MindMapNodeModel; +import freemind.modes.mindmapmode.MindMapXMLElement; + +public class PasteAction extends AbstractAction implements ActorXml { + public static final String NODESEPARATOR = ""; + private static java.util.logging.Logger logger; + private String text; + private final ControllerAdapter c; + public PasteAction(ControllerAdapter adapter) { + super( + adapter.getText("paste"), + new ImageIcon(adapter.getResource("images/editpaste.png"))); + this.c = adapter; + if(logger == null) + logger = c.getFrame().getLogger(this.getClass().getName()); + + this.text = adapter.getText("paste"); + setEnabled(false); + this.c.getActionFactory().registerActor(this, getDoActionClass()); + + } + public void actionPerformed(ActionEvent e) { + if (this.c.getClipboard() != null) { + this.c.paste( + this.c.getClipboard().getContents(c), + this.c.getView().getSelected().getModel()); + } + } + + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#act(freemind.controller.actions.generated.instance.XmlAction) + */ + public void act(XmlAction action) { + PasteNodeAction pasteAction = (PasteNodeAction) action; + _paste( + c.cut.getTransferable(pasteAction.getTransferableContent()), + c.getNodeFromID(pasteAction.getNode()), + pasteAction.isAsSibling(), + pasteAction.isIsLeft()); + } + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#getDoActionClass() + */ + public Class getDoActionClass() { + return PasteNodeAction.class; + } + + + public PasteNodeAction getPasteNodeAction(Transferable t, NodeCoordinate coord) throws JAXBException { + PasteNodeAction pasteAction = + c.getActionXmlFactory().createPasteNodeAction(); + pasteAction.setNode(c.getNodeID(coord.target)); + pasteAction.setTransferableContent(c.cut.getTransferableContent(t)); + pasteAction.setAsSibling(coord.asSibling); + pasteAction.setIsLeft(coord.isLeft); + return pasteAction; + } + + + /** URGENT: Change this method. */ + public void paste(MindMapNode node, MindMapNode parent) { + if (node != null) { + insertNodeInto(node, parent); + c.nodeStructureChanged(parent); + } + } + + + public void paste(Transferable t, MindMapNode target, boolean asSibling, boolean isLeft) { + try { + PasteNodeAction pasteAction = getPasteNodeAction(t,new NodeCoordinate(target,asSibling, isLeft)); + long amountOfCuts = 1; + DataFlavorHandler[] dataFlavorHandlerList = getFlavorHandlers(); + for (int i = 0; i < dataFlavorHandlerList.length; i++) { + DataFlavorHandler handler = dataFlavorHandlerList[i]; + DataFlavor flavor = handler.getDataFlavor(); + if(t.isDataFlavorSupported(flavor)) { + amountOfCuts = handler.getNumberOfObjects(t.getTransferData(flavor), t); + break; + } + } + CompoundAction compound = c.getActionXmlFactory().createCompoundAction(); + for(long i = 0; i < amountOfCuts; ++i) { + CutNodeAction cutNodeAction = c.cut.getCutNodeAction(t, new NodeCoordinate(target,asSibling, isLeft)); + compound.getCompoundActionOrSelectNodeActionOrCutNodeAction().add(cutNodeAction); + } + + + // Undo-action + c.getActionFactory().startTransaction(text); + c.getActionFactory().executeAction(new ActionPair(pasteAction, compound)); + c.getActionFactory().endTransaction(text); + } catch (JAXBException e) { + e.printStackTrace(); + } catch (UnsupportedFlavorException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static class NodeCoordinate { + public MindMapNode target; + public boolean asSibling; + public boolean isLeft; + public NodeCoordinate(MindMapNode target, boolean asSibling, boolean isLeft) { + this.target = target; + this.asSibling = asSibling; + this.isLeft = isLeft; + } + public MindMapNode getNode() { + if (asSibling) { + MindMapNode parentNode = target.getParentNode(); + return (MindMapNode) parentNode.getChildAt(parentNode.getChildPosition(target) - 1); + } else { + logger.finest("getChildCount = " + target.getChildCount() + ", target = "+ target); + return (MindMapNode) target.getChildAt( + target.getChildCount() - 1); + } + } + public NodeCoordinate(MindMapNode node, boolean isLeft) { + this.isLeft = isLeft; + MindMapNode parentNode = node.getParentNode(); + int childPosition = parentNode.getChildPosition(node); + if(childPosition == parentNode.getChildCount() - 1) { + target = parentNode; + asSibling = false; + } else { + target = (MindMapNode) parentNode.getChildAt( + childPosition + 1); + asSibling = true; + } + } + } + + private interface DataFlavorHandler { + void paste(Object TransferData, MindMapNode target, boolean asSibling, boolean isLeft, Transferable t) throws UnsupportedFlavorException, IOException; + long getNumberOfObjects(Object TransferData, Transferable transfer) throws UnsupportedFlavorException, IOException; + DataFlavor getDataFlavor(); + } + + + + private class FileListFlavorHandler implements DataFlavorHandler { + + public void paste(Object TransferData, MindMapNode target, + boolean asSibling, boolean isLeft, Transferable t) { + // TODO: Does not correctly interpret asSibling. + List fileList = (List) TransferData; + for (ListIterator it = fileList.listIterator(); it.hasNext();) { + File file = (File) it.next(); + MindMapNode node = c.newNode(file.getName()); + node.setLink(file.getAbsolutePath()); + insertNodeIntoNoEvent(node, target, asSibling); + } + c.nodeStructureChanged((MindMapNode) (asSibling ? target + .getParent() : target)); + } + + + public long getNumberOfObjects(Object TransferData, Transferable transfer) { + return ((List) TransferData).size(); + } + + + public DataFlavor getDataFlavor() { + return MindMapNodesSelection.fileListFlavor; + } + + } + + private class MindMapNodesFlavorHandler implements DataFlavorHandler { + + public void paste(Object TransferData, MindMapNode target, boolean asSibling, boolean isLeft, Transferable t) { + //System.err.println("mindMapNodesFlavor"); + String textFromClipboard = + (String)TransferData; + if (textFromClipboard != null) { + String[] textLines = textFromClipboard.split(NODESEPARATOR); + if (textLines.length > 1) { + c.getFrame().setWaitingCursor(true); + } + for (int i = 0; i < textLines.length; ++i) { + //logger.info(textLines[i]+", "+ target+", "+ asSibling); + MindMapNodeModel newModel = pasteXMLWithoutRedisplay( + textLines[i], target, asSibling); + // additional code for left/right decision: + newModel.setLeft(isLeft); + } + } + } + + public long getNumberOfObjects(Object TransferData, Transferable transfer) { + String textFromClipboard = (String) TransferData; + if (textFromClipboard != null) { + String[] textLines = textFromClipboard.split(NODESEPARATOR); + return textLines.length; + } + return 0; + } + + public DataFlavor getDataFlavor() { + return MindMapNodesSelection.mindMapNodesFlavor; + } + } + private class HtmlFlavorHandler implements DataFlavorHandler { + + public void paste(Object TransferData, MindMapNode target, + boolean asSibling, boolean isLeft, Transferable t) + throws UnsupportedFlavorException, IOException { + //System.err.println("htmlFlavor"); + String textFromClipboard = (String) TransferData; + // ^ This outputs transfer data to standard output. I don't know + // why. + MindMapNode pastedNode = pasteStringWithoutRedisplay((String) t + .getTransferData(DataFlavor.stringFlavor), target, + asSibling); + + textFromClipboard = textFromClipboard.replaceAll("", ""); // remove + // HTML + // comment + String[] links = textFromClipboard + .split("<[aA][^>]*[hH][rR][eE][fF]=\""); + + MindMapNode linkParentNode = null; + URL referenceURL = null; + boolean baseUrlCanceled = false; + + for (int i = 1; i < links.length; i++) { + String link = links[i].substring(0, links[i].indexOf("\"")); + String textWithHtml = links[i].replaceAll("^[^>]*>", "") + .replaceAll("[\\s\\S]*", ""); + String text = Tools.toXMLUnescapedText(textWithHtml.replaceAll( + "\\n", "").replaceAll("<[^>]*>", "").trim()); + if (text.equals("")) { + text = link; + } + URL linkURL = null; + try { + linkURL = new URL(link); + } catch (MalformedURLException ex) { + try { + // Either invalid URL or relative URL + if (referenceURL == null && !baseUrlCanceled) { + String referenceURLString = JOptionPane + .showInputDialog(c + .getText("enter_base_url")); + if (referenceURLString == null) { + baseUrlCanceled = true; + } else { + referenceURL = new URL(referenceURLString); + } + } + linkURL = new URL(referenceURL, link); + } catch (MalformedURLException ex2) { + } + } + if (linkURL != null) { + if (links.length == 2 & pastedNode != null) { + // pastedNode != null iff the number of pasted lines is + // one + // The firts element in links[] array is never a link, therefore + // the condition links.length == 2 actually says "there is one link". + // Set link directly into node + ((MindMapNodeModel) pastedNode).setLink(linkURL + .toString()); + break; + } + if (linkParentNode == null) { + linkParentNode = c.newNode("Links"); + // Here we cannot set bold, because linkParentNode.font is null + insertNodeInto(linkParentNode, target); + ((NodeAdapter) linkParentNode).setBold(true); + } + MindMapNode linkNode = c.newNode(text); + linkNode.setLink(linkURL.toString()); + insertNodeInto(linkNode, linkParentNode); + } + } + } + + public long getNumberOfObjects(Object TransferData, Transferable transfer) throws UnsupportedFlavorException, IOException { + return ((String) (String) transfer + .getTransferData(DataFlavor.stringFlavor)).split("\n").length; + } + + public DataFlavor getDataFlavor() { + return MindMapNodesSelection.htmlFlavor; + } + + } + + private class StringFlavorHandler implements DataFlavorHandler { + + public void paste(Object TransferData, MindMapNode target, + boolean asSibling, boolean isLeft, Transferable t) + throws UnsupportedFlavorException, IOException { + //System.err.println("stringFlavor"); + String textFromClipboard = (String) t + .getTransferData(DataFlavor.stringFlavor); + pasteStringWithoutRedisplay(textFromClipboard, target, asSibling); + } + + public long getNumberOfObjects(Object TransferData, Transferable transfer) { + return ((String) TransferData).split("\n").length; + } + + public DataFlavor getDataFlavor() { + return DataFlavor.stringFlavor; + } + + } + /* + * + */ + private void _paste(Transferable t, MindMapNode target, boolean asSibling, boolean isLeft) { + if (t == null) { + return; } + try { + // Uncomment to print obtained data flavours + + /* + DataFlavor[] fl = t.getTransferDataFlavors(); + for (int i = 0; i < fl.length; i++) { + System.out.println(fl[i]); } + */ + + DataFlavorHandler[] dataFlavorHandlerList = getFlavorHandlers(); + for (int i = 0; i < dataFlavorHandlerList.length; i++) { + DataFlavorHandler handler = dataFlavorHandlerList[i]; + DataFlavor flavor = handler.getDataFlavor(); + if(t.isDataFlavorSupported(flavor)) { + handler.paste(t.getTransferData(flavor), target, asSibling, isLeft, t); + break; + } + } + c.nodeStructureChanged((MindMapNode) (asSibling ? target.getParent() : target)); } + catch (Exception e) { e.printStackTrace(); } + c.getFrame().setWaitingCursor(false); + } + + /** + * @return + */ + private DataFlavorHandler[] getFlavorHandlers() { + DataFlavorHandler[] dataFlavorHandlerList = new DataFlavorHandler[] { + new FileListFlavorHandler(), + new MindMapNodesFlavorHandler(), new HtmlFlavorHandler(), + new StringFlavorHandler() }; + return dataFlavorHandlerList; + } + private MindMapNodeModel pasteXMLWithoutRedisplay(String pasted, MindMapNode target) + throws XMLParseException { + return pasteXMLWithoutRedisplay(pasted, target, /*asSibling=*/false); } + + public MindMapNodeModel pasteXMLWithoutRedisplay(String pasted, MindMapNode target, boolean asSibling) + throws XMLParseException { + // Call nodeStructureChanged(target) after this function. + try { + MindMapXMLElement element = new MindMapXMLElement(c.getFrame()); + element.parseFromReader(new StringReader(pasted)); + MindMapNodeModel node = (MindMapNodeModel)element.getUserObject(); + element.processUnfinishedLinks(c.getModel().getLinkRegistry()); + // now, the import is finished. We can inform others about the new nodes: + if (asSibling) { + MindMapNode parent = target.getParentNode(); + insertNodeInto(node, parent, parent.getChildPosition(target)); } + else { + insertNodeInto(node, target); } + c.invokeHooksRecursively(node, c.getModel()); + return node; } + catch (IOException ee) { ee.printStackTrace(); return null; }} + + static final Pattern nonLinkCharacter = Pattern.compile("[ \n()'\",;]"); + + /** + * Paste String (as opposed to other flavours) + * + * Split the text into lines; determine the new tree structure + * by the number of leading spaces in lines. In case that + * trimmed line starts with protocol (http:, https:, ftp:), + * create a link with the same content. + * + * If there was only one line to be pasted, return the pasted node, null otherwise. + */ + + private MindMapNode pasteStringWithoutRedisplay(String textFromClipboard, MindMapNode parent, + boolean asSibling) { + + Pattern mailPattern = Pattern.compile("([^@ <>\\*']+@[^@ <>\\*']+)"); + + String[] textLines = textFromClipboard.split("\n"); + + if (textLines.length > 1) { + c.getFrame().setWaitingCursor(true); } + + MindMapNode realParent = null; + if (asSibling) { + // When pasting as sibling, we use virtual node as parent. When the pasting to + // virtual node is completed, we insert the children of that virtual node to + // the parrent of real parent. + realParent = parent; + parent = new MindMapNodeModel(c.getFrame()); } + + ArrayList parentNodes = new ArrayList(); + ArrayList parentNodesDepths = new ArrayList(); + + parentNodes.add(parent); + parentNodesDepths.add(new Integer(-1)); + + String[] linkPrefixes = { "http://", "ftp://", "https://" }; + + MindMapNode pastedNode = null; + + for (int i = 0; i < textLines.length; ++i) { + String text = textLines[i]; + text = text.replaceAll("\t"," "); + if (text.matches(" *")) { + continue; } + + int depth = 0; + while (depth < text.length() && text.charAt(depth) == ' ') { + ++depth; } + String visibleText = text.trim(); + + // If the text is a recognizable link (e.g. http://www.google.com/index.html), + // make it more readable by look nicer by cutting off obvious prefix and other + // transforamtions. + + if (visibleText.matches("^http://(www\\.)?[^ ]*$")) { + visibleText = visibleText.replaceAll("^http://(www\\.)?",""). + replaceAll("(/|\\.[^\\./\\?]*)$","").replaceAll("((\\.[^\\./]*\\?)|\\?)[^/]*$"," ? ...").replaceAll("_|%20"," "); + String[] textParts = visibleText.split("/"); + visibleText = ""; + for (int textPartIdx = 0; textPartIdx < textParts.length; textPartIdx++) { + if (textPartIdx > 0 ) { + visibleText += " > "; } + visibleText += textPartIdx == 0 ? textParts[textPartIdx] : + Tools.firstLetterCapitalized(textParts[textPartIdx].replaceAll("^~*","")); }} + + MindMapNode node = c.newNode(visibleText); + if (textLines.length == 1) { + pastedNode = node; } + + // Heuristically determine, if there is a mail. + + Matcher mailMatcher = mailPattern.matcher(visibleText); + if (mailMatcher.find()) { + node.setLink("mailto:"+mailMatcher.group()); } + + // Heuristically determine, if there is a link. Because this is + // heuristic, it is probable that it can be improved to include + // some matches or exclude some matches. + + for (int j = 0; j < linkPrefixes.length; j++) { + int linkStart = text.indexOf(linkPrefixes[j]); + if (linkStart != -1) { + int linkEnd = linkStart; + while (linkEnd < text.length() && + !nonLinkCharacter.matcher(text.substring(linkEnd,linkEnd+1)).matches()) { + linkEnd++; } + node.setLink(text.substring(linkStart,linkEnd)); }} + + // Determine parent among candidate parents + // Change the array of candidate parents accordingly + + for (int j = parentNodes.size()-1; j >= 0; --j) { + if (depth > ((Integer)parentNodesDepths.get(j)).intValue()) { + for (int k = j+1; k < parentNodes.size(); ++k) { + parentNodes.remove(k); + parentNodesDepths.remove(k); } + MindMapNode target = (MindMapNode)parentNodes.get(j); + insertNodeIntoNoEvent(node, target); + parentNodes.add(node); + parentNodesDepths.add(new Integer(depth)); + break; }}} + + if (asSibling) { + for (Iterator i=parent.childrenUnfolded(); /*children.iterator()*/ i.hasNext(); ) { + insertNodeIntoNoEvent((MindMapNode)i.next(), realParent, asSibling); } + c.nodeStructureChanged(realParent.getParentNode()); } + else { + c.nodeStructureChanged(parent); } + // ^ Do not fire any event when inserting single lines. Fire the event + // when all the lines are inserted. + return pastedNode; + } + /** + * @param node + * @param target + */ + private void insertNodeIntoNoEvent(MindMapNode node, MindMapNode target) { + c.getModel().insertNodeIntoNoEvent(node, target); + } + /** + * @param node + * @param realParent + * @param asSibling + */ + private void insertNodeIntoNoEvent(MindMapNode node, MindMapNode realParent, boolean asSibling) { + c.getModel().insertNodeIntoNoEvent(node, realParent, asSibling); + } + + /** + * @param node + * @param parent + * @param i + */ + private void insertNodeInto(MindMapNodeModel node, MindMapNode parent, int i) { + c.getModel().insertNodeInto(node, parent,i); + } + private void insertNodeInto(MindMapNode node, MindMapNode parent) { + c.getModel().insertNodeInto(node, parent); + } + + + + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/RedoAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/RedoAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/RedoAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/RedoAction.java 2004-10-18 00:00:10.000000000 +0100 @@ -0,0 +1,51 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 20.09.2004 + */ +/*$Id: RedoAction.java,v 1.1.4.1 2004/10/17 23:00:10 dpolivaev Exp $*/ + +package freemind.modes.actions; + +import java.awt.event.ActionEvent; + +import javax.swing.ImageIcon; +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.modes.ControllerAdapter; + + +public class RedoAction extends UndoAction { + private ControllerAdapter controller; + + public RedoAction(ControllerAdapter controller) { + super(controller, controller.getText("redo"), new ImageIcon(controller.getResource("images/redo.png")), controller); + this.controller = controller; + } + + /** + * @param pair + */ + protected void informUndoPartner(ActionPair pair) { + this.controller.undo.add(pair.reverse()); + this.controller.undo.setEnabled(true); + } + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/RemoveAllIconsAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/RemoveAllIconsAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/RemoveAllIconsAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/RemoveAllIconsAction.java 2004-10-18 00:00:10.000000000 +0100 @@ -0,0 +1,103 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 29.09.2004 + */ +/*$Id: RemoveAllIconsAction.java,v 1.1.4.1 2004/10/17 23:00:10 dpolivaev Exp $*/ + +package freemind.modes.actions; + +import java.util.Iterator; + +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.NodeActorXml; +import freemind.controller.actions.generated.instance.CompoundAction; +import freemind.controller.actions.generated.instance.RemoveAllIconsXmlAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.MapAdapter; +import freemind.modes.MindIcon; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; + +/** + * @author foltin + * + */ +public class RemoveAllIconsAction extends NodeGeneralAction implements NodeActorXml { + + private final IconAction addIconAction; + + /** + * @param modeController + * @param textID + * @param iconPath + * @param singleNodeOperation + */ + public RemoveAllIconsAction(ModeController modeController, IconAction addIconAction) { + super(modeController, "remove_all_icons", "images/edittrash.png"); + this.addIconAction = addIconAction; + addActor(this); + } + + public ActionPair apply(MapAdapter model, MindMapNode selected) throws JAXBException { + CompoundAction undoAction = modeController.getActionXmlFactory().createCompoundAction(); + for (Iterator i = selected.getIcons().iterator(); i.hasNext();) { + MindIcon icon = (MindIcon) i.next(); + undoAction.getCompoundActionOrSelectNodeActionOrCutNodeAction().add(addIconAction.createAddIconAction(selected, icon)); + } + return new ActionPair(createRemoveAllIconsXmlAction(selected), undoAction); + } + + public RemoveAllIconsXmlAction createRemoveAllIconsXmlAction(MindMapNode node) throws JAXBException { + RemoveAllIconsXmlAction action = modeController.getActionXmlFactory().createRemoveAllIconsXmlAction(); + action.setNode(node.getObjectId(modeController)); + return action; + } + + public void act(XmlAction action) { + if (action instanceof RemoveAllIconsXmlAction) { + RemoveAllIconsXmlAction removeAction = (RemoveAllIconsXmlAction) action; + MindMapNode node = modeController.getNodeFromID(removeAction.getNode()); + while(node.getIcons().size()>0) { + node.removeLastIcon(); + } + modeController.nodeChanged(node); + } + } + + public void removeAllIcons(MindMapNode node) { + try { + modeController.getActionFactory().startTransaction( + (String) getValue(NAME)); + modeController.getActionFactory().executeAction( + apply(modeController.getMap(), node)); + modeController.getActionFactory().endTransaction( + (String) getValue(NAME)); + } catch (JAXBException e) { + e.printStackTrace(); + } + } + + public Class getDoActionClass() { + return RemoveAllIconsXmlAction.class; + } + +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/RemoveArrowLinkAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/RemoveArrowLinkAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/RemoveArrowLinkAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/RemoveArrowLinkAction.java 2004-10-18 00:00:10.000000000 +0100 @@ -0,0 +1,162 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + * See COPYING for Details + * + * 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. + * + * Created on 08.10.2004 + */ +/* + * $Id: RemoveArrowLinkAction.java,v 1.16.10.1 08.10.2004 07:51:02 + * christianfoltin Exp $ + */ + +package freemind.modes.actions; + +import java.awt.event.ActionEvent; + +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.FreemindAction; +import freemind.controller.actions.generated.instance.AddArrowLinkXmlAction; +import freemind.controller.actions.generated.instance.RemoveArrowLinkXmlAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.main.Tools; +import freemind.modes.MindMapArrowLink; +import freemind.modes.MindMapLink; +import freemind.modes.MindMapLinkRegistry; +import freemind.modes.ModeController; +import freemind.modes.mindmapmode.MindMapArrowLinkModel; + +public class RemoveArrowLinkAction extends FreemindAction implements ActorXml { + + private MindMapArrowLinkModel mArrowLink; + + private final ModeController controller; + + /** + * @param controller + * @param source + * can be null + * @param arrowLink + * can be null. + */ + public RemoveArrowLinkAction(ModeController controller, MindMapArrowLinkModel arrowLink) { + super("remove_arrow_link", "images/edittrash.png", controller); + this.controller = controller; + setArrowLink(arrowLink); + if(arrowLink == null) { + addActor(this); + } + } + + public void actionPerformed(ActionEvent e) { + removeReference(mArrowLink); + } + + public void removeReference(MindMapLink arrowLink) { + controller.getActionFactory().startTransaction( + (String) getValue(NAME)); + controller.getActionFactory().executeAction( + getActionPair(arrowLink)); + controller.getActionFactory().endTransaction( + (String) getValue(NAME)); } + + /** + * @param arrowLink + * @return + */ + private ActionPair getActionPair(MindMapLink arrowLink) { + return new ActionPair(createRemoveArrowLinkXmlAction(arrowLink.getUniqueID()), + createAddArrowLinkXmlAction(arrowLink)); + } + + /** + * @return Returns the arrowLink. + */ + public MindMapArrowLinkModel getArrowLink() { + return mArrowLink; + } + + /** + * @param arrowLink + * The arrowLink to set. + */ + public void setArrowLink(MindMapArrowLinkModel arrowLink) { + this.mArrowLink = arrowLink; + } + + public void act(XmlAction action) { + if (action instanceof RemoveArrowLinkXmlAction) { + RemoveArrowLinkXmlAction removeAction = (RemoveArrowLinkXmlAction) action; + MindMapLink arrowLink = getLinkRegistry().getLinkForID(removeAction.getId()); + if(arrowLink == null) { + // strange: link not found: + throw new IllegalArgumentException("Unknown link to id "+removeAction.getId()+" should be deleted."); + } + getLinkRegistry().deregisterLink(arrowLink); + controller.nodeChanged(arrowLink.getSource()); + controller.nodeChanged(arrowLink.getTarget()); + } + } + + public Class getDoActionClass() { + return RemoveArrowLinkXmlAction.class; + } + + /** + * @return + */ + private MindMapLinkRegistry getLinkRegistry() { + return controller.getMap().getLinkRegistry(); + } + + public RemoveArrowLinkXmlAction createRemoveArrowLinkXmlAction(String id) { + try { + RemoveArrowLinkXmlAction action = controller.getActionXmlFactory().createRemoveArrowLinkXmlAction(); + action.setId(id); + return action; + } catch (JAXBException e) { + e.printStackTrace(); + return null; + } + } + public AddArrowLinkXmlAction createAddArrowLinkXmlAction(MindMapLink link) { + try { + AddArrowLinkXmlAction action = controller.getActionXmlFactory() + .createAddArrowLinkXmlAction(); + action.setNode(link.getSource().getObjectId(controller)); + action.setDestination(link.getTarget().getObjectId(controller)); + action.setNewId(link.getUniqueID()); + action.setColor(Tools.colorToXml(link.getColor())); + if (link instanceof MindMapArrowLink) { + MindMapArrowLink arrowLink = (MindMapArrowLink) link; + action.setEndArrow(arrowLink.getEndArrow()); + action.setEndInclination(Tools.PointToXml(arrowLink.getEndInclination())); + action.setStartArrow(arrowLink.getStartArrow()); + action.setStartInclination(Tools.PointToXml(arrowLink.getStartInclination())); + } + return action; + } catch (JAXBException e) { + e.printStackTrace(); + return null; + } + } + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/RemoveLastIconAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/RemoveLastIconAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/RemoveLastIconAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/RemoveLastIconAction.java 2005-06-30 21:57:01.000000000 +0100 @@ -0,0 +1,112 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 29.09.2004 + */ +/*$Id: RemoveLastIconAction.java,v 1.1.4.2 2005/06/30 20:57:01 christianfoltin Exp $*/ + +package freemind.modes.actions; + +import java.util.List; + +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.NodeActorXml; +import freemind.controller.actions.generated.instance.AddIconAction; +import freemind.controller.actions.generated.instance.RemoveLastIconXmlAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.MapAdapter; +import freemind.modes.MindIcon; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; + +/** + * @author foltin + * + */ +public class RemoveLastIconAction extends NodeGeneralAction implements NodeActorXml{ + + private IconAction iconAction; + /** + * @param title + * @param icon + * @param modeController + */ + public RemoveLastIconAction(ModeController modeController) { + super(modeController, "remove_last_icon", "images/remove.png"); + addActor(this); + } + + public ActionPair apply(MapAdapter model, MindMapNode selected) throws JAXBException { + List icons = selected.getIcons(); + if(icons.size()==0) + return null; + AddIconAction undoAction = iconAction.createAddIconAction(selected, (MindIcon) icons.get(icons.size()-1)); + return new ActionPair(createRemoveLastIconXmlAction(selected), undoAction); + } + + public Class getDoActionClass() { + return RemoveLastIconXmlAction.class; + } + + public RemoveLastIconXmlAction createRemoveLastIconXmlAction(MindMapNode node) throws JAXBException { + RemoveLastIconXmlAction action = modeController.getActionXmlFactory().createRemoveLastIconXmlAction(); + action.setNode(node.getObjectId(modeController)); + return action; + } + + + public int removeLastIcon(MindMapNode node) { + try { + modeController.getActionFactory().startTransaction( + (String) getValue(NAME)); + modeController.getActionFactory().executeAction( + apply(modeController.getMap(), node)); + modeController.getActionFactory().endTransaction( + (String) getValue(NAME)); + return node.getIcons().size(); + } catch (JAXBException e) { + e.printStackTrace(); + return 0; + } + } + + /** + * + */ + + public void act(XmlAction action) { + if (action instanceof freemind.controller.actions.generated.instance.RemoveLastIconXmlAction) { + freemind.controller.actions.generated.instance.RemoveLastIconXmlAction removeAction = (freemind.controller.actions.generated.instance.RemoveLastIconXmlAction) action; + MindMapNode node = modeController.getNodeFromID(removeAction + .getNode()); + node.removeLastIcon(); + modeController.nodeChanged(node); + } + } + + + /** + * @param addIconAction The addIconAction to set. + */ + public void setIconAction(IconAction iconAction) { + this.iconAction = iconAction; + } +} diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/RevertAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/RevertAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/RevertAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/RevertAction.java 2005-07-03 00:19:38.000000000 +0100 @@ -0,0 +1,189 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2005 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 11.03.2005 + */ +/*$Id: RevertAction.java,v 1.1.2.3 2005/07/02 23:19:38 christianfoltin Exp $*/ +package freemind.modes.actions; + +import java.awt.event.ActionEvent; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.StringWriter; + +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.FreemindAction; +import freemind.controller.actions.generated.instance.RevertXmlAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.MindMap; +import freemind.modes.ModeController; + +/** + * Reverts the map to the saved version. In Xml, the old map is stored as xml + * and as an undo action, the new map is stored, too. + * + * Moreover, the filename of the doAction is set to the appropriate map file's + * name. The undo action has no file name associated. + * + * The action goes like this: close the actual map and open the given Xml/File. + * If only a Xml string is given, a temporary file name is created, the xml + * stored into and this map is opened instead of the actual. + * + * @author foltin + * + */ +public class RevertAction extends FreemindAction implements ActorXml { + + private final ModeController controller; + + /** + * @param modeController + */ + public RevertAction(ModeController modeController) { + super("RevertAction", (String) null, modeController); + controller = modeController; + addActor(this); + + } + + /* + * (non-Javadoc) + * + * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) + */ + public void actionPerformed(ActionEvent arg0) { + try { + File file = controller.getMap().getFile(); + RevertXmlAction doAction = createRevertXmlAction(file); + RevertXmlAction undoAction = createRevertXmlAction(controller + .getMap(), null, file.getName()); + controller.getActionFactory().startTransaction( + this.getClass().getName()); + controller.getActionFactory().executeAction( + new ActionPair(doAction, undoAction)); + controller.getActionFactory().endTransaction( + this.getClass().getName()); + } catch (JAXBException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + + } + + public void openXmlInsteadOfMap(String xmlFileContent) { + try { + RevertXmlAction doAction = createRevertXmlAction(xmlFileContent, null, null); + RevertXmlAction undoAction = createRevertXmlAction(controller + .getMap(), null, null); + controller.getActionFactory().startTransaction( + this.getClass().getName()); + controller.getActionFactory().executeAction( + new ActionPair(doAction, undoAction)); + controller.getActionFactory().endTransaction( + this.getClass().getName()); + } catch (JAXBException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + public RevertXmlAction createRevertXmlAction(File file) + throws JAXBException, IOException { + String fileName = file.getAbsolutePath(); + FileReader f = new FileReader(file); + StringBuffer buffer = new StringBuffer(); + for (int c; (c = f.read()) != -1;) + buffer.append((char) c); + f.close(); + return createRevertXmlAction(buffer.toString(), fileName, null); + } + + public RevertXmlAction createRevertXmlAction(MindMap map, String fileName, String filePrefix) + throws JAXBException, IOException { + StringWriter writer = new StringWriter(); + map.getXml(writer); + return createRevertXmlAction(writer.getBuffer().toString(), fileName, + filePrefix); + } + + /** + * @param filePrefix is used to generate the name of the reverted map in case that fileName is null. + * @return + * @throws JAXBException + */ + public RevertXmlAction createRevertXmlAction(String xmlPackedFile, + String fileName, String filePrefix) throws JAXBException { + RevertXmlAction revertXmlAction = controller.getActionXmlFactory() + .createRevertXmlAction(); + revertXmlAction.setLocalFileName(fileName); + revertXmlAction.setMap(xmlPackedFile); + revertXmlAction.setFilePrefix(filePrefix); + return revertXmlAction; + } + + /* + * (non-Javadoc) + * + * @see freemind.controller.actions.ActorXml#act(freemind.controller.actions.generated.instance.XmlAction) + */ + public void act(XmlAction action) { + if (action instanceof RevertXmlAction) { + try { + RevertXmlAction revertAction = (RevertXmlAction) action; + + // close the old map. + controller.getController().close(true); + if (revertAction.getLocalFileName() != null) { + controller.load(new File(revertAction.getLocalFileName())); + } else { + // the map is given by xml. we store it and open it. + String filePrefix = controller.getText("freemind_reverted"); + if (revertAction.getFilePrefix() != null) { + filePrefix = revertAction.getFilePrefix(); + } + File tempFile = File.createTempFile(filePrefix, ".mm", + new File(controller.getFrame() + .getFreemindDirectory())); + FileWriter fw = new FileWriter(tempFile); + fw.write(revertAction.getMap()); + fw.close(); + controller.load(tempFile); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + /* + * (non-Javadoc) + * + * @see freemind.controller.actions.ActorXml#getDoActionClass() + */ + public Class getDoActionClass() { + return RevertXmlAction.class; + } + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/SelectAllAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/SelectAllAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/SelectAllAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/SelectAllAction.java 2005-04-26 22:43:17.000000000 +0100 @@ -0,0 +1,44 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2001 Joerg Mueller + *See COPYING for Details + * + *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. + */ +/*$Id: SelectAllAction.java,v 1.1.2.1 2005/04/26 21:43:17 christianfoltin Exp $*/ + +package freemind.modes.actions; + +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; +import freemind.modes.mindmapmode.MindMapMapModel; +import freemind.modes.mindmapmode.MindMapNodeModel; + +/** */ +public class SelectAllAction extends NodeGeneralAction { + + + /** + * + */ + public SelectAllAction(final ModeController modeController) { + super(modeController, "select_all", null, new SingleNodeOperation(){ + + public void apply(MindMapMapModel map, MindMapNodeModel node) { + modeController.selectBranch((MindMapNode) map.getRoot(), false); + }}); + } + +} + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/SelectBranchAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/SelectBranchAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/SelectBranchAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/SelectBranchAction.java 2005-04-26 22:43:17.000000000 +0100 @@ -0,0 +1,44 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2001 Joerg Mueller + *See COPYING for Details + * + *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. + */ +/*$Id: SelectBranchAction.java,v 1.1.2.1 2005/04/26 21:43:17 christianfoltin Exp $*/ + +package freemind.modes.actions; + +import java.awt.event.ActionEvent; + +import freemind.controller.actions.FreemindAction; +import freemind.modes.ModeController; + +/** */ +public class SelectBranchAction extends FreemindAction { + + + /** + * + */ + public SelectBranchAction(final ModeController modeController) { + super("select_branch", (String) null, modeController); + } + + public void actionPerformed(ActionEvent e) { + getModeController().selectBranch(getModeController().getSelected(), true /* = extend*/); + } + +} + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/SetLinkByTextFieldAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/SetLinkByTextFieldAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/SetLinkByTextFieldAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/SetLinkByTextFieldAction.java 2004-10-18 00:00:10.000000000 +0100 @@ -0,0 +1,101 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + * See COPYING for Details + * + * 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. + * + * Created on 12.10.2004 + */ +/* + * $Id: SetLinkByTextFieldAction.java,v 1.16.10.1 12.10.2004 22:18:45 + * christianfoltin Exp $ + */ + +package freemind.modes.actions; + +import java.awt.event.ActionEvent; + +import javax.swing.JOptionPane; +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.FreemindAction; +import freemind.controller.actions.generated.instance.AddLinkXmlAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.MindMapNode; +import freemind.modes.ModeController; +import freemind.modes.NodeAdapter; + +public class SetLinkByTextFieldAction extends FreemindAction implements ActorXml{ + private final ModeController controller; + + public SetLinkByTextFieldAction(ModeController controller) { + super("set_link_by_textfield", (String) null, controller); + this.controller = controller; + addActor(this); + } + + public void actionPerformed(ActionEvent e) { + String inputValue = JOptionPane.showInputDialog(controller + .getText("edit_link_manually"), controller.getSelected() + .getLink()); + if (inputValue != null) { + if (inputValue.equals("")) { + inputValue = null; // In case of no entry unset link + } + setLink(controller.getSelected(),inputValue); + } + } + + public void setLink(MindMapNode node, String link) { + controller.getActionFactory().startTransaction( + (String) getValue(NAME)); + controller.getActionFactory().executeAction( + getActionPair(node, link)); + controller.getActionFactory().endTransaction( + (String) getValue(NAME)); + } + + public void act(XmlAction action) { + if (action instanceof AddLinkXmlAction) { + AddLinkXmlAction linkAction = (AddLinkXmlAction) action; + NodeAdapter node = controller.getNodeFromID(linkAction.getNode()); + node.setLink(linkAction.getDestination()); + controller.nodeChanged(node); + } + } + + public Class getDoActionClass() { + return AddLinkXmlAction.class; + } + private ActionPair getActionPair(MindMapNode node, String link) { + return new ActionPair(createAddLinkXmlAction(node, link), createAddLinkXmlAction(node, node.getLink())); + } + private AddLinkXmlAction createAddLinkXmlAction(MindMapNode node, String link) { + try { + AddLinkXmlAction action = controller.getActionXmlFactory() + .createAddLinkXmlAction(); + action.setNode(node.getObjectId(controller)); + action.setDestination(link); + return action; + } catch (JAXBException e) { + e.printStackTrace(); + return null; + } + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/SingleNodeOperation.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/SingleNodeOperation.java --- freemind-0.7.1/freemind/freemind/modes/actions/SingleNodeOperation.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/SingleNodeOperation.java 2004-10-18 00:00:10.000000000 +0100 @@ -0,0 +1,18 @@ +/* + * Created on 05.05.2004 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package freemind.modes.actions; + +import freemind.modes.mindmapmode.MindMapMapModel; +import freemind.modes.mindmapmode.MindMapNodeModel; + + + +// NodeGeneralAction +// __________________ + +public interface SingleNodeOperation { + public void apply(MindMapMapModel map, MindMapNodeModel node); } \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/ToggleChildrenFoldedAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/ToggleChildrenFoldedAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/ToggleChildrenFoldedAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/ToggleChildrenFoldedAction.java 2004-10-18 00:00:10.000000000 +0100 @@ -0,0 +1,49 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 13.08.2004 + */ +/*$Id: ToggleChildrenFoldedAction.java,v 1.1.4.1 2004/10/17 23:00:10 dpolivaev Exp $*/ + +package freemind.modes.actions; + +import java.awt.event.ActionEvent; +import java.util.ListIterator; + +import javax.swing.AbstractAction; + +import freemind.main.Tools; +import freemind.modes.ControllerAdapter; +import freemind.modes.MindMapNode; +import freemind.view.mindmapview.NodeView; + + +public class ToggleChildrenFoldedAction extends AbstractAction { + private final ControllerAdapter modeController; + public ToggleChildrenFoldedAction(ControllerAdapter modeController) { + super(modeController.getText("toggle_children_folded")); + this.modeController = modeController; + } + public void actionPerformed(ActionEvent e) { + MindMapNode selected = modeController.getSelected(); + modeController.toggleFolded.toggleFolded(selected.childrenUnfolded()); + modeController.getView().selectAsTheOnlyOneSelected(selected.getViewer()); + modeController.getController().obtainFocusForSelected(); + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/ToggleFoldedAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/ToggleFoldedAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/ToggleFoldedAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/ToggleFoldedAction.java 2005-05-03 20:57:52.000000000 +0100 @@ -0,0 +1,199 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 12.08.2004 + */ +/*$Id: ToggleFoldedAction.java,v 1.1.4.5 2005/05/03 19:57:52 christianfoltin Exp $*/ + +package freemind.modes.actions; + +import java.awt.event.ActionEvent; +import java.util.ListIterator; +import java.util.Vector; +import java.util.logging.Logger; + +import javax.swing.AbstractAction; +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.generated.instance.CompoundAction; +import freemind.controller.actions.generated.instance.FoldAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.main.Tools; +import freemind.modes.ControllerAdapter; +import freemind.modes.MindMapNode; + + +public class ToggleFoldedAction extends AbstractAction implements ActorXml { + private final ControllerAdapter modeController; + private Logger logger; + public ToggleFoldedAction(ControllerAdapter controller) { + super( controller.getText("toggle_folded")); + this.modeController = controller; + modeController.getActionFactory().registerActor(this, getDoActionClass()); + logger = modeController.getFrame().getLogger(this.getClass().getName()); + } + public void actionPerformed(ActionEvent e) { + toggleFolded(); + } + public void toggleFolded() { + toggleFolded(modeController.getSelecteds().listIterator()); + } + public void toggleFolded(ListIterator listIterator) { + + boolean fold = getFoldingState(reset(listIterator)); + CompoundAction doAction = createFoldAction(reset(listIterator), fold, false); + CompoundAction undoAction = createFoldAction(reset(listIterator), !fold, true); + modeController.getActionFactory().startTransaction((String) getValue(NAME)); + modeController.getActionFactory().executeAction(new ActionPair(doAction, undoAction)); + modeController.getActionFactory().endTransaction((String) getValue(NAME)); + } + + ListIterator reset(ListIterator iterator) { + while(iterator.hasPrevious()) { + iterator.previous(); + } + return iterator; + } + /** + * @return + */ + private boolean getFoldingState(ListIterator iterator) { + /* Retrieve the information whether or not all nodes have the same folding state. */ + Tools.BooleanHolder state = null; + boolean allNodeHaveSameFoldedStatus = true; + for (ListIterator it = iterator;it.hasNext();) { + MindMapNode node = (MindMapNode)it.next(); + if(node.getChildCount()==0) { + // no folding state change for unfoldable nodes. + continue; + } + if(state == null) { + state = new Tools.BooleanHolder(); + state.setValue(node.isFolded()); + } else { + if(node.isFolded() != state.getValue()) { + allNodeHaveSameFoldedStatus = false; + break; + } + } + } + /* if the folding state is ambiguous, the nodes are folded. */ + boolean fold = true; + if(allNodeHaveSameFoldedStatus && state != null) { + fold = !state.getValue(); + } + return fold; + } + private CompoundAction createFoldAction(ListIterator iterator, boolean fold , boolean undo) { + try { + CompoundAction comp = modeController.getActionXmlFactory().createCompoundAction(); + MindMapNode lastNode = null; + // sort selectedNodes list by depth, in order to guarantee that sons are deleted first: + for (ListIterator it = + iterator; + it.hasNext(); + ) { + MindMapNode node = (MindMapNode) it.next(); + FoldAction foldAction = createSingleFoldAction(fold, node, undo); + if (foldAction != null) { + if (!undo) { + comp.getCompoundActionOrSelectNodeActionOrCutNodeAction().add(foldAction); + } else { + // reverse the order: + comp.getCompoundActionOrSelectNodeActionOrCutNodeAction().add(0, foldAction); + } + lastNode = node; + } + } + logger.finest("Compound contains " + comp.getCompoundActionOrSelectNodeActionOrCutNodeAction().size() + " elements." ); + return comp; + } catch (JAXBException e) { + e.printStackTrace(); + } + return null; + } + + /** + * @param fold + * @param node + * @return null if node cannot be folded. + * @throws JAXBException + */ + private FoldAction createSingleFoldAction(boolean fold, MindMapNode node, boolean undo) { + FoldAction foldAction = null; + try { + if ( ( undo && (node.isFolded() == fold)) + || (!undo && (node.isFolded() != fold))) { + if (node.hasChildren() + || Tools.safeEquals(modeController.getFrame() + .getProperty("enable_leaves_folding"), "true")) { + foldAction = modeController.getActionXmlFactory() + .createFoldAction(); + foldAction.setFolded(fold); + foldAction.setNode(modeController.getNodeID(node)); + } + } + } catch (JAXBException e) { + e.printStackTrace(); + } + return foldAction; + } + public void act(XmlAction action) { + if (action instanceof FoldAction) { + FoldAction foldAction = (FoldAction) action; + MindMapNode node = modeController.getNodeFromID(foldAction.getNode()); + boolean fold = foldAction.isFolded(); + _setFolded(node, fold); + } + } + public Class getDoActionClass() { + return FoldAction.class; + } + /** + * @param node + * @param folded + */ + public void setFolded(MindMapNode node, boolean folded) { + FoldAction doAction = createSingleFoldAction(folded, node, false); + FoldAction undoAction = createSingleFoldAction(!folded, node, true); + if(doAction == null || undoAction == null) { + return; + } + modeController.getActionFactory().startTransaction((String) getValue(NAME)); + modeController.getActionFactory().executeAction(new ActionPair(doAction, undoAction)); + modeController.getActionFactory().endTransaction((String) getValue(NAME)); + } + + private void _setFolded(MindMapNode node, boolean folded) { + if(node == null) + throw new IllegalArgumentException("setFolded was called with a null node."); + // no root folding, fc, 16.5.2004 + if (node.isRoot() && folded) { + return; + } + if (node.isFolded() != folded) { + node.setFolded(folded); + modeController.nodeStructureChanged(node); + } + } + + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/UnderlinedAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/UnderlinedAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/UnderlinedAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/UnderlinedAction.java 2004-10-18 00:00:10.000000000 +0100 @@ -0,0 +1,104 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + * See COPYING for Details + * + * 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. + * + * Created on 25.08.2004 + */ +/* $Id: UnderlinedAction.java,v 1.1.4.1 2004/10/17 23:00:10 dpolivaev Exp $ */ +package freemind.modes.actions; + +import javax.swing.Action; +import javax.swing.JMenuItem; +import javax.xml.bind.JAXBException; + +import freemind.controller.MenuItemEnabledListener; +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.NodeActorXml; +import freemind.controller.actions.generated.instance.UnderlinedNodeAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.ControllerAdapter; +import freemind.modes.MapAdapter; +import freemind.modes.MindMapNode; +import freemind.modes.NodeAdapter; + + +public class UnderlinedAction extends NodeGeneralAction implements NodeActorXml, MenuItemEnabledListener{ + private final ControllerAdapter modeController; + /** + * @param textID + * @param iconPath + * @param actor + */ + public UnderlinedAction(ControllerAdapter modeController) { + super(modeController, "underlined", "images/Underline24.gif"); + this.modeController = modeController; + addActor(this); + } + + public void act(XmlAction action) { + UnderlinedNodeAction underlinedact = (UnderlinedNodeAction) action; + NodeAdapter node = getNodeFromID(underlinedact.getNode()); + if(node.isUnderlined() != underlinedact.isUnderlined()) { + node.setUnderlined(underlinedact.isUnderlined()); + this.modeController.nodeChanged(node); + } + } + + + public Class getDoActionClass() { + return UnderlinedNodeAction.class; + } + + public ActionPair apply(MapAdapter model, MindMapNode selected) throws JAXBException { + // every node is set to the inverse of the focussed node. + boolean underlined = modeController.getSelected().isUnderlined(); + return getActionPair(selected, underlined); + } + + private ActionPair getActionPair(MindMapNode selected, boolean underlined) + throws JAXBException { + UnderlinedNodeAction underlinedAction = toggleUnderlined(selected, !underlined); + UnderlinedNodeAction undoUnderlinedAction = toggleUnderlined(selected, underlined); + return new ActionPair(underlinedAction, undoUnderlinedAction); + } + + private UnderlinedNodeAction toggleUnderlined(MindMapNode selected, boolean underlined) + throws JAXBException { + UnderlinedNodeAction underlinedAction = getActionXmlFactory().createUnderlinedNodeAction(); + underlinedAction.setNode(getNodeID(selected)); + underlinedAction.setUnderlined(underlined); + return underlinedAction; + } + + public void setUnderlined(MindMapNode node, boolean underlined) { + try { + execute(getActionPair(node, underlined)); + } catch (JAXBException e) { + e.printStackTrace(); + } + } + + public boolean isEnabled(JMenuItem item, Action action) { + boolean underlined = modeController.getSelected().isUnderlined(); + setSelected(item, underlined); + return true; + } + + +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/actions/UndoAction.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/actions/UndoAction.java --- freemind-0.7.1/freemind/freemind/modes/actions/UndoAction.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/actions/UndoAction.java 2005-07-10 20:55:55.000000000 +0100 @@ -0,0 +1,206 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2004 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 20.09.2004 + */ +/*$Id: UndoAction.java,v 1.1.4.2 2005/07/10 19:55:55 christianfoltin Exp $*/ + +package freemind.modes.actions; + +import java.awt.event.ActionEvent; +import java.util.Iterator; +import java.util.Vector; +import java.util.logging.Logger; + +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.xml.bind.JAXBException; + +import freemind.controller.actions.AbstractXmlAction; +import freemind.controller.actions.ActionPair; +import freemind.controller.actions.ActorXml; +import freemind.controller.actions.generated.instance.CompoundAction; +import freemind.controller.actions.generated.instance.CompoundActionType; +import freemind.controller.actions.generated.instance.UndoXmlAction; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.modes.ControllerAdapter; +import freemind.modes.ModeController; + + +public class UndoAction extends AbstractXmlAction implements ActorXml { + + private ControllerAdapter controller; + private boolean isUndoAction; + protected Vector actionPairList=new Vector(); + private long timeOfLastAdd = 0; + private static final long TIME_TO_BEGIN_NEW_ACTION = 100; + protected static Logger logger; + + public UndoAction(ControllerAdapter controller) { + this(controller, controller.getText("undo"), new ImageIcon(controller.getResource("images/undo.png")), controller); + this.controller = controller; + if (logger==null) { + logger = controller.getFrame() + .getLogger(this.getClass().toString()); + } + } + + protected UndoAction(ControllerAdapter adapter, String text, Icon icon, ModeController mode) { + super(text, icon, mode); + this.controller = adapter; + addActor(this); + setEnabled(false); + isUndoAction = false; + } + + /** + * @return + */ + public boolean isUndoAction() { + return isUndoAction; + } + + /* (non-Javadoc) + * @see freemind.controller.actions.AbstractXmlAction#xmlActionPerformed(java.awt.event.ActionEvent) + */ + protected void xmlActionPerformed(ActionEvent arg0) throws JAXBException { + if(actionPairList.size() > 0) { + ActionPair pair = (ActionPair) actionPairList.get(0); + informUndoPartner(pair); + actionPairList.remove(0); + + undoDoAction(pair); + + if(actionPairList.size() == 0) { + // disable undo + this.setEnabled(false); + } + } else { + setEnabled(false); + } + } + + /** + * @param pair + */ + protected void informUndoPartner(ActionPair pair) { + this.controller.redo.add(pair.reverse()); + this.controller.redo.setEnabled(true); + } + + protected void undoDoAction(ActionPair pair) throws JAXBException { + String doActionString = this.controller.marshall(pair.getDoAction()); + String redoActionString = this.controller.marshall(pair.getUndoAction()); + //logger.info("doActionString: "+ doActionString ); + //logger.info("\nredoActionString: "+ redoActionString); + + UndoXmlAction undoAction = this.controller.getActionXmlFactory().createUndoXmlAction(); + undoAction.setDescription(redoActionString); + undoAction.setRemedia(doActionString); + + UndoXmlAction redoAction = this.controller.getActionXmlFactory().createUndoXmlAction(); + redoAction.setDescription(doActionString); + undoAction.setRemedia(redoActionString); + + isUndoAction = true; + this.controller.getActionFactory().executeAction(new ActionPair(undoAction, redoAction)); + isUndoAction = false; + } + + /* (non-Javadoc) + * @see freemind.controller.actions.ActorXml#act(freemind.controller.actions.generated.instance.XmlAction) + */ + public void act(XmlAction action) { + // unmarshall: + UndoXmlAction undoAction = (UndoXmlAction) action; + XmlAction doAction = this.controller.unMarshall( undoAction.getDescription() ); + XmlAction redoAction = this.controller.unMarshall( undoAction.getRemedia() ); + this.controller.getActionFactory().executeAction(new ActionPair(doAction, redoAction)); + } + + public Class getDoActionClass() { + return UndoXmlAction.class; + } + + /* (non-Javadoc) + * @see javax.swing.Action#setEnabled(boolean) + */ + public void setEnabled(boolean arg0) { + if(arg0) + super.setEnabled(actionPairList.size() != 0); + else + super.setEnabled(false); + } + + public void add(ActionPair pair) { + try { + long currentTime = System.currentTimeMillis(); + if((actionPairList.size() > 0) && (currentTime - timeOfLastAdd < TIME_TO_BEGIN_NEW_ACTION)) { + ActionPair firstPair = (ActionPair) actionPairList.get(0); + CompoundAction action; + CompoundAction remedia; + if ( ! (firstPair.getDoAction() instanceof CompoundActionType) || ! (firstPair.getUndoAction() instanceof CompoundActionType)) { + action = controller.getActionXmlFactory().createCompoundAction(); + action.getCompoundActionOrSelectNodeActionOrCutNodeAction().add(firstPair.getDoAction()); + remedia = controller.getActionXmlFactory().createCompoundAction(); + remedia.getCompoundActionOrSelectNodeActionOrCutNodeAction().add(firstPair.getUndoAction()); + actionPairList.remove(0); + actionPairList.add(0, new ActionPair(action, remedia)); + firstPair = (ActionPair) actionPairList.get(0); + } else { + action = (CompoundAction) firstPair.getDoAction(); + remedia = (CompoundAction) firstPair.getUndoAction(); + } + action.getCompoundActionOrSelectNodeActionOrCutNodeAction().add(pair.getDoAction()); + remedia.getCompoundActionOrSelectNodeActionOrCutNodeAction().add(0, pair.getUndoAction()); + } else { + actionPairList.add(0, pair); + // and cut vector, if bigger than given size: + int maxEntries = 100; + try { + maxEntries = new Integer(controller.getFrame().getProperty( + "undo_levels")).intValue(); + } catch (NumberFormatException e) { + e.printStackTrace(); + } + while (actionPairList.size()>maxEntries) { + actionPairList.remove(actionPairList.size()-1); // remove + // last elt + } + } + timeOfLastAdd = currentTime; + } catch (JAXBException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public void clear() { + actionPairList.clear(); + } + + public void print() { + logger.info("Undo list:"); + int j=0; + for (Iterator i = actionPairList.iterator(); i.hasNext();) { + ActionPair pair = (ActionPair) i.next(); + logger.info("line "+(j++)+" = " + controller.marshall(pair.getDoAction())); + } + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/ArrowLinkAdapter.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/ArrowLinkAdapter.java --- freemind-0.7.1/freemind/freemind/modes/ArrowLinkAdapter.java 2003-12-07 21:00:19.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/ArrowLinkAdapter.java 2005-01-10 07:41:27.000000000 +0000 @@ -16,11 +16,13 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: ArrowLinkAdapter.java,v 1.4 2003/12/07 21:00:19 christianfoltin Exp $*/ +/*$Id: ArrowLinkAdapter.java,v 1.4.18.5 2005/01/10 07:41:27 christianfoltin Exp $*/ package freemind.modes; import freemind.modes.LinkAdapter; import freemind.main.FreeMindMain; +import freemind.main.Tools; +import freemind.main.XMLElement; import java.awt.Point; @@ -32,6 +34,7 @@ protected Point endInclination; protected String startArrow; protected String endArrow; + protected boolean showControlPointsFlag; public ArrowLinkAdapter(MindMapNode source,MindMapNode target,FreeMindMain frame) { @@ -40,8 +43,16 @@ endArrow = "Default"; } - public Point getStartInclination() { return startInclination; } - public Point getEndInclination() { return endInclination; } + public Point getStartInclination() { + if(startInclination == null) + return null; + return new Point(startInclination); + } + public Point getEndInclination() { + if(endInclination == null) + return null; + return new Point(endInclination); + } public String getStartArrow() { return startArrow; } public String getEndArrow() { return endArrow; } @@ -79,5 +90,45 @@ arrowLink.endArrow = (endArrow==null)?null:new String(endArrow); return arrowLink; } + + public void showControlPoints(boolean bShowControlPointsFlag){ + showControlPointsFlag = bShowControlPointsFlag; + } + + public boolean getShowControlPointsFlag(){ + return showControlPointsFlag; + } + + public XMLElement save() { + XMLElement arrowLink = new XMLElement(); + arrowLink.setName("arrowlink"); + + if (style != null) { + arrowLink.setAttribute("STYLE",style); + } + if (getUniqueID() != null) { + arrowLink.setAttribute("ID",getUniqueID()); + } + if (color != null) { + arrowLink.setAttribute("COLOR",Tools.colorToXml(color)); + } + if(getDestinationLabel() != null) { + arrowLink.setAttribute("DESTINATION",getDestinationLabel()); + } + if(getReferenceText() != null) { + arrowLink.setAttribute("REFERENCETEXT",getReferenceText()); + } + if(getStartInclination() != null) { + arrowLink.setAttribute("STARTINCLINATION",Tools.PointToXml(getStartInclination())); + } + if(getEndInclination() != null) { + arrowLink.setAttribute("ENDINCLINATION",Tools.PointToXml(getEndInclination())); + } + if(getStartArrow() != null) + arrowLink.setAttribute("STARTARROW",(getStartArrow())); + if(getEndArrow() != null) + arrowLink.setAttribute("ENDARROW",(getEndArrow())); + return arrowLink; + } } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/browsemode/BrowseArrowLinkModel.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/browsemode/BrowseArrowLinkModel.java --- freemind-0.7.1/freemind/freemind/modes/browsemode/BrowseArrowLinkModel.java 2003-12-03 07:15:56.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/browsemode/BrowseArrowLinkModel.java 2004-10-17 21:22:45.000000000 +0100 @@ -16,7 +16,7 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: BrowseArrowLinkModel.java,v 1.1 2003/12/03 07:15:56 christianfoltin Exp $*/ +/*$Id: BrowseArrowLinkModel.java,v 1.1.18.1 2004/10/17 20:22:45 dpolivaev Exp $*/ package freemind.modes.browsemode; @@ -45,4 +45,11 @@ public String toString() { return "Source="+getSource()+", target="+getTarget(); } + /** + * @see freemind.modes.MindMapArrowLink#changeInclination(int, int, int, int) + */ + public void changeInclination(int oldX, int oldY, int deltaX, int deltaY) { + + } + } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/browsemode/BrowseController.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/browsemode/BrowseController.java --- freemind-0.7.1/freemind/freemind/modes/browsemode/BrowseController.java 2003-12-22 11:15:18.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/browsemode/BrowseController.java 2005-03-03 21:11:27.000000000 +0000 @@ -16,63 +16,52 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: BrowseController.java,v 1.13 2003/12/22 11:15:18 christianfoltin Exp $*/ +/*$Id: BrowseController.java,v 1.13.18.4 2005/03/03 21:11:27 christianfoltin Exp $*/ package freemind.modes.browsemode; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; -import java.awt.event.MouseEvent; import java.net.MalformedURLException; import java.net.URL; +import java.util.HashSet; +import java.util.Vector; import javax.swing.AbstractAction; import javax.swing.Action; -import javax.swing.JMenu; import javax.swing.JPopupMenu; import javax.swing.JToolBar; -import java.util.HashSet; -import java.util.Vector; - +import freemind.controller.MenuBar; +import freemind.controller.StructuredMenuHolder; import freemind.main.Tools; import freemind.modes.ControllerAdapter; import freemind.modes.MapAdapter; import freemind.modes.MindMapNode; import freemind.modes.Mode; -import freemind.view.mindmapview.NodeView; +import freemind.modes.actions.GotoLinkNodeAction; public class BrowseController extends ControllerAdapter { private JPopupMenu popupmenu; private JToolBar toolbar; - Action toggleFolded; - Action toggleChildrenFolded; - Action find; - Action findNext; Action followLink; Action nodeUp; Action nodeDown; // disable edit in browse mode (PN) public void edit(KeyEvent e, boolean addNew, boolean editLong) { } - public void addNew(final NodeView target, + public MindMapNode addNew(final MindMapNode target, final int newNodeMode, - final KeyEvent e) { } + final KeyEvent e) { return null;} public BrowseController(Mode mode) { - super.setMode(mode); + super(mode); // Daniel: Actions are initialized here and not above because of // some error it would produce. Not studied in more detail. - toggleFolded = new ToggleFoldedAction(); - toggleChildrenFolded = new ToggleChildrenFoldedAction(); - find = new FindAction(); - findNext = new FindNextAction(); followLink = new FollowLinkAction(); - nodeUp = new NodeUpAction(); - nodeDown = new NodeDownAction(); popupmenu = new BrowsePopupMenu(this); toolbar = new BrowseToolBar(this); @@ -85,28 +74,15 @@ public void doubleClick() { if (getSelected().getLink() == null) { // If link exists, follow the link; toggle folded otherwise - toggleFolded(); + toggleFolded.toggleFolded(); } else { loadURL(); } } - protected MindMapNode newNode() { - return new BrowseNodeModel(getText("new_node"), getFrame()); - } - - //get/set methods - - JMenu getEditMenu() { - JMenu editMenu = new JMenu(); - editMenu.add(getPopupMenu()); - return editMenu; - } - - JMenu getFileMenu() { - JMenu fileMenu = new JMenu(); - return fileMenu; - } + public MindMapNode newNode(Object userObject) { + return new BrowseNodeModel(userObject, getFrame()); + } public JPopupMenu getPopupMenu() { return popupmenu; @@ -119,8 +95,8 @@ BrowseArrowLinkModel link = (BrowseArrowLinkModel) obj; JPopupMenu arrowLinkPopup = new JPopupMenu(); - arrowLinkPopup.add(new GotoLinkNodeAction(link.getSource().toString(), link.getSource())); - arrowLinkPopup.add(new GotoLinkNodeAction(link.getTarget().toString(), link.getTarget())); + arrowLinkPopup.add(getGotoLinkNodeAction(link.getSource())); + arrowLinkPopup.add(getGotoLinkNodeAction(link.getTarget())); arrowLinkPopup.addSeparator(); // add all links from target and from source: @@ -132,10 +108,10 @@ for(int i = 0; i < links.size(); ++i) { BrowseArrowLinkModel foreign_link = (BrowseArrowLinkModel) links.get(i); if(NodeAlreadyVisited.add(foreign_link.getTarget())) { - arrowLinkPopup.add(new GotoLinkNodeAction(foreign_link.getTarget().toString(), foreign_link.getTarget())); + arrowLinkPopup.add(getGotoLinkNodeAction(foreign_link.getTarget())); } if(NodeAlreadyVisited.add(foreign_link.getSource())) { - arrowLinkPopup.add(new GotoLinkNodeAction(foreign_link.getSource().toString(), foreign_link.getSource())); + arrowLinkPopup.add(getGotoLinkNodeAction(foreign_link.getSource())); } } return arrowLinkPopup; @@ -144,15 +120,14 @@ } - //convenience methods - private BrowseMapModel getModel() { - return (BrowseMapModel)getController().getModel(); - } - private BrowseNodeModel getSelected() { - return (BrowseNodeModel)getView().getSelected().getModel(); + /** + * @param destination + * @return + */ + private GotoLinkNodeAction getGotoLinkNodeAction(MindMapNode destination) { + return new GotoLinkNodeAction(this, destination); } - BrowseToolBar getToolBar() { return (BrowseToolBar)toolbar; } @@ -204,7 +179,7 @@ BrowseMapModel model = (BrowseMapModel)newModel(); model.load(url); newMap(model); - mapOpened(true); + //FIXME: Must activate hooks??? } @@ -215,6 +190,7 @@ * whether there is a map open or not. */ protected void setAllActions(boolean enabled) { + super.setAllActions(enabled); toggleFolded.setEnabled(enabled); toggleChildrenFolded.setEnabled(enabled); followLink.setEnabled(enabled); @@ -232,4 +208,15 @@ loadURL(); } } + /* (non-Javadoc) + * @see freemind.modes.ModeController#updateMenus(freemind.controller.StructuredMenuHolder) + */ + public void updateMenus(StructuredMenuHolder holder) { + add(holder, MenuBar.EDIT_MENU+"/find/find", find, "keystroke_find"); + add(holder, MenuBar.EDIT_MENU+"/find/findNext", findNext, "keystroke_find_next"); + add(holder, MenuBar.EDIT_MENU+"/find/followLink", followLink, "keystroke_follow_link"); + holder.addSeparator(MenuBar.EDIT_MENU+"/find"); + add(holder, MenuBar.EDIT_MENU+"/find/toggleFolded", toggleFolded, "keystroke_toggle_folded"); + add(holder, MenuBar.EDIT_MENU+"/find/toggleChildrenFolded", toggleChildrenFolded, "keystroke_toggle_children_folded"); + } } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/browsemode/BrowseMapModel.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/browsemode/BrowseMapModel.java --- freemind-0.7.1/freemind/freemind/modes/browsemode/BrowseMapModel.java 2003-12-02 22:50:22.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/browsemode/BrowseMapModel.java 2005-04-26 22:41:00.000000000 +0100 @@ -16,7 +16,7 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: BrowseMapModel.java,v 1.9 2003/12/02 22:50:22 christianfoltin Exp $*/ +/*$Id: BrowseMapModel.java,v 1.9.18.4 2005/04/26 21:41:00 christianfoltin Exp $*/ package freemind.modes.browsemode; @@ -32,6 +32,7 @@ // link registry. import freemind.modes.LinkRegistryAdapter; import freemind.modes.MindMapLinkRegistry; +import freemind.modes.MindMapNode; public class BrowseMapModel extends MapAdapter { @@ -51,7 +52,7 @@ if(root != null) setRoot(root); else - setRoot(new BrowseNodeModel(getFrame().getResources().getString("new_mindmap"), getFrame())); + setRoot(new BrowseNodeModel(getFrame().getResourceString("new_mindmap"), getFrame())); // register new LinkRegistryAdapter linkRegistry = new LinkRegistryAdapter(); } @@ -150,4 +151,19 @@ root = (BrowseNodeModel) mapElement.getMapChild(); return root; } + + /* (non-Javadoc) + * @see freemind.modes.MindMap#setLinkInclinationChanged() + */ + public void setLinkInclinationChanged() { + } + + /* (non-Javadoc) + * @see freemind.modes.MindMap#getXml(java.io.Writer) + */ + public void getXml(Writer fileout) throws IOException { + // nothing. + //FIXME: Implement me if you need me. + throw new RuntimeException("Unimplemented method called."); + } } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/browsemode/BrowseMode.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/browsemode/BrowseMode.java --- freemind-0.7.1/freemind/freemind/modes/browsemode/BrowseMode.java 2003-12-02 22:50:22.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/browsemode/BrowseMode.java 2004-10-28 06:24:54.000000000 +0100 @@ -16,17 +16,18 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: BrowseMode.java,v 1.8 2003/12/02 22:50:22 christianfoltin Exp $*/ +/*$Id: BrowseMode.java,v 1.8.18.2 2004/10/28 05:24:54 christianfoltin Exp $*/ package freemind.modes.browsemode; -import freemind.main.FreeMindApplet; +import java.net.URL; + +import javax.swing.JToolBar; + import freemind.controller.Controller; +import freemind.main.FreeMindApplet; import freemind.modes.Mode; import freemind.modes.ModeController; -import javax.swing.JMenu; -import javax.swing.JToolBar; -import java.net.URL; public class BrowseMode implements Mode { @@ -99,11 +100,4 @@ return null; } - public JMenu getModeFileMenu() { - return ((BrowseController)getModeController()).getFileMenu(); - } - - public JMenu getModeEditMenu() { - return ((BrowseController)getModeController()).getEditMenu(); - } } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/browsemode/BrowseNodeModel.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/browsemode/BrowseNodeModel.java --- freemind-0.7.1/freemind/freemind/modes/browsemode/BrowseNodeModel.java 2003-11-03 11:00:13.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/browsemode/BrowseNodeModel.java 2004-10-17 21:01:06.000000000 +0100 @@ -16,7 +16,7 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: BrowseNodeModel.java,v 1.7 2003/11/03 11:00:13 sviles Exp $*/ +/*$Id: BrowseNodeModel.java,v 1.7.18.1 2004/10/17 20:01:06 dpolivaev Exp $*/ package freemind.modes.browsemode; @@ -47,10 +47,6 @@ children = new LinkedList(); setEdge(new BrowseEdgeModel(this,getFrame())); } - //Overwritten get Methods - public String getStyle() { - return isFolded() ? MindMapNode.STYLE_BUBBLE : super.getStyle(); } - // // The mandatory load and save methods // diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/browsemode/BrowseXMLElement.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/browsemode/BrowseXMLElement.java --- freemind-0.7.1/freemind/freemind/modes/browsemode/BrowseXMLElement.java 2003-12-07 21:00:21.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/browsemode/BrowseXMLElement.java 2004-12-19 09:00:40.000000000 +0000 @@ -16,7 +16,7 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: BrowseXMLElement.java,v 1.6 2003/12/07 21:00:21 christianfoltin Exp $*/ +/*$Id: BrowseXMLElement.java,v 1.6.18.1 2004/12/19 09:00:40 christianfoltin Exp $*/ package freemind.modes.browsemode; @@ -52,7 +52,7 @@ // We do not need to initialize the things of XMLElement. return new BrowseXMLElement(getFrame(), ArrowLinkAdapters, IDToTarget); } - protected NodeAdapter createNodeAdapter(FreeMindMain frame){ + protected NodeAdapter createNodeAdapter(FreeMindMain frame, String nodeClass){ return new BrowseNodeModel(frame); } protected EdgeAdapter createEdgeAdapter(NodeAdapter node, FreeMindMain frame){ diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/CloudAdapter.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/CloudAdapter.java --- freemind-0.7.1/freemind/freemind/modes/CloudAdapter.java 2003-11-09 22:09:26.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/CloudAdapter.java 2005-06-14 21:38:07.000000000 +0100 @@ -16,33 +16,112 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: CloudAdapter.java,v 1.1 2003/11/09 22:09:26 christianfoltin Exp $*/ +/*$Id: CloudAdapter.java,v 1.1.16.3 2005/06/14 20:38:07 christianfoltin Exp $*/ package freemind.modes; +import java.awt.Color; + +import freemind.controller.Controller; +import freemind.main.FreeMind; import freemind.main.FreeMindMain; import freemind.main.Tools; -import java.awt.Color; -import java.awt.Stroke; -import java.awt.BasicStroke; +import freemind.main.XMLElement; public abstract class CloudAdapter extends LineAdapter implements MindMapCloud { + private static Color standardColor = null; + private static String standardStyle = null; + private static LineAdapterListener listener = null; // // Constructors // public CloudAdapter(MindMapNode target,FreeMindMain frame) { - this(target, frame, "standardcloudcolor", "standardcloudstyle"); + this(target, frame, FreeMind.RESOURCES_CLOUD_COLOR, "standardcloudstyle"); } /** For derived classes.*/ protected CloudAdapter(MindMapNode target,FreeMindMain frame, String standardColorPropertyString, String standardStylePropertyString) { super(target, frame, standardColorPropertyString, standardStylePropertyString); NORMAL_WIDTH = 3; + iterativeLevel = -1; + if(listener == null) { + listener = new LineAdapterListener(); + Controller.addPropertyChangeListener(listener); + } + + } + /** + * calculates the cloud iterative level which + * is importent for the cloud size + */ + + private void calcIterativeLevel(MindMapNode target) { + iterativeLevel = 0; + if (target != null) { + for(MindMapNode parentNode = target.getParentNode(); + parentNode != null; + parentNode = parentNode.getParentNode()) { + MindMapCloud cloud = parentNode.getCloud(); + if (cloud != null) { + iterativeLevel = cloud.getIterativeLevel() + 1; + break; + } + } + } + } + + public void setTarget(MindMapNode target) { + super.setTarget(target); } public Color getExteriorColor() { return getColor().darker(); } + /** gets iterative level which is required for painting and layout. */ + public int getIterativeLevel() { + if (iterativeLevel == -1) { + calcIterativeLevel(target); + } + return iterativeLevel; + } + + /** changes the iterative level.*/ + public void changeIterativeLevel(int deltaLevel) { + if (iterativeLevel != -1) { + iterativeLevel = iterativeLevel + deltaLevel; + } + } + + private int iterativeLevel; + + public XMLElement save() { + XMLElement cloud = new XMLElement(); + cloud.setName("cloud"); + + if (style != null) { + cloud.setAttribute("STYLE",style); + } + if (color != null) { + cloud.setAttribute("COLOR",Tools.colorToXml(color)); + } + if(width != DEFAULT_WIDTH) { + cloud.setAttribute("WIDTH",Integer.toString(width)); + } + return cloud; + } + + protected Color getStandardColor() { + return standardColor; + } + protected void setStandardColor(Color standardColor) { + CloudAdapter.standardColor = standardColor; + } + protected String getStandardStyle() { + return standardStyle; + } + protected void setStandardStyle(String standardStyle) { + CloudAdapter.standardStyle = standardStyle; + } } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/ControllerAdapter.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/ControllerAdapter.java --- freemind-0.7.1/freemind/freemind/modes/ControllerAdapter.java 2004-02-06 06:04:25.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/ControllerAdapter.java 2005-07-26 21:52:34.000000000 +0100 @@ -16,16 +16,14 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: ControllerAdapter.java,v 1.41 2004/02/06 06:04:25 christianfoltin Exp $*/ +/*$Id: ControllerAdapter.java,v 1.41.14.31 2005/07/26 20:52:34 christianfoltin Exp $*/ package freemind.modes; import java.awt.Color; -import java.awt.Dimension; import java.awt.Point; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.DataFlavor; -import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.Transferable; import java.awt.dnd.DnDConstants; import java.awt.dnd.DropTarget; @@ -34,58 +32,113 @@ import java.awt.dnd.DropTargetEvent; import java.awt.dnd.DropTargetListener; import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; import java.awt.event.MouseWheelEvent; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; import java.net.MalformedURLException; import java.net.URL; -import java.util.*; - - - +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.ListIterator; +import java.util.Set; import javax.swing.AbstractAction; import javax.swing.Action; -import javax.swing.BoxLayout; import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JComponent; -import javax.swing.JDialog; +import javax.swing.JCheckBoxMenuItem; import javax.swing.JFileChooser; -import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuItem; import javax.swing.JOptionPane; -import javax.swing.JPanel; import javax.swing.JPopupMenu; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; -import javax.swing.JTextField; import javax.swing.KeyStroke; -import javax.swing.SwingUtilities; import javax.swing.event.PopupMenuEvent; import javax.swing.event.PopupMenuListener; import javax.swing.filechooser.FileFilter; -import javax.swing.text.JTextComponent; -import freemind.main.FreeMind; import freemind.controller.Controller; +import freemind.controller.StructuredMenuHolder; +import freemind.controller.actions.ActionFactory; +import freemind.controller.actions.ModeControllerActionHandler; +import freemind.controller.actions.UndoActionHandler; +import freemind.controller.actions.generated.instance.ObjectFactory; +import freemind.controller.actions.generated.instance.XmlAction; +import freemind.extensions.HookFactory; +import freemind.extensions.ModeControllerHook; +import freemind.extensions.NodeHook; +import freemind.extensions.PermanentNodeHook; +import freemind.extensions.UndoEventReceiver; +import freemind.main.ExampleFileFilter; +import freemind.main.FreeMind; import freemind.main.FreeMindMain; import freemind.main.Tools; -import freemind.main.ExampleFileFilter; import freemind.main.XMLParseException; +import freemind.modes.actions.AddArrowLinkAction; +import freemind.modes.actions.AddLocalLinkAction; +import freemind.modes.actions.ApplyPatternAction; +import freemind.modes.actions.BoldAction; +import freemind.modes.actions.ChangeArrowLinkEndPoints; +import freemind.modes.actions.ChangeArrowsInArrowLinkAction; +import freemind.modes.actions.CloudAction; +import freemind.modes.actions.ColorArrowLinkAction; +import freemind.modes.actions.CompoundActionHandler; +import freemind.modes.actions.CopyAction; +import freemind.modes.actions.CopySingleAction; +import freemind.modes.actions.CutAction; +import freemind.modes.actions.DeleteChildAction; +import freemind.modes.actions.EdgeColorAction; +import freemind.modes.actions.EdgeStyleAction; +import freemind.modes.actions.EdgeWidthAction; +import freemind.modes.actions.EditAction; +import freemind.modes.actions.FindAction; +import freemind.modes.actions.FontFamilyAction; +import freemind.modes.actions.FontSizeAction; +import freemind.modes.actions.GotoLinkNodeAction; +import freemind.modes.actions.IconAction; +import freemind.modes.actions.ImportExplorerFavoritesAction; +import freemind.modes.actions.ImportFolderStructureAction; +import freemind.modes.actions.ItalicAction; +import freemind.modes.actions.JoinNodesAction; +import freemind.modes.actions.MoveNodeAction; +import freemind.modes.actions.NewChildAction; +import freemind.modes.actions.NodeBackgroundColorAction; +import freemind.modes.actions.NodeColorAction; +import freemind.modes.actions.NodeColorBlendAction; +import freemind.modes.actions.NodeHookAction; +import freemind.modes.actions.NodeStyleAction; +import freemind.modes.actions.NodeUpAction; +import freemind.modes.actions.PasteAction; +import freemind.modes.actions.RedoAction; +import freemind.modes.actions.RemoveAllIconsAction; +import freemind.modes.actions.RemoveArrowLinkAction; +import freemind.modes.actions.RemoveLastIconAction; +import freemind.modes.actions.RevertAction; +import freemind.modes.actions.SelectAllAction; +import freemind.modes.actions.SelectBranchAction; +import freemind.modes.actions.SetLinkByTextFieldAction; +import freemind.modes.actions.ToggleChildrenFoldedAction; +import freemind.modes.actions.ToggleFoldedAction; +import freemind.modes.actions.UnderlinedAction; +import freemind.modes.actions.UndoAction; +import freemind.modes.actions.FindAction.FindNextAction; +import freemind.modes.actions.NodeBackgroundColorAction.RemoveNodeBackgroundColorAction; +import freemind.modes.mindmapmode.MindMapArrowLinkModel; import freemind.view.MapModule; import freemind.view.mindmapview.MapView; +import freemind.view.mindmapview.MindMapLayout; import freemind.view.mindmapview.NodeView; @@ -96,29 +149,195 @@ */ public abstract class ControllerAdapter implements ModeController { - Mode mode; - private int noOfMaps = 0; //The number of currently open maps + private final static int MINIMAL_LEAF_WIDTH = MindMapLayout.MINIMAL_LEAF_WIDTH; + private final static int MINIMAL_WIDTH = MindMapLayout.MINIMAL_WIDTH; + + private ActionFactory actionFactory; + // for cascading updates. + private HashSet nodesAlreadyUpdated; + private HashSet nodesToBeUpdated; + // for MouseEventHandlers + private HashSet mRegisteredMouseWheelEventHandler = new HashSet(); + // Logging: + private static java.util.logging.Logger logger; + public ApplyPatternAction patterns[] = new ApplyPatternAction[0]; // Make sure it is initialized + + private Mode mode; private Clipboard clipboard; private int status; - - public Action copy = null; + public UndoAction undo=null; + public RedoAction redo=null; + public CopyAction copy = null; public Action copySingle = null; - public Action cut = null; - public Action paste = null; - - static final Color selectionColor = new Color(200,220,200); - - public ControllerAdapter() { - } + public CutAction cut = null; + public PasteAction paste = null; + public BoldAction bold = null; + public ItalicAction italic = null; + public UnderlinedAction underlined = null; + public FontSizeAction fontSize = null; + public FontFamilyAction fontFamily = null; + public EditAction edit = null; + public NewChildAction newChild = null; + public DeleteChildAction deleteChild = null; + public ToggleFoldedAction toggleFolded = null; + public ToggleChildrenFoldedAction toggleChildrenFolded = null; + public NodeUpAction nodeUp = null; + public NodeDownAction nodeDown = null; + public EdgeColorAction edgeColor = null; + public EdgeWidthAction EdgeWidth_WIDTH_PARENT = null; + public EdgeWidthAction EdgeWidth_WIDTH_THIN = null; + public EdgeWidthAction EdgeWidth_1 = null; + public EdgeWidthAction EdgeWidth_2 = null; + public EdgeWidthAction EdgeWidth_4 = null; + public EdgeWidthAction EdgeWidth_8 = null; + public EdgeWidthAction edgeWidths[] = null; + public EdgeStyleAction EdgeStyle_linear = null; + public EdgeStyleAction EdgeStyle_bezier = null; + public EdgeStyleAction EdgeStyle_sharp_linear = null; + public EdgeStyleAction EdgeStyle_sharp_bezier = null; + public EdgeStyleAction edgeStyles[] = null; + public NodeColorBlendAction nodeColorBlend = null; + public NodeStyleAction fork = null; + public NodeStyleAction bubble = null; + public CloudAction cloud = null; + public freemind.modes.actions.CloudColorAction cloudColor = null; + public AddArrowLinkAction addArrowLinkAction = null; + public RemoveArrowLinkAction removeArrowLinkAction = null; + public ColorArrowLinkAction colorArrowLinkAction = null; + public ChangeArrowsInArrowLinkAction changeArrowsInArrowLinkAction = null; + public NodeBackgroundColorAction nodeBackgroundColor = null; + public RemoveNodeBackgroundColorAction removeNodeBackgroundColor = null; + + public IconAction unknwonIconAction = null; + public RemoveLastIconAction removeLastIconAction = null; + public RemoveAllIconsAction removeAllIconsAction = null; + public SetLinkByTextFieldAction setLinkByTextField = null; + public AddLocalLinkAction addLocalLinkAction = null; + public GotoLinkNodeAction gotoLinkNodeAction = null; + public JoinNodesAction joinNodes = null; + public MoveNodeAction moveNodeAction = null; + public ImportExplorerFavoritesAction importExplorerFavorites = null; + public ImportFolderStructureAction importFolderStructure = null; + public ChangeArrowLinkEndPoints changeArrowLinkEndPoints = null; + + public FindAction find=null; + public FindNextAction findNext=null; + public NodeHookAction nodeHookAction = null; + public RevertAction revertAction = null; + public SelectBranchAction selectBranchAction = null; + public SelectAllAction selectAllAction = null; + + + /** Executes series of actions. */ + private CompoundActionHandler compound = null; + + private Color selectionColor = new Color(200,220,200); + public NodeColorAction nodeColor = null; + private Set globalPatternList; public ControllerAdapter(Mode mode) { - this.mode = mode; + this.setMode(mode); + if(logger==null) { + logger = getFrame().getLogger(this.getClass().getName()); + } + // for updates of nodes: + nodesAlreadyUpdated = new HashSet(); + nodesToBeUpdated = new HashSet(); + // create action factory: + actionFactory = new ActionFactory(getController()); + // prepare undo: + undo = new UndoAction(this); + redo = new RedoAction(this); + // register default action handler: + // the executor must be the first here, because it is executed last then. + getActionFactory().registerHandler(new ModeControllerActionHandler(getActionFactory())); + getActionFactory().registerHandler(new UndoActionHandler(this, undo, redo)); + //debug: getActionFactory().registerHandler(new freemind.controller.actions.PrintActionHandler(this)); cut = new CutAction(this); paste = new PasteAction(this); copy = new CopyAction(this); copySingle = new CopySingleAction(this); - + bold = new BoldAction (this); + italic = new ItalicAction(this); + underlined = new UnderlinedAction(this); + fontSize = new FontSizeAction(this); + fontFamily = new FontFamilyAction(this); + edit = new EditAction(this); + newChild = new NewChildAction(this); + deleteChild = new DeleteChildAction(this); + toggleFolded = new ToggleFoldedAction(this); + toggleChildrenFolded = new ToggleChildrenFoldedAction(this); + nodeUp = new NodeUpAction(this); + nodeDown = new NodeDownAction(this); + edgeColor = new EdgeColorAction(this); + nodeColor = new NodeColorAction(this); + nodeColorBlend = new NodeColorBlendAction(this); + fork = new NodeStyleAction(this, MindMapNode.STYLE_FORK); + bubble = new NodeStyleAction(this, MindMapNode.STYLE_BUBBLE); + // this is an unknown icon and thus corrected by mindicon: + removeLastIconAction = new RemoveLastIconAction(this); + // this action handles the xml stuff: (undo etc.) + unknwonIconAction = new IconAction(this, MindIcon.factory((String) MindIcon + .getAllIconNames().get(0)), removeLastIconAction); + removeLastIconAction.setIconAction(unknwonIconAction); + removeAllIconsAction = new RemoveAllIconsAction(this, unknwonIconAction); + // load pattern actions: + try { + File patternsFile = getFrame().getPatternsFile(); + if (patternsFile != null && patternsFile.exists()) { + loadPatterns(patternsFile); } + else { + System.out.println("User patterns file "+patternsFile+" not found."); + loadPatterns(new InputStreamReader(getResource("patterns.xml").openStream())); }} + catch (XMLParseException e) { + System.err.println("In patterns:"+e); } + catch (Exception ex) { + System.err.println("Patterns not loaded:"+ex); } + EdgeWidth_WIDTH_PARENT = new EdgeWidthAction(this, EdgeAdapter.WIDTH_PARENT); + EdgeWidth_WIDTH_THIN = new EdgeWidthAction(this, EdgeAdapter.WIDTH_THIN); + EdgeWidth_1 = new EdgeWidthAction(this, 1); + EdgeWidth_2 = new EdgeWidthAction(this, 2); + EdgeWidth_4 = new EdgeWidthAction(this, 4); + EdgeWidth_8 = new EdgeWidthAction(this, 8); + edgeWidths = new EdgeWidthAction[]{ + EdgeWidth_WIDTH_PARENT, EdgeWidth_WIDTH_THIN, EdgeWidth_1, EdgeWidth_2, EdgeWidth_4, EdgeWidth_8 + }; + EdgeStyle_linear = new EdgeStyleAction(this, "linear"); + EdgeStyle_bezier = new EdgeStyleAction(this, "bezier"); + EdgeStyle_sharp_linear = new EdgeStyleAction(this, "sharp_linear"); + EdgeStyle_sharp_bezier = new EdgeStyleAction(this, "sharp_bezier"); + edgeStyles = new EdgeStyleAction[]{ + EdgeStyle_linear, + EdgeStyle_bezier, + EdgeStyle_sharp_linear, + EdgeStyle_sharp_bezier + }; + cloud = new CloudAction(this); + cloudColor = new freemind.modes.actions.CloudColorAction(this); + addArrowLinkAction = new AddArrowLinkAction(this); + removeArrowLinkAction = new RemoveArrowLinkAction(this, null); + addArrowLinkAction.setRemoveAction(removeArrowLinkAction); + colorArrowLinkAction = new ColorArrowLinkAction(this, null); + changeArrowsInArrowLinkAction = new ChangeArrowsInArrowLinkAction(this, "none", null, null, true, true); + nodeBackgroundColor = new NodeBackgroundColorAction(this); + removeNodeBackgroundColor = new RemoveNodeBackgroundColorAction(this); + setLinkByTextField = new SetLinkByTextFieldAction(this); + addLocalLinkAction = new AddLocalLinkAction(this); + gotoLinkNodeAction = new GotoLinkNodeAction(this, null); + moveNodeAction = new MoveNodeAction(this); + joinNodes = new JoinNodesAction(this); + importExplorerFavorites = new ImportExplorerFavoritesAction(this); + importFolderStructure = new ImportFolderStructureAction(this); + changeArrowLinkEndPoints = new ChangeArrowLinkEndPoints(this); + find = new FindAction(this); + findNext = new FindNextAction(this,find); + nodeHookAction = new NodeHookAction("no_title", this); + revertAction = new RevertAction(this); + selectBranchAction = new SelectBranchAction(this); + selectAllAction = new SelectAllAction(this); + + compound = new CompoundActionHandler(this); DropTarget dropTarget = new DropTarget(getFrame().getViewport(), new FileOpener()); @@ -133,11 +352,45 @@ } + private void loadPatterns(File file) throws Exception { + createPatterns(StylePattern.loadPatterns(file)); + } + + private void loadPatterns(Reader reader) throws Exception { + createPatterns(StylePattern.loadPatterns(reader)); + } + + private void createPatterns(List patternsList) throws Exception { + globalPatternList = new HashSet(); + globalPatternList.addAll(patternsList); + patterns = new ApplyPatternAction[patternsList.size()]; + for (int i = 0; i < patterns.length; i++) { + patterns[i] = new ApplyPatternAction(this, + (StylePattern) patternsList.get(i)); + + // search icons for patterns: + MindIcon patternIcon = ((StylePattern) patternsList.get(i)) + .getNodeIcon(); + if (patternIcon != null) { + patterns[i].putValue(Action.SMALL_ICON, patternIcon + .getIcon(getFrame())); + } + } + } + + public ActionFactory getActionFactory() { + return actionFactory; + } + + // // Methods that should be overloaded // - protected abstract MindMapNode newNode(); + public abstract MindMapNode newNode(Object userObject); + protected MindMapNode newNode() { + return newNode(null); + } /** * You _must_ implement this if you use one of the following actions: @@ -156,9 +409,70 @@ return null; } - public void nodeChanged(MindMapNode n) { + + /** Currently, this method is called by the mapAdapter. This is buggy, and is to be changed.*/ + public void nodeChanged(MindMapNode node) { + getMap().setSaved(false); + nodeRefresh(node,true); } + public void nodeRefresh(MindMapNode node) { + nodeRefresh(node,false); + } + private void nodeRefresh(MindMapNode node, boolean isUpdate) { + logger.finest("nodeChanged called for node "+node+" parent="+node.getParentNode()); + if(nodesAlreadyUpdated.contains(node)) { + return; + } + nodesToBeUpdated.add(node); + nodesAlreadyUpdated.add(node); + if (isUpdate) { + // update modification times: + if(node.getHistoryInformation()!= null) { + node.getHistoryInformation().setLastModifiedAt(new Date()); + } + // Tell any node hooks that the node is changed: + recursiveCallUpdateHooks((MindMapNode) node, (MindMapNode) node /* self update */); + } + getMap().nodeChangedMapInternal(node); + nodesToBeUpdated.remove(node); + if(nodesToBeUpdated.size()==0) { + // this is the end of all updates: + nodesAlreadyUpdated.clear(); + } + } + + /** + * @param parent + */ + public void nodeStructureChanged(MindMapNode node) { + getMap().nodeStructureChanged(node); + } + + public boolean isUndoAction() { + return undo.isUndoAction() || redo.isUndoAction(); + } + + /** + * @param node + */ + private void recursiveCallUpdateHooks(MindMapNode node, MindMapNode changedNode) { + // Tell any node hooks that the node is changed: + if(node instanceof MindMapNode) { + for(Iterator i= ((MindMapNode)node).getActivatedHooks().iterator(); i.hasNext();) { + PermanentNodeHook hook = (PermanentNodeHook) i.next(); + if ( (! isUndoAction()) || hook instanceof UndoEventReceiver) { + if (node == changedNode) + hook.onUpdateNodeHook(); + else + hook.onUpdateChildrenHook(changedNode); + } + } + } + if(!node.isRoot() && node.getParentNode()!= null) + recursiveCallUpdateHooks(node.getParentNode(), changedNode); + } + public void anotherNodeSelected(MindMapNode n) { } @@ -188,7 +502,7 @@ if(getSelecteds().size() != 1) return; MindMapNode node = ((NodeView)(e.getComponent())).getModel(); - if (getView().getSelected().followLink(e.getX())) { + if (getView().getSelected().isInFollowLinkRegion(e.getX())) { loadURL(); } else { if (!node.hasChildren()) { @@ -204,24 +518,20 @@ // Map Management // - /** - * Get text identification of the map - */ - - protected String getText(String textId) { + public String getText(String textId) { return getController().getResourceString(textId); } protected boolean binOptionIsTrue(String option) { return getFrame().getProperty(option).equals("true");} - public void newMap() { - getController().getMapModuleManager().newMapModule(newModel()); - mapOpened(true); + public MindMap newMap() { + MapAdapter newModel = newModel(); + newMap(newModel); + return newModel; } - protected void newMap(MindMap map) { - getController().getMapModuleManager().newMapModule(map); - mapOpened(true); + public void newMap(MindMap mapModel) { + getController().getMapModuleManager().newMapModule(mapModel); } /** @@ -230,9 +540,12 @@ */ public void load (File file) throws FileNotFoundException, IOException, XMLParseException { MapAdapter model = newModel(); - model.load(file); - getController().getMapModuleManager().newMapModule(model); - mapOpened(true); + model.load(file); + getController().getMapModuleManager().newMapModule(model); + //FIXME: This must be done in the mapModuleManager. Ojo: The + // ModeController has changed. + getController().getModeController().invokeHooksRecursively( + (NodeAdapter) getModel().getRoot(), getModel()); } public boolean save() { @@ -241,9 +554,16 @@ return saveAs(); } else { return save(getModel().getFile()); }} + + + public void load(String xmlMapContents) { + revertAction.openXmlInsteadOfMap(xmlMapContents); + } - /** fc, 24.1.2004: having two methods getSelecteds with different return values (linkedlists of models resp. views) is asking for trouble. @see MapView */ - protected LinkedList getSelecteds() { + /** fc, 24.1.2004: having two methods getSelecteds with different return values + * (linkedlists of models resp. views) is asking for trouble. @see MapView + * @return returns a list of MindMapNode s. */ + public List getSelecteds() { LinkedList selecteds = new LinkedList(); ListIterator it = getView().getSelecteds().listIterator(); if (it != null) { @@ -256,8 +576,47 @@ } + /** + * This class sortes nodes by ascending depth of their paths to root. This + * is useful to assure that children are cutted before their + * fathers!!!. + * + * Moreover, it sorts nodes with the same depth according to their + * position relative to each other. + */ + protected class nodesDepthComparator implements Comparator{ + public nodesDepthComparator() {} + /* the < relation.*/ + public int compare(Object p1, Object p2) { + MindMapNode n1 = ((MindMapNode) p1); + MindMapNode n2 = ((MindMapNode) p2); + Object[] path1 = getModel().getPathToRoot(n1); + Object[] path2 = getModel().getPathToRoot(n2); + int depth = path1.length - path2.length; + if(depth > 0) + return -1; + if(depth < 0) + return 1; + if(n1.isRoot()) // if n1 is root, n2 is root, too ;) + return 0; + return n1.getParentNode().getChildPosition(n1) - n2.getParentNode().getChildPosition(n2); + } + } - /** + public List getSelectedsByDepth() { + // return an ArrayList of MindMapNodes. + List result = getSelecteds(); + sortNodesByDepth(result); + return result; + } + + + public void sortNodesByDepth(List inPlaceList) { + Collections.sort(inPlaceList, new nodesDepthComparator()); + logger.finest("Sort result: "+inPlaceList); + } + + /** * Return false is the action was cancelled, e.g. when * it has to lead to saving as. */ @@ -271,7 +630,27 @@ return item; } - protected void add(JMenu menu, Action action) { + /** @return returns the new JMenuItem. + * @param keystroke can be null, if no keystroke should be assigned. */ + protected JMenuItem add(StructuredMenuHolder holder, String category, Action action, String keystroke) { + JMenuItem item = holder.addMenuItem(new JMenuItem(action), category); + if(keystroke != null) { + item.setAccelerator(KeyStroke.getKeyStroke(getFrame().getProperty(keystroke))); + } + return item; + } + + /** @return returns the new JCheckBoxMenuItem. + * @param keystroke can be null, if no keystroke should be assigned. */ + protected JMenuItem addCheckBox(StructuredMenuHolder holder, String category, Action action, String keystroke) { + JCheckBoxMenuItem item = (JCheckBoxMenuItem) holder.addMenuItem(new JCheckBoxMenuItem(action), category); + if(keystroke != null) { + item.setAccelerator(KeyStroke.getKeyStroke(getFrame().getProperty(keystroke))); + } + return item; + } + + protected void add(JMenu menu, Action action) { menu.add(action); } // @@ -310,6 +689,7 @@ else if (exceptionType.equals("java.io.FileNotFoundException")) { getController().errorMessage(ex.getMessage()); } else { + ex.printStackTrace(); getController().errorMessage(ex); } } @@ -322,7 +702,7 @@ chooser = new JFileChooser(getMap().getFile().getParentFile()); } else { chooser = new JFileChooser(); - chooser.setSelectedFile(new File(((MindMapNode)getMap().getRoot()).toString()+".mm")); + chooser.setSelectedFile(new File(getFileNameProposal()+".mm")); } //chooser.setLocale(currentLocale); if (getFileFilter() != null) { @@ -363,13 +743,32 @@ return true; } /** + * Creates a proposal for a file name to save the map. Removes all illegal + * characters. + * + * Fixed: When creating file names based on the text of the root node, now all the + * extra unicode characters are replaced with _. This is not very good. For + * chinese content, you would only get a list of ______ as a file name. Only + * characters special for building file paths shall be removed (rather than + * replaced with _), like : or /. The exact list of dangeous characters + * needs to be investigated. 0.8.0RC3. + * + * @return + */ + private String getFileNameProposal() { + String rootText = ((MindMapNode)getMap().getRoot()).toString(); + rootText = rootText.replaceAll("[&:/\\\\\0%$#~\\?\\*]+", ""); + return rootText; + } + + /** * Return false if user has canceled. */ - public boolean close() { + public boolean close(boolean force) { String[] options = {getText("yes"), getText("no"), getText("cancel")}; - if (!getModel().isSaved()) { + if (!force && !getModel().isSaved()) { String text = getText("save_unsaved")+"\n"+getMapModule().toString(); String title = getText("save"); int returnVal = JOptionPane.showOptionDialog(getFrame().getContentPane(),text,title,JOptionPane.YES_NO_CANCEL_OPTION, @@ -378,54 +777,97 @@ boolean savingNotCancelled = save(); if (!savingNotCancelled) { return false; }} - else if (returnVal==JOptionPane.CANCEL_OPTION) { + else if ((returnVal==JOptionPane.CANCEL_OPTION) || (returnVal == JOptionPane.CLOSED_OPTION)) { return false; }} getModel().destroy(); - mapOpened(false); return true; } - /** - * Call this method if you have opened a map for this mode with true, - * and if you have closed a map of this mode with false. It updates the Actions - * that are dependent on whether there is a map or not. - * --> What to do if either newMap or load or close are overwritten by a concrete - * implementation? uups. - */ - public void mapOpened(boolean open) { - if (open) { - if (noOfMaps == 0) { - //opened the first map - setAllActions(true); - if (cut!=null) cut.setEnabled(true); - if (copy!=null) copy.setEnabled(true); - if (copySingle!=null) copySingle.setEnabled(true); - if (paste!=null) paste.setEnabled(true); - } - if (getFrame().getView()!=null) { - DropTarget dropTarget = new DropTarget - (getFrame().getView(), new FileOpener() ); - } - noOfMaps++; - } else { - noOfMaps--; - if (noOfMaps == 0) { - //closed the last map - setAllActions(false); - if (cut!=null) cut.setEnabled(false); - if (copy!=null) copy.setEnabled(false); - if (copySingle!=null) copySingle.setEnabled(true); - if (paste!=null) paste.setEnabled(false); - } - } - } + + /* (non-Javadoc) + * @see freemind.modes.ModeController#setVisible(boolean) + */ + public void setVisible(boolean visible) { + if (visible) { + MindMapNode node = getSelected(); + for (Iterator j = node.getActivatedHooks().iterator(); + j.hasNext(); + ) { + PermanentNodeHook hook = (PermanentNodeHook) j.next(); + hook.onReceiveFocusHook(); + } + } else { + MindMapNode node = getSelected(); + // bug fix, fc 18.5.2004. This should not be here. + if (node != null) { + for (Iterator j = node.getActivatedHooks().iterator(); + j.hasNext(); + ) { + PermanentNodeHook hook = (PermanentNodeHook) j.next(); + hook.onLooseFocusHook(); + } + } + } + } + /** * Overwrite this to set all of your actions which are * dependent on whether there is a map or not. */ protected void setAllActions(boolean enabled) { + // controller actions: + getController().zoomIn.setEnabled(enabled); + getController().zoomOut.setEnabled(enabled); + cut.setEnabled(enabled); + copy.setEnabled(enabled); + copySingle.setEnabled(enabled); + paste.setEnabled(enabled); + undo.setEnabled(enabled); + redo.setEnabled(enabled); + edit.setEnabled(enabled); + newChild.setEnabled(enabled); + toggleFolded.setEnabled(enabled); + toggleChildrenFolded.setEnabled(enabled); + setLinkByTextField.setEnabled(enabled); + italic.setEnabled(enabled); + bold.setEnabled(enabled); + find.setEnabled(enabled); + findNext.setEnabled(enabled); + addArrowLinkAction.setEnabled(enabled); + addLocalLinkAction.setEnabled(enabled); + nodeColorBlend.setEnabled(enabled); + nodeUp.setEnabled(enabled); + nodeBackgroundColor.setEnabled(enabled); + nodeDown.setEnabled(enabled); + importExplorerFavorites.setEnabled(enabled); + importFolderStructure.setEnabled(enabled); + joinNodes.setEnabled(enabled); + deleteChild.setEnabled(enabled); + cloud.setEnabled(enabled); + cloudColor.setEnabled(enabled); +// normalFont.setEnabled(enabled); + nodeColor.setEnabled(enabled); + edgeColor.setEnabled(enabled); + removeLastIconAction.setEnabled(enabled); + removeAllIconsAction.setEnabled(enabled); + selectAllAction.setEnabled(enabled); + selectBranchAction.setEnabled(enabled); + removeNodeBackgroundColor.setEnabled(enabled); + moveNodeAction.setEnabled(enabled); + revertAction.setEnabled(enabled); + for (int i=0; i=0 iff we are in the drag public void mouseWheelMoved(MouseWheelEvent e) { - if (isBlocked()) { - return; // block the scroll during edit (PN) - } + if (isBlocked()) { + return; // block the scroll during edit (PN) + } + for (Iterator i = mRegisteredMouseWheelEventHandler.iterator(); i.hasNext();) { + MouseWheelEventHandler handler = (MouseWheelEventHandler) i.next(); + boolean result = handler.handleMouseWheelEvent(e); + if(result) { + // event was consumed: + return; + } + } if ((e.getModifiers() & ZOOM_MASK) != 0) { // fc, 18.11.2003: when control pressed, then the zoom is changed. @@ -498,265 +948,24 @@ } else if ((e.getModifiers() & HORIZONTAL_SCROLL_MASK) != 0) { for (int i=0; i < SCROLL_SKIPS; i++) { ((MapView)e.getComponent()).scrollBy( - SCROLL_SKIP * e.getWheelRotation(), 0); }} + SCROLL_SKIP * e.getWheelRotation(), 0, false); }} else { for (int i=0; i < SCROLL_SKIPS; i++) { ((MapView)e.getComponent()).scrollBy(0, - SCROLL_SKIP * e.getWheelRotation()); }} + SCROLL_SKIP * e.getWheelRotation(), false); }} } - // edit begins with home/end or typing (PN 6.2) - public void edit(KeyEvent e, boolean addNew, boolean editLong) { - if (getView().getSelected() != null) { - if (e == null || !addNew) { - edit(getView().getSelected(),getView().getSelected(), e, false, false, editLong); - } - else if (!isBlocked()) { - addNew(getView().getSelected(), NEW_SIBLING_BEHIND, e); - } - if (e != null) { - e.consume(); - } - } + public void registerMouseWheelEventHandler(MouseWheelEventHandler handler) { + logger.info("Registered MouseWheelEventHandler "+handler); + mRegisteredMouseWheelEventHandler.add(handler); } - - private void changeComponentHeight(JComponent component, int difference, int minimum) { - Dimension preferredSize = component.getPreferredSize(); - System.out.println("pf:"+preferredSize); - if (preferredSize.getHeight() + difference >= minimum) { - System.out.println("pf:"+preferredSize); - component.setPreferredSize(new Dimension((int)preferredSize.getWidth(), - (int)preferredSize.getHeight() + difference)); }} - - /** Private variable to hold the last value of the "Enter confirms" state.*/ - private static Tools.BooleanHolder booleanHolderForConfirmState; - - private void editLong(final NodeView node, - final String text, - final KeyEvent firstEvent) { - - final int BUTTON_OK = 0; - final int BUTTON_CANCEL = 1; - final int BUTTON_SPLIT = 2; - - final JDialog dialog = new JDialog((JFrame)getFrame(), getText("edit_long_node"), /*modal=*/true); - - final JTextArea textArea = new JTextArea(text); - textArea.setLineWrap(true); - textArea.setWrapStyleWord(true); // wrap around words rather than characters - if (firstEvent != null) { - switch (firstEvent.getKeyCode()) { - case KeyEvent.VK_HOME: - textArea.setCaretPosition(0); - break; - - default: - textArea.setCaretPosition(text.length()); - break; - } - } - else { - textArea.setCaretPosition(text.length()); - } - - - final JScrollPane editorScrollPane = new JScrollPane(textArea); - editorScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); - - //int preferredHeight = new Integer(getFrame().getProperty("el__default_window_height")).intValue(); - int preferredHeight = node.getHeight(); - preferredHeight = - Math.max (preferredHeight, Integer.parseInt(getFrame().getProperty("el__min_default_window_height"))); - preferredHeight = - Math.min (preferredHeight, Integer.parseInt(getFrame().getProperty("el__max_default_window_height"))); - - int preferredWidth = node.getWidth(); - preferredWidth = - Math.max (preferredWidth, Integer.parseInt(getFrame().getProperty("el__min_default_window_width"))); - preferredWidth = - Math.min (preferredWidth, Integer.parseInt(getFrame().getProperty("el__max_default_window_width"))); - - editorScrollPane.setPreferredSize(new Dimension(preferredWidth, preferredHeight)); - //textArea.setPreferredSize(new Dimension(500, 160)); - - final JPanel panel = new JPanel(); - - //String performedAction; - final Tools.IntHolder eventSource = new Tools.IntHolder(); - final JButton okButton = new JButton("OK"); - final JButton cancelButton = new JButton(getText("cancel")); - final JButton splitButton = new JButton(getText("split")); - final JCheckBox enterConfirms = - new JCheckBox(getText("enter_confirms"), binOptionIsTrue("el__enter_confirms_by_default")); - - if(booleanHolderForConfirmState == null) { - booleanHolderForConfirmState = new Tools.BooleanHolder(); - booleanHolderForConfirmState.setValue(enterConfirms.isSelected()); - } else { - enterConfirms.setSelected(booleanHolderForConfirmState.getValue()); - } - - okButton.setMnemonic(KeyEvent.VK_O); - enterConfirms.setMnemonic(KeyEvent.VK_E); - splitButton.setMnemonic(KeyEvent.VK_S); - cancelButton.setMnemonic(KeyEvent.VK_C); - - okButton.addActionListener (new ActionListener() { - public void actionPerformed(ActionEvent e) { - eventSource.setValue(BUTTON_OK); - dialog.dispose(); }}); - - cancelButton.addActionListener (new ActionListener() { - public void actionPerformed(ActionEvent e) { - eventSource.setValue(BUTTON_CANCEL); - dialog.dispose(); }}); - - splitButton.addActionListener (new ActionListener() { - public void actionPerformed(ActionEvent e) { - eventSource.setValue(BUTTON_SPLIT); - dialog.dispose(); }}); - - enterConfirms.addActionListener (new ActionListener() { - public void actionPerformed(ActionEvent e) { - textArea.requestFocus(); - booleanHolderForConfirmState.setValue(enterConfirms.isSelected()); - }}); - - // On Enter act as if OK button was pressed - - textArea.addKeyListener(new KeyListener() { - public void keyPressed(KeyEvent e) { - // escape key in long text editor (PN) - if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { - e.consume(); - eventSource.setValue(BUTTON_CANCEL); - dialog.dispose(); - } - else if (e.getKeyCode() == KeyEvent.VK_ENTER) { - if (enterConfirms.isSelected() == ((e.getModifiers() & KeyEvent.CTRL_MASK) == 0)) { - e.consume(); - eventSource.setValue(BUTTON_OK); - dialog.dispose(); } - else if (enterConfirms.isSelected() && (e.getModifiers() & KeyEvent.CTRL_MASK) != 0) { - e.consume(); - textArea.insert("\n",textArea.getCaretPosition()); }}} - - /* - // Daniel: I tried to make editor resizable. It worked somehow, but not - // quite. When I increased the size and then decreased again to the original - // size, it stopped working. The main idea here is to change the preferred - // size. I also tried to change the size but it did not do anything sensible. - // - // One possibility would be to disable decreasing the size. - // - // Another thing which was far from nice was that it flickered. - // - // If someone wants to find a solution, let it be. - - else if (e.getKeyCode() == KeyEvent.VK_DOWN && - (e.getModifiers() & KeyEvent.CTRL_MASK) != 0) { - - changeComponentHeight(editorScrollPane, 60, 180); - dialog.doLayout(); - dialog.pack(); - e.consume(); - } - else if (e.getKeyCode() == KeyEvent.VK_UP && - (e.getModifiers() & KeyEvent.CTRL_MASK) != 0) { - changeComponentHeight(editorScrollPane, -60, 180); - dialog.doLayout(); - dialog.pack(); - e.consume(); }} */ - public void keyTyped(KeyEvent e) {} - public void keyReleased(KeyEvent e) {} - }); - - textArea.addMouseListener(new MouseListener() { - public void mouseClicked(MouseEvent e) {} - public void mouseEntered( MouseEvent e ) {} - public void mouseExited( MouseEvent e ) {} - - public void mousePressed( MouseEvent e ) { - conditionallyShowPopup(e); } - - public void mouseReleased( MouseEvent e ) { - conditionallyShowPopup(e); } - - private void conditionallyShowPopup(MouseEvent e) { - if (e.isPopupTrigger()) { - JPopupMenu popupMenu = new EditPopupMenu(textArea); - popupMenu.show(e.getComponent(),e.getX(),e.getY()); - e.consume(); }} - }); - - - textArea.setFont(node.getFont()); - textArea.setForeground(node.getForeground()); - - //panel.setPreferredSize(new Dimension(500, 160)); - //editorScrollPane.setPreferredSize(new Dimension(500, 160)); - - JPanel buttonPane = new JPanel(); - buttonPane.add(enterConfirms); - buttonPane.add(okButton); - buttonPane.add(cancelButton); - buttonPane.add(splitButton); - buttonPane.setMaximumSize(new Dimension(1000, 20)); - - if (getFrame().getProperty("el__buttons_position").equals("above")) { - panel.add(buttonPane); - panel.add(editorScrollPane); } - else { - panel.add(editorScrollPane); - panel.add(buttonPane); } - - panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); - - dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); - dialog.setContentPane(panel); - dialog.pack(); // calculate the size - - // set position - getView().scrollNodeToVisible(node, 0); - Point frameScreenLocation = getFrame().getLayeredPane().getLocationOnScreen(); - double posX = node.getLocationOnScreen().getX() - frameScreenLocation.getX(); - double posY = node.getLocationOnScreen().getY() - frameScreenLocation.getY() - + (binOptionIsTrue("el__position_window_below_node") ? node.getHeight() : 0); - if (posX + dialog.getWidth() > getFrame().getLayeredPane().getWidth()) { - posX = getFrame().getLayeredPane().getWidth() - dialog.getWidth(); - } - if (posY + dialog.getHeight() > getFrame().getLayeredPane().getHeight()) { - posY = getFrame().getLayeredPane().getHeight() - dialog.getHeight(); - } - posX = ((posX < 0) ? 0 : posX) + frameScreenLocation.getX(); - posY = ((posY < 0) ? 0 : posY) + frameScreenLocation.getY(); - dialog.setLocation(new Double(posX).intValue(), new Double(posY).intValue()); - - - textArea.requestFocusInWindow(); // make the text area focused when the dialog comes - dialog.show(); - //dialog.setVisible(true); - - if (eventSource.getValue() == BUTTON_OK) { - getModel().changeNode(node.getModel(), textArea.getText()); } - if (eventSource.getValue() == BUTTON_SPLIT) { - //getModel().changeNode(node.getModel(), textArea.getText()); - getModel().splitNode(node.getModel(), - textArea.getCaretPosition(), - textArea.getText()); - getController().obtainFocusForSelected(); // focus fix - } - + public void deRegisterMouseWheelEventHandler(MouseWheelEventHandler handler) { + logger.info("Deregistered MouseWheelEventHandler "+handler); + mRegisteredMouseWheelEventHandler.remove(handler); } - // this enables from outside close the edit mode private FocusListener textFieldListener = null; - private void closeEdit() { - if (this.textFieldListener != null) { - textFieldListener.focusLost(null); // hack to close the edit - } - } // status, currently: default, blocked (PN) // (blocked to protect against particular events e.g. in edit mode) @@ -765,413 +974,256 @@ public boolean isBlocked() { return this.isBlocked; } - private void setBlocked(boolean isBlocked) { + public void setBlocked(boolean isBlocked) { this.isBlocked = isBlocked; } - private void edit(final NodeView node, - final NodeView prevSelected, // when new->esc: node be selected - final KeyEvent firstEvent, - final boolean isNewNode, // when new->esc: cut the node - final boolean parentFolded, // when new->esc: fold prevSelected - final boolean editLong) { - if (node == null){ - return; } - - closeEdit(); - setBlocked(true); // locally "modal" stated - - String text = node.getModel().toString(); - if (node.getIsLong() || editLong) { - editLong(node, text, firstEvent); - setBlocked(false); - return; - } - - //if (isNewNode) { - // if (firstEvent instanceof KeyEvent - // && ((KeyEvent)firstEvent).getKeyChar() != KeyEvent.CHAR_UNDEFINED) { - // } - // //else if (text.length() == 0) { - // // new node text if the user did not press a key and the text would be empty - // // text = getText("new_node"); - // //} - //} - - final JTextField textField = (text.length() < 8) - ? new JTextField(text,8) //Make fields for short texts editable - : new JTextField(text); - - // Set textFields's properties - - /* fc, 12.10.2003: the following method is not correct. Even more with the zoom factors!*/ - int linkIconWidth = 16; - int textFieldBorderWidth = 2; - int cursorWidth = 1; - int xOffset = -1 * textFieldBorderWidth + node.getLeftWidthOverhead() - 1; - int yOffset = -1; // Optimized for Windows style; basically ad hoc - int widthAddition = 2 * textFieldBorderWidth + cursorWidth - 2 * node.getLeftWidthOverhead() + 2; - int heightAddition = 2; - if (node.getModel().getLink() != null) { - xOffset += linkIconWidth; - widthAddition -= linkIconWidth; } - if (node.getModel().getIcons().size() != 0) { // fc, 24.9.2003 full ok for the moment, that an icon has the same size as the link icon. - xOffset += linkIconWidth * node.getModel().getIcons().size(); - widthAddition -= linkIconWidth; } - /* fc, 12.10.2003: end buggy method*/ - - // minimal width for input field of leaf or folded node (PN) - final int MINIMAL_LEAF_WIDTH = 150; - final int MINIMAL_WIDTH = 50; - - int xSize = node.getWidth() + widthAddition; - int xExtraWidth = 0; - if (MINIMAL_LEAF_WIDTH > xSize - && (node.getModel().isFolded() || !node.getModel().hasChildren())) { - // leaf or folded node with small size - xExtraWidth = MINIMAL_LEAF_WIDTH - xSize; - xSize = MINIMAL_LEAF_WIDTH; // increase minimum size - if (node.isLeft()) { // left leaf - xExtraWidth = - xExtraWidth; - textField.setHorizontalAlignment(JTextField.RIGHT); - } - } - else if (MINIMAL_WIDTH > xSize) { - // opened node with small size - xExtraWidth = MINIMAL_WIDTH - xSize; - xSize = MINIMAL_WIDTH; // increase minimum size - if (node.isLeft()) { // left node - xExtraWidth = - xExtraWidth; - textField.setHorizontalAlignment(JTextField.RIGHT); - } - } - - textField.setSize(xSize, node.getHeight() + heightAddition); - textField.setFont(node.getFont()); - textField.setForeground(node.getForeground()); - textField.setSelectedTextColor(node.getForeground()); - textField.setSelectionColor(selectionColor); - // textField.selectAll(); // no selection on edit (PN) - - final int INIT = 0; - final int EDIT = 1; - final int CANCEL = 2; - final Tools.IntHolder eventSource = new Tools.IntHolder(); - eventSource.setValue(INIT); - - // listener class - class TextFieldListener implements KeyListener, - FocusListener, MouseListener { - - public void focusGained(FocusEvent e) { - // the first time the edit field gains a focus - // process the predefined first key (if any) - - if (eventSource.getValue() == INIT) { - eventSource.setValue(EDIT); - if (firstEvent instanceof KeyEvent) { - KeyEvent firstKeyEvent = (KeyEvent)firstEvent; - if (firstKeyEvent.getKeyChar() == KeyEvent.CHAR_UNDEFINED) { - // for the char_undefined the scenario with dispatching - // doesn't work => hard code dispatching :-( - // // dispatch action key events as it came - // textField.dispatchEvent(firstKeyEvent); - - // dispatch 2 known events (+ special for insert:) (hardcoded) - switch (firstKeyEvent.getKeyCode()) { - case KeyEvent.VK_HOME: - textField.setCaretPosition(0); - break; - case KeyEvent.VK_END: - textField.setCaretPosition(textField.getText().length()); - break; - } - } - else { - // or create new "key type" event for printable key - KeyEvent keyEv; - keyEv = new KeyEvent( - firstKeyEvent.getComponent(), - KeyEvent.KEY_TYPED, - firstKeyEvent.getWhen(), - firstKeyEvent.getModifiers(), - KeyEvent.VK_UNDEFINED, - firstKeyEvent.getKeyChar(), - KeyEvent.KEY_LOCATION_UNKNOWN ); - textField.selectAll(); // to enable overwrite - textField.dispatchEvent(keyEv); - } - } // 1st key event defined - } // first focus - } // focus gained - public void focusLost(FocusEvent e) { - - // %%% open problems: - // - adding of a child to the rightmost node - // - scrolling while in editing mode (it can behave just like other viewers) - // - block selected events while in editing mode + public void setBold(MindMapNode node, boolean bolded) { + bold.setBold(node, bolded); + } + + public void setItalic(MindMapNode node, boolean isItalic) { + italic.setItalic(node, isItalic); + } + + public void setCloud(MindMapNode node, boolean enable) { + cloud.setCloud(node, enable); + } + public void setCloudColor(MindMapNode node, Color color) { + cloudColor.setCloudColor(node, color); + } + //Node editing + public void setFontSize(MindMapNode node, String fontSizeValue) { + fontSize.setFontSize(node, fontSizeValue); + } + + /** + * + */ + + public void increaseFontSize(MindMapNode node, int increment) { + int newSize = Integer.valueOf(node.getFontSize()).intValue()+increment; - if (e == null) { // can be when called explicitly - getModel().changeNode(node.getModel(), textField.getText()); - getFrame().getLayeredPane().remove(textField); - getFrame().repaint(); // getLayeredPane().repaint(); - textFieldListener = null; - eventSource.setValue(CANCEL); // disallow real focus lost - } - else if (eventSource.getValue() != CANCEL) { - // always confirm the text if not yet - getModel().changeNode(node.getModel(), textField.getText()); - getFrame().getLayeredPane().remove(textField); - getFrame().repaint(); // getLayeredPane().repaint(); - setBlocked(false); - textFieldListener = null; - } - } + if (newSize > 0) { + setFontSize(node, Integer.toString(newSize)); + } + } + + public void setFontFamily(MindMapNode node, String fontFamilyValue) { + fontFamily.setFontFamily(node, fontFamilyValue); + } - public void keyPressed(KeyEvent e) { + public void setNodeColor(MindMapNode node, Color color) { + nodeColor.setNodeColor(node, color); + } + + public void setNodeBackgroundColor(MindMapNode node, Color color) { + nodeBackgroundColor.setNodeBackgroundColor(node, color); + } + public void blendNodeColor(MindMapNode node) { + Color mapColor = getMap().getBackgroundColor(); + Color nodeColor = node.getColor(); + if (nodeColor == null) { + nodeColor = Tools.xmlToColor(getFrame().getProperty( + FreeMind.RESOURCES_NODE_COLOR)); + } + setNodeColor(node, new Color( + (3 * mapColor.getRed() + nodeColor.getRed()) / 4, (3 * mapColor + .getGreen() + nodeColor.getGreen()) / 4, (3 * mapColor + .getBlue() + nodeColor.getBlue()) / 4)); + } - if (e.isAltDown() || e.isControlDown()) { - return; - } - boolean commit = true; + public void setEdgeColor(MindMapNode node, Color color) { + edgeColor.setEdgeColor(node, color); + } - switch (e.getKeyCode()) { - case KeyEvent.VK_ESCAPE: - commit = false; - case KeyEvent.VK_ENTER: - e.consume(); - - eventSource.setValue(CANCEL); // do not process loose of focus - if (commit) { - getModel().changeNode(node.getModel(), textField.getText()); - } - else if (isNewNode) { // delete also the node and set focus to the parent - getView().selectAsTheOnlyOneSelected(node); - getModel().cut(); - select(prevSelected); // include max level for navigation - if (parentFolded) { - getModel().setFolded(prevSelected.getModel(), true); - } - } - getFrame().getLayeredPane().remove(textField); - getFrame().repaint(); // getLayeredPane().repaint(); - setBlocked(false); - textFieldListener = null; - getController().obtainFocusForSelected(); // hack: to keep the focus + public void applyPattern(MindMapNode node, String patternName){ + for (int i = 0; i < patterns.length; i++) { + ApplyPatternAction patternAction = patterns[i]; + if(patternAction.getPattern().getName().equals(patternName)){ + patternAction.applyPattern(node, patternAction.getPattern()); break; + } + } + } - case KeyEvent.VK_SPACE: - e.consume(); - } - } - public void keyTyped(KeyEvent e) { } - public void keyReleased(KeyEvent e) { } - - public void mouseClicked(MouseEvent e) {} - public void mouseEntered( MouseEvent e ) {} - public void mouseExited( MouseEvent e ) {} + - public void mousePressed( MouseEvent e ) { - conditionallyShowPopup(e); } - - public void mouseReleased( MouseEvent e ) { - conditionallyShowPopup(e); } + public void applyPattern(MindMapNode node, StylePattern pattern) { + if(patterns.length > 0) { + patterns[0].applyPattern(node, pattern); + } else { + throw new IllegalArgumentException("No pattern defined."); + } + } + + public void addIcon(MindMapNode node, MindIcon icon) { + unknwonIconAction.addIcon(node, icon); + } - private void conditionallyShowPopup(MouseEvent e) { - if (e.isPopupTrigger()) { - JPopupMenu popupMenu = new EditPopupMenu(textField); - popupMenu.show(e.getComponent(),e.getX(),e.getY()); - e.consume(); }} - } + public void removeAllIcons(MindMapNode node) { + removeAllIconsAction.removeAllIcons(node); + } - // create the listener - final TextFieldListener textFieldListener = new TextFieldListener(); - - // Add listeners - this.textFieldListener = textFieldListener; - textField.addFocusListener( textFieldListener ); - textField.addKeyListener( textFieldListener ); - textField.addMouseListener( textFieldListener ); + public int removeLastIcon(MindMapNode node) { + return removeLastIconAction.removeLastIcon(node); + } + /** + * + */ - // screen positionining --------------------------------------------- + public void addLink(MindMapNode source, MindMapNode target) { + addArrowLinkAction.addLink(source, target); + } - // SCROLL if necessary - getView().scrollNodeToVisible(node, xExtraWidth); + public void removeReference(MindMapLink arrowLink){ + removeArrowLinkAction.removeReference(arrowLink); + } - // NOTE: this must be calculated after scroll because the pane location changes - Point frameScreenLocation = getFrame().getLayeredPane().getLocationOnScreen(); - Point nodeScreenLocation = node.getLocationOnScreen(); + public void setArrowLinkColor(MindMapLink arrowLink, Color color) { + colorArrowLinkAction.setArrowLinkColor(arrowLink, color); + } + + /** + * + */ - int xLeft = (int)(nodeScreenLocation.getX() - frameScreenLocation.getX() + xOffset); - if (xExtraWidth < 0) { - xLeft += xExtraWidth; - } + public void changeArrowsOfArrowLink(MindMapArrowLinkModel arrowLink, + boolean hasStartArrow, boolean hasEndArrow) { + changeArrowsInArrowLinkAction.changeArrowsOfArrowLink(arrowLink, hasStartArrow, hasEndArrow); + } + + public void setArrowLinkEndPoints(MindMapArrowLink link, Point startPoint, + Point endPoint) { + changeArrowLinkEndPoints.setArrowLinkEndPoints(link, startPoint, endPoint); + } + public void setLink(MindMapNode node, String link) { + setLinkByTextField.setLink(node, link); + } + /** + * + */ - textField.setLocation(xLeft, (int)(nodeScreenLocation.getY() - - frameScreenLocation.getY() + yOffset)); - - getFrame().getLayeredPane().add(textField); // 2000); - getFrame().repaint(); - - SwingUtilities.invokeLater( new Runnable() { // PN 0.6.2 - public void run () { textField.requestFocus(); }}); + public void setToolTip(MindMapNode node, String key, String value) { + node.setToolTip(key, value); + nodeRefresh(node); } + // edit begins with home/end or typing (PN 6.2) + public void edit(KeyEvent e, boolean addNew, boolean editLong) { + edit.edit(e, addNew, editLong); + } - public final int NEW_CHILD_WITHOUT_FOCUS = 1; // old model of insertion - public final int NEW_CHILD = 2; - public final int NEW_SIBLING_BEHIND = 3; - public final int NEW_SIBLING_BEFORE = 4; - - public void addNew(final NodeView target, final int newNodeMode, final KeyEvent e) { - closeEdit(); - - MindMapNode newNode = newNode(); - final MindMapNode targetNode = target.getModel(); - - switch (newNodeMode) { - case NEW_SIBLING_BEFORE: - case NEW_SIBLING_BEHIND: - if (targetNode.isRoot()) { - getController().errorMessage( - getText("new_node_as_sibling_not_possible_for_the_root")); - setBlocked(false); - return; - } - MindMapNode parent = targetNode.getParentNode(); - int childPosition = parent.getChildPosition(targetNode); - if (newNodeMode == NEW_SIBLING_BEHIND) { - childPosition++; - } - if(targetNode.isLeft()!= null) { - newNode.setLeft(targetNode.isLeft().getValue()); - } - getModel().insertNodeInto(newNode, parent, childPosition); - select(newNode.getViewer()); - getFrame().repaint(); // getLayeredPane().repaint(); - edit(newNode.getViewer(), target, e, true, false, false); - break; - - case NEW_CHILD: - case NEW_CHILD_WITHOUT_FOCUS: - final boolean parentFolded = targetNode.isFolded(); - if (parentFolded) { - getModel().setFolded(targetNode,false); - } - int position = getFrame().getProperty("placenewbranches").equals("last") ? - targetNode.getChildCount() : 0; - // Here the NodeView is created for the node. } - getModel().insertNodeInto(newNode, targetNode, position); - getFrame().repaint(); // getLayeredPane().repaint(); - if (newNodeMode == NEW_CHILD) { - select(newNode.getViewer()); - } - final NodeView editView = newNode.getViewer(); - edit(editView, targetNode.getViewer(), e, true, parentFolded, false); - break; - } - } - -// public void toggleFolded() { -// MindMapNode node = getSelected(); -// // fold the node only if the node is not a leaf (PN 0.6.2) -// if (node.hasChildren() -// || node.isFolded() -// || Tools.safeEquals(getFrame() -// .getProperty("enable_leaves_folding"),"true")) { -// getModel().setFolded(node, !node.isFolded()); -// } -// getView().selectAsTheOnlyOneSelected(node.getViewer()); -// } - - public void toggleFolded() { - /* Retrieve the information whether or not all nodes have the same folding state. */ - Tools.BooleanHolder state = null; - boolean allNodeHaveSameFoldedStatus = true; - for (ListIterator it = getSelecteds().listIterator();it.hasNext();) { - MindMapNode node = (MindMapNode)it.next(); - if(state == null) { - state = new Tools.BooleanHolder(); - state.setValue(node.isFolded()); - } else { - if(node.isFolded() != state.getValue()) { - allNodeHaveSameFoldedStatus = false; - break; - } - } - } - /* if the folding state is ambiguous, the nodes are folded. */ - boolean fold = true; - if(allNodeHaveSameFoldedStatus && state != null) { - fold = !state.getValue(); - } - MindMapNode lastNode = null; - for (ListIterator it = getView().getSelectedsByDepth().listIterator();it.hasNext();) { - MindMapNode node = ((NodeView)it.next()).getModel(); - // fold the node only if the node is not a leaf (PN 0.6.2) - if (node.hasChildren() || node.isFolded() || Tools.safeEquals(getFrame().getProperty("enable_leaves_folding"),"true")) { - getModel().setFolded(node, fold); - } - lastNode = node; - } - if(lastNode != null) - getView().selectAsTheOnlyOneSelected(lastNode.getViewer()); + + public void setNodeText(MindMapNode selected, String newText) { + edit.setNodeText(selected, newText); } + /** + * + */ + public void setEdgeWidth(MindMapNode node, int width) { + EdgeWidth_1.setEdgeWidth(node, width); + } /** - * If any children are folded, unfold all folded children. - * Otherwise, fold all children. + * */ - protected void toggleChildrenFolded() { - // have NodeAdapter; need NodeView - MindMapNode parent = getSelected(); - ListIterator children_it = parent.getViewer().getChildrenViews().listIterator(); - boolean areAnyFolded = false; - while(children_it.hasNext() && !areAnyFolded) { - NodeView child = (NodeView)children_it.next(); - if(child.getModel().isFolded()) { - areAnyFolded = true; - } - } - // fold the node only if the node is not a leaf (PN 0.6.2) - boolean enableLeavesFolding = - Tools.safeEquals(getFrame(). - getProperty("enable_leaves_folding"),"true"); - - children_it = parent.getViewer().getChildrenViews().listIterator(); - while(children_it.hasNext()) { - MindMapNode child = ((NodeView)children_it.next()).getModel(); - if (child.hasChildren() - || enableLeavesFolding - || child.isFolded()) { - getModel().setFolded(child, !areAnyFolded); // (PN 0.6.2) - } - } - getView().selectAsTheOnlyOneSelected(parent.getViewer()); + public void setEdgeStyle(MindMapNode node, String style) { + EdgeStyle_bezier.setEdgeStyle(node, style); + } + /** + * + */ - getController().obtainFocusForSelected(); // focus fix + public void setNodeStyle(MindMapNode node, String style) { + fork.setStyle(node, style); } + public Transferable cut() { + return cut(getSelecteds()); + } - protected void setLinkByTextField() { - // Requires J2SDK1.4.0! - String inputValue = JOptionPane.showInputDialog - (getText("edit_link_manually"), getModel().getLink(getSelected())); - if (inputValue != null) { - if (inputValue.equals("")) { - inputValue = null; // In case of no entry unset link - } - getModel().setLink(getSelected(),inputValue); - } + + + public Transferable cut(List nodeList) { + return cut.cut(nodeList); + } + public void paste(Transferable t, MindMapNode parent) { + boolean isLeft = false; + if(parent.isLeft()!= null) + isLeft = parent.isLeft().getValue(); + paste(t, /*target=*/parent, /*asSibling=*/ false, isLeft); } + + /** @param isLeft determines, whether or not the node is placed on the left or right. **/ + public void paste(Transferable t, MindMapNode target, boolean asSibling, boolean isLeft) { + paste.paste(t, target, asSibling, isLeft); + } + + public void paste(MindMapNode node, MindMapNode parent) { + paste.paste(node, parent); + } + + + public static final int NEW_CHILD_WITHOUT_FOCUS = 1; // old model of insertion + public static final int NEW_CHILD = 2; + public static final int NEW_SIBLING_BEHIND = 3; + public static final int NEW_SIBLING_BEFORE = 4; + + public MindMapNode addNew(final MindMapNode target, final int newNodeMode, final KeyEvent e) { + return newChild.addNew(target, newNodeMode, e); + } + + public MindMapNode addNewNode(MindMapNode parent, int index, freemind.main.Tools.BooleanHolder newNodeIsLeft) { + return newChild.addNewNode(parent, index, newNodeIsLeft); } + + public void deleteNode(MindMapNode selectedNode) { + deleteChild.deleteNode(selectedNode); + } + + public void toggleFolded() { + toggleFolded.toggleFolded(); + } + + public void setFolded(MindMapNode node, boolean folded) { + toggleFolded.setFolded(node, folded); + } + + public void displayNode(MindMapNode node){ + find.displayNode(node, null); + } + + public void centerNode(MindMapNode node){ + if(node.getViewer()==null){ + displayNode(node); + } + // Select the node and scroll to it. + getView().centerNode(node.getViewer()); + getView().selectAsTheOnlyOneSelected(node.getViewer()); + getController().obtainFocusForSelected(); + } + + public String getLinkShortText(MindMapNode node) { + return gotoLinkNodeAction.getShortTextForLink(node); + } + + public void moveNodes(MindMapNode selected, List selecteds, int direction){ + nodeUp.moveNodes(selected, selecteds, direction); + } + + public void joinNodes(MindMapNode selectedNode, List selectedNodes) { + joinNodes.joinNodes(selectedNode, selectedNodes); + } + protected void setLinkByFileChooser() { String relative = getLinkByFileChooser(getFileFilter()); - if (relative != null) getModel().setLink(getSelected(),relative); + if (relative != null) + setLink((NodeAdapter) getSelected(),relative); } protected void setImageByFileChooser() { @@ -1195,6 +1247,7 @@ } try { + // FIXME: Is this used????? if (picturesAmongSelecteds) { for (ListIterator e = getSelecteds().listIterator();e.hasNext();) { MindMapNode node = (MindMapNode)e.next(); @@ -1203,9 +1256,9 @@ String relative = Tools.isAbsolutePath(possiblyRelative) ? new File(possiblyRelative).toURL().toString() : possiblyRelative; if (relative != null) { - String strText = ""; - node.setLink(null); - getModel().changeNode(node,strText); + String strText = ""; + setLink(node, null); + setNodeText(node, strText); } } } @@ -1214,7 +1267,7 @@ String relative = getLinkByFileChooser(filter); if (relative != null) { String strText = ""; - getModel().changeNode((MindMapNode)getSelected(),strText); + setNodeText((MindMapNode)getSelected(),strText); } } } @@ -1294,7 +1347,20 @@ //absolute = new URL("file://"+relative); } absolute = new File(relative).toURL(); } - else { + else if(relative.startsWith("#")){ + // inner map link, fc, 12.10.2004 + logger.finest("found relative link to "+relative); + String target = relative.substring(1); + try { + MindMapNode node = getNodeFromID(target); + centerNode(node); + return; + } catch (Exception e) { + // give "not found" message + throw new FileNotFoundException(null); + } + + } else{ absolute = new URL(getMap().getFile().toURL(), relative); // Remark: getMap().getFile().toURL() returns URLs like file:/C:/... // It seems, that it does not cause any problems. @@ -1309,7 +1375,7 @@ getFrame().setWaitingCursor(true); load(file); }} else { // ---- Open URL in browser - // fc, 14.12.2003: The following code seems not very good. Imagine file names with spaces. Then they occur as %20, now the OS does not find the file, + // fc, 14.12.2003: The following code seems not to be very good. Imagine file names with spaces. Then they occur as %20, now the OS does not find the file, // etc. If this is necessary, this should be done in the openDocument command. // if (absolute.getProtocol().equals("file")) { // File file = new File (Tools.urlGetFile(absolute)); @@ -1332,8 +1398,11 @@ getText("repair_link"), JOptionPane.YES_NO_OPTION); if (returnVal==JOptionPane.YES_OPTION) { - setLinkByTextField(); }} - catch (Exception e) { e.printStackTrace(); } + setLinkByTextField.actionPerformed(null); + } + } catch (Exception e) { + e.printStackTrace(); + } getFrame().setWaitingCursor(false); } @@ -1356,10 +1425,12 @@ this.mode = mode; } + //FIXME: Wrong as the actual controller is eventually not used (think of more than one map opened). protected MapModule getMapModule() { return getController().getMapModuleManager().getMapModule(); } + //FIXME: Wrong as the actual controller is eventually not used (think of more than one map opened). public MapAdapter getMap() { if (getMapModule() != null) { return (MapAdapter)getMapModule().getModel(); @@ -1368,6 +1439,10 @@ } } + public MindMapNode getRootNode(){ + return (MindMapNode) getMap().getRoot(); + } + public URL getResource (String name) { return getFrame().getResource(name); } @@ -1380,7 +1455,14 @@ return getController().getFrame(); } - private MapAdapter getModel() { + /** This was inserted by fc, 10.03.04 to enable all actions to refer to its controller easily.*/ + public ControllerAdapter getModeController() { + return this; + } + + // fc, 29.2.2004: there is no sense in having this private and the controller public, + // because the getController().getModel() method is available anyway. + public MapAdapter getModel() { return (MapAdapter)getController().getModel(); } @@ -1392,8 +1474,27 @@ getController().getMapModuleManager().updateMapModuleName(); } - private NodeAdapter getSelected() { - return (NodeAdapter)getView().getSelected().getModel(); + /* *********************************************************** + * Helper methods + * ***********************************************************/ + public NodeAdapter getNodeFromID(String nodeID) { + NodeAdapter node = + (NodeAdapter) getMap().getLinkRegistry().getTargetForID(nodeID); + if(node == null) { + throw new IllegalArgumentException("Node belonging to the node id "+ nodeID + " not found."); + } + return node; + } + public String getNodeID(MindMapNode selected) { + getMap().getLinkRegistry().registerLinkTarget(selected); + return getMap().getLinkRegistry().getLabel(selected); + } + + + public MindMapNode getSelected() { + if(getView() != null && getView().getSelected()!=null) + return (MindMapNode)getView().getSelected().getModel(); + return null; } public boolean extendSelection(MouseEvent e) { @@ -1443,33 +1544,94 @@ return retValue; } - private void select( NodeView node) { + public void select( NodeView node) { + getView().scrollNodeToVisible(node); getView().selectAsTheOnlyOneSelected(node); getView().setSiblingMaxLevel(node.getModel().getNodeLevel()); // this level is default } - //////////// - // Actions - /////////// - - protected class NewMapAction extends AbstractAction { - ControllerAdapter c; - public NewMapAction(ControllerAdapter controller) { - super(getText("new"), new ImageIcon(getResource("images/New24.gif"))); - c = controller; - //Workaround to get the images loaded in jar file. - //they have to be added to jar manually with full path from root - //I really don't like this, but it's a bug of java - } - public void actionPerformed(ActionEvent e) { - c.newMap(); + public void select( MindMapNode selected) { + // are they visible visible? + displayNode(selected); + select(selected.getViewer()); + } + + public void selectMultipleNodes(MindMapNode focussed, Collection selecteds) { + // are they visible visible? + for (Iterator i = selecteds.iterator(); i.hasNext();) { + MindMapNode node = (MindMapNode) i.next(); + displayNode(node); + } + // this one must be visible. + select(focussed); + for (Iterator i = selecteds.iterator(); i.hasNext();) { + MindMapNode node = (MindMapNode) i.next(); + getView().makeTheSelected(node.getViewer()); } + getController().obtainFocusForSelected(); // focus fix + } + + public void selectBranch(MindMapNode selected, boolean extend) { + displayNode(selected); + getView().selectBranch(selected.getViewer(), extend); } + + public void invokeHook(ModeControllerHook hook) { + hook.setController(this); + // initialize: + // the main invocation: + hook.startupMapHook(); + // and good bye. + hook.shutdownMapHook(); + } + + /** + * + */ + public void invokeHooksRecursively(NodeAdapter node, MindMap map) { + for(Iterator i = node.childrenUnfolded(); i.hasNext();) { + NodeAdapter child = (NodeAdapter) i.next(); + invokeHooksRecursively(child, map); + } + for(Iterator i = node.getHooks().iterator(); i.hasNext();) { + PermanentNodeHook hook = (PermanentNodeHook) i.next(); + hook.setController(this); + hook.setMap(map); + node.invokeHook(hook); + } + } + + + public NodeHook createNodeHook(String hookName, MindMapNode node, + MindMap map) { + HookFactory hookFactory = getFrame().getHookFactory(); + NodeHook hook = (NodeHook) hookFactory.createNodeHook(hookName); + hook.setController(this); + hook.setMap(map); + if (hook instanceof PermanentNodeHook) { + PermanentNodeHook permHook = (PermanentNodeHook) hook; + if(hookFactory.getInstanciationMethod(hookName).isSingleton()) { + // search for already instanciated hooks of this type: + PermanentNodeHook otherHook = hookFactory.getHookInNode(node, hookName); + if(otherHook != null) { + return otherHook; + } + } + node.addHook(permHook); + } + return hook; + } + + public void addHook(MindMapNode focussed, List selecteds, String hookName) { + nodeHookAction.addHook(focussed, selecteds, hookName); + } + + protected class OpenAction extends AbstractAction { ControllerAdapter mc; public OpenAction(ControllerAdapter modeController) { - super(getText("open"), new ImageIcon(getResource("images/Open24.gif"))); + super(getText("open"), new ImageIcon(getResource("images/fileopen.png"))); mc = modeController; } public void actionPerformed(ActionEvent e) { @@ -1481,7 +1643,7 @@ protected class SaveAction extends AbstractAction { ControllerAdapter mc; public SaveAction(ControllerAdapter modeController) { - super(getText("save"), new ImageIcon(getResource("images/Save24.gif"))); + super(getText("save"), new ImageIcon(getResource("images/filesave.png"))); mc = modeController; } public void actionPerformed(ActionEvent e) { @@ -1494,7 +1656,7 @@ protected class SaveAsAction extends AbstractAction { ControllerAdapter mc; public SaveAsAction(ControllerAdapter modeController) { - super(getText("save_as"), new ImageIcon(getResource("images/SaveAs24.gif"))); + super(getText("save_as"), new ImageIcon(getResource("images/filesaveas.png"))); mc = modeController; } public void actionPerformed(ActionEvent e) { @@ -1503,73 +1665,35 @@ } } - protected class FindAction extends AbstractAction { - public FindAction() { - super(getText("find")); } - public void actionPerformed(ActionEvent e) { - String what = JOptionPane.showInputDialog(getView().getSelected(), - getText("find_what")); - if (what == null || what.equals("")) { - return; } - boolean found = getView().getModel().find - (getView().getSelected().getModel(), what, /*caseSensitive=*/ false); - getView().repaint(); - if (!found) { - getController().informationMessage - (getText("no_found_from").replaceAll("\\$1",what). - replaceAll("\\$2", getView().getModel().getFindFromText()), - getView().getSelected()); }}} - - protected class FindNextAction extends AbstractAction { - public FindNextAction() { - super(getText("find_next")); } - public void actionPerformed(ActionEvent e) { - String what = getView().getModel().getFindWhat(); - if (what == null) { - getController().informationMessage(getText("no_previous_find"), getView().getSelected()); - return; } - boolean found = getView().getModel().findNext(); - getView().repaint(); - if (!found) { - getController().informationMessage - (getText("no_more_found_from").replaceAll("\\$1",what). - replaceAll("\\$2", getView().getModel().getFindFromText()), - getView().getSelected()); }}} - - protected class GotoLinkNodeAction extends AbstractAction { - MindMapNode source; - public GotoLinkNodeAction(String text, MindMapNode source) { - super("", new ImageIcon(getResource("images/Link.png"))); - // only display a reasonable part of the string. the rest is available via the short description (tooltip). - String adaptedText = new String(text); - adaptedText = adaptedText.replaceAll("", ""); - if(adaptedText.length() > 40) - adaptedText = adaptedText.substring(0,40) + " ..."; - putValue(Action.NAME, getText("follow_link") + adaptedText ); - putValue(Action.SHORT_DESCRIPTION, text); - this.source = source; - } + protected class ModeControllerHookAction extends AbstractAction { + String hookName; + ModeController controller; + public ModeControllerHookAction(String hookName, ModeController controller) { + super(hookName); + this.hookName = hookName; + this.controller = controller; + } - public void actionPerformed(ActionEvent e) { - getMap().displayNode(source, null); - } - } + public void actionPerformed(ActionEvent arg0) { + HookFactory hookFactory = getFrame().getHookFactory(); + // two different invocation methods:single or selecteds + ModeControllerHook hook = hookFactory.createModeControllerHook(hookName); + hook.setController(controller); + invokeHook(hook); + } + + } - // - // Node editing - // + public String marshall(XmlAction action) { + return getController().marshall(action); + } - protected class EditAction extends AbstractAction { - public EditAction() { - super(getText("edit")); - } - public void actionPerformed(ActionEvent e) { - edit(null, false, false); - } - } + public XmlAction unMarshall(String inputString) { + return getController().unMarshall(inputString); + } - protected class EditLongAction extends AbstractAction { + protected class EditLongAction extends AbstractAction { public EditLongAction() { super(getText("edit_long_node")); } @@ -1578,124 +1702,6 @@ } } - // old model of inserting node - protected class NewChildWithoutFocusAction extends AbstractAction { - public NewChildWithoutFocusAction() { - super(getText("new_node")); - } - public void actionPerformed(ActionEvent e) { - addNew(getView().getSelected(), NEW_CHILD_WITHOUT_FOCUS, null); - } - } - - // new model of inserting node - protected class NewSiblingAction extends AbstractAction { - public NewSiblingAction() { - super(getText("new_sibling_behind")); - } - public void actionPerformed(ActionEvent e) { - addNew(getView().getSelected(), NEW_SIBLING_BEHIND, null); - } - } - - protected class NewChildAction extends AbstractAction { - public NewChildAction() { - super(getText("new_child")); - } - public void actionPerformed(ActionEvent e) { - addNew(getView().getSelected(), NEW_CHILD, null); - } - } - - protected class NewPreviousSiblingAction extends AbstractAction { - public NewPreviousSiblingAction() { - super(getText("new_sibling_before")); - } - public void actionPerformed(ActionEvent e) { - addNew(getView().getSelected(), NEW_SIBLING_BEFORE, null); - } - } - - - protected class RemoveAction extends AbstractAction { - public RemoveAction() { - super(getText("remove_node")); - } - public void actionPerformed(ActionEvent e) { - if (getMapModule() != null) { - getView().getModel().cut(); - getController().obtainFocusForSelected(); }}} - - protected class NodeUpAction extends AbstractAction { - public NodeUpAction() { - super(getText("node_up")); - } - public void actionPerformed(ActionEvent e) { - MindMapNode selected = getView().getSelected().getModel(); - if(!selected.isRoot()) { - MindMapNode parent = selected.getParentNode(); - int index = getModel().getIndexOfChild(parent, selected); - int newIndex = getModel().moveNodeTo(selected,parent,index, -1); - getModel().removeNodeFromParent(selected); - getModel().insertNodeInto(selected,parent,newIndex); -// int maxindex = parent.getChildCount(); // (PN) -// if(index - 1 <0) { -// getModel().insertNodeInto(selected,parent,maxindex, -1); -// } else { -// getModel().insertNodeInto(selected,parent,index - 1, -1); -// } - getModel().nodeStructureChanged(parent); - getView().selectAsTheOnlyOneSelected(selected.getViewer()); - - getController().obtainFocusForSelected(); // focus fix - } - } - } - - protected class NodeDownAction extends AbstractAction { - public NodeDownAction() { - super(getText("node_down")); - } - public void actionPerformed(ActionEvent e) { - MindMapNode selected = getView().getSelected().getModel(); - if(!selected.isRoot()) { - MindMapNode parent = selected.getParentNode(); - int index = getModel().getIndexOfChild(parent, selected); - int newIndex = getModel().moveNodeTo(selected,parent,index, 1); - getModel().removeNodeFromParent(selected); - getModel().insertNodeInto(selected,parent,newIndex); -// int maxindex = parent.getChildCount(); // (PN) -// if(index + 1 > maxindex) { -// getModel().insertNodeInto(selected,parent,0, 1); -// } else { -// getModel().insertNodeInto(selected,parent,index + 1, 1); -// } - getModel().nodeStructureChanged(parent); - getView().selectAsTheOnlyOneSelected(selected.getViewer()); - - getController().obtainFocusForSelected(); // focus fix - } - } - } - - protected class ToggleFoldedAction extends AbstractAction { - public ToggleFoldedAction() { - super(getText("toggle_folded")); - } - public void actionPerformed(ActionEvent e) { - toggleFolded(); - } - } - - protected class ToggleChildrenFoldedAction extends AbstractAction { - public ToggleChildrenFoldedAction() { - super(getText("toggle_children_folded")); - } - public void actionPerformed(ActionEvent e) { - toggleChildrenFolded(); - } - } - protected class SetLinkByFileChooserAction extends AbstractAction { public SetLinkByFileChooserAction() { super(getText("set_link_by_filechooser")); @@ -1715,16 +1721,6 @@ } } - protected class SetLinkByTextFieldAction extends AbstractAction { - public SetLinkByTextFieldAction() { - super(getText("set_link_by_textfield")); - } - public void actionPerformed(ActionEvent e) { - setLinkByTextField(); - } - } - - protected class FollowLinkAction extends AbstractAction { public FollowLinkAction() { super(getText("follow_link")); @@ -1734,47 +1730,6 @@ } } - protected class CopyAction extends AbstractAction { - public CopyAction(Object controller) { - super(getText("copy"), new ImageIcon(getResource("images/Copy24.gif"))); - setEnabled(false); - } - public void actionPerformed(ActionEvent e) { - if(getMapModule() != null) { - Transferable copy = getView().getModel().copy(); - if (copy != null) { - clipboard.setContents(copy,null); }}}} - - protected class CopySingleAction extends AbstractAction { - public CopySingleAction(Object controller) { - super(getText("copy_single")); - setEnabled(false); - } - public void actionPerformed(ActionEvent e) { - if(getMapModule() != null) { - Transferable copy = getView().getModel().copySingle(); - if (copy != null) { - clipboard.setContents(copy,null); }}}} - - protected class CutAction extends AbstractAction { - public CutAction(Object controller) { - super(getText("cut"), new ImageIcon(getResource("images/Cut24.gif"))); - setEnabled(false); - } - public void actionPerformed(ActionEvent e) { - if (getMapModule() != null) { - Transferable copy = getView().getModel().cut(); - if (copy != null) { - clipboard.setContents(copy,null); - getController().obtainFocusForSelected(); }}}} - - protected class PasteAction extends AbstractAction { - public PasteAction(Object controller) { - super(getText("paste"),new ImageIcon(getResource("images/Paste24.gif"))); - setEnabled(false); } - public void actionPerformed(ActionEvent e) { - if(clipboard != null) { - getModel().paste(clipboard.getContents(this), getView().getSelected().getModel()); }}} protected class FileOpener implements DropTargetListener { private boolean isDragAcceptable(DropTargetDragEvent event) { @@ -1846,26 +1801,85 @@ public void dropActionChanged (DropTargetDragEvent e) {} } - protected class EditCopyAction extends AbstractAction { - private JTextComponent textComponent; - public EditCopyAction(JTextComponent textComponent) { - super(getText("copy")); - this.textComponent = textComponent; } - public void actionPerformed(ActionEvent e) { - String selection = textComponent.getSelectedText(); - if (selection != null) { - clipboard.setContents(new StringSelection(selection),null); }}} - - private class EditPopupMenu extends JPopupMenu { - //private JTextComponent textComponent; - - public EditPopupMenu(JTextComponent textComponent) { - //this.textComponent = textComponent; - this.add(new EditCopyAction(textComponent)); + + /** + * @return + */ + public ObjectFactory getActionXmlFactory() { + return getController().getActionXmlFactory(); + } + + /** + * @return + */ + public Color getSelectionColor() { + return selectionColor; + } + + /** + * @return + */ + public Clipboard getClipboard() { + return clipboard; + } + + + /* (non-Javadoc) + * @see freemind.modes.ModeController#updatePopupMenu(freemind.controller.StructuredMenuHolder) + */ + public void updatePopupMenu(StructuredMenuHolder holder) { + } - } + /** + * + */ + + public void shutdownController() { + setAllActions(false); + } + /** + * + */ + + public void startupController() { + setAllActions(true); + if (getFrame().getView() != null) { + DropTarget dropTarget = new DropTarget(getFrame().getView(), + new FileOpener()); + } + } + /** + * + */ + /** + * @param node + * @param position + * @param newText + */ + public void splitNode(MindMapNode node, int caretPosition, String newText) { + //If there are children, they go to the node below + String futureText = newText != null ? newText : node.toString(); + + String newLowerContent = futureText.substring(caretPosition, futureText.length()); + String newUpperContent = futureText.substring(0,caretPosition); + + setNodeText(node, newLowerContent); + + MindMapNode parent = node.getParentNode(); + MindMapNode upperNode = addNewNode(parent, parent.getChildPosition(node), parent.isLeft()); + upperNode.setColor(node.getColor()); + upperNode.setFont(node.getFont()); + setNodeText(upperNode, newUpperContent); + + } + public void moveNodePosition(MindMapNode node, int vGap, int hGap, + int shiftY) { + moveNodeAction.moveNodeTo(node, vGap, hGap, shiftY); + } + + } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/EdgeAdapter.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/EdgeAdapter.java --- freemind-0.7.1/freemind/freemind/modes/EdgeAdapter.java 2003-11-16 22:15:15.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/EdgeAdapter.java 2005-06-14 21:38:07.000000000 +0100 @@ -1,44 +1,63 @@ -/*FreeMind - A Program for creating and viewing Mindmaps - *Copyright (C) 2000-2001 Joerg Mueller - *See COPYING for Details - * - *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. +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2001 Joerg Mueller See COPYING for Details + * + * 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. */ -/*$Id: EdgeAdapter.java,v 1.14 2003/11/16 22:15:15 christianfoltin Exp $*/ +/* $Id: EdgeAdapter.java,v 1.14.18.3 2005/06/14 20:38:07 christianfoltin Exp $ */ package freemind.modes; -import freemind.main.FreeMindMain; -import freemind.main.Tools; +import java.awt.BasicStroke; import java.awt.Color; import java.awt.Stroke; -import java.awt.BasicStroke; + +import freemind.controller.Controller; +import freemind.main.FreeMind; +import freemind.main.FreeMindMain; +import freemind.main.Tools; +import freemind.main.XMLElement; public abstract class EdgeAdapter extends LineAdapter implements MindMapEdge { - public static final int WIDTH_PARENT = -1; - public static final int WIDTH_THIN = 0; - public EdgeAdapter(MindMapNode target,FreeMindMain frame) { - this(target, frame, "standardedgecolor", "standardedgestyle"); + private static Color standardColor = null; + private static String standardStyle = null; + private static LineAdapterListener listener = null; + + public static final int WIDTH_PARENT = -1; + + public static final int WIDTH_THIN = 0; + + private static Color standardEdgeColor = new Color(0); + + public EdgeAdapter(MindMapNode target, FreeMindMain frame) { + this(target, frame, FreeMind.RESOURCES_EDGE_COLOR, FreeMind.RESOURCES_EDGE_STYLE); } - /** For derived classes.*/ - protected EdgeAdapter(MindMapNode target,FreeMindMain frame, String standardColorPropertyString, String standardStylePropertyString) { - super(target, frame, standardColorPropertyString, standardStylePropertyString); + /** For derived classes. */ + protected EdgeAdapter(MindMapNode target, FreeMindMain frame, + String standardColorPropertyString, + String standardStylePropertyString) { + super(target, frame, standardColorPropertyString, + standardStylePropertyString); NORMAL_WIDTH = WIDTH_PARENT; + if(listener == null) { + listener = new LineAdapterListener(); + Controller.addPropertyChangeListener(listener); + } } // @@ -46,30 +65,33 @@ // public Color getColor() { - if(color==null) { + if (color == null) { if (getTarget().isRoot()) { - String stdcolor = getFrame().getProperty(standardColorPropertyString); - if (stdcolor.length() == 7) { - return Tools.xmlToColor(stdcolor); - } - return Color.blue; + return getStandardColor(); } return getSource().getEdge().getColor(); } return color; } + public Color getRealColor() { + return color; + } + public int getWidth() { - if (width==WIDTH_PARENT) { + if (width == WIDTH_PARENT) { if (getTarget().isRoot()) { - return WIDTH_THIN; } - return getSource().getEdge().getWidth(); } - return width; } + return WIDTH_THIN; + } + return getSource().getEdge().getWidth(); + } + return width; + } public Stroke getStroke() { - if (width==WIDTH_THIN) + if (width == WIDTH_THIN) return null; - if(stroke==null) { + if (stroke == null) { if (getTarget().isRoot()) { return null; } @@ -77,14 +99,20 @@ } return stroke; } - + public void setWidth(int width) { this.width = width; - stroke = ((width==WIDTH_PARENT) || (width==WIDTH_THIN)) ? null : - new BasicStroke(getWidth(),BasicStroke.CAP_BUTT,BasicStroke.JOIN_MITER); } + stroke = ((width == WIDTH_PARENT) || (width == WIDTH_THIN)) ? null + : new BasicStroke(getWidth(), BasicStroke.CAP_BUTT, + BasicStroke.JOIN_MITER); + } + + public int getRealWidth() { + return width; + } public String getStyle() { - if(style==null) { + if (style == null) { if (getTarget().isRoot()) { return getFrame().getProperty(standardStylePropertyString); } @@ -100,4 +128,38 @@ private MindMapNode getSource() { return target.getParentNode(); } + + public XMLElement save() { + if (style != null || color != null || width != WIDTH_PARENT) { + XMLElement edge = new XMLElement(); + edge.setName("edge"); + + if (style != null) { + edge.setAttribute("STYLE", style); + } + if (color != null) { + edge.setAttribute("COLOR", Tools.colorToXml(color)); + } + if (width != WIDTH_PARENT) { + if (width == WIDTH_THIN) + edge.setAttribute("WIDTH", "thin"); + else + edge.setAttribute("WIDTH", Integer.toString(width)); + } + return edge; + } + return null; + } + protected Color getStandardColor() { + return standardColor; + } + protected void setStandardColor(Color standardColor) { + EdgeAdapter.standardColor = standardColor; + } + protected String getStandardStyle() { + return standardStyle; + } + protected void setStandardStyle(String standardStyle) { + EdgeAdapter.standardStyle = standardStyle; + } } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/filemode/FileController.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/filemode/FileController.java --- freemind-0.7.1/freemind/freemind/modes/filemode/FileController.java 2003-11-03 11:00:13.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/filemode/FileController.java 2005-06-15 21:13:48.000000000 +0100 @@ -16,25 +16,31 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: FileController.java,v 1.11 2003/11/03 11:00:13 sviles Exp $*/ +/*$Id: FileController.java,v 1.11.18.4 2005/06/15 20:13:48 christianfoltin Exp $*/ package freemind.modes.filemode; -import freemind.modes.Mode; -import freemind.modes.MindMap; +import java.awt.event.ActionEvent; +import java.io.File; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.JOptionPane; +import javax.swing.JPopupMenu; + +import freemind.controller.MenuBar; +import freemind.controller.StructuredMenuHolder; +import freemind.modes.ControllerAdapter; import freemind.modes.MapAdapter; +import freemind.modes.MindMap; import freemind.modes.MindMapNode; -import freemind.modes.ControllerAdapter; -import java.io.File; -import java.awt.event.ActionEvent; -import javax.swing.*; +import freemind.modes.Mode; +import freemind.modes.actions.NewMapAction; public class FileController extends ControllerAdapter { - Action find = new FindAction(); - Action findNext = new FindNextAction(); - Action newMap = new NewMapAction(this); + Action newMap = new NewMapAction(this, this); Action center = new CenterAction(); Action openPath = new OpenPathAction(); @@ -49,19 +55,9 @@ return new FileMapModel(getFrame()); } - public MindMapNode newNode() { - File newNode = new File(((FileNodeModel)getSelected()).getFile(),"new_Directory"); - newNode.mkdir(); - return new FileNodeModel(newNode,getFrame()); + public MindMapNode newNode(Object userObject) { + return new FileNodeModel((File) userObject, getFrame()); } - - public JMenu getEditMenu() { - JMenu editMenu = new JMenu(); - add(editMenu, find, "keystroke_find"); - add(editMenu, findNext, "keystroke_find_next"); - add(editMenu, openPath); - return editMenu; } - public JPopupMenu getPopupMenu() { return this.popupmenu; } @@ -70,18 +66,11 @@ // Private // - private MindMap getModel() { - return (MindMap)getController().getModel(); - } +// private MindMap getModel() { +// return (MindMap)getController().getModel(); +// } - private MindMapNode getSelected() { - if (getView() != null) { - return (MindMapNode)getView().getSelected().getModel(); - } else { - return null; - } - } - + private class CenterAction extends AbstractAction { CenterAction() { super(getController().getResourceString("center")); @@ -111,4 +100,15 @@ } } + /* (non-Javadoc) + * @see freemind.modes.ModeController#updateMenus(freemind.controller.StructuredMenuHolder) + */ + public void updateMenus(StructuredMenuHolder holder) { + add(holder, MenuBar.EDIT_MENU+"/find", find, "keystroke_find"); + add(holder, MenuBar.EDIT_MENU+"/findNext", findNext, "keystroke_find_next"); + add(holder, MenuBar.EDIT_MENU+"/openPath", openPath, null); + } + + + } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/filemode/FileMapModel.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/filemode/FileMapModel.java --- freemind-0.7.1/freemind/freemind/modes/filemode/FileMapModel.java 2003-11-03 11:00:13.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/filemode/FileMapModel.java 2005-06-15 21:13:48.000000000 +0100 @@ -16,29 +16,42 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: FileMapModel.java,v 1.7 2003/11/03 11:00:13 sviles Exp $*/ +/*$Id: FileMapModel.java,v 1.7.18.4 2005/06/15 20:13:48 christianfoltin Exp $*/ package freemind.modes.filemode; import freemind.main.FreeMindMain; +import freemind.modes.LinkRegistryAdapter; +import freemind.modes.MindMapLinkRegistry; import freemind.modes.MindMapNode; import freemind.modes.MapAdapter; import java.io.File; +import java.io.IOException; +import java.io.Writer; public class FileMapModel extends MapAdapter { + private LinkRegistryAdapter linkRegistry; + // // Constructors // public FileMapModel(FreeMindMain frame) { - super(frame); - setRoot(new FileNodeModel(new File(File.separator), getFrame())); + this(new File(File.separator), frame); } public FileMapModel( File root , FreeMindMain frame) { - super(frame); - setRoot(new FileNodeModel(root,getFrame())); + super(frame); + setRoot(new FileNodeModel(root,getFrame())); + linkRegistry = new LinkRegistryAdapter(); + } + + // + // Other methods + // + public MindMapLinkRegistry getLinkRegistry() { + return linkRegistry; } // @@ -48,6 +61,15 @@ return true; } + /** + * + */ + + public void destroy() { + /* fc, 8.8.2004: don't call super.destroy as this method tries to remove the hooks recursively. + * This must fail. */ + //super.destroy(); + } public void load(File file) { } @@ -72,6 +94,23 @@ // nodeChanged(node); } + + /* (non-Javadoc) + * @see freemind.modes.MindMap#setLinkInclinationChanged() + */ + public void setLinkInclinationChanged() { + } + + /* (non-Javadoc) + * @see freemind.modes.MindMap#getXml(java.io.Writer) + */ + public void getXml(Writer fileout) throws IOException { + // nothing. + //FIXME: Implement me if you need me. + throw new RuntimeException("Unimplemented method called."); + } + + } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/filemode/FileMode.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/filemode/FileMode.java --- freemind-0.7.1/freemind/freemind/modes/filemode/FileMode.java 2003-11-03 11:00:13.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/filemode/FileMode.java 2004-10-18 00:00:12.000000000 +0100 @@ -16,13 +16,14 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: FileMode.java,v 1.14 2003/11/03 11:00:13 sviles Exp $*/ +/*$Id: FileMode.java,v 1.14.18.1 2004/10/17 23:00:12 dpolivaev Exp $*/ package freemind.modes.filemode; import freemind.modes.Mode; import freemind.modes.ModeController; import freemind.controller.Controller; +import freemind.controller.StructuredMenuHolder; import javax.swing.JMenu; import javax.swing.JToolBar; @@ -54,15 +55,12 @@ * (updates Actions etc.) */ public void activate() { - if (!isRunning) { - getModeController().newMap(); - isRunning = true; - } else { + if (!isRunning) { + getModeController().newMap(); + isRunning = true; + } else { c.getMapModuleManager().changeToMapOfMode(this); - } - // menu.add( ((FileController)getModeController()).center ); -// getController().cut.setEnabled(false); -// getController().paste.setEnabled(false); + } } public void restore(String restoreable) { @@ -80,10 +78,6 @@ return null; } - public JMenu getModeEditMenu() { - return ((FileController)getModeController()).getEditMenu(); - } - public JToolBar getModeToolBar() { return toolbar; } @@ -91,4 +85,5 @@ public JToolBar getLeftToolBar() { return null; } + } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/filemode/FileNodeModel.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/filemode/FileNodeModel.java --- freemind-0.7.1/freemind/freemind/modes/filemode/FileNodeModel.java 2003-11-03 11:00:13.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/filemode/FileNodeModel.java 2005-06-15 21:13:48.000000000 +0100 @@ -16,7 +16,7 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: FileNodeModel.java,v 1.11 2003/11/03 11:00:13 sviles Exp $*/ +/*$Id: FileNodeModel.java,v 1.11.18.1 2005/06/15 20:13:48 christianfoltin Exp $*/ package freemind.modes.filemode; @@ -28,6 +28,7 @@ import freemind.main.FreeMindMain; import freemind.modes.MindMapNode; +import freemind.modes.ModeController; import freemind.modes.NodeAdapter; @@ -52,14 +53,15 @@ //Overwritten get Methods public String getStyle() { - // This condition shows the code is not quite logical: - // ordinary file should not be considered folded and - // therefore the clause !isLeaf() should not be necessary. - if (isFolded()) { // && !isLeaf()) { - return MindMapNode.STYLE_BUBBLE; - } else { return MindMapNode.STYLE_FORK; - } + // // This condition shows the code is not quite logical: + // // ordinary file should not be considered folded and + // // therefore the clause !isLeaf() should not be necessary. + // if (isFolded()) { // && !isLeaf()) { + // return MindMapNode.STYLE_BUBBLE; + // } else { + // return MindMapNode.STYLE_FORK; + // } } /* if (file.isFile()) { diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/HistoryInformation.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/HistoryInformation.java --- freemind-0.7.1/freemind/freemind/modes/HistoryInformation.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/HistoryInformation.java 2005-07-06 07:00:03.000000000 +0100 @@ -0,0 +1,65 @@ +/*FreeMind - A Program for creating and viewing Mindmaps + *Copyright (C) 2000-2005 Joerg Mueller, Daniel Polansky, Christian Foltin and others. + * + *See COPYING for Details + * + *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. + * + * Created on 05.07.2005 + */ +/*$Id: HistoryInformation.java,v 1.1.2.1 2005/07/06 06:00:03 christianfoltin Exp $*/ +package freemind.modes; + +import java.util.Date; + +/** + * Here, the creation and modification times of objects (by now, only for + * nodes) are stored. + * + * The storage as longs is preferred as they are normally inlined by the Java + * compiler. + * + * @author foltin + * + */ +public class HistoryInformation { + long createdAt=0l; + long lastModifiedAt=0l; + + /** + * Initializes to today. + */ + public HistoryInformation() { + long now = new Date().getTime(); + createdAt = now; + lastModifiedAt = now; + } + public HistoryInformation(Date createdAt, Date lastModifiedAt) { + this.createdAt = createdAt.getTime(); + this.lastModifiedAt = lastModifiedAt.getTime(); + } + public Date getCreatedAt() { + return new Date(createdAt); + } + public Date getLastModifiedAt() { + return new Date(lastModifiedAt); + } + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt.getTime(); + } + public void setLastModifiedAt(Date lastModifiedAt) { + this.lastModifiedAt = lastModifiedAt.getTime(); + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/LineAdapter.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/LineAdapter.java --- freemind-0.7.1/freemind/freemind/modes/LineAdapter.java 2003-11-29 17:12:33.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/LineAdapter.java 2005-06-14 21:38:07.000000000 +0100 @@ -16,15 +16,17 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: LineAdapter.java,v 1.2 2003/11/29 17:12:33 christianfoltin Exp $*/ +/*$Id: LineAdapter.java,v 1.2.18.2 2005/06/14 20:38:07 christianfoltin Exp $*/ package freemind.modes; -import freemind.main.FreeMindMain; -import freemind.main.Tools; +import java.awt.BasicStroke; import java.awt.Color; import java.awt.Stroke; -import java.awt.BasicStroke; + +import freemind.main.FreeMindMain; +import freemind.main.Tools; +import freemind.preferences.FreemindPropertyListener; public abstract class LineAdapter implements MindMapLine { @@ -52,6 +54,7 @@ this.standardStylePropertyString = standardStylePropertyString; width = DEFAULT_WIDTH; stroke = null; + updateStandards(); } @@ -59,17 +62,37 @@ // Attributes // + /** + * @param standardColorPropertyString + */ + protected void updateStandards() { + if (getStandardColor() == null) { + String stdColor = getFrame().getProperty( + standardColorPropertyString); + if (stdColor != null && stdColor.length() == 7) { + setStandardColor(Tools.xmlToColor(stdColor)); + } else { + setStandardColor(Color.RED); + } + } + if (getStandardStyle() == null) { + String stdStyle = getFrame().getProperty( + standardStylePropertyString); + if (stdStyle != null ) { + setStandardStyle(stdStyle); + } else { +// setStandardStyle(Style.RED); + } + } + } + public FreeMindMain getFrame() { return frame; } public Color getColor() { if(color==null) { - String stdcolor = getFrame().getProperty(standardColorPropertyString); - if (stdcolor != null && stdcolor.length() == 7) { - return Tools.xmlToColor(stdcolor); - } - return Color.red; + return getStandardColor(); } return color; } @@ -96,7 +119,7 @@ public String getStyle() { if(style==null) { - return getFrame().getProperty(standardStylePropertyString); + return getStandardStyle(); } return style; } @@ -132,6 +155,29 @@ return null; } } + /** As this color is static but used in at least three different + * objects (edges, clouds and links), the abstract mechanism was chosen. + * The derived classes set and get the static instance variable. */ + protected abstract void setStandardColor(Color standardColor); + + /** See @see setStandardColor + */ + protected abstract Color getStandardColor(); + + protected abstract void setStandardStyle(String standardStyle); + protected abstract String getStandardStyle() ; + + protected class LineAdapterListener implements FreemindPropertyListener { + public void propertyChanged(String propertyName, + String newValue, String oldValue) { + if (propertyName.equals(standardColorPropertyString)) { + setStandardColor(Tools.xmlToColor(newValue)); + } + if (propertyName.equals(standardStylePropertyString)) { + setStandardStyle(newValue); + } + } + } } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/LinkAdapter.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/LinkAdapter.java --- freemind-0.7.1/freemind/freemind/modes/LinkAdapter.java 2003-11-29 17:12:33.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/LinkAdapter.java 2005-06-14 21:38:07.000000000 +0100 @@ -16,20 +16,30 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: LinkAdapter.java,v 1.3 2003/11/29 17:12:33 christianfoltin Exp $*/ +/*$Id: LinkAdapter.java,v 1.3.18.2 2005/06/14 20:38:07 christianfoltin Exp $*/ package freemind.modes; +import java.awt.Color; + +import freemind.controller.Controller; import freemind.modes.LineAdapter; +import freemind.modes.LineAdapter.LineAdapterListener; +import freemind.main.FreeMind; import freemind.main.FreeMindMain; public abstract class LinkAdapter extends LineAdapter implements MindMapLink { + private static Color standardColor = null; + private static String standardStyle = null; + private static LineAdapterListener listener = null; + String destinationLabel; String referenceText; MindMapNode source; + private String uniqueID; public LinkAdapter(MindMapNode source,MindMapNode target,FreeMindMain frame) { - this(source,target, frame, "standardlinkcolor", "standardlinkstyle"); + this(source,target, frame, FreeMind.RESOURCES_LINK_COLOR, "standardlinkstyle"); } /** For derived classes.*/ @@ -38,6 +48,10 @@ this.source=source; destinationLabel = null; referenceText = null; + if(listener == null) { + listener = new LineAdapterListener(); + Controller.addPropertyChangeListener(listener); + } } public String getDestinationLabel() { return destinationLabel; } @@ -57,4 +71,28 @@ // } + /** + * @return Returns the uniqueID. + */ + public String getUniqueID() { + return uniqueID; + } + /** + * @param uniqueID The uniqueID to set. + */ + public void setUniqueID(String uniqueID) { + this.uniqueID = uniqueID; + } + protected Color getStandardColor() { + return standardColor; + } + protected void setStandardColor(Color standardColor) { + LinkAdapter.standardColor = standardColor; + } + protected String getStandardStyle() { + return standardStyle; + } + protected void setStandardStyle(String standardStyle) { + LinkAdapter.standardStyle = standardStyle; + } } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/LinkRegistryAdapter.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/LinkRegistryAdapter.java --- freemind-0.7.1/freemind/freemind/modes/LinkRegistryAdapter.java 2003-12-22 11:14:52.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/LinkRegistryAdapter.java 2005-04-28 22:12:34.000000000 +0100 @@ -16,19 +16,18 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: LinkRegistryAdapter.java,v 1.10 2003/12/22 11:14:52 christianfoltin Exp $*/ +/*$Id: LinkRegistryAdapter.java,v 1.10.18.3 2005/04/28 21:12:34 christianfoltin Exp $*/ package freemind.modes; -import freemind.modes.MindMapNode; -import freemind.modes.mindmapmode.MindMapNodeModel; -import freemind.modes.mindmapmode.MindMapArrowLinkModel; -import java.util.HashMap; -import java.util.Random; -import java.util.Vector; import java.util.Collection; +import java.util.HashMap; import java.util.Iterator; import java.util.ListIterator; +import java.util.Random; +import java.util.Vector; + +import freemind.modes.mindmapmode.MindMapNodeModel; @@ -86,11 +85,14 @@ protected HashMap /* MindMapNode = Target -> ID_BasicState. */ TargetToID; protected HashMap /* id -> vector of links whose TargetToID.get(target) == id.*/ IDToLinks; protected HashMap /* id -> vector of links whose TargetToID.get(target) == id and who are cutted recently.*/ IDToCuttedLinks; + protected HashMap /* id -> link */ IDToLink; /** The map the registry belongs to.*/ // protected MindMap map; // Logging: for applets the logging must be anonymously. This will be generalized later. fc, 22.12.2003. private static java.util.logging.Logger logger = java.util.logging.Logger.getAnonymousLogger(); //getLogger("freemind.modes.LinkRegistryAdapter"); + // bug fix from Dimitri. + protected static Random ran = new Random(); //////////////////////////////////////////////////////////////////////////////////////// //// Methods ///// @@ -100,17 +102,22 @@ TargetToID = new HashMap(); IDToLinks = new HashMap(); IDToCuttedLinks = new HashMap(); + IDToLink = new HashMap(); logger.setLevel(java.util.logging.Level.WARNING); //logger.setLevel(java.util.logging.Level.FINEST); logger.info("New Registry"); }; - protected String generateUniqueID(String proposedID) { - Random ran = new Random(); + public String generateUniqueID(String proposedID) { + return generateID(proposedID, IDToLinks, "Freemind_Link_"); + } + + public String generateUniqueLinkID(String proposedID) { + return generateID(proposedID, IDToLink, "Freemind_Arrow_Link_"); + }; + + private String generateID(String proposedID, HashMap hashMap, String prefix) { String myProposedID = new String((proposedID != null)?proposedID:""); - /* The under score is to enable the id to be an ID in the sense of XML/DTD.*/ - if(!myProposedID.startsWith("_")) - myProposedID = "_" + myProposedID; String returnValue; do { if(!myProposedID.equals("")) { @@ -120,13 +127,14 @@ myProposedID=""; } else { /* The prefix is to enable the id to be an ID in the sense of XML/DTD.*/ - returnValue = "Freemind_Link_" + Integer.toString(ran.nextInt(2000000000)); + returnValue = prefix + Integer.toString(ran.nextInt(2000000000)); } - } while (IDToLinks.containsKey(returnValue)); + } while (hashMap.containsKey(returnValue)); return returnValue; }; + /** The main method. Registeres a node with a new (or an existing) node-id. If the state of the id is pending, then it is set to registered again. @@ -160,14 +168,6 @@ return new ID_BlankAdapter(); }; - protected String getIDString(MindMapNode node) { - if(TargetToID.containsKey(node)) { - ID_BasicState state = (ID_BasicState) TargetToID.get(node); - return state.getID(); - } - return null; - } - public MindMapNode getTargetForID(String ID){ for(Iterator i = TargetToID.keySet().iterator(); i.hasNext();) { @@ -209,6 +209,7 @@ // throw new java.lang.IllegalArgumentException("Cannot remove a link target, if there are sources pointing to."); logger.info("Deregister target node:"+target); TargetToID.remove(target); + IDToLinks.remove(state.getID()); } } @@ -229,6 +230,14 @@ return; } vec.add(link); + if(IDToLink.containsKey(link.getUniqueID())) { + if(IDToLink.get(link.getUniqueID()) != link) { + logger.warning("link with duplicated unique id found:" +link); + // new id: + ((LinkAdapter) link).setUniqueID(generateUniqueLinkID(link.getUniqueID())); + } + } + IDToLink.put(link.getUniqueID(), link); logger.info("Register link ("+link+") from source node:"+source+" to target " + target); }; @@ -246,8 +255,18 @@ logger.info("Deregister link ("+link+") from source node:"+source+" to target " + target); } } + IDToLink.remove(link.getUniqueID()); }; + public MindMapLink getLinkForID(String ID) { + if(IDToLink.containsKey(ID)) { + return (MindMapLink) IDToLink.get(ID); + } + return null; + } + + + /** Returns a Vector of Nodes that point to the given target node.*/ public Vector /* of MindMapNode s */ getAllSources(MindMapNode target) { Vector returnValue; @@ -313,7 +332,7 @@ ID_BasicState state = getState(target); if(state instanceof ID_Registered) { // there is a registered target id. - String id = getIDString(target); + String id = getLabel(target); // create new vector to the links: Vector vec; if(IDToCuttedLinks.containsKey(id) ) { @@ -367,5 +386,4 @@ return vec; } - } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/MapAdapter.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/MapAdapter.java --- freemind-0.7.1/freemind/freemind/modes/MapAdapter.java 2004-01-28 20:09:27.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/MapAdapter.java 2005-07-18 21:46:44.000000000 +0100 @@ -16,30 +16,37 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: MapAdapter.java,v 1.24 2004/01/28 20:09:27 christianfoltin Exp $*/ +/*$Id: MapAdapter.java,v 1.24.14.9 2005/07/18 20:46:44 christianfoltin Exp $*/ package freemind.modes; -import freemind.main.FreeMindMain; -import freemind.main.Tools; -import freemind.main.XMLParseException; -import freemind.modes.StylePattern; -import freemind.view.mindmapview.NodeView; -import freemind.controller.MindMapNodesSelection; - -import java.net.URL; -import java.net.MalformedURLException; import java.awt.Color; -import javax.swing.tree.TreeNode; +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.Writer; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.logging.Logger; + +import javax.swing.event.EventListenerList; +import javax.swing.event.TreeModelEvent; +import javax.swing.event.TreeModelListener; import javax.swing.tree.MutableTreeNode; +import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; -import javax.swing.event.TreeModelListener; -import javax.swing.event.TreeModelEvent; -import javax.swing.event.EventListenerList; -// Clipboard -import java.awt.datatransfer.*; -import java.io.*; -import java.util.*; + +import freemind.controller.MindMapNodesSelection; +import freemind.extensions.PermanentNodeHook; +import freemind.main.FreeMind; +import freemind.main.FreeMindMain; +import freemind.main.Tools; +import freemind.main.XMLParseException; public abstract class MapAdapter implements MindMap { @@ -51,17 +58,15 @@ private Color backgroundColor; private File file; private FreeMindMain frame; + static protected Logger logger; - // For find next - private String findWhat; - private MindMapNode findFromNode; - private boolean findCaseSensitive; - private LinkedList findNodeQueue; - private ArrayList findNodesUnfoldedByLastFind; public MapAdapter (FreeMindMain frame) { - this.frame = frame; + this.frame = frame; + if(logger == null) { + logger = frame.getLogger(this.getClass().getName()); + } } // @@ -86,13 +91,30 @@ public void destroy() { // Do all the necessary destructions in your model, // e.g. remove file locks. + // and remove all hooks: + removeHooks((MindMapNode) getRoot()); } // (PN) // public void close() { // } - public FreeMindMain getFrame() { + /** + * @param node + */ + private void removeHooks(MindMapNode node) { + while(node.getHooks().size()>0) { + PermanentNodeHook hook = (PermanentNodeHook) node.getHooks().get(0); + node.removeHook(hook); + } + // and all children: + for(Iterator i= node.childrenUnfolded(); i.hasNext();) { + MindMapNode child = (MindMapNode) i.next(); + removeHooks(child); + } + } + + public FreeMindMain getFrame() { return frame; } @@ -108,6 +130,9 @@ return readOnly; } + /** Counts the amount of actions performed. + * @param saved true if the file was saved recently. False otherwise. + */ protected void setSaved(boolean saved) { if(saved) changesPerformedSinceLastSave = 0; @@ -119,17 +144,9 @@ return changesPerformedSinceLastSave; } - public String getFindWhat() { - return findWhat; - } - - public String getFindFromText() { - return findFromNode.toString(); - } - public Color getBackgroundColor() { if (backgroundColor==null) { - return Tools.xmlToColor(getFrame().getProperty("standardbackgroundcolor")); + return Tools.xmlToColor(getFrame().getProperty(FreeMind.RESOURCES_BACKGROUND_COLOR)); } return backgroundColor; } @@ -167,38 +184,17 @@ } protected String getText(String textId) { - String result; - try { - result = getFrame().getResources().getString(textId); } - catch (Exception e) { - return textId; } - return result; } - + return getFrame().getResourceString(textId); + } // // Node editing // - public void setFolded( MindMapNode node, boolean folded ) { - if (node.isFolded() != folded) { - node.setFolded(folded); - getFrame().getView().selectAsTheOnlyOneSelected(node.getViewer()); - fireTreeStructureChanged(this, getPathToRoot(node), null, null); }} - public void setLink( NodeAdapter node, String link ) { - node.setLink(link); - nodeChanged(node); - } - - public String getLink( NodeAdapter node ) { - return node.getLink(); - } - public Object[] getPathToRoot( TreeNode node ) { return ( ((MindMapNode)node).getPath() ).getPath();//Create Object[] from TreePath } - public void splitNode(MindMapNode node, int caretPosition, String newText) {} - // // cut'n'paste // @@ -209,23 +205,6 @@ return t; } - public final Transferable cut() { - Transferable t = copy(); - // clear all recently cutted links from the registry: - getLinkRegistry().clearCuttedNodeBuffer(); - - // sort selectedNodes list by depth, in order to guarantee that sons are deleted first: - LinkedList sortedNodes = getFrame().getView().getSelectedsByDepth(); - for(Iterator i = sortedNodes.iterator();i.hasNext();) { - MindMapNode selectedNode = ((NodeView)i.next()).getModel(); - getLinkRegistry().cutNode(selectedNode); - try { - removeNodeFromParent(selectedNode); - } catch(IllegalArgumentException e) { - System.err.println("Error occured during cut. The application was not able to cut the node " + selectedNode + "."); - } - } - return t; } public Transferable copy(MindMapNode node) { return null; @@ -240,7 +219,7 @@ selectedNodes.add(selectedNode.shallowCopy()); return copy(selectedNodes, selectedNode.toString()); } - private Transferable copy(ArrayList selectedNodes, String inPlainText) { + public Transferable copy(List selectedNodes, String inPlainText) { try { String forNodesFlavor = ""; boolean firstLoop = true; @@ -251,14 +230,12 @@ else { forNodesFlavor += ""; } - // v This is not a smart solution. While copy() handles multiple flavors, - // copy(node) handles only string flavor, but with the meaning of nodes flavor. - // It does no harm apart from being not very nice and confusing. - forNodesFlavor += copy(tmpNode).getTransferData(DataFlavor.stringFlavor); } + forNodesFlavor += copy(tmpNode).getTransferData(MindMapNodesSelection.mindMapNodesFlavor); + } String plainText = inPlainText != null ? inPlainText : getAsPlainText(selectedNodes); return new MindMapNodesSelection - (forNodesFlavor, plainText, getAsRTF(selectedNodes), ""); } + (forNodesFlavor, plainText, getAsRTF(selectedNodes), null, null, null); } //return new StringSelection(forClipboard); } @@ -273,31 +250,11 @@ public String getAsRTF(List mindMapNodes) { return ""; } - public void paste(Transferable t, MindMapNode parent) { - boolean isLeft = false; - if(parent.isLeft()!= null) - isLeft = parent.isLeft().getValue(); - paste(t, /*target=*/parent, /*asSibling=*/ false, isLeft); } - - public void paste(Transferable t, MindMapNode target, boolean asSibling, boolean isLeft) { - if (t != null) { - // In MapAdapter it does basically nothing. - nodeStructureChanged(asSibling ? target.getParent() : target); - } - } - - public void paste(MindMapNode node, MindMapNode parent) { - if (node != null) { - insertNodeInto(node, parent); - nodeStructureChanged(parent); - } - } public String getRestoreable() { return null; } - public MindMapLinkRegistry getLinkRegistry() { return null; } @@ -318,12 +275,15 @@ // The default position is after the last node if (asSibling) { - MindMapNode oldpa = parent.getParentNode(); - //insertNodeInto(node, parent, parent.getChildPosition(target)); //} - oldpa.insert(newChild, oldpa.getChildPosition(parent)); } // parent.getRealChildCount()); } - // } + MindMapNode oldpa = parent.getParentNode(); + oldpa.insert(newChild, oldpa.getChildPosition(parent)); + recursiveCallAddChildren(oldpa, newChild); + } else { - parent.insert(newChild, parent.getChildCount()); } + parent.insert(newChild, parent.getChildCount()); + recursiveCallAddChildren(parent, newChild); + } + } public void insertNodeInto(MindMapNode newChild, @@ -332,6 +292,14 @@ insertNodeInto(newChild, parent, parent.getChildCount()); } + public void insertNodeInto( + MindMapNode newChild, + MindMapNode parent, + int index) { + insertNodeInto((MutableTreeNode) newChild, (MutableTreeNode) parent, index); + recursiveCallAddChildren(parent, newChild); + } + /** * Use this method to add children because it will cause the appropriate event. */ @@ -344,75 +312,25 @@ // an exception otherwise. } - /** - * The direction is used if side left and right are present. then the next suitable place on the same side# - is searched. if there is no such place, then the side is changed. - @return returns the new index. - */ - public int moveNodeTo(MindMapNode newChild, MindMapNode parent, int index, int direction){ - int newIndex = index; - if(newChild.isLeft() != null) { - boolean iAmLeft = newChild.isLeft().getValue(); - int maxIndex = parent.getChildCount(); - Vector sortedNodes = new Vector(); - Vector sortedNodesIndices = new Vector(); - // definition of leftRightBoundary: all elements with index >= leftRightBoundary are right. - int leftRightBoundary=0; - // sort the nodes according to their direction and position: - // and find myself: - Tools.IntHolder myPositionInVector=null; - for(int i = 0 ; i < maxIndex; ++i) { - TreeNode nextItem = parent.getChildAt(i); - if(!(nextItem instanceof MindMapNode)){ - System.err.println("Strange error I in method insertNodeInto of MapAdapter."); - return newIndex; - } - MindMapNode nextNode = (MindMapNode) nextItem; - if(nextNode.isLeft() != null && nextNode.isLeft().getValue() == true){ - // left - sortedNodes.add (leftRightBoundary, nextNode); - sortedNodesIndices.add(leftRightBoundary, new Tools.IntHolder(i)); - leftRightBoundary++; - if(i == index) - myPositionInVector = (Tools.IntHolder) sortedNodesIndices.get(leftRightBoundary-1); - } else { - // right - sortedNodes.add(nextNode); // at the end. - sortedNodesIndices.add(new Tools.IntHolder(i)); // at the end. - if(i == index) - myPositionInVector = (Tools.IntHolder) sortedNodesIndices.get(sortedNodesIndices.size()-1); + /**URGENT: This method must be moved to the ControllerAdapter. + * @param node + */ + private void recursiveCallAddChildren(MindMapNode node, MindMapNode addedChild) { + // Tell any node hooks that the node is added: + if(node instanceof MindMapNode) { + for(Iterator i= ((MindMapNode)node).getActivatedHooks().iterator(); i.hasNext();) { + PermanentNodeHook hook = (PermanentNodeHook) i.next(); + if (addedChild.getParentNode() == node) { + hook.onAddChild(addedChild); } - } - if(myPositionInVector == null){ - System.err.println("Strange error II in method insertNodeInto of MapAdapter."); - return newIndex; - } - int oldPositionInVector = sortedNodesIndices.indexOf(myPositionInVector); - int newPositionInVector = oldPositionInVector + direction; - boolean passedFrontiers=false; - if(newPositionInVector < 0) { - newPositionInVector = sortedNodesIndices.size()-1; - passedFrontiers = true; - } - if(newPositionInVector >= sortedNodesIndices.size()) { - newPositionInVector = 0; - passedFrontiers = true; - } - newIndex = ((Tools.IntHolder) sortedNodesIndices.get(newPositionInVector)).getValue(); - // test if frontiers passed: - if(((newPositionInVector >= leftRightBoundary) && oldPositionInVector < leftRightBoundary) || - ((newPositionInVector < leftRightBoundary) && oldPositionInVector >= leftRightBoundary)) { - newPositionInVector = oldPositionInVector; - passedFrontiers = true; - } - if(passedFrontiers) { - // flip: - newChild.setLeft(!iAmLeft); - } - } - return newIndex; - } + hook.onAddChildren(addedChild); + } + } + if(!node.isRoot() && node.getParentNode()!= null) + recursiveCallAddChildren(node.getParentNode(), addedChild); + } + /** * Joerg: Message this to remove node from its parent. This will message * nodesWereRemoved to create the appropriate event. This is the @@ -437,10 +355,10 @@ removedArray[0] = node; nodesWereRemoved(parent, childIndex, removedArray); }} - public void changeNode(MindMapNode node, String newText) { - node.setUserObject(newText); - nodeChanged(node); - } +// public void changeNode(MindMapNode node, String newText) { +// node.setUserObject(newText); +// nodeChanged(node); +// } // // Interface TreeModel @@ -474,133 +392,6 @@ ( (MutableTreeNode)path.getLastPathComponent() ).setUserObject( newValue ); } - public void applyPattern(NodeAdapter node, StylePattern pattern) { - applyPattern(node, pattern, true /* = visible */); - } - - protected void applyPattern(NodeAdapter node, StylePattern pattern, boolean visible) { - if (pattern.getAppliesToNode()) { - if (pattern.getText() != null) { - node.setUserObject(pattern.getText()); } - node.setColor(pattern.getNodeColor()); - node.setStyle(pattern.getNodeStyle()); - if (pattern.getAppliesToNodeIcon()) { - if (pattern.getNodeIcon() == null) { - while (node.removeLastIcon()>0) {}} - else { - node.addIcon(pattern.getNodeIcon()); }} // fc, 28.9.2003 - if (pattern.getAppliesToNodeFont()) { - node.setFont(pattern.getNodeFont()); - node.estabilishOwnFont(); }} - - if (pattern.getAppliesToEdge()) { - EdgeAdapter edge = (EdgeAdapter)node.getEdge(); - edge.setColor(pattern.getEdgeColor()); - edge.setStyle(pattern.getEdgeStyle()); - edge.setWidth(pattern.getEdgeWidth()); - } - - if(pattern.getAppliesToChildren()) { - for (ListIterator i = node.childrenUnfolded(); i.hasNext(); ) { - NodeAdapter child = (NodeAdapter) i.next(); - applyPattern(child, pattern.getChildrenStylePattern(), (visible)?(!node.isFolded()):false); - } - } - if(visible) - nodeChanged(node); - } - - // find - - public boolean find(MindMapNode node, String what, boolean caseSensitive) { - findNodesUnfoldedByLastFind = new ArrayList(); - LinkedList nodes = new LinkedList(); - nodes.addFirst(node); - findFromNode = node; - if (!caseSensitive) { - what = what.toLowerCase(); } - return find(nodes, what, caseSensitive); } - - public boolean findNext() { - // Precodition: findWhat != null. We check the precodition but give no message. - - // The logic of find next is vulnerable. find next relies on the queue - // of nodes from previous find / find next. However, between previous - // find / find next and this find next, nodes could have been deleted - // or moved. The logic expects that no changes happened, even that no - // node has been folded / unfolded. - - // You may want to come with more correct solution, but this one - // works for most uses, and does not cause any big trouble except - // perhaps for some uncaught exceptions. As a result, it is not very - // nice, but far from critical and working quite fine. - - if (findWhat != null) { - return find(findNodeQueue, findWhat, findCaseSensitive); } - return false; } - - private boolean find(LinkedList /*queue of MindMapNode*/ nodes, String what, boolean caseSensitive) { - // Precondition: if !caseSensitive then >>what<< is in lowercase. - - // Fold the path of previously found node - boolean thereWereNodesToBeFolded = !findNodesUnfoldedByLastFind.isEmpty(); - if (!findNodesUnfoldedByLastFind.isEmpty()) { - - //if (false) { - ListIterator i = findNodesUnfoldedByLastFind.listIterator - (findNodesUnfoldedByLastFind.size()); - while (i.hasPrevious()) { - MindMapNode node = (MindMapNode)i.previous(); - try { - setFolded(node, true); } - catch (Exception e) {}} - findNodesUnfoldedByLastFind = new ArrayList(); } - - // We implement width-first search. - while (!nodes.isEmpty()) { - MindMapNode node = (MindMapNode)nodes.removeFirst(); - // Add children to the queue - for (ListIterator i = node.childrenUnfolded(); i.hasNext(); ) { - nodes.addLast(i.next()); } - - String nodeText = caseSensitive ? - node.toString() : node.toString().toLowerCase(); - if (nodeText.indexOf(what) >= 0) { // Found - displayNode(node, findNodesUnfoldedByLastFind); - - // Save the state for find next - findWhat = what; - findCaseSensitive = caseSensitive; - findNodeQueue = nodes; - - return true; }} - - if (thereWereNodesToBeFolded) { - getFrame().getView().centerNode(findFromNode.getViewer()); } - else { - getFrame().getView().scrollNodeToVisible(findFromNode.getViewer()); } - getFrame().getView().selectAsTheOnlyOneSelected(findFromNode.getViewer()); - frame.getController().obtainFocusForSelected(); - - return false; } - - public void displayNode(MindMapNode node, ArrayList NodesUnfoldedByDisplay) { - // Unfold the path to the node - Object[] path = getPathToRoot(node); - // Iterate the path with the exception of the last node - for (int i = 0; i < path.length - 1; i++) { - MindMapNode nodeOnPath = (MindMapNode)path[i]; - //System.out.println(nodeOnPath); - if (nodeOnPath.isFolded()) { - if(findNodesUnfoldedByLastFind != null) - findNodesUnfoldedByLastFind.add(nodeOnPath); - setFolded(nodeOnPath, false); }} - - // Select the node and scroll to it. - getFrame().getView().centerNode(node.getViewer()); - getFrame().getView().selectAsTheOnlyOneSelected(node.getViewer()); - frame.getController().obtainFocusForSelected(); - } // // API for updating the view. @@ -652,39 +443,37 @@ // /** - * Invoke this method after you've changed how node is to be - * represented in the tree. + * This method should not be called directly! */ - protected void nodeChanged(TreeNode node) { + public void nodeChanged(TreeNode node) { + frame.getController().getMode().getModeController().nodeChanged((MindMapNode)node); + } - // Tell the mode controller that the node was changed, for the case - // he is interested. - frame.getController().getMode().getModeController().nodeChanged((MindMapNode)node); - - if (treeModelListeners != null && node != null) { - TreeNode parent = node.getParent(); - - if (parent != null) { - int anIndex = parent.getIndex(node); - if (anIndex != -1) { - int[] cIndexs = new int[1]; + public void nodeChangedMapInternal(TreeNode node) { + if (treeModelListeners != null && node != null) { + TreeNode parent = node.getParent(); + + if (parent != null) { + int anIndex = parent.getIndex(node); + if (anIndex != -1) { + int[] cIndexs = new int[1]; + + cIndexs[0] = anIndex; + nodesChanged(parent, cIndexs); + } + } + else if (((MindMapNode)node).isRoot()) { + nodesChanged(node, null); + } + } + } - cIndexs[0] = anIndex; - nodesChanged(parent, cIndexs); - } - } - else if (((MindMapNode)node).isRoot()) { - nodesChanged(node, null); - } - } - } - /** + /** * Invoke this method after you've changed how the children identified by * childIndicies are to be represented in the tree. */ protected void nodesChanged(TreeNode node, int[] childIndices) { - setSaved(false); if (node != null) { if (childIndices != null) { @@ -693,9 +482,11 @@ if (cCount > 0) { Object[] cChildren = new Object[cCount]; - for(int counter = 0; counter < cCount; counter++) + for(int counter = 0; counter < cCount; counter++) { cChildren[counter] = node.getChildAt (childIndices[counter]); + logger.finest("Children array at "+counter+" = "+ cChildren[counter]); + } fireTreeNodesChanged(this, getPathToRoot(node), childIndices, cChildren); } } @@ -835,76 +626,6 @@ } } } -} - - - - - - +} -// private void setFont(NodeModel node, String font) { -// node.setFont(font); -// nodeStructureChanged(node); -// } - -// private void setFontSize(NodeModel node, int fontSize) { -// node.setFontSize(fontSize); -// nodeStructureChanged(node); -// } - -// private void setUnderlined(NodeModel node) { -// if (isUnderlined(node)) { -// node.setUnderlined(false); -// } else { -// node.setUnderlined(true); -// } -// nodeChanged(node); -// } - -// private void setNormalFont(NodeModel node) { -// node.setItalic(false); -// node.setBold(false); -// node.setUnderlined(false); -// nodeChanged(node); -// } - -// private void setBold(NodeModel node) { -// if (isBold(node)) { -// node.setBold(false); -// } else { -// node.setBold(true); -// } -// nodeChanged(node); -// } - -// private void setItalic(NodeModel node) { -// if (isItalic(node)) { -// node.setItalic(false); -// } else { -// node.setItalic(true); -// } -// nodeChanged(node); -// } - -// private void setEdgeStyle(NodeModel node, String style) { -// EdgeModel edge = (EdgeModel)node.getEdge(); -// edge.setStyle(style); -// nodeStructureChanged(node); -// } - -// private void setNodeStyle(NodeModel node, String style) { -// node.setStyle(style); -// nodeStructureChanged(node); -// } - -// private void setNodeColor(NodeModel node, Color color) { -// node.setColor(color); -// nodeChanged(node); -// } - -// private void setEdgeColor(NodeModel node, Color color) { -// ((EdgeModel)node.getEdge()).setColor(color); -// nodeChanged(node); -// } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/MindIcon.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/MindIcon.java --- freemind-0.7.1/freemind/freemind/modes/MindIcon.java 2003-11-03 11:02:44.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/MindIcon.java 2005-05-03 06:29:50.000000000 +0100 @@ -16,16 +16,16 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: MindIcon.java,v 1.1 2003/11/03 11:02:44 sviles Exp $*/ +/*$Id: MindIcon.java,v 1.1.18.5 2005/05/03 05:29:50 christianfoltin Exp $*/ package freemind.modes; -import java.util.*; -import java.io.*; import java.net.URL; -import javax.swing.Icon; +import java.util.HashMap; +import java.util.Vector; + import javax.swing.ImageIcon; -/* for resources:*/ + import freemind.main.FreeMindMain; /** @@ -35,11 +35,19 @@ public class MindIcon { private String name; private String description; - private Icon associatedIcon; + /** + * Stores the once created ImageIcon. + */ + private ImageIcon associatedIcon; private static Vector mAllIconNames; - private static Icon iconNotFound; + private static ImageIcon iconNotFound; + /** + * Set of all created icons. Name -> MindIcon + */ + private static HashMap createdIcons = new HashMap(); + - public MindIcon(String name) { + private MindIcon(String name) { setName(name); associatedIcon=null; } @@ -91,21 +99,23 @@ * @return Value of description. */ public String getDescription(FreeMindMain frame) { - /* GRRR: doubled code from controller: */ String resource = new String("icon_"+getName()); - try { - return frame.getResources().getString(resource); } - catch (Exception ex) { - System.err.println("Warning - resource string not found:"+resource); - return getName(); - } + return frame.getResourceString(resource); } public String getIconFileName() { - return "images/icons/"+getName()+".png"; + return getIconsPath()+getIconBaseFileName(); } - public Icon getIcon(FreeMindMain frame) { + public String getIconBaseFileName() { + return getName()+".png"; + } + + public static String getIconsPath() { + return "images/icons/"; + } + + public ImageIcon getIcon(FreeMindMain frame) { // We need the frame to be able to obtain the resource URL of the icon. if (iconNotFound == null) { iconNotFound = new ImageIcon(frame.getResource("images/IconNotFound.png")); } @@ -114,7 +124,7 @@ return associatedIcon; if ( name != null ) { URL imageURL = frame.getResource(getIconFileName()); - Icon icon = imageURL == null ? iconNotFound : new ImageIcon(imageURL); + ImageIcon icon = imageURL == null ? iconNotFound : new ImageIcon(imageURL); setIcon(icon); return icon; } else { @@ -125,7 +135,7 @@ * Set the value of icon. * @param v Value to assign to icon. */ - protected void setIcon(Icon _associatedIcon) { + protected void setIcon(ImageIcon _associatedIcon) { this.associatedIcon = _associatedIcon; } public static Vector getAllIconNames () { @@ -137,6 +147,13 @@ mAllIconNames.add("idea"); mAllIconNames.add("button_ok"); mAllIconNames.add("button_cancel"); + mAllIconNames.add("full-1"); + mAllIconNames.add("full-2"); + mAllIconNames.add("full-3"); + mAllIconNames.add("full-4"); + mAllIconNames.add("full-5"); + mAllIconNames.add("full-6"); + mAllIconNames.add("full-7"); mAllIconNames.add("back"); mAllIconNames.add("forward"); mAllIconNames.add("attach"); @@ -161,4 +178,12 @@ return mAllIconNames; } + public static MindIcon factory(String iconName){ + if(createdIcons.containsKey(iconName)){ + return (MindIcon) createdIcons.get(iconName); + } + MindIcon icon = new MindIcon(iconName); + createdIcons.put(iconName, icon); + return icon; + } } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/MindMapArrowLink.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/MindMapArrowLink.java --- freemind-0.7.1/freemind/freemind/modes/MindMapArrowLink.java 2003-12-07 21:00:20.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/MindMapArrowLink.java 2004-10-28 06:24:53.000000000 +0100 @@ -16,14 +16,14 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: MindMapArrowLink.java,v 1.2 2003/12/07 21:00:20 christianfoltin Exp $*/ +/*$Id: MindMapArrowLink.java,v 1.2.18.2 2004/10/28 05:24:53 christianfoltin Exp $*/ package freemind.modes; -import freemind.modes.MindMapLink; -import freemind.modes.MindMapNode; import java.awt.Point; +import freemind.main.XMLElement; + public interface MindMapArrowLink extends MindMapLink { // public Color getColor(); @@ -37,9 +37,21 @@ /* for arrows: */ public Point getStartInclination(); // the zero is the start point of the line; public Point getEndInclination(); // the zero is the end point of the line; - /** the type of the start arrow: currently "None" and "Default". */ + public void setStartInclination(Point startInclination); + public void setEndInclination(Point endInclination); + /** the type of the start arrow: currently "None" and "Default". */ public String getStartArrow(); /** the type of the end arrow: currently "None" and "Default". */ public String getEndArrow(); + /** + * @param originX + * @param originY + * @param deltaX + * @param deltaY + */ + public void changeInclination(int originX, int originY, int deltaX, int deltaY); + public void showControlPoints(boolean bShowControlPointsFlag); + public boolean getShowControlPointsFlag(); + public XMLElement save(); } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/MindMapCloud.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/MindMapCloud.java --- freemind-0.7.1/freemind/freemind/modes/MindMapCloud.java 2003-11-09 22:09:26.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/MindMapCloud.java 2004-10-28 06:24:53.000000000 +0100 @@ -16,14 +16,13 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: MindMapCloud.java,v 1.1 2003/11/09 22:09:26 christianfoltin Exp $*/ +/*$Id: MindMapCloud.java,v 1.1.16.2 2004/10/28 05:24:53 christianfoltin Exp $*/ package freemind.modes; -import freemind.modes.MindMapLine; -import freemind.modes.MindMapNode; import java.awt.Color; -import java.awt.Stroke; + +import freemind.main.XMLElement; public interface MindMapCloud extends MindMapLine { @@ -34,4 +33,19 @@ // public String toString(); /** Describes the color of the exterior of the cloud. Normally, this color is derived from the interior color. */ public Color getExteriorColor(); + /** gets iterative level which is required for painting and layout. + * + * Cloud iterative level is kept in CloudAdapter object. + * It is automatically calculated during the first call + * of this Method (delayed initialisation). + * */ + public int getIterativeLevel(); + + /** changes the iterative level. + * + * When some parent node gets or loses its cloud, + * it should call this Method, + * with deltaLevel equal to 1 or -1.*/ + public void changeIterativeLevel(int deltaLevel); + public XMLElement save(); } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/MindMapEdge.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/MindMapEdge.java --- freemind-0.7.1/freemind/freemind/modes/MindMapEdge.java 2003-11-09 22:09:26.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/MindMapEdge.java 2004-10-28 06:24:53.000000000 +0100 @@ -16,13 +16,11 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: MindMapEdge.java,v 1.9 2003/11/09 22:09:26 christianfoltin Exp $*/ +/*$Id: MindMapEdge.java,v 1.9.18.1 2004/10/28 05:24:53 christianfoltin Exp $*/ package freemind.modes; -import freemind.modes.MindMapLine; -import java.awt.Color; -import java.awt.Stroke; +import freemind.main.XMLElement; public interface MindMapEdge extends MindMapLine { @@ -32,4 +30,5 @@ // public int getWidth(); // public String toString(); // public void setTarget(MindMapNode node); + public XMLElement save(); } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/MindMap.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/MindMap.java --- freemind-0.7.1/freemind/freemind/modes/MindMap.java 2004-01-17 23:20:58.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/MindMap.java 2005-07-18 21:46:44.000000000 +0100 @@ -16,53 +16,57 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: MindMap.java,v 1.14 2004/01/17 23:20:58 christianfoltin Exp $*/ +/*$Id: MindMap.java,v 1.14.14.7 2005/07/18 20:46:44 christianfoltin Exp $*/ package freemind.modes; +import java.awt.Color; +import java.awt.datatransfer.Transferable; import java.io.File; -import java.net.URL; +import java.io.IOException; +import java.io.Writer; import java.net.MalformedURLException; -import java.awt.Color; +import java.net.URL; import java.util.List; -import java.util.ArrayList; + import javax.swing.tree.TreeModel; import javax.swing.tree.TreeNode; -import freemind.modes.MindMapLinkRegistry; -// Clipboard -import java.awt.datatransfer.Transferable; public interface MindMap extends TreeModel { - void changeNode(MindMapNode node, String newText); +// void changeNode(MindMapNode node, String newText); + //nodeChanged has moved to the modeController. (fc, 2.5.2004) + void nodeChanged(TreeNode node); Transferable cut(MindMapNode node); Transferable copy(MindMapNode node); // ^ Is copy with node really needed? It seems to me, that no. - Transferable cut(); Transferable copy(); - Transferable copySingle(); + Transferable copySingle(); + /** + * @param selectedNodes + * @param inPlainText typically this is null. AN alternative is node.toString(); if there is only one node. + * @return + */ + public Transferable copy(List selectedNodes, String inPlainText); String getAsPlainText(List mindMapNodes); String getAsRTF(List mindMapNodes); - void splitNode(MindMapNode node, int caretPosition, String newText); - - void paste(Transferable t, MindMapNode parent); - /** @param isLeft determines, whether or not the node is placed on the left or right. **/ - void paste(Transferable t, MindMapNode target, boolean asSibling, boolean isLeft); - + void insertNodeInto( + MindMapNode newChild, + MindMapNode parent, + int index); + +// void paste(Transferable t, MindMapNode parent); +// /** @param isLeft determines, whether or not the node is placed on the left or right. **/ +// void paste(Transferable t, MindMapNode target, boolean asSibling, boolean isLeft); +// // void paste(MindMapNode node, MindMapNode parent); - boolean find(MindMapNode node, String what, boolean caseSensitive); - boolean findNext(); - String getFindWhat(); - String getFindFromText(); - - /** Display a node in the display (used by find and the goto action by arrow link actions).*/ - void displayNode(MindMapNode node, ArrayList NodesUnfoldedByDisplay); + /** * Returns the file name of the map edited or null if not possible. @@ -73,6 +77,12 @@ * Return URL of the map (whether as local file or a web location) */ URL getURL() throws MalformedURLException; + + /** writes the content of the map to a writer. + * @param fileout + * @throws IOException + */ + void getXml(Writer fileout) throws IOException; /** * Returns a string that may be given to the modes restore() @@ -88,11 +98,11 @@ void setBackgroundColor(Color color); - void setFolded(MindMapNode node, boolean folded); /** @return returns the link registry associated with this mode, or null, if no registry is present.*/ MindMapLinkRegistry getLinkRegistry(); - + + /** * Destroy everything you have created upon opening. */ diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/MindMapLink.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/MindMapLink.java --- freemind-0.7.1/freemind/freemind/modes/MindMapLink.java 2003-11-29 17:12:33.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/MindMapLink.java 2004-10-18 00:00:08.000000000 +0100 @@ -16,7 +16,7 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: MindMapLink.java,v 1.3 2003/11/29 17:12:33 christianfoltin Exp $*/ +/*$Id: MindMapLink.java,v 1.3.18.1 2004/10/17 23:00:08 dpolivaev Exp $*/ package freemind.modes; @@ -39,6 +39,9 @@ MindMapNode getTarget(); MindMapNode getSource(); + /** The id is automatically set on creation. Is saved and restored. */ + String getUniqueID(); + // public Object clone(); } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/MindMapLinkRegistry.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/MindMapLinkRegistry.java --- freemind-0.7.1/freemind/freemind/modes/MindMapLinkRegistry.java 2003-11-29 17:12:33.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/MindMapLinkRegistry.java 2004-10-18 00:00:08.000000000 +0100 @@ -16,7 +16,7 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: MindMapLinkRegistry.java,v 1.6 2003/11/29 17:12:33 christianfoltin Exp $*/ +/*$Id: MindMapLinkRegistry.java,v 1.6.18.1 2004/10/17 23:00:08 dpolivaev Exp $*/ package freemind.modes; @@ -62,8 +62,14 @@ throws java.lang.IllegalArgumentException; public ID_BasicState getState(MindMapNode node); public String getLabel(MindMapNode target); + /** This can be used, if the id has to be known, before a node can be labled. */ + public String generateUniqueID(String proposedID); /** Reverses the getLabel method: searches for a node with the id given as the argument.*/ public MindMapNode getTargetForID(String ID); + /** This can be used, if the id has to be known, before a link can be labled. */ + public String generateUniqueLinkID(String proposedID); + /** Reverses the getUniqueID method: searches for a link with the id given as the argument.*/ + public MindMapLink getLinkForID(String ID); // /** Method to keep track of the targets associated to a target node. This method also sets the new id to the target. // Moreover, it is not required that the target node is already registered. This will be done on the fly.*/ /** Removes links to all nodes beginning from target with its children.*/ diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/mindmapmode/EncryptedMindMapNode.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/mindmapmode/EncryptedMindMapNode.java --- freemind-0.7.1/freemind/freemind/modes/mindmapmode/EncryptedMindMapNode.java 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/mindmapmode/EncryptedMindMapNode.java 2008-01-01 17:39:38.000000000 +0000 @@ -0,0 +1,446 @@ +/* + * FreeMind - A Program for creating and viewing Mindmaps Copyright (C) + * 2000-2001 Joerg Mueller See COPYING for Details + * + * 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. + */ +/* $Id: EncryptedMindMapNode.java,v 1.1.2.10.4.1 2008/01/01 17:39:38 dpolivaev Exp $ */ + +package freemind.modes.mindmapmode; + +import java.io.IOException; +import java.io.StringWriter; +import java.io.UnsupportedEncodingException; +import java.io.Writer; +import java.security.spec.AlgorithmParameterSpec; +import java.security.spec.KeySpec; +import java.util.Iterator; +import java.util.ListIterator; +import java.util.Vector; + +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.SecretKey; +import javax.crypto.SecretKeyFactory; +import javax.crypto.spec.PBEKeySpec; +import javax.crypto.spec.PBEParameterSpec; +import javax.swing.ImageIcon; + +import freemind.main.FreeMindMain; +import freemind.main.Tools; +import freemind.main.XMLElement; +import freemind.modes.ControllerAdapter; +import freemind.modes.MindIcon; +import freemind.modes.MindMapLinkRegistry; +import freemind.modes.MindMapNode; +import freemind.modes.actions.PasteAction; + +public class EncryptedMindMapNode extends MindMapNodeModel { + + private boolean isVisible = true; + + /** + * is only set to false by the load mechanism. + * If the node is generated or it is decrypted once, this is always true. + */ + private boolean isDecrypted = true; + + /** + * password have to be stored in a StringBuffer as Strings cannot be deleted + * or overwritten. + */ + private StringBuffer password = null; + + private String encryptedContent; + + private static ImageIcon encryptedIcon; + + private static ImageIcon decryptedIcon; + + private boolean isShuttingDown=false; + + /** + * @param userObject + * @param frame + */ + public EncryptedMindMapNode(Object userObject, FreeMindMain frame) { + super(userObject, frame); + if (encryptedIcon == null) { + encryptedIcon = MindIcon.factory("encrypted").getIcon(frame); + } + if (decryptedIcon == null) { + decryptedIcon = MindIcon.factory("decrypted").getIcon(frame); + } + updateIcon(); + } + + /** + * @param givenPassword + * @return true, if the password was correct. + */ + public boolean decrypt(StringBuffer givenPassword) { + if (!checkPassword(givenPassword)) { + return false; + } + if (!isDecrypted) { + String childXml = decryptXml(encryptedContent, password); + String[] childs = childXml.split(PasteAction.NODESEPARATOR); + // and now? paste it: + for (int i = childs.length-1; i >=0; i--) { + String string = childs[i]; + ((ControllerAdapter) getFrame().getController() + .getModeController()).paste.pasteXMLWithoutRedisplay( + string, this, false); + + } + isDecrypted = true; + } + setVisible(true); + setFolded(false); + return true; + } + + /** + * @param givenPassword + */ + public boolean checkPassword(StringBuffer givenPassword) { + + if (password != null) { + if (!equals(givenPassword, password)) { + logger.warning("Wrong password supplied (cached!=given)."); + return false; + } + return true; + } + // new password: + String decryptedNode = decryptXml(encryptedContent, givenPassword); + // FIXME: Better test needed. + if (decryptedNode == null || !decryptedNode.startsWith("=0) { + String saltString = str.substring(0, indexOfSaltIndicator); + str = str.substring(indexOfSaltIndicator+1); + salt = Tools.fromBase64(saltString); + } + // Decode base64 to get bytes + byte[] dec = Tools.fromBase64(str); + init(salt); + + // Decrypt + byte[] utf8 = dcipher.doFinal(dec); + + // Decode using utf-8 + return new String(utf8, "UTF8"); + } catch (javax.crypto.BadPaddingException e) { + } catch (IllegalBlockSizeException e) { + } catch (UnsupportedEncodingException e) { + } catch (java.io.IOException e) { + } + return null; + } + } +} \ No newline at end of file diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/mindmapmode/freemind_version_updater.xslt /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/mindmapmode/freemind_version_updater.xslt --- freemind-0.7.1/freemind/freemind/modes/mindmapmode/freemind_version_updater.xslt 1970-01-01 01:00:00.000000000 +0100 +++ freemind-0.8.1/freemind/freemind/modes/mindmapmode/freemind_version_updater.xslt 2008-01-02 21:51:36.000000000 +0000 @@ -0,0 +1,109 @@ + + + + + + + + + + + + 0710000080000108000100800100080020008003000800400080050008010000811000-1 + + + + + + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/mindmapmode/MindMapArrowLinkModel.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/mindmapmode/MindMapArrowLinkModel.java --- freemind-0.7.1/freemind/freemind/modes/mindmapmode/MindMapArrowLinkModel.java 2003-12-07 21:00:23.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/mindmapmode/MindMapArrowLinkModel.java 2005-01-10 07:29:07.000000000 +0000 @@ -16,7 +16,7 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: MindMapArrowLinkModel.java,v 1.5 2003/12/07 21:00:23 christianfoltin Exp $*/ +/*$Id: MindMapArrowLinkModel.java,v 1.5.18.4 2005/01/10 07:29:07 christianfoltin Exp $*/ package freemind.modes.mindmapmode; @@ -25,8 +25,10 @@ import freemind.modes.ArrowLinkAdapter; import freemind.main.Tools; import java.awt.Color; +import java.awt.Point; import freemind.main.XMLElement; +import freemind.view.mindmapview.NodeView; public class MindMapArrowLinkModel extends ArrowLinkAdapter { @@ -39,35 +41,58 @@ return super.clone(); } - public XMLElement save() { - XMLElement arrowLink = new XMLElement(); - arrowLink.setName("arrowlink"); - - if (style != null) { - arrowLink.setAttribute("style",style); - } - if (color != null) { - arrowLink.setAttribute("color",Tools.colorToXml(color)); - } - if(getDestinationLabel() != null) { - arrowLink.setAttribute("destination",getDestinationLabel()); - } - if(getReferenceText() != null) { - arrowLink.setAttribute("referenceText",getReferenceText()); + public String toString() { return "Source="+getSource()+", target="+getTarget()+", "+save().toString(); } + + /* (non-Javadoc) + * @see freemind.modes.MindMapArrowLink#changeInclination(int, int, int, int) + */ + public void changeInclination(int originX, int originY, int deltaX, int deltaY) { + NodeView targetNode = getTarget().getViewer(); + NodeView sourceNode = getSource().getViewer(); + double distSqToTarget = 0; + double distSqToSource = 0; + if(targetNode != null && sourceNode != null){ + Point targetLinkPoint = targetNode.getLinkPoint(getEndInclination()); + Point sourceLinkPoint = sourceNode.getLinkPoint(getStartInclination()); + distSqToTarget = targetLinkPoint.distanceSq(originX, originY); + distSqToSource = sourceLinkPoint.distanceSq(originX, originY); + } + if((targetNode == null || sourceNode != null) && distSqToSource < distSqToTarget * 2.25){ + Point changedInclination = getStartInclination(); + changeInclination(deltaX, deltaY, sourceNode, changedInclination); + setStartInclination(changedInclination); + } + + if((sourceNode == null || targetNode != null) && distSqToTarget < distSqToSource * 2.25){ + Point changedInclination = getEndInclination(); + changeInclination(deltaX, deltaY, targetNode, changedInclination); + setEndInclination(changedInclination); + } + + } + + private void changeInclination( + int deltaX, + int deltaY, + NodeView linkedNodeView, + Point changedInclination) { + if(linkedNodeView.isLeft() || linkedNodeView.isRoot()){ + deltaX = - deltaX; } - if(getStartInclination() != null) { - arrowLink.setAttribute("startInclination",getStartInclination().toString()); + changedInclination.translate(deltaX, deltaY); + if(changedInclination.x != 0 && Math.abs((double)changedInclination.y / changedInclination.x) < 0.015){ + changedInclination.y = 0; } - if(getEndInclination() != null) { - arrowLink.setAttribute("endInclination",getEndInclination().toString()); + double k = changedInclination.distance(0,0); + if(k < 10){ + if (k > 0){ + changedInclination.x = (int) (changedInclination.x * 10 / k); + changedInclination.y = (int) (changedInclination.y * 10 / k); + } + else{ + changedInclination.x = 10; + } } - if(getStartArrow() != null) - arrowLink.setAttribute("startArrow",(getStartArrow())); - if(getEndArrow() != null) - arrowLink.setAttribute("endArrow",(getEndArrow())); - return arrowLink; } - public String toString() { return "Source="+getSource()+", target="+getTarget()+", "+save().toString(); } - } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/mindmapmode/MindMapCloudModel.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/mindmapmode/MindMapCloudModel.java --- freemind-0.7.1/freemind/freemind/modes/mindmapmode/MindMapCloudModel.java 2003-11-09 22:09:26.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/mindmapmode/MindMapCloudModel.java 2004-10-28 06:24:54.000000000 +0100 @@ -16,7 +16,7 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: MindMapCloudModel.java,v 1.1 2003/11/09 22:09:26 christianfoltin Exp $*/ +/*$Id: MindMapCloudModel.java,v 1.1.18.1 2004/10/28 05:24:54 christianfoltin Exp $*/ package freemind.modes.mindmapmode; @@ -34,20 +34,4 @@ super(node,frame); } - public XMLElement save() { - XMLElement cloud = new XMLElement(); - cloud.setName("cloud"); - - if (style != null) { - cloud.setAttribute("style",style); - } - if (color != null) { - cloud.setAttribute("color",Tools.colorToXml(color)); - } - if(width != DEFAULT_WIDTH) { - cloud.setAttribute("width",Integer.toString(width)); - } - return cloud; - } - } diff -Nru /tmp/kZ808EjPBq/freemind-0.7.1/freemind/freemind/modes/mindmapmode/MindMapController.java /tmp/Offd2O1oj4/freemind-0.8.1/freemind/freemind/modes/mindmapmode/MindMapController.java --- freemind-0.7.1/freemind/freemind/modes/mindmapmode/MindMapController.java 2004-02-06 06:04:25.000000000 +0000 +++ freemind-0.8.1/freemind/freemind/modes/mindmapmode/MindMapController.java 2005-06-16 20:27:05.000000000 +0100 @@ -16,38 +16,74 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*$Id: MindMapController.java,v 1.35 2004/02/06 06:04:25 christianfoltin Exp $*/ +/*$Id: MindMapController.java,v 1.35.14.13 2005/06/16 19:27:05 christianfoltin Exp $*/ package freemind.modes.mindmapmode; +import java.awt.event.ActionEvent; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Constructor; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.Vector; +import java.util.logging.Logger; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.JFileChooser; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPopupMenu; +import javax.swing.JRadioButtonMenuItem; +import javax.swing.JToolBar; +import javax.swing.KeyStroke; +import javax.swing.filechooser.FileFilter; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; + +import freemind.common.JaxbTools; +import freemind.controller.MenuBar; +import freemind.controller.StructuredMenuHolder; +import freemind.controller.actions.generated.instance.MenuActionBase; +import freemind.controller.actions.generated.instance.MenuCategoryBase; +import freemind.controller.actions.generated.instance.MenuCheckedAction; +import freemind.controller.actions.generated.instance.MenuSeparator; +import freemind.controller.actions.generated.instance.MenuStructure; +import freemind.controller.actions.generated.instance.MenuSubmenu; +import freemind.extensions.HookFactory; +import freemind.extensions.HookRegistration; +import freemind.extensions.HookFactory.RegistrationContainer; import freemind.main.Tools; -import freemind.main.XMLParseException; -import freemind.modes.MindMapNode; -import freemind.modes.NodeAdapter; -import freemind.modes.Mode; import freemind.modes.ControllerAdapter; import freemind.modes.MapAdapter; -import freemind.modes.EdgeAdapter; -import freemind.modes.StylePattern; import freemind.modes.MindIcon; -import freemind.modes.MindMapCloud; -import freemind.modes.mindmapmode.MindMapArrowLinkModel; -import freemind.view.mindmapview.NodeView; -// link registry. -import freemind.modes.MindMapLinkRegistry; - -import java.io.*; -import java.util.*; -import java.util.HashSet; -import java.net.URL; -import java.net.MalformedURLException; -import java.awt.Color; -import java.awt.Component; -import java.awt.event.ActionEvent; -import java.awt.event.MouseEvent; -import javax.swing.*; -import javax.swing.filechooser.FileFilter; -import javax.swing.JRadioButtonMenuItem; +import freemind.modes.MindMap; +import freemind.modes.MindMapNode; +import freemind.modes.Mode; +import freemind.modes.ModeController; +import freemind.modes.NodeAdapter; +import freemind.modes.actions.ChangeArrowsInArrowLinkAction; +import freemind.modes.actions.ColorArrowLinkAction; +import freemind.modes.actions.FindAction; +import freemind.modes.actions.GotoLinkNodeAction; +import freemind.modes.actions.IconAction; +import freemind.modes.actions.ImportExplorerFavoritesAction; +import freemind.modes.actions.ImportFolderStructureAction; +import freemind.modes.actions.NewMapAction; +import freemind.modes.actions.NewPreviousSiblingAction; +import freemind.modes.actions.NewSiblingAction; +import freemind.modes.actions.NodeGeneralAction; +import freemind.modes.actions.NodeHookAction; +import freemind.modes.actions.RemoveArrowLinkAction; +import freemind.modes.actions.SingleNodeOperation; @@ -55,366 +91,338 @@ public class MindMapController extends ControllerAdapter { - // Mode mode; - private JPopupMenu popupmenu; + private static Logger logger; + private Vector hookActions; + /** Stores the menu items belonging to the given action. */ + private HashMap actionToMenuPositions; + // Mode mode; + private MindMapPopupMenu popupmenu; //private JToolBar toolbar; private MindMapToolBar toolbar; private boolean addAsChildMode = false; + public Action newMap = new NewMapAction(this, this); + public Action open = new OpenAction(this); + public Action save = new SaveAction(this); + public Action saveAs = new SaveAsAction(this); + public Action exportToHTML = new ExportToHTMLAction(this); + public Action exportBranchToHTML = new ExportBranchToHTMLAction(this); + + public Action editLong = new EditLongAction(); + public Action newSibling = new NewSiblingAction(this); + public Action newPreviousSibling = new NewPreviousSiblingAction(this); + public Action setLinkByFileChooser = new SetLinkByFileChooserAction(); + public Action setImageByFileChooser = new SetImageByFileChooserAction(); + public Action followLink = new FollowLinkAction(); + public Action exportBranch = new ExportBranchAction(); + public Action importBranch = new ImportBranchAction(); + public Action importLinkedBranch = new ImportLinkedBranchAction(); + public Action importLinkedBranchWithoutRoot = new ImportLinkedBranchWithoutRootAction(); - Action newMap = new NewMapAction(this); - Action open = new OpenAction(this); - Action save = new SaveAction(this); - Action saveAs = new SaveAsAction(this); - Action exportToHTML = new ExportToHTMLAction(this); - Action exportBranchToHTML = new ExportBranchToHTMLAction(this); - - Action edit = new EditAction(); - Action editLong = new EditLongAction(); - Action newChild = new NewChildAction(); - Action newChildWithoutFocus = new NewChildWithoutFocusAction(); - Action newSibling = new NewSiblingAction(); - Action newPreviousSibling = new NewPreviousSiblingAction(); - Action remove = new RemoveAction(); - Action toggleFolded = new ToggleFoldedAction(); - Action toggleChildrenFolded = new ToggleChildrenFoldedAction(); - Action setLinkByFileChooser = new SetLinkByFileChooserAction(); - Action setImageByFileChooser = new SetImageByFileChooserAction(); - Action setLinkByTextField = new SetLinkByTextFieldAction(); - Action followLink = new FollowLinkAction(); - Action exportBranch = new ExportBranchAction(); - Action importBranch = new ImportBranchAction(); - Action importLinkedBranch = new ImportLinkedBranchAction(); - Action importLinkedBranchWithoutRoot = new ImportLinkedBranchWithoutRootAction(); - Action importExplorerFavorites = new ImportExplorerFavoritesAction(); - Action importFolderStructure = new ImportFolderStructureAction(); - Action joinNodes = new JoinNodesAction(); - Action nodeUp = new NodeUpAction(); - Action nodeDown = new NodeDownAction(); - Action find = new FindAction(); - Action findNext = new FindNextAction(); - - Action fork = new ForkAction(); - Action bubble = new BubbleAction(); - Action nodeColor = new NodeColorAction(); - Action nodeColorBlend = new NodeGeneralAction ("blend_color", null, - new SingleNodeOperation() { public void apply(MindMapMapModel map, MindMapNodeModel node) { - map.blendNodeColor(node); }}); - Action edgeColor = new EdgeColorAction(); - Action edgeWidths[] = { - new EdgeWidthAction(EdgeAdapter.WIDTH_PARENT), - new EdgeWidthAction(EdgeAdapter.WIDTH_THIN), - new EdgeWidthAction(1), - new EdgeWidthAction(2), - new EdgeWidthAction(4), - new EdgeWidthAction(8) - }; - Action edgeStyles[] = { - new EdgeStyleAction("linear"), - new EdgeStyleAction("bezier"), - new EdgeStyleAction("sharp_linear"), - new EdgeStyleAction("sharp_bezier") - }; - Action cloudColor = new CloudColorAction(); - - Action italic = new NodeGeneralAction ("italic", "images/Italic24.gif", + public Action increaseNodeFont = new NodeGeneralAction (this, "increase_node_font_size", null, new SingleNodeOperation() { public void apply(MindMapMapModel map, MindMapNodeModel node) { - map.setItalic(node); }}); - Action bold = new NodeGeneralAction ("bold", "images/Bold24.gif", + increaseFontSize(node, 1); + }}); + public Action decreaseNodeFont = new NodeGeneralAction (this, "decrease_node_font_size", null, new SingleNodeOperation() { public void apply(MindMapMapModel map, MindMapNodeModel node) { - map.setBold(node); }}); - Action cloud = new NodeGeneralAction ("cloud", "images/Cloud24.gif", - new SingleNodeOperation() { private MindMapCloud lastCloud; - private MindMapNodeModel nodeOfLastCloud; - public void apply(MindMapMapModel map, MindMapNodeModel node) { - // store last color to enable if the node is switched on and off. - if(node.getCloud() != null) { - lastCloud = node.getCloud(); - nodeOfLastCloud = node; - } - map.setCloud(node); - // restore color: - if((node.getCloud() != null) && (node == nodeOfLastCloud)) { - node.setCloud(lastCloud); - } - - } - }); - Action normalFont = new NodeGeneralAction ("normal", "images/Normal24.gif", - new SingleNodeOperation() { public void apply(MindMapMapModel map, MindMapNodeModel node) { - map.setNormalFont(node); }}); - Action increaseNodeFont = new NodeGeneralAction ("increase_node_font_size", null, - new SingleNodeOperation() { public void apply(MindMapMapModel map, MindMapNodeModel node) { - map.increaseFontSize(node,1); }}); - Action decreaseNodeFont = new NodeGeneralAction ("decrease_node_font_size", null, - new SingleNodeOperation() { public void apply(MindMapMapModel map, MindMapNodeModel node) { - map.increaseFontSize(node,-1); }}); + increaseFontSize(node, -1); + }}); // Extension Actions - Action patterns[] = new Action[0]; // Make sure it is initialized - Vector iconActions = new Vector(); //fc - Action removeLastIcon = new NodeGeneralAction ("remove_last_icon", "images/remove.png", - new SingleNodeOperation() { public void apply(MindMapMapModel map, MindMapNodeModel node) { - map.removeLastIcon(node); }}); - Action removeAllIcons = new NodeGeneralAction ("remove_all_icons", "images/edittrash.png", - new SingleNodeOperation() { public void apply(MindMapMapModel map, MindMapNodeModel node) { - while(map.removeLastIcon(node)>0) {}; }}); + public Vector iconActions = new Vector(); //fc FileFilter filefilter = new MindMapFilter(); + private MenuStructure mMenuStructure; + private List pRegistrations; + public MindMapController(Mode mode) { super(mode); - try { - File patternsFile = getFrame().getPatternsFile(); - if (patternsFile != null && patternsFile.exists()) { - loadPatterns(patternsFile); } - else { - System.out.println("User patterns file "+patternsFile+" not found."); - loadPatterns(new InputStreamReader(getResource("patterns.xml").openStream())); }} - catch (XMLParseException e) { - System.err.println("In patterns:"+e); } - catch (Exception ex) { - System.err.println("Patterns not loaded:"+ex); } + if(logger == null) { + logger = getFrame().getLogger(this.getClass().getName()); + } + logger.info("createIconActions"); // icon actions: createIconActions(); + logger.info("createNodeHookActions"); + //node hook actions: + createNodeHookActions(); + + logger.info("mindmap_menus"); + // load menus: + try { + InputStream in; + in = this.getFrame().getResource("mindmap_menus.xml").openStream(); + mMenuStructure = updateMenusFromXml(in); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + logger.info("MindMapPopupMenu"); + popupmenu = new MindMapPopupMenu(this); + logger.info("MindMapToolBar"); + toolbar = new MindMapToolBar(this); + logger.info("setAllActions"); + setAllActions(false); - popupmenu = new MindMapPopupMenu(this); - toolbar = new MindMapToolBar(this); - - setAllActions(false); - // addAsChildMode (use old model of handling CtrN) (PN) - addAsChildMode = Tools.safeEquals( - getFrame().getProperty("add_as_child"),"true"); + addAsChildMode = + Tools.safeEquals(getFrame().getProperty("add_as_child"), "true"); + pRegistrations = new Vector(); } - public MapAdapter newModel() { - return new MindMapMapModel(getFrame()); } - - private void loadPatterns(File file) throws Exception { - createPatterns(StylePattern.loadPatterns(file)); } + /** This method is called after and before a change of the map module. + * Use it to perform the actions that cannot be performed at creation time. + * + */ + public void startupController() { + super.startupController(); + HookFactory hookFactory = getFrame().getHookFactory(); + List pluginRegistratios = hookFactory.getRegistrations(this.getClass()); + logger.info("mScheduledActions are executed: " + + pluginRegistratios.size()); + for (Iterator i = pluginRegistratios.iterator(); i.hasNext();) { + // call constructor: + try { + HookFactory.RegistrationContainer container = (RegistrationContainer) i + .next(); + Class registrationClass = container.hookRegistrationClass; + Constructor hookConstructor = registrationClass + .getConstructor(new Class[] { ModeController.class, + MindMap.class }); + HookRegistration registrationInstance = (HookRegistration) hookConstructor + .newInstance(new Object[] { this, getMap() }); + // register the instance to enable basePlugins. + hookFactory.registerRegistrationContainer(container, + registrationInstance); + registrationInstance.register(); + pRegistrations.add(registrationInstance); + } catch (Exception e) { + e.printStackTrace(); + } + } + } - private void loadPatterns(Reader reader) throws Exception { - createPatterns(StylePattern.loadPatterns(reader)); } - private void createPatterns(List patternsList) throws Exception { - patterns = new Action[patternsList.size()]; - for (int i=0;i