debian/jabref/branches/upstream/current.
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib" path="lib/aelfred-1.2.jar"/>
+ <classpathentry kind="lib" path="lib/antlr.jar"/>
+ <classpathentry kind="lib" path="lib/ccl.jar"/>
+ <classpathentry kind="lib" path="lib/jalopy-1.0b10.jar"/>
+ <classpathentry kind="lib" path="lib/jalopy-ant-0.6.1.jar"/>
+ <classpathentry kind="lib" path="lib/javancss.jar"/>
+ <classpathentry kind="lib" path="lib/jaxen-core-1.0-fcs.jar"/>
+ <classpathentry kind="lib" path="lib/jaxp-1.2.jar"/>
+ <classpathentry kind="lib" path="lib/jdom-1.0b8.jar"/>
+ <classpathentry kind="lib" path="lib/log4j-1.2.6.jar"/>
+ <classpathentry kind="lib" path="lib/looks-1.2.2.jar"/>
+ <classpathentry kind="lib" path="lib/oro-2.0.6.jar"/>
+ <classpathentry kind="lib" path="lib/plastic-1.2.1.jar"/>
+ <classpathentry kind="lib" path="lib/sax-2.0.1.jar"/>
+ <classpathentry kind="lib" path="lib/saxpath-1.0-fcs.jar"/>
+ <classpathentry kind="lib" path="lib/vizant.jar"/>
+ <classpathentry kind="lib" path="lib/spin.jar"/>
+ <classpathentry kind="var" path="JUNIT_HOME/junit.jar"/>
+ <classpathentry kind="lib" path="lib/pmd-2.0.jar"/>
+ <classpathentry kind="lib" path="lib/forms-1.0.4.jar"/>
+ <classpathentry kind="lib" path="lib/junit.jar"/>
+ <classpathentry kind="lib" path="lib/log4j-1.2.9.jar"/>
+ <classpathentry kind="output" path="build"/>
+</classpath>
--- /dev/null
+bak
+build
+.classpath
+.project
+work.jpx
+work.refactor
+.#build.xml.1.38
+.#jabref.log.1.2
+ini
+jabref.log
+jabref.log.lck
+build.number
+classes
+jabref.jpx
+jabref.oif
#Build Number for ANT. Do not edit!
-#Thu Jun 29 22:30:13 CEST 2006
-build.number=100
+#Wed Aug 09 18:35:54 CEST 2006
+build.number=570
Compiler: Ant
Authors: Joerg K. Wegner, wegnerj@informatik.uni-tuebingen.de
Morten O. Alver
- Version: $Revision: 1.61 $
- $Date: 2006/06/29 19:59:18 $
+ Version: $Revision: 1.62 $
+ $Date: 2006/07/25 19:56:36 $
$Author: mortenalver $
modified:
<!-- some version information -->
<property name="jabref.bin" value="jabref" />
- <property name="jabref.version" value="2.1 beta 2" />
+ <property name="jabref.version" value="2.1" />
<property name="jabref.placeholder.version" value="@version@" /> <!-- used by replace task -->
<!--<pathelement location="${library.directory}/commons-httpclient-2.0.jar" />
<pathelement location="${library.directory}/commons-logging.jar" />-->
<pathelement location="${library.directory}/antlr.jar" />
- <pathelement location="${library.directory}/looks-2.0.1.jar" />
+ <pathelement location="${library.directory}/looks-2.0.4.jar" />
<pathelement location="${library.directory}/forms-1.0.4.jar" />
<pathelement location="${library.directory}/spin-1.4.jar" />
<pathelement location="${library.directory}/glazedlists-1.5.0_java14.jar" />
<classpath>
<pathelement location="${build.lib}/jabref.jar"/>
<pathelement location="${library.directory}/antlr.jar" />
- <pathelement location="${library.directory}/looks-2.0.1.jar" />
+ <pathelement location="${library.directory}/looks-2.0.4.jar" />
<pathelement location="${library.directory}/forms-1.0.4.jar" />
<pathelement location="${library.directory}/spin.jar" />
<pathelement location="${library.directory}/glazedlists-1.5.0_java14.jar" />
<classpath>
<pathelement location="${build.lib}/jabref.jar"/>
<pathelement location="${library.directory}/antlr.jar" />
- <pathelement location="${library.directory}/looks-2.0.1.jar" />
+ <pathelement location="${library.directory}/looks-2.0.4.jar" />
<pathelement location="${library.directory}/forms-1.0.4.jar" />
<pathelement location="${library.directory}/spin-1.4.jar" />
<pathelement location="${library.directory}/glazedlists-1.5.0_java14.jar" />
<classpath>
<pathelement location="${build.lib}/jabref.jar"/>
<pathelement location="${library.directory}/antlr.jar" />
- <pathelement location="${library.directory}/looks-2.0.1.jar" />
+ <pathelement location="${library.directory}/looks-2.0.4.jar" />
<pathelement location="${library.directory}/forms-1.0.4.jar" />
<pathelement location="${library.directory}/spin-1.4.jar" />
<pathelement location="${library.directory}/glazedlists-1.5.0_java14.jar" />
<target name="compile">
<mkdir dir="${build.classes}" />
<!--deprecation="on"-->
- <javac debug="on" deprecation="on" destdir="${build.classes}" source="1.4" target="1.4">
+ <javac debug="off" deprecation="on" destdir="${build.classes}" source="1.4" target="1.4">
<src path="${java.dir}"/>
<exclude name="tests/**"/>
<classpath>
<!--<pathelement location="${library.directory}/commons-httpclient-2.0.jar" />
<pathelement location="${library.directory}/commons-logging.jar" />-->
<pathelement location="${library.directory}/antlr.jar" />
- <pathelement location="${library.directory}/looks-2.0.1.jar" />
+ <pathelement location="${library.directory}/looks-2.0.4.jar" />
<pathelement location="${library.directory}/forms-1.0.4.jar" />
<pathelement location="${library.directory}/spin-1.4.jar" />
<pathelement location="${library.directory}/glazedlists-1.5.0_java14.jar" />
<!--<pathelement location="${library.directory}/commons-httpclient-2.0.jar" />
<pathelement location="${library.directory}/commons-logging.jar" />-->
<pathelement location="${library.directory}/antlr.jar" />
- <pathelement location="${library.directory}/looks-2.0.1.jar" />
+ <pathelement location="${library.directory}/looks-2.0.4.jar" />
<pathelement location="${library.directory}/spin-1.4.jar" />
</classpath>
</javac>
<target name="osx">
<mkdir dir="${build.classes}" />
- <javac srcdir="${osx.dir}" debug="on" destdir="${build.classes}" target="1.4">
+ <javac srcdir="${osx.dir}" debug="off" destdir="${build.classes}" target="1.4">
</javac>
</target>
<mkdir dir="${build.images}" />
<copy todir="${build.images}">
<fileset dir="${images.dir}">
- <include name="*" />
+ <include name="**" />
</fileset>
</copy>
<unjar src="${library.directory}/commons-logging.jar" dest="${build.tmp}" />-->
<unjar src="${library.directory}/antlr.jar" dest="${build.tmp}" />
<!-- <unjar src="${library.directory}/plastic-1.2.1.jar" dest="${build.classes}" />-->
- <unjar src="${library.directory}/looks-2.0.1.jar" dest="${build.tmp}" />
+ <unjar src="${library.directory}/looks-2.0.4.jar" dest="${build.tmp}" />
<unjar src="${library.directory}/forms-1.0.4.jar" dest="${build.tmp}" />
<unjar src="${library.directory}/spin-1.4.jar" dest="${build.tmp}" />
<unjar src="${library.directory}/glazedlists-1.5.0_java14.jar" dest="${build.tmp}" />
<!--<pathelement location="${library.directory}/commons-httpclient-2.0.jar" />
<pathelement location="${library.directory}/commons-logging.jar" />-->
<pathelement location="${library.directory}/antlr.jar" />
- <pathelement location="${library.directory}/looks-2.0.1.jar" />
- <pathelement location="${library.directory}/looks-2.0.1.jar" />
+ <pathelement location="${library.directory}/looks-2.0.4.jar" />
+ <pathelement location="${library.directory}/looks-2.0.4.jar" />
<pathelement location="${library.directory}/spin-1.4.jar" />
</classpath>
<H1>JabRef version @version@ </H1>
(c) 2006
+<p>
+<img src="/images/JabRef-icon-48.png"></img>
<P>
-JabRef is freely distributable under the terms of the
-<a href="License.html">GNU Public License</a>, version 2.
+JabRef is freely distributable under the terms of the GNU
+<a href="License.html">General Public License</a>, version 2.
<H2>Developers:</H2>
-Morten O. Alver<BR>
-Nizar N. Batada<BR>
-Michel Baylac<BR>
-Guillaume Gardey<BR>
-Cyrille d'Haese<BR>
-Raik Nagel<BR>
-Ellen Reitmayr<BR>
-Andreas Rudert<BR>
-Michael Spiegel<BR>
-Ulrik Stervbo<BR>
-Dominik Waßenhoven<BR>
-Joerg K. Wegner<BR>
-Michael Wrighton<BR>
-Egon Willighagen <BR>
-Jörg Zieren<BR>
+Morten O. Alver,
+Nizar N. Batada,
+Michel Baylac,
+Guillaume Gardey,
+Cyrille d'Haese,
+Raik Nagel,
+Ellen Reitmayr,
+Andreas Rudert,
+Michael Spiegel,
+Ulrik Stervbo,
+Dominik Waßenhoven,
+Joerg K. Wegner,
+Michael Wrighton,
+Egon Willighagen,
+Jörg Zieren
<H2>Contributions from:</H2>
-Kolja Brix<BR>
-Frédéric Darboux<BR>
-Fabrice Dessaint<BR>
-Nathan Dunn<BR>
-Brian Van Essen<br>
-Alexis Gallagher<BR>
-Sascha Hunold<BR>
-Bernd Kalbfuss<BR>
-Martin Kähmer<BR>
-Ervin Kolenovic<BR>
-Jeffrey Kuhn<BR>
-Alex Montgomery<BR>
-John Relph<BR>
-Moritz Ringler<BR>
-Andreas Rudert<BR>
-Rudolf Seemann<BR>
-Toralf Senger<br>
-Mike Smoot<BR>
-Martin Stolle<BR>
-David Weitzman<BR>
-Seb Wills<BR>
+Kolja Brix,
+Frédéric Darboux,
+Fabrice Dessaint,
+Nathan Dunn,
+Brian Van Essen,
+Alexis Gallagher,
+Sascha Hunold,
+Bernd Kalbfuss,
+Martin Kähmer,
+Ervin Kolenovic,
+Krzysztof A. Kościuszkiewicz,
+Jeffrey Kuhn,
+Alex Montgomery,
+Christopher Oezbek,
+John Relph,
+Moritz Ringler,
+Andreas Rudert,
+Rudolf Seemann,
+Toralf Senger,
+Mike Smoot,
+Martin Stolle,
+David Weitzman,
+Seb Wills,
+John Zedlewski
<H2>Thanks to:</H2>
-Samin Muhammad Ridwanul Karim<BR>
-Stefan Robert<BR>
+Samin Muhammad Ridwanul Karim,
+Stefan Robert
<H2>Third-party software used:</H2>
-JabRef uses JGoodies Looks 1.2.2 and JGoodies Forms 1.0.4, distributed by JGoodies
+JabRef uses JGoodies Looks 2.0.4 and JGoodies Forms 1.0.5, distributed by JGoodies
(<code>http://www.jgoodies.com</code>) under the terms of the BSD License (see
<code>http://www.opensource.org/licenses/bsd-license.html</code> for details).
<P>
<P>
Command line options are parsed using RitOpt (<code>http://ritopt.sourceforge.net</code>). RitOpt
-is distributed under the terms of the <a href="License.html">GNU Public License</a>,
+is distributed under the terms of the GNU <a href="License.html">General Public License</a>,
version 2.
<P>
JabRef uses the ANTLR parser generator for interpreting search strings. ANTLR is
<p>
For table presentation and filtering, JabRef uses the Glazed Lists library
(<code>http://publicobject.com/glazedlists</code>), which is
- distributed under the Lesser GNU Public License.
+ distributed under the Lesser General Public License.
<P>
JabRef also uses the threading library Spin 1.3.1, which is distributed under the terms of
-the Lesser GNU Public License.
+the Lesser General Public License.
<P>
Some GUI components from the Microba library are used, it is licensed under a BSD style license.
See <code>http://sourceforge.net/projects/microba/</code> for more informations.
-<P>
-This product includes software developed by the Apache Software
-Foundation (http://www.apache.org/). The libraries Commons Logging and
-Commons HTTP Client are distributed by The Jakarta Project
-(<code>http://jakarta.apache.org</code>) under the Apache Software
-License, Version 1.1. See the enclosed file
-<code>apache-license.txt</code> or
-<code>http://opensource.org/licenses/apachepl.php</code> for details.
<P>
-Some icons are by us, but most are either from the Eclipse project (<code>http://www.eclipse.org</code>),
-distributed under the <a href="cpl-v10.html">Common Public License</a>, and from the QIcons package
-(<code>http://qt.osdn.org.ua</code>), which is distributed under the terms of the
-<a href="License.html">GNU Public License</a>.
+The majority of icons are from the Crystal Clear icon set by Everaldo
+(<code>http://www.everaldo.com</code>), which is distributed under the
+ terms of the Lesser General Public License.
</CENTER>
</BODY>
<H1>Importing From CiteSeer</H1>
+
+CiteSeer is a scientific literature digital library and search engine
+that focuses primarily on the literature in computer and information
+science.
+
<H2>Importing An Entry From CiteSeer</H2>
JabRef can download information about a particular citation from the CiteSeer database.
If a refining group is a subgroup of a group that includes its subgroups -- the refining group's siblings --, these siblings are ignored when the refining group is selected.
-Selecting a group shows the entries contained in that group. Selecting multiple groups shows the entries contained in any group (union) or those contained in all groups (intersection), depending on the current settings. All this is explained in detail below.
-<p>
-Group definitions are database-specific; they are saved as a <tt>@COMMENT</tt> block in the <tt>.bib</tt>-file and are shared among all users. (Future versions of JabRef might support user-dependent groups.)
-
-<H2>Interface</H2>
-
-The groups interface is shown in the side pane on the left of the screen. It can be toggled on or off by pressing <tt>CTRL-SHIFT-G</tt> or by the groups button in the toolbar. The interface has several buttons, but most functions are accessed via a context ("right-click") menu. Drag and Drop is also supported.
-<p>
-
-<table cellspacing=0 cellpadding=5 border=0 bgcolor=#c0ffc0>
-<tr><td>
-<h2>Some quick examples</h2>
-
-You might want to...
-
-<h3>...just create a group and assign some entries to it</h3>
-
-Ensure that the groups interface is visible. Press the <b>New Group</b> button, enter a name for the group, then press OK, leaving all values at their defaults. Now select the entries to be assigned to the group and use Drag and Drop to the group, or the option <b>Add to group</b> in the context menu. Finally select the group to see its content (which should be the entries you just assigned).
-
-<h3>...use the <tt>keywords</tt> field to group the entries</h3>
-
-Ensure that the groups interface is visible. Press the <b>New Group</b> button, enter a name for the group, and select the option to dynamically group entries by searching a field for a keyword. Enter the keyword to search for, then click OK. Finally select the group to see its content (which should be all entries whose <tt>keywords</tt> field contains the keyword you specified).
-
-<h3>...use a free-form search expression to define a group</h3>
-
-Ensure that the groups interface is visible. Press the <b>New Group</b> button, enter a name for the group, and select the option to dynamically group entries by a free-form search expression. Enter <tt>author=smith</tt> as a search expression (replace <tt>smith</tt> with a name that actually occurs in your database) and click <b>OK</b>. Finally select the group to see its content (which should be all entries whose <tt>author</tt> field contains the name you specified).
-
-<h3>...combine multiple groups</h3>
-
-Create two different groups (e.g. as described above). Click the <b>Settings</b> button and make sure that <b>Union</b> is selected. Now select both groups. You should see all entries contained in any of the two groups. Click <b>Settings</b> again and select <b>Intersection</b>. Now you should see only those entries contained in both groups (which might be none at all, or exactly the same entries as before in case both groups contain the same entries).
-
-<h3>...identify overlapping groups</h3>
-
-JabRef allows you to easily identify groups that overlap with the currently selected groups (i.e. that contain at least one entry that is also contained in the currently selected groups). Click <b>Settings</b> and activate the option to highlight overlapping groups. Then select a group that overlaps with other groups. The other groups should be highlighted.
-
-</tr></td>
-</table>
-<p>
-
-<H2>Types of groups</H2>
-
-In JabRef 1.8 there are four different types of groups:
-
-<ol>
-<li> The group <b>All Entries</b>, which -- as the name suggests -- contains all entries, is always present and cannot be edited or removed.
-<li> <b>Static groups</b> behave like directories on disk and contain only those entries that you explicitly assign to them.
-<li> <b>Dynamic groups based on keyword search</b> contain entries in which a certain BibTeX field (e.g. <tt>keywords</tt>) contains a certain keyword (e.g. <tt>electrical</tt>). This method does not require manual assignment of entries, but uses information that is already present in the database. If all entries in your database have suitable keywords in their <tt>keywords</tt> field, using this type of group might be the best choice.
-<li> <b>Dynamic groups based on free-form search expressions</b> contain entries that match a specified search expression, using the same syntax as the <a href="SearchHelp.html">search panel</a> on the side pane. This <a href="SearchHelp.html#advanced">syntax</a> supports logical operators (<tt>AND</tt>, <tt>OR</tt>, <tt>NOT</tt>) and allows to specify one or more BibTeX fields to search, facilitating more flexible group definitions than a keyword search (e.g. <tt>author=smith and title=electrical</tt>).
-</ol>
-
-Every group that you create is of one of the last three types. The group editing dialog, which is invoked by double-clicking on a group, shows a short description of the selected/edited group in plain English.
-
-<H2>Groups structure, creating and removing groups</H2>
-
-Just like directories, groups are structured like a tree, with the group <b>All Entries</b> at the root. By right-clicking on a group you can add a new group to the tree, either at the same level as the selected group or as a subgroup of it. The <b>New Group</b> button lets you create a new subgroup of the group <b>All Entries</b>, regardless of the currently selected group(s). The context menu also allows to remove groups and/or subgroups, to sort subgroups alphabetically, or to move groups to a different location in the tree. The latter can also be done by Drag and Drop, with the restriction that Drag and Drop does not support changing the order of a group's subgroups.
-<p>
-Undo and redo is supported for all edits.
-
-<H3>Static groups</h3>
-
-Static groups are populated only by explicit manual assignment of entries. After creating a static group you select the entries to be assigned to it, and use either Drag and Drop or the main table's context menu to perform the assignment. To remove entries from a static group, select them and use the main table's context menu. There are no options to be configured.
-<p>
-This method of grouping requires that all entries have a unique BibTeX key. In case of missing or duplicate BibTeX keys, the assignment of the affected entries cannot be correctly restored in future sessions.
-
-<H3>Dynamic groups</h3>
-
-The content of a dynamic group is defined by a logical condition. Only entries that meet this condition are contained in the group. This method uses the information stored in the database itself, and updates dynamically whenever the database changes.
-<p>
-Two types of conditions can be used:
-<dl>
-<dt><b>Searching a field for a keyword</b></dt>
-<dd>
-This method groups entries in which a specified BibTeX field (e.g. <tt>keywords</tt>) contains a specified search term (e.g. <tt>electrical</tt>). Obviously, for this to work, the grouping field must be present in every entry, and its content must be accurate. The above example would group all entries referring to something electrical. Using the field <tt>author</tt> allows to group entries by a certain author, etc. The search can either be done as a plain-text or a regular expression search. In the former case, JabRef allows to manually assign/remove entries to/from the group by simply appending/removing the search term to/from the content of the grouping field. This makes sense only for the <tt>keywords</tt> field or for self-defined fields, but obviously not for fields like <tt>author</tt> or <tt>year</tt>.
-</dd>
-<dt><b>Using a free-form search expression</b></dt>
-<dd>
-This is similar to the above, but rather than search a single field for a single search term, the <a href="SearchHelp.html#advanced">search expression syntax</a> can be used, which supports logical operators (<tt>AND</tt>, <tt>OR</tt>, <tt>NOT</tt>) and allows to search multiple BibTeX fields. For example, the search expression <tt>keywords=regression and not keywords=linear</tt> groups entries concerned with non-linear regression.
-</dd>
-</dl>
-
-In the groups view, dynamic groups are shown in <i>italics</i> by default. This can be turned off in the preferences.
-
-<h3>Hierarchical context</h3>
-
-By default, a group is <b>independent</b> of its position in the groups tree: When selected, only the group's contents are shown. However, especially when using dynamic groups, it is often useful to define a subgroup that <b>refines its supergroup</b>, i.e., when selected, entries contained in both groups are displayed. For example, create a supergroup containing entries with the keyword <tt>distribution</tt> and a subgroup containing entries with the keyword <tt>gauss</tt> that refines this supergroup. Selecting the subgroup now displays entries that match both conditions, i.e. are concerned with Gaussian distributions. By adding another refining subgroup for <tt>laplace</tt> to the original supergroup, the grouping can easily be extended. In the groups tree, refining groups have a special icon (this can be turned off in the preferences).
-<p>
-The logical complement to a refining group is a group that <b>includes its subgroups</b>, i.e. when selected, not only the group's own entries, but also its subgroups' entries are shown. In the groups tree, this type of group has a special icon (this can be turned off in the preferences).
-
-<h2>Viewing a group's entries, combining multiple groups</H2>
-
-Selecting a group shows the entries contained in that group by highlighting them and, depending on the settings (accessible by clicking the <b>Settings</b> button), moving them to the top of the list and/or selecting them. These options are identical to those available for the regular search.
-<p>
-When multiple groups are selected, either the union or the intersection of their content is shown, depending on the current settings. This allows to quickly combine multiple conditions, e.g. if you have a static group <tt>Extremely Important</tt> to which you assign all extremely important entries, you can view the extremely important entries in any other group by selecting both groups (this requires to have <b>Intersection</b> selected in the settings).
-
-<h2>Groups and searching</h2>
-
-When viewing the contents of the selected group(s), a search can be performed within these contents using the regular search facility.
-
-<h2>Highlighting overlapping groups</h2>
-
-The <b>Settings</b> button offers an option to highlight overlapping groups. If this is activated, upon selection of one or more groups, all groups that contain at least one of the entries contained in the currently selected group(s) are highlighted. This quickly identifies overlap between the groups' contents. You might, for example, create a group <tt>To Read</tt> that contains all entries which you plan to read. Now, whenever you select any group, the group <tt>To Read</tt> is highlighted if the selected group contains entries that you plan to read.
-
-<h2>Advanced features</h2>
-
-After mastering the grouping concepts described above, the following advanced features might come in handy.
-
-<h3>Automatically creating dynamic groups</h3>
-
-By clicking the <b>Automatically create groups for database</b> button, you can quickly create a set of groups appropriate for your database. This feature will gather all words found in a specific field of your choice, and create a group for each word. This is useful for instance if your database contains suitable keywords for all entries. By autogenerating groups based on the <tt>keywords</tt> field, you should have a basic set of groups at no cost.
-<p>
-You can also specify characters to ignore, for instance commas used between keywords. These will be treated as separators between words, and not part of them. This step is important for combined keywords such as <tt>laplace distribution</tt> to be recognized as a single semantic unit. (You cannot use this option to remove complete words. Instead, delete the unwanted groups manually after they were created automatically.)
-
-<h3>Refreshing the groups view</h3>
-
-The <b>Refresh</b> button updates the entry table to reflect the current groups selection. This is usually done automatically, but in rare occasions (e.g. after a group-related undo/redo) a manual refresh is required.
-
-<h3>Mixing refining groups with including groups</h3>
-
-If a refining group is a subgroup of a group that includes its subgroups -- the refining group's siblings --, these siblings are ignored when the refining group is selected.
-
</HTML>
\ No newline at end of file
<H1>Search IEEEXplore</H1>
+IEEEXplore delivers access to technical literature in electrical engineering,
+computer science, and electronics.
+<p>
JabRef can download citations from the IEEEXplore database.
To use this feature, choose <b>Web search -> Search IEEEXplore</b>,
and the search interface will appear in the side pane.
<H1>Fetching Medline entries</H1>
+MEDLINE is the U.S. National Library of Medicine's premier bibliographic database.
+It contains references to journal articles in life sciences
+with a concentration on biomedicine.
+<P>
JabRef can download citations from the Medline database.
To use this feature, choose <b>Web search -> Fetch Medline</b>,
and the Medline interface will appear in the side pane.
<h1>JabRef Version @version@</h1>
(c) 2006
+<p>
+<img src="/images/JabRef-icon-48.png"></img>
<p>
-JabRef ist frei verfügbar unter den Bedingungen der
-<a href="License.html">Gnu Public License</a>.
+JabRef ist frei verfügbar unter den Bedingungen der GNU
+<a href="License.html">General Public License</a>.
</p><h2>Entwickler:</h2>
-Morten O. Alver<br>
-Nizar N. Batada<br>
-Michel Baylac<br>
-Guillaume Gardey<br>
-Cyrille d'Haese<br>
-Raik Nagel<br>
-Ellen Reitmayr<br>
-Andreas Rudert<br>
-Michael Spiegel<br>
-Ulrik Stervbo<br>
-Dominik Waßenhoven<br>
-Joerg K. Wegner<br>
-Michael Wrighton<br>
-Egon Willighagen <br>
-Jörg Zieren<br>
+Morten O. Alver,
+Nizar N. Batada,
+Michel Baylac,
+Guillaume Gardey,
+Cyrille d'Haese,
+Raik Nagel,
+Ellen Reitmayr,
+Andreas Rudert,
+Michael Spiegel,
+Ulrik Stervbo,
+Dominik Waßenhoven,
+Joerg K. Wegner,
+Michael Wrighton,
+Egon Willighagen,
+Jörg Zieren
<h2>Beiträge von:</h2>
-Kolja Brix<br>
-Frédéric Darboux<br>
-Fabrice Dessaint<br>
-Nathan Dunn<br>
-Brian van Essen<br>
-Alexis Gallagher<br>
-Sascha Hunold<br>
-Bernd Kalbfuss<br>
-Martin Kähmer<br>
-Ervin Kolenovic<BR>
-Jeffrey Kuhn<br>
-Alex Montgomery<br>
-John Relph<br>
-Moritz Ringler<br>
-Rudolf Seemann<br>
-Toralf Senger<br>
-Mike Smoot<br>
-Martin Stolle<br>
-David Weitzman<br>
-Seb Wills<br>
-
+Kolja Brix,
+Frédéric Darboux,
+Fabrice Dessaint,
+Nathan Dunn,
+Brian van Essen,
+Alexis Gallagher,
+Sascha Hunold,
+Bernd Kalbfuss,
+Martin Kähmer,
+Ervin Kolenovic,
+Krzysztof A. Kościuszkiewicz,
+Jeffrey Kuhn,
+Alex Montgomery,
+Christopher Oezbek,
+John Relph,
+Moritz Ringler,
+Rudolf Seemann,
+Toralf Senger,
+Mike Smoot,
+Martin Stolle,
+David Weitzman,
+Seb Wills,
+John Zedlewski
+
<h2>Dank an:</h2>
-Samin Muhammad Ridwanul Karim<br>
-Stefan Robert<br>
+Samin Muhammad Ridwanul Karim,
+Stefan Robert
<h2>Benutzte Fremdsoftware:</h2>
-JabRef benutzt JGoodies Looks 1.2.2 und JGoodiesForms 1.0.4, das von JGoodies (<code>http://www.jgoodies.com</code>) unter den Bedingungen der BSD License vertrieben wird (siehe <code>http://www.opensource.org/licenses/bsd-license.html</code> für nähere Einzelheiten dieser Lizenz).
+JabRef benutzt JGoodies Looks 2.0.4 und JGoodiesForms 1.0.5, das von JGoodies (<code>http://www.jgoodies.com</code>) unter den Bedingungen der BSD License vertrieben wird (siehe <code>http://www.opensource.org/licenses/bsd-license.html</code> für nähere Einzelheiten dieser Lizenz).
<p>
Außerdem werden zwei zustätzliche Klassen
(SimpleInternalFrame and UIFSplitPane) von Karsten Lentzsch benutzt,
die unter <a href="jgoodies.html">diesen Bedingungen</a> vertrieben werden.
</p><p>
-Kommandozeilenbefehle werden geparst mit RitOpt (<code>http://ritopt.sourceforge.net</code>), das unter den Bedingungen der <a href="License.html">GNU Public License</a> (Version 2) verfügbar ist.
+Kommandozeilenbefehle werden geparst mit RitOpt (<code>http://ritopt.sourceforge.net</code>), das unter den Bedingungen der GNU <a href="License.html">General Public License</a> (Version 2) verfügbar ist.
</p><p>
JabRef verwendet für die Suche den ANTLR Parser Generator. ANTLR ist public domain software - siehe <code>http://www.antlr.org/license.html</code> für die Lizenzbedingungen.
</p><p>
Für die Darstellung und Filterung der Tabelle benutzt JabRef die Glazed Lists library
- (<code>http://publicobject.com/glazedlists</code>), die unter den Bedingungen der Lesser GNU Public License vertrieben wird.
+ (<code>http://publicobject.com/glazedlists</code>), die unter den Bedingungen der Lesser General Public License vertrieben wird.
</p><p>
JabRef benutzt darüber hinaus die "threading library" Spin 1.3.1,
-die unter den Bedingungen der LGPL (Lesser GNU Public License)
+die unter den Bedingungen der LGPL (Lesser General Public License)
vertrieben wird.<br>
</p>
<p>Für die einfache Auswahl und den Umgang mit Datumsangaben
für eine genauere Beschreibung.
</p><p>
-Dieses Produkt beinhaltet Software, die von der Apache Software Foundation (<code>http://www.apache.org</code>) entwickelt wurde. Die Bibliotheken "Commons Logging" und "Commons HTTP Client" werden von The Jakarta Project (<code>http://jakarta.apache.org</code>) unter der Apache Software Lizenz (Version 1.1) vertrieben (siehe die beigelegte Datei <code>apache-license.txt</code> oder <code>http://opensource.org/licenses/apachepl.php</code> für nähere Einzelheiten dieser Lizenz).
-</p><p>
-Einige Icons sind von uns, aber die meisten stammen vom Eclipse Projekt (<code>http://www.eclipse.org</code>), das unter den Bedingungen der <a href="cpl-v10.html">Common Public License</a> vertrieben wird, sowie vom QIcons Paket (<code>http://qt.osdn.org.ua</code>), das unter den Bedingungen der <a href="License.html">GNU Public License</a> vertrieben wird.
+The majority of icons are from the Crystal Clear icon set by Everaldo
+(<code>http://www.everaldo.com</code>), which is distributed under the
+ terms of the Lesser General Public License.
</p></center>
</body></html>
\ No newline at end of file
<H1>JabRef version @version@</H1>
(c) 2006
+<p>
+<img src="/images/JabRef-icon-48.png"></img>
<P>
-JabRef est librement distribuable selon les termes de la
-<a href="License.html">GNU Public License</a>, version 2.
+JabRef est librement distribuable selon les termes de la GNU
+<a href="../License.html">General Public License</a>, version 2.
<H2>Développeurs :</H2>
-Morten O. Alver<BR>
-Nizar N. Batada<BR>
-Michel Baylac<BR>
-Guillaume Gardey<BR>
-Cyrille d'Haese<BR>
-Raik Nagel<BR>
-Ellen Reitmayr<BR>
-Andreas Rudert<BR>
-Michael Spiegel<BR>
-Ulrik Stervbo<BR>
-Dominik Waßenhoven<BR>
-Joerg K. Wegner<BR>
-Michael Wrighton<BR>
-Egon Willighagen <BR>
-Jörg Zieren<BR>
+Morten O. Alver,
+Nizar N. Batada,
+Michel Baylac,
+Guillaume Gardey,
+Cyrille d'Haese,
+Raik Nagel,
+Ellen Reitmayr,
+Andreas Rudert,
+Michael Spiegel,
+Ulrik Stervbo,
+Dominik Waßenhoven,
+Joerg K. Wegner,
+Michael Wrighton,
+Egon Willighagen,
+Jörg Zieren
<H2>Contributions de :</H2>
-Kolja Brix<BR>
-Frédéric Darboux<BR>
-Fabrice Dessaint<BR>
-Nathan Dunn<BR>
-Brian Van Essen<br>
-Alexis Gallagher<BR>
-Sascha Hunold<BR>
-Bernd Kalbfuss<BR>
-Martin Kähmer<BR>
-Ervin Kolenovic<BR>
-Jeffrey Kuhn<BR>
-Alex Montgomery<BR>
-John Relph<BR>
-Moritz Ringler<BR>
-Rudolf Seemann<BR>
-Toralf Senger<br>
-Mike Smoot<BR>
-Martin Stolle<BR>
-David Weitzman<BR>
-Seb Wills<BR>
+Kolja Brix,
+Frédéric Darboux,
+Fabrice Dessaint,
+Nathan Dunn,
+Brian Van Essen,
+Alexis Gallagher,
+Sascha Hunold,
+Bernd Kalbfuss,
+Martin Kähmer,
+Ervin Kolenovic,
+Krzysztof A. Kościuszkiewicz,
+Jeffrey Kuhn,
+Alex Montgomery,
+Christopher Oezbek,
+John Relph,
+Moritz Ringler,
+Rudolf Seemann,
+Toralf Senger,
+Mike Smoot,
+Martin Stolle,
+David Weitzman,
+Seb Wills,
+John Zedlewski
<H2>Remerciements à :</H2>
-Samin Muhammad Ridwanul Karim<BR>
-Stefan Robert<BR>
+Samin Muhammad Ridwanul Karim,
+Stefan Robert
<H2>Logiciels tiers utilisés :</H2>
-JabRef utilise JGoodies Looks 1.2.2 et JGoodies Forms 1.0.4, distribués par JGoodies
+JabRef utilise JGoodies Looks 2.0.4 et JGoodies Forms 1.0.5 distribués par JGoodies
(<code>http://www.jgoodies.com</code>) selon les termes de la License BSD (voir
<code>http://www.opensource.org/licenses/bsd-license.html</code> pour plus de détails).
<P>
Deux classes additionnelles sont aussi incluses (SimpleInternalFrame et UIFSplitPane), de Karsten
-Lentzsch, qui sont distribuées sous <A HREF="jgoodies.html">ces termes</A>.
+Lentzsch, qui sont distribuées sous <A HREF="../jgoodies.html">ces termes</A>.
<P>
Les options de la ligne de commande sont traitées en utilisant RitOpt (<code>http://ritopt.sourceforge.net</code>). RitOpt
-est distribuée selon les termes de la <a href="License.html">GNU Public License</a>,
+est distribuée selon les termes de la GNU <a href="../License.html">General Public License</a>,
version 2.
<P>
JabRef utilise le générateur d'analyseur syntaxique ANTLR pour interpréter les chaînes de recherche. ANTLR est un logiciel du domaine public
- voir <code>http://www.antlr.org/license.html</code> pour les termes de la license.
<p>
Pour la présentation de la table et le filtrage, JabRef utilise la bibliothèque Glazed Lists
-(<code>http://publicobject.com/glazedlists</code>), qui est distribuée sous la license "Lesser GNU Public License".
+(<code>http://publicobject.com/glazedlists</code>), qui est distribuée sous la license "Lesser General Public License".
<P>
JabRef utilise aussi la bibliothèque de threading Spin 1.3.1, qui est distribuée selon les termes de la Lesser GNU Public License.
+
<P>
-Ce produit inclut des logiciels développés par Apache Software
-Foundation (http://www.apache.org/). Les bibliothèques Commons Logging et
-Commons HTTP Client sont distribuées par The Jakarta Project
-(<code>http://jakarta.apache.org</code>) sous la License Apache Software, Version 1.1. Voir le fichier inclus
-<code>apache-license.txt</code> ou
-<code>http://opensource.org/licenses/apachepl.php</code> pour plus de détails.
+Certains composants de l'interface graphique de la bibliothèque Microba sont utilisés. Elle est distribuée sous une license de type BSD. Voir <code>http://sourceforge.net/projects/microba/</code> pour plus d'informations.
<P>
-Certains icônes sont de notre facture, mais la plupart viennent soit du projet Eclipse (<code>http://www.eclipse.org</code>),
-distribués sous la <a href="cpl-v10.html">Common Public License</a>, soit du paquetage QIcons (<code>http://qt.osdn.org.ua</code>), qui est distribué selon les termes de la <a href="License.html">GNU Public License</a>.
+La majorité des icônes proviennent de l'ensemble d'icônes Crystal Clear par Everaldo
+(<code>http://www.everaldo.com</code>), qui est distribuée sous les termes de la
+Lesser General Public License.
</CENTER>
</BODY>
<basefont size="4" color="#2F4958" face="arial">
<h1>Récupération depuis CiteSeer</h1>
+
+
+CiteSeer est une bibliothèque numérique et un moteur de
+recherche qui s'intéresse principalement à la
+littérature scientifique en informatique et science de
+l'information.
+
+
<h2>Récupération d'une entrée depuis CiteSeer</h2>
<p>
<H1>Recherche IEEEXplore</H1>
+IEEEXplore permet l'accès à de la litterature technique
+en génie électrique, informatique et électronique.
+<p>
JabRef peut télécharger des citations à partir de la base de données IEEEXplore.
-
Pour utiliser cette fonction, sélectionner <b>Recherche internet -> Recherche IEEEXplore</b>
fera apparaître l'interface de recherche dans le panneau latéral.
<P>
<p>
Vous pouvez choisir de télécharger les résumés avec les informations de citation pour chaque
entrée en cochant la case <b>Inclure les résumés</b>. Comme cela entraîne une
-quantité importante de requêtes réseau, afin d'éviter une pression excessive
+quantité importante de requêtes réseau, afin d'éviter une pression excessive
sur le site internet IEEExplore, Jabref refusera de télécharger les résumés
pour les recherches retournant plus qu'un nombre donné de résultats.
<h1>Récupération d'entrées depuis Medline</h1>
+MEDLINE est la principale base de données bibliographique de la
+bibliothèque nationale de médecine des Etats-Unis.
+Elle contient des références à des articles de journaux
+sur les sciences de la vie avec une spécialisation
+sur la biomédecine.
<p>
JabRef peut télécharger des citations depuis la base de données Medline. Pour réaliser cette opération, sélectionnez <b>Recherche internet -> Recherche Medline</b> et vous verrez apparaître l'interface de Medline dans le panneau latéral.
</p>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="744.09448819"
+ height="1052.3622047"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.44"
+ sodipodi:docbase="/home/alver/Documents"
+ sodipodi:docname="jabrefIkon.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient2915">
+ <stop
+ id="stop2917"
+ offset="0"
+ style="stop-color:white;stop-opacity:1;" />
+ <stop
+ id="stop2919"
+ offset="1"
+ style="stop-color:#dadce0;stop-opacity:1;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2909">
+ <stop
+ id="stop2911"
+ offset="0"
+ style="stop-color:white;stop-opacity:1;" />
+ <stop
+ id="stop2913"
+ offset="1"
+ style="stop-color:#cfd1d7;stop-opacity:1;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2897">
+ <stop
+ style="stop-color:#dadee7;stop-opacity:1;"
+ offset="0"
+ id="stop2899" />
+ <stop
+ style="stop-color:#1e68c6;stop-opacity:1;"
+ offset="1"
+ id="stop2901" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2889">
+ <stop
+ style="stop-color:#e0e4ee;stop-opacity:1;"
+ offset="0"
+ id="stop2891" />
+ <stop
+ style="stop-color:#e0e4ee;stop-opacity:0;"
+ offset="1"
+ id="stop2893" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2915"
+ id="linearGradient2971"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.115225,0,0,1,-1.889007,46.1244)"
+ x1="329.18756"
+ y1="289.87192"
+ x2="598.66205"
+ y2="548.62866" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2909"
+ id="linearGradient2974"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.082601,0,0,1,-1.374219,40)"
+ x1="145.45497"
+ y1="332.74286"
+ x2="326.12537"
+ y2="576.18854" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2909"
+ id="linearGradient2983"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(8.119652e-2,0,0,7.966468e-2,422.1323,954.272)"
+ x1="145.45497"
+ y1="332.74286"
+ x2="326.12537"
+ y2="576.18854" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2915"
+ id="linearGradient2985"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(8.119652e-2,0,0,7.966468e-2,424.2434,954.7598)"
+ x1="329.18756"
+ y1="289.87192"
+ x2="598.66205"
+ y2="548.62866" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2909"
+ id="linearGradient3878"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.824753e-2,0,0,3.538487e-2,403.2956,1005.814)"
+ x1="145.45497"
+ y1="332.74286"
+ x2="326.12537"
+ y2="576.18854" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2915"
+ id="linearGradient3880"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.863231e-2,4.140938e-3,-3.672702e-3,3.351102e-2,404.9189,1005.265)"
+ x1="329.18756"
+ y1="289.87192"
+ x2="598.66205"
+ y2="548.62866" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="50"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="21.286454"
+ inkscape:cx="416.46054"
+ inkscape:cy="31.511436"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:guide-bbox="false"
+ showguides="true"
+ inkscape:window-width="1118"
+ inkscape:window-height="944"
+ inkscape:window-x="0"
+ inkscape:window-y="0" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="opacity:1;fill:#4f5f8f;fill-opacity:1"
+ id="rect2905"
+ width="716.55713"
+ height="730.3371"
+ x="10.717734"
+ y="89.297173" />
+ <path
+ style="fill:url(#linearGradient2974);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 122.04224,150.95548 C 208.65029,150.95548 286.97046,184.73542 286.97046,184.73542 C 286.97046,184.73542 372.48612,237.27117 327.52453,611.24332 C 314.57556,683.68157 250.81542,747.98797 172.90939,747.98797 C 95.003363,747.98797 50.24884,702.05483 50.24884,648.46615 C 119.867,694.3993 168.69957,681.54848 189.48514,672.96384 C 199.45516,668.84613 251.63441,636.1731 257.44572,548.94433 C 264.07602,449.42251 247.50026,297.84312 122.04224,150.95548 z "
+ id="path1972"
+ sodipodi:nodetypes="cccscssc" />
+ <path
+ style="fill:url(#linearGradient2971);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.05348015px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 322.49657,164.88378 C 533.15821,196.83799 712.94701,311.87314 516.81377,452.47165 C 462.33232,497.20754 627.59274,671.35798 692.97048,751.2435 C 544.0545,717.69157 402.40271,580.28849 400.58666,476.43731 C 398.77062,401.34492 516.81377,393.35637 516.81377,347.02276 C 516.81377,300.68916 344.28916,262.34411 322.49657,164.88378 z "
+ id="path1993"
+ sodipodi:nodetypes="cccc" />
+ <rect
+ style="opacity:1;fill:#4f5f8f;fill-opacity:1"
+ id="rect3872"
+ width="24.96747"
+ height="24.892717"
+ x="403.74191"
+ y="1008.134"
+ inkscape:export-xdpi="173.03"
+ inkscape:export-ydpi="173.03"
+ inkscape:export-filename="/home/alver/div/smalltheme/jabrefIkon-48.png" />
+ <path
+ style="fill:url(#linearGradient3878);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 407.84626,1010.4236 C 410.90607,1010.4236 413.43489,1010.4972 413.43489,1010.4972 C 413.43489,1010.4972 416.50376,1012.7951 414.91528,1026.0281 C 414.45779,1028.5913 412.2052,1030.8669 409.45284,1030.8669 C 406.70046,1030.8669 405.11931,1029.2413 405.11931,1027.3453 C 407.95995,1028.6292 410.06622,1027.9794 410.80057,1027.6755 C 411.15281,1027.5298 412.46165,1026.9172 412.43944,1023.8236 C 412.38788,1016.6442 413.08837,1015.0847 407.84626,1010.4236 z "
+ id="path3874"
+ sodipodi:nodetypes="cccscssc"
+ inkscape:export-filename="/home/alver/div/smalltheme/jabrefIkon-48.png"
+ inkscape:export-xdpi="173.03"
+ inkscape:export-ydpi="173.03" />
+ <path
+ style="fill:url(#linearGradient3880);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.05348015px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 415.71976,1010.449 C 423.13477,1010.8154 428.70544,1016.8245 421.39485,1020.8079 C 419.34326,1022.1048 424.42839,1028.5544 426.39975,1031.4741 C 421.3644,1029.7968 416.96212,1024.6664 417.28063,1021.1794 C 417.49352,1018.6562 421.61195,1018.8269 421.78212,1017.2742 C 421.95228,1015.7216 419.07637,1015.8865 415.71976,1010.449 z "
+ id="path3876"
+ sodipodi:nodetypes="ccccsc"
+ inkscape:export-filename="/home/alver/div/smalltheme/jabrefIkon-48.png"
+ inkscape:export-xdpi="173.03"
+ inkscape:export-ydpi="173.03" />
+ </g>
+</svg>
--- /dev/null
+jabrefIcon=JabRef-icon.png
+#jabrefIcon=ikon.gif
+about=JabRef-icon.png
+
+new=filenew.png
+open=fileopen.png
+loadSession=fileimport.png
+save=filesave.png
+saveAs=filesaveas.png
+copy=editcopy.png
+paste=editpaste.png
+cut=editcut.png
+undo=undo.png
+redo=redo.png
+refresh=reload.png
+left=1leftarrow.png
+right=1rightarrow.png
+up=1uparrow.png
+down=1downarrow.png
+add=edit_add.png
+remove=edit_remove.png
+delete=trash.png
+edit=edit.png
+help=help.png
+helpSmall=help.png
+helpContents=contents2.png
+search=search.png
+incSearch=search.png
+toggleSearch=search.png
+complete=button_ok.png
+wrong=cancel.png
+makeKey=wizard.png
+psSmall=ps.png
+pdfSmall=pdf-document.png
+openFile=pdf-document.png
+preferences=advancedsettings.png
+openUrl=agt_internet.png
+www=agt_internet.png
+wwwSmall=agt_internet_small.png
+medline=agt_internet.png
+integrityWarn=status_unknown.png
+integrityInfo=documentinfo.png
+integrityFail=gg_ignored.png
+
+togglePreview=text_bottom.png
+toggleGroups=queue.png
+editPreamble=preamble.png
+editStrings=strings.png
+emacs=emacs.png
+lyx=lyx2.png
+winedt=winedt.png
+required=reqIcon.png
+optional=optIcon.png
+general=genIcon.png
+abstract=absIcon.png
+source=viewsource.gif
+duplicate=duplicate.png
+autoGroup=run.png
+markEntries=mark.png
+unmarkEntries=unmark.png
+citeseer=wwwciteseer.png
+doiSmall=doismall.png
+groupsHighlightAny=groupsHighlightAny.png
+groupsHighlightAll=groupsHighlightAll.png
+close=fileclose.png
+close2=fileclose2.png
+integrityCheck=integrity.png
+groupIncluding=groupIncluding.png
+groupRefining=groupRefining.png
--- /dev/null
+#jabrefIcon=JabRef-icon.png
+jabrefIcon=ikon.gif
+about=JabRef-icon.png
+
+new=filenew.png
+open=fileopen.png
+loadSession=fileimport.png
+save=filesave.png
+saveAs=filesaveas.png
+copy=editcopy.png
+paste=editpaste.png
+cut=editcut.png
+undo=undo.png
+redo=redo.png
+refresh=reload.png
+left=1leftarrow.png
+right=1rightarrow.png
+up=1uparrow.png
+down=1downarrow.png
+add=edit_add.png
+remove=edit_remove.png
+delete=trash.png
+edit=edit.png
+help=help.png
+helpSmall=help.png
+helpContents=contents2.png
+search=search.png
+incSearch=search.png
+toggleSearch=search.png
+complete=button_ok.png
+wrong=cancel.png
+makeKey=wizard.png
+psSmall=ps.png
+pdfSmall=pdf-document.png
+openFile=pdf-document.png
+preferences=advancedsettings.png
+openUrl=agt_internet.png
+www=agt_internet.png
+wwwSmall=agt_internet_small.png
+medline=agt_internet.png
+integrityWarn=status_unknown.png
+integrityInfo=documentinfo.png
+integrityFail=gg_ignored.png
+
+togglePreview=text_bottom.png
+toggleGroups=queue.png
+editPreamble=preamble.png
+editStrings=strings.png
+emacs=emacs.png
+lyx=lyx2.png
+winedt=winedt.png
+required=reqIcon.png
+optional=optIcon.png
+general=genIcon.png
+abstract=absIcon.png
+source=viewsource.gif
+duplicate=duplicate.png
+autoGroup=run.png
+markEntries=mark.png
+unmarkEntries=unmark.png
+citeseer=wwwciteseer.png
+doiSmall=doismall.png
+groupsHighlightAny=groupsHighlightAny.png
+groupsHighlightAll=groupsHighlightAll.png
+close=fileclose.png
+close2=fileclose2.png
+integrityCheck=integrity.png
+groupIncluding=groupIncluding.png
+groupRefining=groupRefining.png
JPanel pan = new JPanel(),
lnf = new JPanel();
JLabel lab;
- JCheckBox useDefault, useRemoteServer;
+ JCheckBox useDefault, useRemoteServer, useNativeFileDialogOnMac;
JTextField className, remoteServerPort;
JButton def1 = new JButton(Globals.lang("Default")),
def2 = new JButton(Globals.lang("Default"));
remoteHelp = new HelpAction(diag, GUIGlobals.remoteHelp, "Help",
- GUIGlobals.helpSmallIconFile);
+ GUIGlobals.getIconUrl("helpSmall"));
useDefault = new JCheckBox(Globals.lang("Use other look and feel"));
useRemoteServer = new JCheckBox(Globals.lang("Listen for remote operation on port")+":");
+ useNativeFileDialogOnMac = new JCheckBox(Globals.lang("Use native file dialog"));
remoteServerPort = new JTextField();
className = new JTextField(50);
final JTextField clName = className;
"");
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
JPanel pan = new JPanel();
- builder.appendSeparator(Globals.lang("Look and feel"));
- JLabel lab = new JLabel(Globals.lang("Default look and feel")+": "
- +(Globals.ON_WIN ? GUIGlobals.windowsDefaultLookAndFeel :
- GUIGlobals.linuxDefaultLookAndFeel));
- builder.nextLine();
- builder.append(pan);
- builder.append(lab);
- builder.nextLine();
- builder.append(pan);
- builder.append(useDefault);
- builder.nextLine();
- builder.append(pan);
- JPanel pan2 = new JPanel();
- lab = new JLabel(Globals.lang("Class name")+":");
- pan2.add(lab);
- pan2.add(className);
- builder.append(pan2);
- builder.nextLine();
- builder.append(pan);
- lab = new JLabel(Globals.lang("Note that you must specify the fully qualified class name for the look and feel,"));
- builder.append(lab);
- builder.nextLine();
- builder.append(pan);
- lab = new JLabel(Globals.lang("and the class must be available in your classpath next time you start JabRef."));
- builder.append(lab);
- builder.nextLine();
+
+ if (!Globals.ON_MAC) {
+ builder.appendSeparator(Globals.lang("Look and feel"));
+ JLabel lab = new JLabel(Globals.lang("Default look and feel")+": "
+ +(Globals.ON_WIN ? GUIGlobals.windowsDefaultLookAndFeel :
+ GUIGlobals.linuxDefaultLookAndFeel));
+ builder.nextLine();
+ builder.append(pan);
+ builder.append(lab);
+ builder.nextLine();
+ builder.append(pan);
+ builder.append(useDefault);
+ builder.nextLine();
+ builder.append(pan);
+ JPanel pan2 = new JPanel();
+ lab = new JLabel(Globals.lang("Class name")+":");
+ pan2.add(lab);
+ pan2.add(className);
+ builder.append(pan2);
+ builder.nextLine();
+ builder.append(pan);
+ lab = new JLabel(Globals.lang("Note that you must specify the fully qualified class name for the look and feel,"));
+ builder.append(lab);
+ builder.nextLine();
+ builder.append(pan);
+ lab = new JLabel(Globals.lang("and the class must be available in your classpath next time you start JabRef."));
+ builder.append(lab);
+ builder.nextLine();
+ }
builder.appendSeparator(Globals.lang("Remote operation"));
builder.nextLine();
builder.append(new JPanel());
p.add(remoteHelp.getIconButton());
builder.append(p);
+ if (Globals.ON_MAC) {
+ builder.nextLine();
+ builder.appendSeparator(Globals.lang("Mac file dialog"));
+ builder.nextLine();
+ builder.append(new JPanel());
+ builder.append(useNativeFileDialogOnMac);
+ }
+
pan = builder.getPanel();
pan.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
setLayout(new BorderLayout());
useRemoteServer.setSelected(_prefs.getBoolean("useRemoteServer"));
oldPort = _prefs.getInt("remoteServerPort");
remoteServerPort.setText(String.valueOf(oldPort));
+ useNativeFileDialogOnMac.setSelected(Globals.prefs.getBoolean("useNativeFileDialogOnMac"));
}
public void storeSettings() {
_prefs.putBoolean("useDefaultLookAndFeel", !useDefault.isSelected());
_prefs.put("lookAndFeel", className.getText());
+ _prefs.putBoolean("useNativeFileDialogOnMac", useNativeFileDialogOnMac.isSelected());
try {
int port = Integer.parseInt(remoteServerPort.getText());
if (port != oldPort) {
class AppearancePrefsTab extends JPanel implements PrefsTab {
JabRefPreferences _prefs;
- private JCheckBox colorCodes, antialias;
+ private JCheckBox colorCodes, antialias, overrideFonts;//, useCustomIconTheme;
private GridBagLayout gbl = new GridBagLayout();
private JButton fontButton = new JButton(Globals.lang("Set table font"));
private ColorSetupPanel colorPanel = new ColorSetupPanel();
private Font font = GUIGlobals.CURRENTFONT;
private int oldMenuFontSize;
- private JTextField fontSize;
+ private boolean oldOverrideFontSize;
+ private JTextField fontSize;//, customIconThemeFile;
/**
* Customization of appearance parameters.
setLayout(new BorderLayout());
// Font sizes:
- fontSize = new JTextField();
+ fontSize = new JTextField(5);
colorCodes = new JCheckBox(Globals.lang
("Color codes for required and optional fields"));
antialias = new JCheckBox(Globals.lang
("Use antialiasing font"));
+ overrideFonts = new JCheckBox(Globals.lang("Override default font settings"));
+ //useCustomIconTheme = new JCheckBox(Globals.lang("Use custom icon theme"));
+ //customIconThemeFile = new JTextField();
FormLayout layout = new FormLayout
("1dlu, 8dlu, left:pref, 4dlu, fill:pref, 4dlu, fill:60dlu, 4dlu, fill:pref",
"");
p1.add(fontSize);
builder.append(p1);
builder.nextLine();
- builder.append(antialias);
+ builder.append(overrideFonts);
builder.nextLine();
builder.appendSeparator(Globals.lang("Table appearance"));
+ builder.append(antialias);
+ builder.nextLine();
builder.append(colorCodes);
builder.nextLine();
builder.append(fontButton);
builder.nextLine();
builder.append(colorPanel);
-
-
+ /*builder.appendSeparator(Globals.lang("Custom icon theme"));
+ builder.append(useCustomIconTheme);
+ builder.nextLine();
+ JPanel p2 = new JPanel();
+ lab = new JLabel(Globals.lang("Custom icon theme file")+":");
+ p2.add(lab);
+ p2.add(customIconThemeFile);
+ BrowseAction browse = new BrowseAction(null, customIconThemeFile, false);
+ JButton browseBut = new JButton(Globals.lang("Browse"));
+ browseBut.addActionListener(browse);
+ p2.add(browseBut);
+ builder.append(p2);
+ */
JPanel upper = new JPanel(),
sort = new JPanel(),
iconCol.setLayout(gbl);
+ overrideFonts.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ fontSize.setEnabled(overrideFonts.isSelected());
+ }
+ });
fontButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
antialias.setSelected(_prefs.getBoolean("antialias"));
fontSize.setText("" + _prefs.getInt("menuFontSize"));
oldMenuFontSize = _prefs.getInt("menuFontSize");
-
+ overrideFonts.setSelected(_prefs.getBoolean("overrideDefaultFonts"));
+ oldOverrideFontSize = overrideFonts.isSelected();
+ fontSize.setEnabled(overrideFonts.isSelected());
+ //useCustomIconTheme.setSelected(_prefs.getBoolean("useCustomIconTheme"));
+ //customIconThemeFile.setText(_prefs.get("customIconThemeFile"));
colorPanel.setValues();
}
_prefs.put("fontFamily", font.getFamily());
_prefs.putInt("fontStyle", font.getStyle());
_prefs.putInt("fontSize", font.getSize());
+ _prefs.putBoolean("overrideDefaultFonts", overrideFonts.isSelected());
GUIGlobals.CURRENTFONT = font;
colorPanel.storeSettings();
try {
int size = Integer.parseInt(fontSize.getText());
- if (size != oldMenuFontSize) {
+ if ((overrideFonts.isSelected() != oldOverrideFontSize) ||
+ (size != oldMenuFontSize)) {
_prefs.putInt("menuFontSize", size);
JOptionPane.showMessageDialog(null, Globals.lang("You have changed the menu and label font size. "
+ "You must restart JabRef for this to come into effect."), Globals.lang("Changed font settings"),
// The action for saving a database.
actions.put("save", new AbstractWorker() {
- private boolean success = false;
+ private boolean success = false, cancelled = false;
public void init() throws Throwable {
success = false;
+ cancelled = false;
if (file == null)
runCommand("saveAs");
else {
frame.setTabTitle(BasePanel.this, file.getName());
frame.output(Globals.lang("Saved database")+" '"
+file.getPath()+"'.");
- } else {
+ } else if (!cancelled) {
frame.output(Globals.lang("Save failed"));
}
}
public void run() {
+ if (file == null) {
+ cancelled = true;
+ return;
+ }
+
try {
// If the option is set, autogenerate keys for all entries that are
// lacking keys, before saving:
MainTableFormat tableFormat = new MainTableFormat(this);
tableFormat.updateTableFormat();
//EventTableModel tableModel = new EventTableModel(sortedList, tableFormat);
- mainTable = new MainTable(/*tableModel, */tableFormat, searchFilterList);
+ mainTable = new MainTable(/*tableModel, */tableFormat, searchFilterList, frame);
+
selectionListener = new MainTableSelectionListener(this, mainTable);
mainTable.updateFont();
mainTable.addSelectionListener(selectionListener);
}
/**
- * Sets the given field to the given value.
+ * Sets a number of fields simultaneously. The given HashMap contains field
+ * names as keys, each mapped to the value to set.
+ * WARNING: this method does not notify change listeners, so it should *NOT*
+ * be used for entries that are being displayed in the GUI. Furthermore, it
+ * does not check values for content, so e.g. empty strings will be set as such.
*/
public void setField(HashMap fields){
_fields.putAll(fields);
dummy = new BibtexSingleField( MARKED, false) ;
dummy.setPrivate();
- dummy.setWriteable(false);
+ dummy.setWriteable(true); // This field must be written to file!
dummy.setDisplayable(false);
add(dummy) ;
*/
public class BrowseAction extends AbstractAction implements ActionListener {
- JFrame frame;
+ JFrame frame=null;
+ //JDialog dialog=null;
JTextField comp;
boolean dir;
}
+ /*public BrowseAction(JDialog dialog, JTextField tc, boolean dir) {
+ super(Globals.lang("Browse"));
+ this.dialog = dialog;
+ this.dir = dir;
+ comp = tc;
+
+ } */
+
public void actionPerformed(ActionEvent e) {
String chosen = null;
if (dir)
KEEP_UPPER = 1,
KEEP_LOWER = 2,
BREAK = 5, // close
+ IMPORT_AND_DELETE_OLD = 1,
+ IMPORT_AND_KEEP_OLD = 0,
+ DO_NOT_IMPORT = 2,
DUPLICATE_SEARCH = 1,
IMPORT_CHECK = 2,
INSPECTION = 3;
boolean block = true;
TitleLabel lab;
- public DuplicateResolverDialog(JabRefFrame frame, BibtexEntry one, BibtexEntry two, int type) {
- super(frame, Globals.lang("Possible duplicate entries"), true);
+ public DuplicateResolverDialog(JFrame frame, BibtexEntry one, BibtexEntry two, int type) {
+ super(frame, Globals.lang("Possible duplicate entries"), true);
+ init(one, two, type);
+ Util.placeDialog(this, frame);
+ }
+
+ public DuplicateResolverDialog(JDialog frame, BibtexEntry one, BibtexEntry two, int type) {
+ super(frame, Globals.lang("Possible duplicate entries"), true);
+ init(one, two, type);
+ Util.placeDialog(this, frame);
+ }
+ private void init(BibtexEntry one, BibtexEntry two, int type) {
switch (type) {
case DUPLICATE_SEARCH:
first = new JButton(Globals.lang("Keep upper"));
con.gridwidth = GridBagConstraints.REMAINDER;
con.weightx = 1;
con.weighty = 0;
- lab = new TitleLabel(Globals.lang((type==DUPLICATE_SEARCH)?"":
- "Entry in current database"));
+ lab = new TitleLabel((type==DUPLICATE_SEARCH) ? "" :
+ Globals.lang("Entry in current database"));
gbl.setConstraints(lab, con);
main.add(lab);
con.weighty = 1;
main.add(sp);
con.weighty = 0;
con.insets = new Insets(10,10,0,10);
- lab = new TitleLabel(Globals.lang((type==DUPLICATE_SEARCH)?"":
- "Entry in import"));
+ lab = new TitleLabel((type==DUPLICATE_SEARCH) ? "" :
+ Globals.lang("Entry in import"));
gbl.setConstraints(lab, con);
main.add(lab);
con.weighty = 1;
both.requestFocus();
- Util.placeDialog(this, frame);
+
}
private void setSourceView(BibtexEntry one, BibtexEntry two) {
return status;
}
- public static int resolveDuplicate(JabRefFrame frame, BibtexEntry one, BibtexEntry two) {
+ public static int resolveDuplicate(JFrame frame, BibtexEntry one, BibtexEntry two) {
+ DuplicateResolverDialog drd = new DuplicateResolverDialog(frame, one, two,
+ DUPLICATE_SEARCH);
+ drd.setVisible(true); // drd.show(); -> deprecated since 1.5
+ return drd.getSelected();
+ }
+
+ public static int resolveDuplicate(JDialog frame, BibtexEntry one, BibtexEntry two) {
DuplicateResolverDialog drd = new DuplicateResolverDialog(frame, one, two,
DUPLICATE_SEARCH);
drd.setVisible(true); // drd.show(); -> deprecated since 1.5
return drd.getSelected();
}
+ public static int resolveDuplicateInImport(JabRefFrame frame, BibtexEntry existing,
+ BibtexEntry imported) {
+ DuplicateResolverDialog drd = new DuplicateResolverDialog(frame, existing, imported,
+ IMPORT_CHECK);
+ drd.setVisible(true); // drd.show(); -> deprecated since 1.5
+ return drd.getSelected();
+ }
+
}
super(parent,Globals.lang("Customize entry types"), false);
this.parent = parent;
help = new HelpAction(parent.helpDiag, GUIGlobals.customEntriesHelp,
- "Help", GUIGlobals.helpSmallIconFile);
+ "Help", GUIGlobals.getIconUrl("helpSmall"));
setTypeSelection();
//setSize(440,400);
initialize();
fieldList = java.util.Arrays.asList(fields);
reqPan = new EntryEditorTab(fieldList, this, true, Globals.lang("Required fields"));
tabbed.addTab(Globals.lang("Required fields"),
- new ImageIcon(GUIGlobals.showReqIconFile), reqPan.getPane(),
+ GUIGlobals.getImage("required"), reqPan.getPane(),
Globals.lang("Show required fields"));
tabs.add(reqPan);
//}
optPan = new EntryEditorTab(java.util.Arrays.asList(entry.getOptionalFields()),
this, false, Globals.lang("Optional fields"));
tabbed.addTab(Globals.lang("Optional fields"),
- new ImageIcon(GUIGlobals.showOptIconFile), optPan.getPane(),
+ GUIGlobals.getImage("optional"), optPan.getPane(),
Globals.lang("Show optional fields"));
tabs.add(optPan);
}
for (int i=0; i<tabList.getTabCount(); i++) {
EntryEditorTab newTab = new EntryEditorTab(tabList.getTabFields(i),
this, false, tabList.getTabName(i));
- tabbed.addTab(tabList.getTabName(i), new ImageIcon(GUIGlobals.showGenIconFile), newTab.getPane());
+ tabbed.addTab(tabList.getTabName(i), GUIGlobals.getImage("general"), newTab.getPane());
tabs.add(newTab);
}
srcPanel.setName(Globals.lang("BibTeX source"));
if (Globals.prefs.getBoolean("showSource")) {
tabbed.addTab(Globals.lang("BibTeX source"),
- new ImageIcon(GUIGlobals.sourceIconFile), srcPanel,
+ GUIGlobals.getImage("source"), srcPanel,
Globals.lang("Show/edit BibTeX source"));
tabs.add(srcPanel);
}
*/
public synchronized void switchTo(BibtexEntry be) {
if (entry == be)
- return;
+ return;
- //Util.pr("EntryEditor.switchTo(BibtexEntry): "+entry.getCiteKey());
- //Util.pr("::EntryEditor.switchTo(BibtexEntry): "+this.type.getName());
+ //Util.pr("EntryEditor.switchTo(BibtexEntry): "+entry.getCiteKey());
+ //Util.pr("::EntryEditor.switchTo(BibtexEntry): "+this.type.getName());
storeCurrentEdit();
- entry = be;
- updateAllFields();
- validateAllFields();
- updateSource();
- panel.showing = be;
- }
+ // Remove this instance as property listener for the entry:
+ entry.removePropertyChangeListener(this);
+ // Register as property listener for the new entry:
+ be.addPropertyChangeListener(this);
+
+ entry = be;
+
+ updateAllFields();
+ validateAllFields();
+ updateSource();
+ panel.showing = be;
+
+ }
/**
* Returns false if the contents of the source panel has not been validated,
class DeleteAction extends AbstractAction {
public DeleteAction() {
- super(Globals.lang("Delete"), new ImageIcon(GUIGlobals.removeIconFile));
+ super(Globals.lang("Delete"), GUIGlobals.getImage("delete"));
putValue(SHORT_DESCRIPTION, Globals.lang("Delete entry"));
}
class CloseAction extends AbstractAction {
public CloseAction() {
- super(Globals.lang("Close window"), new ImageIcon(GUIGlobals.closeIconFile));
+ super(Globals.lang("Close window"), GUIGlobals.getImage("close"));
putValue(SHORT_DESCRIPTION, Globals.lang("Close window"));
}
class CopyKeyAction extends AbstractAction {
public CopyKeyAction() {
- super("Copy BibTeX key to clipboard", new ImageIcon(GUIGlobals.copyKeyIconFile));
+ super("Copy BibTeX key to clipboard");
putValue(SHORT_DESCRIPTION, "Copy BibTeX key to clipboard (Ctrl-K)");
//putValue(MNEMONIC_KEY, GUIGlobals.copyKeyCode);
class NextEntryAction extends AbstractAction {
public NextEntryAction() {
- super(Globals.lang("Next entry"), new ImageIcon(GUIGlobals.downIconFile));
+ super(Globals.lang("Next entry"), GUIGlobals.getImage("down"));
putValue(SHORT_DESCRIPTION, Globals.lang("Next entry"));
}
class PrevEntryAction extends AbstractAction {
public PrevEntryAction() {
- super(Globals.lang("Previous entry"), new ImageIcon(GUIGlobals.upIconFile));
+ super(Globals.lang("Previous entry"), GUIGlobals.getImage("up"));
putValue(SHORT_DESCRIPTION, Globals.lang("Previous entry"));
}
BibtexEntry selectedEntry;
public GenerateKeyAction(JabRefFrame parentFrame) {
- super(Globals.lang("Generate BibTeX key"), new ImageIcon(GUIGlobals.genKeyIconFile));
+ super(Globals.lang("Generate BibTeX key"), GUIGlobals.getImage("makeKey"));
parent = parentFrame;
// selectedEntry = newEntry ;
class UndoAction extends AbstractAction {
public UndoAction() {
- super("Undo", new ImageIcon(GUIGlobals.undoIconFile));
+ super("Undo", GUIGlobals.getImage("undo"));
putValue(SHORT_DESCRIPTION, "Undo");
}
class RedoAction extends AbstractAction {
public RedoAction() {
- super("Undo", new ImageIcon(GUIGlobals.redoIconFile));
+ super("Undo", GUIGlobals.getImage("redo"));
putValue(SHORT_DESCRIPTION, "Redo");
}
}
public void validateAllFields() {
- for (Iterator i=editors.keySet().iterator(); i.hasNext();) {
- String field = (String)i.next();
- FieldEditor ed = (FieldEditor)editors.get(field);
- if (((Component)ed).hasFocus())
- ed.setBackground(GUIGlobals.activeEditor);
- else
+ for (Iterator i = editors.keySet().iterator(); i.hasNext();) {
+ String field = (String) i.next();
+ FieldEditor ed = (FieldEditor) editors.get(field);
+ ed.setEnabled(true);
+ if (((Component) ed).hasFocus())
+ ed.setBackground(GUIGlobals.activeEditor);
+ else
ed.setBackground(GUIGlobals.validFieldBackground);
}
}
package net.sf.jabref;
+import com.jgoodies.forms.builder.ButtonBarBuilder;
+
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
getContentPane().setLayout(new BorderLayout());
JPanel pan = new JPanel();
getContentPane().add(pan, BorderLayout.CENTER);
- JPanel lower = new JPanel();
+ JPanel buttons = new JPanel();
JButton // ok = new JButton("Ok"),
cancel = new JButton(Globals.lang("Cancel"));
//ok.addActionListener(this);
cancel.addActionListener(this);
- //pan.setBackground(GUIGlobals.lightGray);
- //lower.setBackground(GUIGlobals.lightGray);
- // Make ESC close dialog, equivalent to clicking Cancel.
+ // Make ESC close dialog, equivalent to clicking Cancel.
cancel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
.put(baseFrame_.prefs.getKey("Close dialog"), "close");
cancel.getActionMap().put("close", cancelAction);
- //lower.add(ok);
- lower.add(cancel);
- getContentPane().add(lower, BorderLayout.SOUTH);
+ //buttons.add(ok);
+ ButtonBarBuilder bb = new ButtonBarBuilder(buttons);
+ //buttons.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
+ bb.addGlue();
+ bb.addGridded(cancel);
+ bb.addGlue();
+
+ getContentPane().add(buttons, BorderLayout.SOUTH);
GridBagLayout gbl = new GridBagLayout();
pan.setLayout(gbl);
GridBagConstraints con = new GridBagConstraints();
(BorderFactory.createEtchedBorder(),
Globals.lang("Entry types")));
//pan.setBackground(Color.white);
- //lower.setBackground(Color.white);
+ //buttons.setBackground(Color.white);
pack();
setResizable(false);
}
import javax.swing.*;
import com.jgoodies.forms.layout.Sizes;
+import com.jgoodies.looks.Options;
public class FieldContentSelector extends JComponent implements ActionListener {
* insertion.
*/
public FieldContentSelector(JabRefFrame frame, BasePanel panel,
- Dialog owner, FieldEditor editor, MetaData data,
- AbstractAction action, boolean horizontalLayout) {
+ Dialog owner, FieldEditor editor, MetaData data,
+ AbstractAction action, boolean horizontalLayout) {
m_editor = editor;
m_metaData = data;
m_action = action;
* insertion.
*/
public FieldContentSelector(JabRefFrame frame, BasePanel panel,
- Frame owner, FieldEditor editor, MetaData data,
- AbstractAction action, boolean horizontalLayout) {
+ Frame owner, FieldEditor editor, MetaData data,
+ AbstractAction action, boolean horizontalLayout) {
m_editor = editor;
m_metaData = data;
m_action = action;
//list.setEditable(true);
list.setMaximumRowCount(35);
-
+ // Set the width of the popup independent of the size of th box itself:
+ list.putClientProperty(
+ Options.COMBO_POPUP_PROTOTYPE_DISPLAY_VALUE_KEY,
+ "The longest text in the combo popup menu. And even longer.");
/*
* list.getInputMap().put(Globals.prefs.getKey("Select value"),
* "enter"); list.getActionMap().put("enter", new EnterAction());
public void keyTyped(KeyEvent event) {
}
+
+/* public void setText(String t) {
+ super.setText(t); //To change body of overridden methods use File | Settings | File Templates.
+ Thread.dumpStack();
+ }*/
}
{
public PasteAction()
{
- super("Paste from clipboard", "Paste from clipboard", GUIGlobals.pasteIconFile);
+ super("Paste from clipboard", "Paste from clipboard",
+ GUIGlobals.getIconUrl("paste"));
}
public void actionPerformed(ActionEvent e)
{
public CopyAction()
{
- super("Copy to clipboard", "Copy to clipboard", GUIGlobals.copyIconFile);
+ super("Copy to clipboard", "Copy to clipboard", GUIGlobals.getIconUrl("copy"));
}
public void actionPerformed(ActionEvent e)
import java.util.*;
//import java.util.List;
import java.net.URL;
+import java.net.MalformedURLException;
import javax.swing.*;
-import java.io.FileInputStream;
import java.io.InputStream;
+import java.io.IOException;
+import java.io.File;
public class GUIGlobals {
static HashMap tableIcons = new HashMap(); // Contains table icon mappings. Set up
// further below.
- public static JLabel incompleteLabel; // JLabel with icon signaling an incomplete entry.
public static Color activeEditor = new Color(230, 230, 255);
+ static HashMap iconMap;
+
public static JLabel getTableIcon(String fieldType) {
Object o = tableIcons.get(fieldType);
if (o == null) {
}
- public static URL
-
- openIconFile = GUIGlobals.class.getResource(pre + "fldr_obj.gif"),
- editIconFile = GUIGlobals.class.getResource(pre + "edittsk_tsk.gif"),
- saveIconFile = GUIGlobals.class.getResource(pre + "save_edit.gif"),
- saveAsIconFile = GUIGlobals.class.getResource(pre + "saveas_edit.gif"),
- prefsIconFile = GUIGlobals.class.getResource(pre + "configure2.png"),
- newIconFile = GUIGlobals.class.getResource(pre + "new_page.gif"),
- undoIconFile = GUIGlobals.class.getResource(pre + "undo_edit.gif"),
- redoIconFile = GUIGlobals.class.getResource(pre + "redo_edit.gif"),
- preambleIconFile = GUIGlobals.class.getResource(pre + "preamble.png"),
- addIconFile = GUIGlobals.class.getResource(pre + "plus.gif"),
- delRowIconFile = GUIGlobals.class.getResource(pre + "minus.gif"),
- showReqIconFile = GUIGlobals.class.getResource(pre + "reqIcon.png"),
- showOptIconFile = GUIGlobals.class.getResource(pre + "optIcon.png"),
- showGenIconFile = GUIGlobals.class.getResource(pre + "absIcon.png"),
- showAbsIconFile = GUIGlobals.class.getResource(pre + "genIcon.png"),
- sourceIconFile = GUIGlobals.class.getResource(pre + "viewsource.gif"),
- copyIconFile = GUIGlobals.class.getResource(pre + "copy_edit.gif"),
- cutIconFile = GUIGlobals.class.getResource(pre + "cut_edit.gif"),
- copyKeyIconFile = GUIGlobals.class.getResource(pre + "copy_edit.gif"),
- genKeyIconFile = GUIGlobals.class.getResource(pre + "wizard.png"),
- lyxIconFile = GUIGlobals.class.getResource(pre + "lyx2.png"),
- backIconFile = GUIGlobals.class.getResource(pre + "backward_nav.gif"),
- forwardIconFile = GUIGlobals.class.getResource(pre + "forward_nav.gif"),
- contentsIconFile = GUIGlobals.class.getResource(pre + "toc_closed.gif"),
- removeIconFile = GUIGlobals.class.getResource(pre + "delete_edit.gif"),
- upIconFile = GUIGlobals.class.getResource(pre + "prev_nav.gif"),
- downIconFile = GUIGlobals.class.getResource(pre + "next_nav.gif"),
- stringsIconFile = GUIGlobals.class.getResource(pre + "strings.png"),
- groupsIconFile = GUIGlobals.class.getResource(pre + "queue.png"),
- groupsHighlightMatchingAnyFile = GUIGlobals.class.getResource(pre + "groupsHighlightAny.png"),
- groupsHighlightMatchingAllFile = GUIGlobals.class.getResource(pre + "groupsHighlightAll.png"),
- closeIconFile = GUIGlobals.class.getResource(pre + "fileclose.png"),
- close2IconFile = GUIGlobals.class.getResource(pre + "fileclose2.png"),
- refreshSmallIconFile = GUIGlobals.class.getResource(pre + "refresh_nav.gif"),
- helpSmallIconFile = GUIGlobals.class.getResource(pre + "view.gif"),
- helpIconFile = GUIGlobals.class.getResource(pre + "view.gif"),
- aboutIcon = GUIGlobals.class.getResource(pre + "view.gif"),
- helpContentsIconFile = GUIGlobals.class.getResource(pre + "contents2.png"),
- newSmallIconFile = GUIGlobals.class.getResource(pre + "new_page.gif"),
- pasteIconFile = GUIGlobals.class.getResource(pre + "paste_edit.gif"),
- editEntryIconFile = GUIGlobals.class.getResource(pre + "DocumentDraw.gif"),
- searchIconFile = GUIGlobals.class.getResource(pre + "search.gif"),
- previewIconFile = GUIGlobals.class.getResource(pre + "preview.png"),
- autoGroupIcon = GUIGlobals.class.getResource(pre + "addtsk_tsk.gif"),
- wwwIcon = GUIGlobals.class.getResource(pre + "www.png"),
- wwwCiteSeerIcon = GUIGlobals.class.getResource(pre + "wwwciteseer.png"),
- fetchMedlineIcon = GUIGlobals.class.getResource(pre + "goto.png"),
- fetchHourglassIcon = GUIGlobals.class.getResource(pre + "Hourglass.png"),
- pdfIcon = GUIGlobals.class.getResource(pre + "pdf.png"),
- pdfSmallIcon = GUIGlobals.class.getResource(pre + "pdf_small.gif"),
- sheetIcon = GUIGlobals.class.getResource(pre + "defaults_ps.gif"),
- doiIcon = GUIGlobals.class.getResource(pre + "doi.png"),
- doiSmallIcon = GUIGlobals.class.getResource(pre + "doismall.png"),
- psIcon = GUIGlobals.class.getResource(pre + "postscript.png"),
- incompleteIcon = GUIGlobals.class.getResource(pre + "exclamation.gif"),
- winEdtIcon = GUIGlobals.class.getResource(pre + "winedt.png"),
- jabreflogo = GUIGlobals.class.getResource(pre + "JabRef-icon.png"),
- completeTagIcon = GUIGlobals.class.getResource(pre + "completeItem.png"),
- wrongTagIcon = GUIGlobals.class.getResource(pre + "wrongItem.png"),
- clearInputArea = GUIGlobals.class.getResource(pre + "new_page.gif"),
- markIcon = GUIGlobals.class.getResource(pre + "mark.png"),
- unmarkIcon = GUIGlobals.class.getResource(pre + "unmark.png"),
- newBibFile = GUIGlobals.class.getResource(pre + "newBibFile.png"),
- integrityCheck = GUIGlobals.class.getResource(pre + "integrity.png"),
- integrityInfo = GUIGlobals.class.getResource(pre + "messageInfo.png"),
- integrityWarn = GUIGlobals.class.getResource(pre + "messageWarn.png"),
- integrityFail = GUIGlobals.class.getResource(pre + "messageFail.png"),
- duplicateIcon = GUIGlobals.class.getResource(pre + "duplicate.png"),
- emacsIcon = GUIGlobals.class.getResource(pre + "emacs.png");
-
- public static ImageIcon
- groupRefiningIcon = new ImageIcon(GUIGlobals.class.getResource(pre +"groupRefining.png")),
- groupIncludingIcon = new ImageIcon(GUIGlobals.class.getResource(pre +"groupIncluding.png")),
- groupRegularIcon = null;
-
- /*public static incompleteEntryIcon = new ImageIcon(incompleteIcon);
- static {
- incompleteEntryIcon.setTool
- }*/
-
// Help files (in HTML format):
public static String
baseFrameHelp = "BaseFrameHelp.html",
}
+ /**
+ * Read either the default icon theme, or a custom one. If loading of the custom theme
+ * fails, try to fall back on the default theme.
+ */
+ public static void setUpIconTheme() {
+ String defaultPrefix = "/images/crystal_16/", prefix = defaultPrefix;
+
+ URL defaultResource = GUIGlobals.class.getResource(prefix+"Icons.properties");
+ URL resource = defaultResource;
+
+ if (Globals.prefs.getBoolean("useCustomIconTheme")) {
+ String filename = Globals.prefs.get("customIconThemeFile");
+ if (filename != null)
+ try {
+ File file = new File(filename);
+ String parent = file.getParentFile().getAbsolutePath();
+ prefix = "file://"+parent+System.getProperty("file.separator");
+ resource = new URL("file://"+file.getAbsolutePath());
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ }
+ try {
+ iconMap = readIconThemeFile(resource, prefix);
+ } catch (IOException e) {
+ System.err.println(Globals.lang("Unable to read icon theme file")+" '"+
+ resource.toString()+"'");
+ // If we were trying to load a custom theme, try the default one as a fallback:
+ if (resource != defaultResource)
+ try {
+ iconMap = readIconThemeFile(defaultResource, defaultPrefix);
+ } catch (IOException e2) {
+ System.err.println(Globals.lang("Unable to read default icon theme."));
+ }
+
+ }
+
+
+ }
+
+ /**
+ * Looks up the URL for the image representing the given function, in the resource
+ * file listing images.
+ * @param name The name of the icon, such as "open", "save", "saveAs" etc.
+ * @return The URL to the actual image to use.
+ */
+ public static URL getIconUrl(String name) {
+ if (iconMap.containsKey(name)) {
+ String path = (String)iconMap.get(name);
+ URL url = GUIGlobals.class.getResource(path);
+ if (url == null)
+ // This may be a resource outside of the jar file, so we try a general URL:
+ try {
+ url = new URL(path);
+ } catch (MalformedURLException e) {
+ url = null;
+ }
+ if (url == null)
+ System.err.println(Globals.lang("Could not find image file")+" '"+path+"'");
+ return url;
+ }
+ else return null;
+ }
+
+ /**
+ * Constructs an ImageIcon for the given function, using the image specified in
+ * the resource files resource/Icons_en.properties.
+ * @param name The name of the icon, such as "open", "save", "saveAs" etc.
+ * @return The ImageIcon for the function.
+ */
+ public static ImageIcon getImage(String name) {
+ URL u = getIconUrl(name);
+ return u != null ? new ImageIcon(getIconUrl(name)) : null;
+ }
+
+ /**
+ * Read a typical java property file into a HashMap. Currently doesn't support escaping
+ * of the '=' character - it simply looks for the first '=' to determine where the key ends.
+ * Both the key and the value is trimmed for whitespace at the ends.
+ * @param file The URL to read information from.
+ * @param prefix A String to prefix to all values read. Can represent e.g. the directory
+ * where icon files are to be found.
+ * @return A HashMap containing all key-value pairs found.
+ * @throws IOException
+ */
+ private static HashMap readIconThemeFile(URL file, String prefix) throws IOException {
+ HashMap map = new HashMap();
+ InputStream in = null;
+ try {
+ in = file.openStream();
+ StringBuffer buffer = new StringBuffer();
+ int c;
+ while ((c = in.read()) != -1)
+ buffer.append((char)c);
+ String[] lines = buffer.toString().split("\n");
+ String directory = null;
+ for (int i=0; i<lines.length; i++) {
+ String line = lines[i].trim();
+ int index = line.indexOf("=");
+ if (index >= 0) {
+ String key = line.substring(0, index).trim();
+ String value = prefix+line.substring(index+1).trim();
+ map.put(key, value);
+ }
+ }
+ } catch (IOException ex) {
+ throw ex;
+ } finally {
+ try {
+ if (in != null) in.close();
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+ return map;
+ }
+
/** returns the path to language independent help files */
public static String getLocaleHelpPath()
{
public static void init() {
typeNameFont = new Font("arial", Font.ITALIC+Font.BOLD, 24);
fieldNameFont = new Font("arial", Font.ITALIC+Font.BOLD, 14);
- incompleteLabel = new JLabel(new ImageIcon(GUIGlobals.incompleteIcon));
- incompleteLabel.setToolTipText(Globals.lang("Entry is incomplete"));
JLabel lab;
- lab = new JLabel(new ImageIcon(pdfIcon));
+ lab = new JLabel(getImage("pdfSmall"));
lab.setToolTipText(Globals.lang("Open")+" PDF");
tableIcons.put("pdf", lab);
- lab = new JLabel(new ImageIcon(wwwIcon));
+ lab = new JLabel(getImage("wwwSmall"));
lab.setToolTipText(Globals.lang("Open")+" URL");
tableIcons.put("url", lab);
- lab = new JLabel(new ImageIcon(wwwCiteSeerIcon));
+ lab = new JLabel(getImage("citeseer"));
lab.setToolTipText(Globals.lang("Open")+" CiteSeer URL");
tableIcons.put("citeseerurl", lab);
- lab = new JLabel(new ImageIcon(doiSmallIcon));
+ lab = new JLabel(getImage("doiSmall"));
lab.setToolTipText(Globals.lang("Open")+" DOI "+Globals.lang("web link"));
tableIcons.put("doi", lab);
- lab = new JLabel(new ImageIcon(psIcon));
+ lab = new JLabel(getImage("psSmall"));
lab.setToolTipText(Globals.lang("Open")+" PS");
tableIcons.put("ps", lab);
timeStampFormat = new JTextField();
timeStampField = new JTextField();
ownerHelp = new HelpAction(frame.helpDiag, GUIGlobals.ownerHelp,
- "Help", GUIGlobals.helpSmallIconFile);
+ "Help", GUIGlobals.getIconUrl("helpSmall"));
timeStampHelp = new HelpAction(frame.helpDiag, GUIGlobals.timeStampHelp, "Help",
- GUIGlobals.helpSmallIconFile);
+ GUIGlobals.getIconUrl("helpSmall"));
inspectionWarnDupli = new JCheckBox(Globals.lang("Warn about unresolved duplicates when closing inspection window"));
Insets marg = new Insets(0,12,3,0);
"pref, 6dlu, pref, 6dlu, pref, 6dlu, pref, 6dlu, pref, 6dlu, "
+"pref, 6dlu, pref, 6dlu, pref, 6dlu, pref, 6dlu, pref, 6dlu, "
+"pref, 6dlu, pref, 6dlu, pref, 6dlu, pref, 6dlu, pref, 6dlu, "
- +"pref, 6dlu, pref, 6dlu, pref");
+ +"pref, 6dlu, pref, 6dlu, pref, 6dlu, pref");
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
CellConstraints cc = new CellConstraints();
builder.addSeparator(Globals.lang("File"), cc.xyw(1,1, 5));
builder.add(defSource, cc.xy(2, 19));
builder.addSeparator(Globals.lang("Miscellaneous"), cc.xyw(1, 21, 5));
builder.add(useImportInspector, cc.xy(2, 23));
- builder.add(useImportInspectorForSingle, cc.xy(4, 23));
- builder.add(inspectionWarnDupli, cc.xy(4, 25));
- builder.add(ctrlClick, cc.xy(2, 27));
- builder.add(confirmDelete, cc.xy(2, 29));
- builder.add(keyDuplicateWarningDialog, cc.xy(2, 31));
- builder.add(keyEmptyWarningDialog, cc.xy(2, 33));
+ builder.add(useImportInspectorForSingle, cc.xy(2, 25));
+ builder.add(inspectionWarnDupli, cc.xy(2, 27));
+ builder.add(ctrlClick, cc.xy(2, 29));
+ builder.add(confirmDelete, cc.xy(2, 31));
+ builder.add(keyDuplicateWarningDialog, cc.xy(2, 33));
+ builder.add(keyEmptyWarningDialog, cc.xy(2, 35));
// Create a new panel with its own FormLayout for the last items:
FormLayout layout2 = new FormLayout
("left:pref, 8dlu, fill:60dlu, 4dlu, left:pref, 4dlu, fill:60dlu, 4dlu, fill:pref", "");
builder2.append(lab);
builder2.append(encodings);
- builder.add(builder2.getPanel(), cc.xyw(2, 35, 3));
+ builder.add(builder2.getPanel(), cc.xyw(2, 37, 3));
JPanel pan = builder.getPanel();
}
catch (MissingResourceException ex) {
translation = key;
- logger("Warning: could not get translation for \""
- + key + "\"");
+
+ //Thread.dumpStack(); // For debugging
+ /*logger("Warning: could not get translation for \""
+ + key + "\"");*/
}
if ((translation != null) && (translation.length() != 0)) {
translation = translation.replaceAll("_", " ");
off = new OpenFileFilter();
else if (!extension.equals(NONE))
off = new OpenFileFilter(extension);
- return (String[])getNewFileImpl(owner, directory, extension, null, off,
+ Object o = getNewFileImpl(owner, directory, extension, null, off,
JFileChooser.OPEN_DIALOG, updateWorkingdirectory, false, true);
+ String[] toReturn;
+ if (o instanceof String[])
+ toReturn = (String[])o;
+ else toReturn = new String[] {(String)o};
+
+ return toReturn;
}
public static String getNewFile(JFrame owner,
boolean dirOnly,
boolean multipleSelection) {
- if (ON_MAC) {
+ if (ON_MAC && prefs.getBoolean("useNativeFileDialogOnMac")) {
+
return getNewFileForMac(owner, directory, extension, dialogType,
- updateWorkingDirectory, dirOnly, off);
+ updateWorkingDirectory, dirOnly, off);
}
JFileChooser fc = null;
fc.addChoosableFileFilter(off);
fc.setDialogType(dialogType);
- int dialogResult = JFileChooser.CANCEL_OPTION;
+ int dialogResult;
if (dialogType == JFileChooser.OPEN_DIALOG) {
dialogResult = fc.showOpenDialog(owner);
} else if (dialogType == JFileChooser.SAVE_DIALOG) {
FilenameFilter filter) {
FileDialog fc = new FileDialog(owner);
+
//fc.setFilenameFilter(filter);
if (directory != null) {
fc.setDirectory(directory.getParent());
--- /dev/null
+/* (C) 2003 Nizar N. Batada, Morten O. Alver
+
+ All programs in this directory and
+ subdirectories are published under the GNU General Public License as
+ described below.
+
+ 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
+
+ Further information about the GNU GPL is available at:
+ http://www.gnu.org/copyleft/gpl.ja.html
+
+ */
+package net.sf.jabref;
+
+import java.io.* ;
+import java.nio.charset.Charset;
+import java.util.* ;
+import java.util.List;
+import java.util.logging.* ;
+import java.util.logging.Filter ;
+
+import java.awt.* ;
+import javax.swing.* ;
+
+import net.sf.jabref.collab.* ;
+import net.sf.jabref.imports.* ;
+import net.sf.jabref.util.* ;
+import net.sf.jabref.journals.JournalAbbreviations;
+
+public class Globals {
+
+ public static int SHORTCUT_MASK,// = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
+ FUTURE_YEAR = 2050, // Needs to give a year definitely in the future. Used for guessing the
+ // year field when parsing textual data. :-)
+
+ STANDARD_EXPORT_COUNT = 5, // The number of standard export formats.
+ METADATA_LINE_LENGTH = 70; // The line length used to wrap metadata.
+
+ private static String resourcePrefix = "resource/JabRef",
+ menuResourcePrefix = "resource/Menu",
+ integrityResourcePrefix = "resource/IntegrityMessage";
+ private static final String buildInfos = "/resource/build.properties" ;
+ public static final String additionalFields = "/resource/fields/fields.xml" ; // some extra field definitions
+ private static String logfile = "jabref.log";
+ public static ResourceBundle messages, menuTitles, intMessages ;
+ public static FileUpdateMonitor fileUpdateMonitor = new FileUpdateMonitor();
+ public static ImportFormatReader importFormatReader = new ImportFormatReader();
+
+ public static ErrorConsole errorConsole;
+
+ public static String VERSION,
+ BUILD,
+ BUILD_DATE ;
+
+ static
+ {
+ TBuildInfo bi = new TBuildInfo(buildInfos) ;
+ VERSION = bi.getBUILD_VERSION() ;
+ BUILD = bi.getBUILD_NUMBER() ;
+ BUILD_DATE = bi.getBUILD_DATE() ;
+
+ // TODO: Error console initialization here. When should it be used?
+ errorConsole = ErrorConsole.getInstance();
+ }
+
+
+
+ //public static ResourceBundle preferences = ResourceBundle.getBundle("resource/defaultPrefs");
+ public static Locale locale;
+ public static final String FILETYPE_PREFS_EXT = "_dir",
+ SELECTOR_META_PREFIX = "selector_",
+ LAYOUT_PREFIX = "/resource/layout/",
+ MAC = "Mac OS X",
+ DOI_LOOKUP_PREFIX = "http://dx.doi.org/",
+ NONE = "_non__",
+ FORMATTER_PACKAGE = "net.sf.jabref.export.layout.format.";
+ public static float duplicateThreshold = 0.75f;
+ private static Handler consoleHandler = new java.util.logging.ConsoleHandler();
+ public static String[] ENCODINGS,
+ ALL_ENCODINGS = //(String[]) Charset.availableCharsets().keySet().toArray(new String[]{});
+ new String[] {"ISO8859_1", "UTF8", "UTF-16", "ASCII",
+ "Cp1250", "Cp1251", "Cp1252", "Cp1253", "Cp1254", "Cp1257",
+ "JIS", "SJIS", "EUC-JP", // Added Japanese encodings.
+ "Big5", "Big5_HKSCS", "GBK",
+ "ISO8859_2", "ISO8859_3", "ISO8859_4", "ISO8859_5", "ISO8859_6",
+ "ISO8859_7", "ISO8859_8", "ISO8859_9", "ISO8859_13", "ISO8859_15"};
+
+ // String array that maps from month number to month string label:
+ public static String[] MONTHS = new String[] {"jan", "feb", "mar", "apr", "may", "jun",
+ "jul", "aug", "sep", "oct", "nov", "dec"};
+
+ // Map that maps from month string labels to
+ public static Map MONTH_STRINGS = new HashMap();
+ static {
+ MONTH_STRINGS.put("jan", "January");
+ MONTH_STRINGS.put("feb", "February");
+ MONTH_STRINGS.put("mar", "March");
+ MONTH_STRINGS.put("apr", "April");
+ MONTH_STRINGS.put("may", "May");
+ MONTH_STRINGS.put("jun", "June");
+ MONTH_STRINGS.put("jul", "July");
+ MONTH_STRINGS.put("aug", "August");
+ MONTH_STRINGS.put("sep", "September");
+ MONTH_STRINGS.put("oct", "October");
+ MONTH_STRINGS.put("nov", "November");
+ MONTH_STRINGS.put("dec", "December");
+
+ // Build list of encodings, by filtering out all that are not supported
+ // on this system:
+ List encodings = new ArrayList();
+ for (int i=0; i<ALL_ENCODINGS.length; i++) {
+ if (Charset.isSupported(ALL_ENCODINGS[i]))
+ encodings.add(ALL_ENCODINGS[i]);
+ }
+ ENCODINGS = (String[])encodings.toArray(new String[0]);
+
+ }
+
+
+ public static GlobalFocusListener focusListener = new GlobalFocusListener();
+ public static JabRefPreferences prefs = null;
+ public static HelpDialog helpDiag = null;
+ public static String osName = System.getProperty("os.name", "def");
+ public static boolean ON_MAC = (osName.equals(MAC)),
+ ON_WIN = osName.startsWith("Windows");
+
+
+ public static String[] SKIP_WORDS = {"a", "an", "the", "for", "on"};
+ public static SidePaneManager sidePaneManager;
+ public static final String NEWLINE = System.getProperty("line.separator");
+ public static final boolean UNIX_NEWLINE = NEWLINE.equals("\n"); // true if we have unix newlines.
+
+ public static final String BIBTEX_STRING = "__string";
+ // "Fieldname" to indicate that a field should be treated as a bibtex string. Used when writing database to file.
+
+ public static void logger(String s) {
+ Logger.global.info(s);
+ }
+
+ public static void turnOffLogging() { // only log exceptions
+ Logger.global.setLevel(java.util.logging.Level.SEVERE);
+ }
+
+ // should be only called once
+ public static void turnOnConsoleLogging() {
+ Logger.global.addHandler(consoleHandler);
+
+ }
+
+
+
+ public static void turnOnFileLogging() {
+ Logger.global.setLevel(java.util.logging.Level.ALL);
+ java.util.logging.Handler handler;
+ handler = new ConsoleHandler();
+ /*try {
+ handler = new FileHandler(logfile); // this will overwrite
+ }
+ catch (IOException e) { //can't open log file so use console
+ e.printStackTrace();
+
+ } */
+ Logger.global.addHandler(handler);
+
+ handler.setFilter(new Filter() { // select what gets logged
+ public boolean isLoggable(LogRecord record) {
+ return true;
+ }
+ });
+ }
+
+ public static void setLanguage(String language, String country) {
+ locale = new Locale(language, country);
+ messages = ResourceBundle.getBundle(resourcePrefix, locale);
+ menuTitles = ResourceBundle.getBundle(menuResourcePrefix, locale);
+ intMessages = ResourceBundle.getBundle(integrityResourcePrefix, locale);
+ Locale.setDefault(locale);
+ javax.swing.JComponent.setDefaultLocale(locale);
+ }
+
+
+ public static JournalAbbreviations journalAbbrev;
+
+
+ public static String lang(String key, String[] params) {
+ String translation = null;
+ try {
+ if (Globals.messages != null) {
+ translation = Globals.messages.getString(key.replaceAll(" ", "_"));
+ }
+ }
+ catch (MissingResourceException ex) {
+ translation = key;
+
+ //Thread.dumpStack(); // For debugging
+ logger("Warning: could not get translation for \""
+ + key + "\"");
+ }
+ if ((translation != null) && (translation.length() != 0)) {
+ translation = translation.replaceAll("_", " ");
+ StringBuffer sb = new StringBuffer();
+ boolean b = false;
+ char c;
+ for (int i = 0; i < translation.length(); ++i) {
+ c = translation.charAt(i);
+ if (c == '%') {
+ b = true;
+ } else {
+ if (!b) {
+ sb.append(c);
+ } else {
+ b = false;
+ try {
+ int index = Integer.parseInt(String.valueOf(c));
+ if (params != null && index >= 0 && index <= params.length)
+ sb.append(params[index]);
+ } catch (NumberFormatException e) {
+ // append literally (for quoting) or insert special symbol
+ switch (c) {
+ case 'c': // colon
+ sb.append(':');
+ break;
+ case 'e': // equal
+ sb.append('=');
+ break;
+ default: // anything else, e.g. %
+ sb.append(c);
+ }
+ }
+ }
+ }
+ }
+ return sb.toString();
+ }
+ return key;
+ }
+
+ public static String lang(String key) {
+ return lang(key, (String[])null);
+ }
+
+ public static String lang(String key, String s1) {
+ return lang(key, new String[]{s1});
+ }
+
+ public static String lang(String key, String s1, String s2) {
+ return lang(key, new String[]{s1, s2});
+ }
+
+ public static String lang(String key, String s1, String s2, String s3) {
+ return lang(key, new String[]{s1, s2, s3});
+ }
+
+ public static String menuTitle(String key) {
+ String translation = null;
+ try {
+ if (Globals.messages != null) {
+ translation = Globals.menuTitles.getString(key.replaceAll(" ", "_"));
+ }
+ }
+ catch (MissingResourceException ex) {
+ translation = key;
+
+ //System.err.println("Warning: could not get menu item translation for \""
+ // + key + "\"");
+
+ }
+ if ((translation != null) && (translation.length() != 0)) {
+ return translation.replaceAll("_", " ");
+ }
+ else {
+ return key;
+ }
+ }
+
+ public static String getIntegrityMessage(String key)
+ {
+ String translation = null;
+ try {
+ if (Globals.intMessages != null) {
+ translation = Globals.intMessages.getString(key);
+ }
+ }
+ catch (MissingResourceException ex) {
+ translation = key;
+
+// System.err.println("Warning: could not get menu item translation for \""
+// + key + "\"");
+ }
+ if ((translation != null) && (translation.length() != 0)) {
+ return translation ;
+ }
+ else {
+ return key;
+ }
+ }
+
+
+ //============================================================
+ // Using the hashmap of entry types found in BibtexEntryType
+ //============================================================
+ public static BibtexEntryType getEntryType(String type) {
+ // decide which entryType object to return
+ Object o = BibtexEntryType.ALL_TYPES.get(type);
+ if (o != null) {
+ return (BibtexEntryType) o;
+ }
+ else {
+ return BibtexEntryType.OTHER;
+ }
+ /*
+ if(type.equals("article"))
+ return BibtexEntryType.ARTICLE;
+ else if(type.equals("book"))
+ return BibtexEntryType.BOOK;
+ else if(type.equals("inproceedings"))
+ return BibtexEntryType.INPROCEEDINGS;
+ */
+ }
+
+ /**
+ * This method provides the correct opening brace to use when writing a field
+ * to BibTeX format.
+ * @return A String containing the braces to use.
+ */
+ public static String getOpeningBrace() {
+ return "{";
+ /*
+ As of version 2.0, storing all fields with double braces is no longer supported, because
+ it causes problems with e.g. the author field.
+
+ if (prefs.getBoolean("autoDoubleBraces"))
+ return "{{";
+ else
+ return "{";
+ */
+ }
+
+ /**
+ * This method provides the correct closing brace to use when writing a field
+ * to BibTeX format.
+ * @return A String containing the braces to use.
+ */
+ public static String getClosingBrace() {
+ return "}";
+ /*
+ As of version 2.0, storing all fields with double braces is no longer supported, because
+ it causes problems with e.g. the author field.
+
+ if (prefs.getBoolean("autoDoubleBraces"))
+ return "}}";
+ else
+ */
+
+ }
+
+ /* public static void setupKeyBindings(JabRefPreferences prefs) {
+ }*/
+
+
+ public static String[] getMultipleFiles(JFrame owner,
+ File directory, String extension,
+ boolean updateWorkingdirectory) {
+
+ OpenFileFilter off = null;
+ if (extension == null)
+ off = new OpenFileFilter();
+ else if (!extension.equals(NONE))
+ off = new OpenFileFilter(extension);
+ Object o = getNewFileImpl(owner, directory, extension, null, off,
+ JFileChooser.OPEN_DIALOG, updateWorkingdirectory, false, true);
+ String[] toReturn;
+ if (o instanceof String[])
+ toReturn = (String[])o;
+ else toReturn = new String[] {(String)o};
+
+ return toReturn;
+ }
+
+ public static String getNewFile(JFrame owner,
+ File directory, String extension,
+ int dialogType,
+ boolean updateWorkingDirectory) {
+ return getNewFile(owner, directory, extension, null, dialogType,
+ updateWorkingDirectory, false);
+ }
+
+
+ public static String getNewFile(JFrame owner,
+ File directory, String extension,
+ String description,
+ int dialogType,
+ boolean updateWorkingDirectory) {
+ return getNewFile(owner, directory, extension, description, dialogType,
+ updateWorkingDirectory, false);
+ }
+
+
+ public static String getNewDir(JFrame owner,
+ File directory, String extension,
+ int dialogType, boolean updateWorkingDirectory) {
+ return getNewFile(owner, directory, extension, null, dialogType,
+ updateWorkingDirectory, true);
+ }
+
+ public static String getNewDir(JFrame owner,
+ File directory, String extension,
+ String description,
+ int dialogType, boolean updateWorkingDirectory) {
+ return getNewFile(owner, directory, extension, description, dialogType,
+ updateWorkingDirectory, true);
+ }
+
+ private static String getNewFile(JFrame owner,
+ File directory, String extension,
+ String description,
+ int dialogType,
+ boolean updateWorkingDirectory,
+ boolean dirOnly) {
+
+ OpenFileFilter off = null;
+
+ if (extension == null)
+ off = new OpenFileFilter();
+ else if (!extension.equals(NONE))
+ off = new OpenFileFilter(extension);
+
+ return (String)getNewFileImpl(owner, directory, extension, description, off,
+ dialogType, updateWorkingDirectory, dirOnly, false);
+ }
+
+ private static Object getNewFileImpl(JFrame owner,
+ File directory, String extension,
+ String description,
+ OpenFileFilter off,
+ int dialogType,
+ boolean updateWorkingDirectory,
+ boolean dirOnly,
+ boolean multipleSelection) {
+
+ if (ON_MAC && prefs.getBoolean("useNativeFileDialogOnMac")) {
+
+ return getNewFileForMac(owner, directory, extension, dialogType,
+ updateWorkingDirectory, dirOnly, off);
+ }
+
+ JFileChooser fc = null;
+ try {
+ fc = new JabRefFileChooser(directory);
+ } catch (InternalError errl) {
+ // This try/catch clause was added because a user reported an
+ // InternalError getting thrown on WinNT, presumably because of a
+ // bug in JGoodies Windows PLAF. This clause can be removed if the
+ // bug is fixed, but for now we just resort to the native file
+ // dialog, using the same method as is always used on Mac:
+ return getNewFileForMac(owner, directory, extension, dialogType,
+ updateWorkingDirectory, dirOnly, off);
+ }
+
+ if (dirOnly) {
+ fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+
+ }
+
+ fc.setMultiSelectionEnabled(multipleSelection);
+
+ fc.addChoosableFileFilter(off);
+ fc.setDialogType(dialogType);
+ int dialogResult;
+ if (dialogType == JFileChooser.OPEN_DIALOG) {
+ dialogResult = fc.showOpenDialog(owner);
+ } else if (dialogType == JFileChooser.SAVE_DIALOG) {
+ dialogResult = fc.showSaveDialog(owner);
+ } else {
+ dialogResult = fc.showDialog(owner, description);
+ }
+
+ // the getSelectedFile method returns a valid fileselection
+ // (if something is selected) indepentently from dialog return status
+ if (dialogResult != JFileChooser.APPROVE_OPTION)
+ return null;
+
+ // okay button
+ File selectedFile = fc.getSelectedFile();
+ if (selectedFile == null) { // cancel
+ return null;
+ }
+
+ // If this is a save dialog, and the user has not chosen "All files" as filter
+ // we enforce the given extension. But only if extension is not null.
+ if ((extension != null) && (dialogType == JFileChooser.SAVE_DIALOG) && (fc.getFileFilter() == off) &&
+ !off.accept(selectedFile)) {
+
+ // add the first extension if there are multiple extensions
+ selectedFile = new File(selectedFile.getPath() + extension.split("[, ]+", 0)[0]);
+ }
+
+ if (updateWorkingDirectory) {
+ prefs.put("workingDirectory", selectedFile.getPath());
+ }
+
+ if (!multipleSelection)
+ return selectedFile.getAbsolutePath();
+ else {
+ File[] files = fc.getSelectedFiles();
+ String[] filenames = new String[files.length];
+ for (int i=0; i<files.length; i++)
+ filenames[i] = files[i].getAbsolutePath();
+ return filenames;
+ }
+ }
+
+ private static String getNewFileForMac(JFrame owner,
+ File directory, String extensions,
+ int dialogType,
+ boolean updateWorkingDirectory,
+ boolean dirOnly,
+ FilenameFilter filter) {
+
+ FileDialog fc = new FileDialog(owner);
+
+ //fc.setFilenameFilter(filter);
+ if (directory != null) {
+ fc.setDirectory(directory.getParent());
+ }
+ if (dialogType == JFileChooser.OPEN_DIALOG) {
+ fc.setMode(FileDialog.LOAD);
+ }
+ else {
+ fc.setMode(FileDialog.SAVE);
+ }
+
+ fc.setVisible(true); // fc.show(); -> deprecated since 1.5
+
+ if (fc.getFile() != null) {
+ Globals.prefs.put("workingDirectory", fc.getDirectory() + fc.getFile());
+ return fc.getDirectory() + fc.getFile();
+ }
+ else {
+ return null;
+ }
+ }
+
+
+ public static String SPECIAL_COMMAND_CHARS = "\"`^~'c";
+ public static HashMap HTML_CHARS = new HashMap(),
+ HTMLCHARS = new HashMap(),
+ XML_CHARS = new HashMap(),
+ ASCII2XML_CHARS = new HashMap(),
+ UNICODE_CHARS = new HashMap(),
+ RTFCHARS = new HashMap(),
+ URL_CHARS = new HashMap();
+ static {
+
+ //System.out.println(journalAbbrev.getAbbreviatedName("Journal of Fish Biology", true));
+ //System.out.println(journalAbbrev.getAbbreviatedName("Journal of Fish Biology", false));
+ //System.out.println(journalAbbrev.getFullName("Aquaculture Eng."));
+ /*for (Iterator i=journalAbbrev.fullNameIterator(); i.hasNext();) {
+ String s = (String)i.next();
+ System.out.println(journalAbbrev.getFullName(s)+" : "+journalAbbrev.getAbbreviatedName(s, true));
+ } */
+
+ // Start the thread that monitors file time stamps.
+ //Util.pr("Starting FileUpdateMonitor thread. Globals line 293.");
+ fileUpdateMonitor.start();
+
+ try {
+ SHORTCUT_MASK = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
+ } catch (Throwable t) {
+
+ }
+
+ // Special characters in URLs need to be replaced to ensure that the URL
+ // opens properly on all platforms:
+ URL_CHARS.put("<", "%3c");
+ URL_CHARS.put(">", "%3e");
+ URL_CHARS.put("(", "%28");
+ URL_CHARS.put(")", "%29");
+ URL_CHARS.put(" ", "%20");
+ URL_CHARS.put("&", "%26");
+ URL_CHARS.put("$", "%24");
+
+
+
+// HTMLCHARS.put("\"a", "ä");
+// HTMLCHARS.put("\"A", "Ä");
+// HTMLCHARS.put("\"e", "ë");
+// HTMLCHARS.put("\"E", "Ë");
+// HTMLCHARS.put("\"i", "ï");
+// HTMLCHARS.put("\"I", "Ï");
+// HTMLCHARS.put("\"o", "ö");
+// HTMLCHARS.put("\"O", "Ö");
+// HTMLCHARS.put("\"u", "ü");
+// HTMLCHARS.put("\"U", "Ü");
+// HTMLCHARS.put("`a", "à");
+// HTMLCHARS.put("`A", "À");
+// HTMLCHARS.put("`e", "è");
+// HTMLCHARS.put("`E", "È");
+// HTMLCHARS.put("`i", "ì");
+// HTMLCHARS.put("`I", "Ì");
+// HTMLCHARS.put("`o", "ò");
+// HTMLCHARS.put("`O", "Ò");
+// HTMLCHARS.put("`u", "ù");
+// HTMLCHARS.put("`U", "Ù");
+// HTMLCHARS.put("'e", "é");
+// HTMLCHARS.put("'E", "É");
+// HTMLCHARS.put("'i", "í");
+// HTMLCHARS.put("'I", "Í");
+// HTMLCHARS.put("'o", "ó");
+// HTMLCHARS.put("'O", "Ó");
+// HTMLCHARS.put("'u", "ú");
+// HTMLCHARS.put("'U", "Ú");
+// HTMLCHARS.put("'a", "á");
+// HTMLCHARS.put("'A", "Á");
+// HTMLCHARS.put("^a", "ô");
+// HTMLCHARS.put("^A", "Ô");
+// HTMLCHARS.put("^o", "ô");
+// HTMLCHARS.put("^O", "Ô");
+// HTMLCHARS.put("^u", "û");
+// HTMLCHARS.put("^U", "Û");
+// HTMLCHARS.put("^e", "ê");
+// HTMLCHARS.put("^E", "Ê");
+// HTMLCHARS.put("^i", "î");
+// HTMLCHARS.put("^I", "Î");
+// HTMLCHARS.put("~o", "õ");
+// HTMLCHARS.put("~O", "Õ");
+// HTMLCHARS.put("~n", "ñ");
+// HTMLCHARS.put("~N", "Ñ");
+// HTMLCHARS.put("~a", "ã");
+// HTMLCHARS.put("~A", "Ã");
+// HTMLCHARS.put("cc", "ç");
+// HTMLCHARS.put("cC", "Ç");
+
+
+ // Following character definitions contributed by Ervin Kolenovic:
+ // HTML named entities from #192 - #255 (UNICODE Latin-1)
+ HTMLCHARS.put("`A", "À"); // #192
+ HTMLCHARS.put("'A", "Á"); // #193
+ HTMLCHARS.put("^A", "Â"); // #194
+ HTMLCHARS.put("~A", "Ã"); // #195
+ HTMLCHARS.put("\"A", "Ä"); // #196
+ HTMLCHARS.put("AA", "Å"); // #197
+ HTMLCHARS.put("AE", "Æ"); // #198
+ HTMLCHARS.put("cC", "Ç"); // #199
+ HTMLCHARS.put("`E", "È"); // #200
+ HTMLCHARS.put("'E", "É"); // #201
+ HTMLCHARS.put("^E", "Ê"); // #202
+ HTMLCHARS.put("\"E", "Ë"); // #203
+ HTMLCHARS.put("`I", "Ì"); // #204
+ HTMLCHARS.put("'I", "Í"); // #205
+ HTMLCHARS.put("^I", "Î"); // #206
+ HTMLCHARS.put("\"I", "Ï"); // #207
+ HTMLCHARS.put("DH", "Ð"); // #208
+ HTMLCHARS.put("~N", "Ñ"); // #209
+ HTMLCHARS.put("`O", "Ò"); // #210
+ HTMLCHARS.put("'O", "Ó"); // #211
+ HTMLCHARS.put("^O", "Ô"); // #212
+ HTMLCHARS.put("~O", "Õ"); // #213
+ HTMLCHARS.put("\"O", "Ö"); // #214
+ // According to ISO 8859-1 the "\times" symbol should be placed here (#215).
+ // Omitting this, because it is a mathematical symbol.
+ HTMLCHARS.put("O", "&OSlash;"); // #216
+ HTMLCHARS.put("`U", "Ù"); // #217
+ HTMLCHARS.put("'U", "Ú"); // #218
+ HTMLCHARS.put("^U", "Û"); // #219
+ HTMLCHARS.put("\"U", "Ü"); // #220
+ HTMLCHARS.put("'Y", "Ý"); // #221
+ HTMLCHARS.put("TH", "Þ"); // #222
+ HTMLCHARS.put("ss", "ß"); // #223
+ HTMLCHARS.put("`a", "à"); // #224
+ HTMLCHARS.put("'a", "á"); // #225
+ HTMLCHARS.put("^a", "â"); // #226
+ HTMLCHARS.put("~a", "ã"); // #227
+ HTMLCHARS.put("\"a", "ä"); // #228
+ HTMLCHARS.put("aa", "å"); // #229
+ HTMLCHARS.put("ae", "æ"); // #230
+ HTMLCHARS.put("cc", "ç"); // #231
+ HTMLCHARS.put("`e", "è"); // #232
+ HTMLCHARS.put("'e", "é"); // #233
+ HTMLCHARS.put("^e", "ê"); // #234
+ HTMLCHARS.put("\"e", "ë"); // #235
+ HTMLCHARS.put("`i", "ì"); // #236
+ HTMLCHARS.put("'i", "í"); // #237
+ HTMLCHARS.put("^i", "î"); // #238
+ HTMLCHARS.put("\"i", "ï"); // #239
+ HTMLCHARS.put("dh", "ð"); // #240
+ HTMLCHARS.put("~n", "ñ"); // #241
+ HTMLCHARS.put("`o", "ò"); // #242
+ HTMLCHARS.put("'o", "ó"); // #243
+ HTMLCHARS.put("^o", "ô"); // #244
+ HTMLCHARS.put("~o", "õ"); // #245
+ HTMLCHARS.put("\"o", "ö"); // #246
+ // According to ISO 8859-1 the "\div" symbol should be placed here (#247).
+ // Omitting this, because it is a mathematical symbol.
+ HTMLCHARS.put("o", "ø"); // #248
+ HTMLCHARS.put("`u", "ù"); // #249
+ HTMLCHARS.put("'u", "ú"); // #250
+ HTMLCHARS.put("^u", "û"); // #251
+ HTMLCHARS.put("\"u", "ü"); // #252
+ HTMLCHARS.put("'y", "ý"); // #253
+ HTMLCHARS.put("th", "þ"); // #254
+ HTMLCHARS.put("\"y", "ÿ"); // #255
+
+ // HTML special characters without names (UNICODE Latin Extended-A), indicated by UNICODE number
+ HTMLCHARS.put("=A", "Ā"); // "Amacr"
+ HTMLCHARS.put("=a", "ā"); // "amacr"
+ HTMLCHARS.put("uA", "Ă"); // "Abreve"
+ HTMLCHARS.put("ua", "ă"); // "abreve"
+ HTMLCHARS.put("kA", "Ą"); // "Aogon"
+ HTMLCHARS.put("ka", "ą"); // "aogon"
+ HTMLCHARS.put("'C", "Ć"); // "Cacute"
+ HTMLCHARS.put("'c", "ć"); // "cacute"
+ HTMLCHARS.put("^C", "Ĉ"); // "Ccirc"
+ HTMLCHARS.put("^c", "ĉ"); // "ccirc"
+ HTMLCHARS.put(".C", "Ċ"); // "Cdot"
+ HTMLCHARS.put(".c", "ċ"); // "cdot"
+ HTMLCHARS.put("vC", "Č"); // "Ccaron"
+ HTMLCHARS.put("vc", "č"); // "ccaron"
+ HTMLCHARS.put("vD", "Ď"); // "Dcaron"
+ // Symbol #271 (d´) has no special Latex command
+ HTMLCHARS.put("DJ", "Đ"); // "Dstrok"
+ HTMLCHARS.put("dj", "đ"); // "dstrok"
+ HTMLCHARS.put("=E", "Ē"); // "Emacr"
+ HTMLCHARS.put("=e", "ē"); // "emacr"
+ HTMLCHARS.put("uE", "Ĕ"); // "Ebreve"
+ HTMLCHARS.put("ue", "ĕ"); // "ebreve"
+ HTMLCHARS.put(".E", "Ė"); // "Edot"
+ HTMLCHARS.put(".e", "ė"); // "edot"
+ HTMLCHARS.put("kE", "Ę"); // "Eogon"
+ HTMLCHARS.put("ke", "ę"); // "eogon"
+ HTMLCHARS.put("vE", "Ě"); // "Ecaron"
+ HTMLCHARS.put("ve", "ě"); // "ecaron"
+ HTMLCHARS.put("^G", "Ĝ"); // "Gcirc"
+ HTMLCHARS.put("^g", "ĝ"); // "gcirc"
+ HTMLCHARS.put("uG", "Ğ"); // "Gbreve"
+ HTMLCHARS.put("ug", "ğ"); // "gbreve"
+ HTMLCHARS.put(".G", "Ġ"); // "Gdot"
+ HTMLCHARS.put(".g", "ġ"); // "gdot"
+ HTMLCHARS.put("cG", "Ģ"); // "Gcedil"
+ HTMLCHARS.put("'g", "ģ"); // "gacute"
+ HTMLCHARS.put("^H", "Ĥ"); // "Hcirc"
+ HTMLCHARS.put("^h", "ĥ"); // "hcirc"
+ HTMLCHARS.put("Hstrok", "Ħ"); // "Hstrok"
+ HTMLCHARS.put("hstrok", "ħ"); // "hstrok"
+ HTMLCHARS.put("~I", "Ĩ"); // "Itilde"
+ HTMLCHARS.put("~i", "ĩ"); // "itilde"
+ HTMLCHARS.put("=I", "Ī"); // "Imacr"
+ HTMLCHARS.put("=i", "ī"); // "imacr"
+ HTMLCHARS.put("uI", "Ĭ"); // "Ibreve"
+ HTMLCHARS.put("ui", "ĭ"); // "ibreve"
+ HTMLCHARS.put("kI", "Į"); // "Iogon"
+ HTMLCHARS.put("ki", "į"); // "iogon"
+ HTMLCHARS.put(".I", "İ"); // "Idot"
+ HTMLCHARS.put("i", "ı"); // "inodot"
+ // Symbol #306 (IJ) has no special Latex command
+ // Symbol #307 (ij) has no special Latex command
+ HTMLCHARS.put("^J", "Ĵ"); // "Jcirc"
+ HTMLCHARS.put("^j", "ĵ"); // "jcirc"
+ HTMLCHARS.put("cK", "Ķ"); // "Kcedil"
+ HTMLCHARS.put("ck", "ķ"); // "kcedil"
+ // Symbol #312 (k) has no special Latex command
+ HTMLCHARS.put("'L", "Ĺ"); // "Lacute"
+ HTMLCHARS.put("'l", "ĺ"); // "lacute"
+ HTMLCHARS.put("cL", "Ļ"); // "Lcedil"
+ HTMLCHARS.put("cl", "ļ"); // "lcedil"
+ // Symbol #317 (L´) has no special Latex command
+ // Symbol #318 (l´) has no special Latex command
+ HTMLCHARS.put("Lmidot", "Ŀ"); // "Lmidot"
+ HTMLCHARS.put("lmidot", "ŀ"); // "lmidot"
+ HTMLCHARS.put("L", "Ł"); // "Lstrok"
+ HTMLCHARS.put("l", "ł"); // "lstrok"
+ HTMLCHARS.put("'N", "Ń"); // "Nacute"
+ HTMLCHARS.put("'n", "ń"); // "nacute"
+ HTMLCHARS.put("cN", "Ņ"); // "Ncedil"
+ HTMLCHARS.put("cn", "ņ"); // "ncedil"
+ HTMLCHARS.put("vN", "Ň"); // "Ncaron"
+ HTMLCHARS.put("vn", "ň"); // "ncaron"
+ // Symbol #329 (´n) has no special Latex command
+ HTMLCHARS.put("NG", "Ŋ"); // "ENG"
+ HTMLCHARS.put("ng", "ŋ"); // "eng"
+ HTMLCHARS.put("=O", "Ō"); // "Omacr"
+ HTMLCHARS.put("=o", "ō"); // "omacr"
+ HTMLCHARS.put("uO", "Ŏ"); // "Obreve"
+ HTMLCHARS.put("uo", "ŏ"); // "obreve"
+ HTMLCHARS.put("HO", "Ő"); // "Odblac"
+ HTMLCHARS.put("Ho", "ő"); // "odblac"
+ HTMLCHARS.put("OE", "Œ"); // "OElig"
+ HTMLCHARS.put("oe", "œ"); // "oelig"
+ HTMLCHARS.put("'R", "Ŕ"); // "Racute"
+ HTMLCHARS.put("'r", "ŕ"); // "racute"
+ HTMLCHARS.put("cR", "Ŗ"); // "Rcedil"
+ HTMLCHARS.put("cr", "ŗ"); // "rcedil"
+ HTMLCHARS.put("vR", "Ř"); // "Rcaron"
+ HTMLCHARS.put("vr", "ř"); // "rcaron"
+ HTMLCHARS.put("'S", "Ś"); // "Sacute"
+ HTMLCHARS.put("'s", "ś"); // "sacute"
+ HTMLCHARS.put("^S", "Ŝ"); // "Scirc"
+ HTMLCHARS.put("^s", "ŝ"); // "scirc"
+ HTMLCHARS.put("cS", "Ş"); // "Scedil"
+ HTMLCHARS.put("cs", "ş"); // "scedil"
+ HTMLCHARS.put("vS", "Š"); // "Scaron"
+ HTMLCHARS.put("vs", "š"); // "scaron"
+ HTMLCHARS.put("cT", "Ţ"); // "Tcedil"
+ HTMLCHARS.put("ct", "ţ"); // "tcedil"
+ HTMLCHARS.put("vT", "Ť"); // "Tcaron"
+ // Symbol #357 (t´) has no special Latex command
+ HTMLCHARS.put("Tstrok", "Ŧ"); // "Tstrok"
+ HTMLCHARS.put("tstrok", "ŧ"); // "tstrok"
+ HTMLCHARS.put("~U", "Ũ"); // "Utilde"
+ HTMLCHARS.put("~u", "ũ"); // "utilde"
+ HTMLCHARS.put("=U", "Ū"); // "Umacr"
+ HTMLCHARS.put("=u", "ū"); // "umacr"
+ HTMLCHARS.put("uU", "Ŭ"); // "Ubreve"
+ HTMLCHARS.put("uu", "ŭ"); // "ubreve"
+ HTMLCHARS.put("rU", "Ů"); // "Uring"
+ HTMLCHARS.put("ru", "ů"); // "uring"
+ HTMLCHARS.put("HU", "Ű"); // "Odblac"
+ HTMLCHARS.put("Hu", "ű"); // "odblac"
+ HTMLCHARS.put("kU", "Ų"); // "Uogon"
+ HTMLCHARS.put("ku", "ų"); // "uogon"
+ HTMLCHARS.put("^W", "Ŵ"); // "Wcirc"
+ HTMLCHARS.put("^w", "ŵ"); // "wcirc"
+ HTMLCHARS.put("^Y", "Ŷ"); // "Ycirc"
+ HTMLCHARS.put("^y", "ŷ"); // "ycirc"
+ HTMLCHARS.put("\"Y", "Ÿ"); // "Yuml"
+ HTMLCHARS.put("'Z", "Ź"); // "Zacute"
+ HTMLCHARS.put("'z", "ź"); // "zacute"
+ HTMLCHARS.put(".Z", "Ż"); // "Zdot"
+ HTMLCHARS.put(".z", "ż"); // "zdot"
+ HTMLCHARS.put("vZ", "Ž"); // "Zcaron"
+ HTMLCHARS.put("vz", "ž"); // "zcaron"
+ // Symbol #383 (f) has no special Latex command
+
+
+ XML_CHARS.put("\\{\\\\\\\"\\{a\\}\\}", "ä");
+ XML_CHARS.put("\\{\\\\\\\"\\{A\\}\\}", "Ä");
+ XML_CHARS.put("\\{\\\\\\\"\\{e\\}\\}", "ë");
+ XML_CHARS.put("\\{\\\\\\\"\\{E\\}\\}", "Ë");
+ XML_CHARS.put("\\{\\\\\\\"\\{i\\}\\}", "ï");
+ XML_CHARS.put("\\{\\\\\\\"\\{I\\}\\}", "Ï");
+ XML_CHARS.put("\\{\\\\\\\"\\{o\\}\\}", "ö");
+ XML_CHARS.put("\\{\\\\\\\"\\{O\\}\\}", "Ö");
+ XML_CHARS.put("\\{\\\\\\\"\\{u\\}\\}", "ü");
+ XML_CHARS.put("\\{\\\\\\\"\\{U\\}\\}", "Ü");
+
+ XML_CHARS.put("\\{\\\\\\`\\{e\\}\\}", "è");
+ XML_CHARS.put("\\{\\\\\\`\\{E\\}\\}", "È");
+ XML_CHARS.put("\\{\\\\\\`\\{i\\}\\}", "ì");
+ XML_CHARS.put("\\{\\\\\\`\\{I\\}\\}", "Ì");
+ XML_CHARS.put("\\{\\\\\\`\\{o\\}\\}", "ò");
+ XML_CHARS.put("\\{\\\\\\`\\{O\\}\\}", "Ò");
+ XML_CHARS.put("\\{\\\\\\`\\{u\\}\\}", "ù");
+ XML_CHARS.put("\\{\\\\\\`\\{U\\}\\}", "Ù");
+ XML_CHARS.put("\\{\\\\\\'\\{e\\}\\}", "é");
+ XML_CHARS.put("\\{\\\\\\\uFFFD\\{E\\}\\}", "É");
+ XML_CHARS.put("\\{\\\\\\\uFFFD\\{i\\}\\}", "í");
+ XML_CHARS.put("\\{\\\\\\\uFFFD\\{I\\}\\}", "Í");
+ XML_CHARS.put("\\{\\\\\\\uFFFD\\{o\\}\\}", "ó");
+ XML_CHARS.put("\\{\\\\\\\uFFFD\\{O\\}\\}", "Ó");
+ XML_CHARS.put("\\{\\\\\\\uFFFD\\{u\\}\\}", "ú");
+ XML_CHARS.put("\\{\\\\\\\uFFFD\\{U\\}\\}", "Ú");
+ XML_CHARS.put("\\{\\\\\\\uFFFD\\{a\\}\\}", "á");
+ XML_CHARS.put("\\{\\\\\\\uFFFD\\{A\\}\\}", "Á");
+
+ XML_CHARS.put("\\{\\\\\\^\\{o\\}\\}", "ô");
+ XML_CHARS.put("\\{\\\\\\^\\{O\\}\\}", "Ô");
+ XML_CHARS.put("\\{\\\\\\^\\{u\\}\\}", "ù");
+ XML_CHARS.put("\\{\\\\\\^\\{U\\}\\}", "Ù");
+ XML_CHARS.put("\\{\\\\\\^\\{e\\}\\}", "ê");
+ XML_CHARS.put("\\{\\\\\\^\\{E\\}\\}", "Ê");
+ XML_CHARS.put("\\{\\\\\\^\\{i\\}\\}", "î");
+ XML_CHARS.put("\\{\\\\\\^\\{I\\}\\}", "Î");
+ XML_CHARS.put("\\{\\\\\\~\\{o\\}\\}", "õ");
+ XML_CHARS.put("\\{\\\\\\~\\{O\\}\\}", "Õ");
+ XML_CHARS.put("\\{\\\\\\~\\{n\\}\\}", "ñ");
+ XML_CHARS.put("\\{\\\\\\~\\{N\\}\\}", "Ñ");
+ XML_CHARS.put("\\{\\\\\\~\\{a\\}\\}", "ã");
+ XML_CHARS.put("\\{\\\\\\~\\{A\\}\\}", "Ã");
+
+
+ XML_CHARS.put("\\{\\\\\\\"a\\}", "ä");
+ XML_CHARS.put("\\{\\\\\\\"A\\}", "Ä");
+ XML_CHARS.put("\\{\\\\\\\"e\\}", "ë");
+ XML_CHARS.put("\\{\\\\\\\"E\\}", "Ë");
+ XML_CHARS.put("\\{\\\\\\\"i\\}", "ï");
+ XML_CHARS.put("\\{\\\\\\\"I\\}", "Ï");
+ XML_CHARS.put("\\{\\\\\\\"o\\}", "ö");
+ XML_CHARS.put("\\{\\\\\\\"O\\}", "Ö");
+ XML_CHARS.put("\\{\\\\\\\"u\\}", "ü");
+ XML_CHARS.put("\\{\\\\\\\"U\\}", "Ü");
+
+ XML_CHARS.put("\\{\\\\\\`e\\}", "è");
+ XML_CHARS.put("\\{\\\\\\`E\\}", "È");
+ XML_CHARS.put("\\{\\\\\\`i\\}", "ì");
+ XML_CHARS.put("\\{\\\\\\`I\\}", "Ì");
+ XML_CHARS.put("\\{\\\\\\`o\\}", "ò");
+ XML_CHARS.put("\\{\\\\\\`O\\}", "Ò");
+ XML_CHARS.put("\\{\\\\\\`u\\}", "ù");
+ XML_CHARS.put("\\{\\\\\\`U\\}", "Ù");
+ XML_CHARS.put("\\{\\\\\\'e\\}", "é");
+ XML_CHARS.put("\\{\\\\\\'E\\}", "É");
+ XML_CHARS.put("\\{\\\\\\'i\\}", "í");
+ XML_CHARS.put("\\{\\\\\\'I\\}", "Í");
+ XML_CHARS.put("\\{\\\\\\'o\\}", "ó");
+ XML_CHARS.put("\\{\\\\\\'O\\}", "Ó");
+ XML_CHARS.put("\\{\\\\\\'u\\}", "ú");
+ XML_CHARS.put("\\{\\\\\\'U\\}", "Ú");
+ XML_CHARS.put("\\{\\\\\\'a\\}", "á");
+ XML_CHARS.put("\\{\\\\\\'A\\}", "Á");
+
+ XML_CHARS.put("\\{\\\\\\^a\\}", "ô");
+ XML_CHARS.put("\\{\\\\\\^A\\}", "Ô");
+ XML_CHARS.put("\\{\\\\\\^o\\}", "ô");
+ XML_CHARS.put("\\{\\\\\\^O\\}", "Ô");
+ XML_CHARS.put("\\{\\\\\\^u\\}", "ù");
+ XML_CHARS.put("\\{\\\\\\^U\\}", "Ù");
+ XML_CHARS.put("\\{\\\\\\^e\\}", "ê");
+ XML_CHARS.put("\\{\\\\\\^E\\}", "Ê");
+ XML_CHARS.put("\\{\\\\\\^i\\}", "î");
+ XML_CHARS.put("\\{\\\\\\^I\\}", "Î");
+ XML_CHARS.put("\\{\\\\\\~o\\}", "õ");
+ XML_CHARS.put("\\{\\\\\\~O\\}", "Õ");
+ XML_CHARS.put("\\{\\\\\\~n\\}", "ñ");
+ XML_CHARS.put("\\{\\\\\\~N\\}", "Ñ");
+ XML_CHARS.put("\\{\\\\\\~a\\}", "ã");
+ XML_CHARS.put("\\{\\\\\\~A\\}", "Ã");
+
+ ASCII2XML_CHARS.put("<", "<");
+ ASCII2XML_CHARS.put("\"", """);
+ ASCII2XML_CHARS.put(">", ">");
+
+
+ UNICODE_CHARS.put("\u00C0", "A");
+ UNICODE_CHARS.put("\u00C1", "A");
+ UNICODE_CHARS.put("\u00C2", "A");
+ UNICODE_CHARS.put("\u00C3", "A");
+ UNICODE_CHARS.put("\u00C4", "A");
+ UNICODE_CHARS.put("\u00C5", "Aa");
+ UNICODE_CHARS.put("\u00C6", "Ae");
+ UNICODE_CHARS.put("\u00C7", "C");
+ UNICODE_CHARS.put("\u00C8", "E");
+ UNICODE_CHARS.put("\u00C9", "E");
+ UNICODE_CHARS.put("\u00CA", "E");
+ UNICODE_CHARS.put("\u00CB", "E");
+ UNICODE_CHARS.put("\u00CC", "I");
+ UNICODE_CHARS.put("\u00CD", "I");
+ UNICODE_CHARS.put("\u00CE", "I");
+ UNICODE_CHARS.put("\u00CF", "I");
+ UNICODE_CHARS.put("\u00D0", "D");
+ UNICODE_CHARS.put("\u00D1", "N");
+ UNICODE_CHARS.put("\u00D2", "O");
+ UNICODE_CHARS.put("\u00D3", "O");
+ UNICODE_CHARS.put("\u00D4", "O");
+ UNICODE_CHARS.put("\u00D5", "O");
+ UNICODE_CHARS.put("\u00D6", "Oe");
+ UNICODE_CHARS.put("\u00D8", "Oe");
+ UNICODE_CHARS.put("\u00D9", "U");
+ UNICODE_CHARS.put("\u00DA", "U");
+ UNICODE_CHARS.put("\u00DB", "U");
+ UNICODE_CHARS.put("\u00DC", "Ue"); // U umlaut ..
+ UNICODE_CHARS.put("\u00DD", "Y");
+ UNICODE_CHARS.put("\u00DF", "ss");
+ UNICODE_CHARS.put("\u00E0", "a");
+ UNICODE_CHARS.put("\u00E1", "a");
+ UNICODE_CHARS.put("\u00E2", "a");
+ UNICODE_CHARS.put("\u00E3", "a");
+ UNICODE_CHARS.put("\u00E4", "ae");
+ UNICODE_CHARS.put("\u00E5", "aa");
+ UNICODE_CHARS.put("\u00E6", "ae");
+ UNICODE_CHARS.put("\u00E7", "c");
+ UNICODE_CHARS.put("\u00E8", "e");
+ UNICODE_CHARS.put("\u00E9", "e");
+ UNICODE_CHARS.put("\u00EA", "e");
+ UNICODE_CHARS.put("\u00EB", "e");
+ UNICODE_CHARS.put("\u00EC", "i");
+ UNICODE_CHARS.put("\u00ED", "i");
+ UNICODE_CHARS.put("\u00EE", "i");
+ UNICODE_CHARS.put("\u00EF", "i");
+ UNICODE_CHARS.put("\u00F0", "o");
+ UNICODE_CHARS.put("\u00F1", "n");
+ UNICODE_CHARS.put("\u00F2", "o");
+ UNICODE_CHARS.put("\u00F3", "o");
+ UNICODE_CHARS.put("\u00F4", "o");
+ UNICODE_CHARS.put("\u00F5", "o");
+ UNICODE_CHARS.put("\u00F6", "oe");
+ UNICODE_CHARS.put("\u00F8", "oe");
+ UNICODE_CHARS.put("\u00F9", "u");
+ UNICODE_CHARS.put("\u00FA", "u");
+ UNICODE_CHARS.put("\u00FB", "u");
+ UNICODE_CHARS.put("\u00FC", "ue"); // u umlaut...
+ UNICODE_CHARS.put("\u00FD", "y");
+ UNICODE_CHARS.put("\u00FF", "y");
+ UNICODE_CHARS.put("\u0100", "A");
+ UNICODE_CHARS.put("\u0101", "a");
+ UNICODE_CHARS.put("\u0102", "A");
+ UNICODE_CHARS.put("\u0103", "a");
+ UNICODE_CHARS.put("\u0104", "A");
+ UNICODE_CHARS.put("\u0105", "a");
+ UNICODE_CHARS.put("\u0106", "C");
+ UNICODE_CHARS.put("\u0107", "c");
+ UNICODE_CHARS.put("\u0108", "C");
+ UNICODE_CHARS.put("\u0109", "c");
+ UNICODE_CHARS.put("\u010A", "C");
+ UNICODE_CHARS.put("\u010B", "c");
+ UNICODE_CHARS.put("\u010C", "C");
+ UNICODE_CHARS.put("\u010D", "c");
+ UNICODE_CHARS.put("\u010E", "D");
+ UNICODE_CHARS.put("\u010F", "d");
+ UNICODE_CHARS.put("\u0110", "D");
+ UNICODE_CHARS.put("\u0111", "d");
+ UNICODE_CHARS.put("\u0112", "E");
+ UNICODE_CHARS.put("\u0113", "e");
+ UNICODE_CHARS.put("\u0114", "E");
+ UNICODE_CHARS.put("\u0115", "e");
+ UNICODE_CHARS.put("\u0116", "E");
+ UNICODE_CHARS.put("\u0117", "e");
+ UNICODE_CHARS.put("\u0118", "E");
+ UNICODE_CHARS.put("\u0119", "e");
+ UNICODE_CHARS.put("\u011A", "E");
+ UNICODE_CHARS.put("\u011B", "e");
+ UNICODE_CHARS.put("\u011C", "G");
+ UNICODE_CHARS.put("\u011D", "g");
+ UNICODE_CHARS.put("\u011E", "G");
+ UNICODE_CHARS.put("\u011F", "g");
+ UNICODE_CHARS.put("\u0120", "G");
+ UNICODE_CHARS.put("\u0121", "g");
+ UNICODE_CHARS.put("\u0122", "G");
+ UNICODE_CHARS.put("\u0123", "g");
+ UNICODE_CHARS.put("\u0124", "H");
+ UNICODE_CHARS.put("\u0125", "h");
+ UNICODE_CHARS.put("\u0127", "h");
+ UNICODE_CHARS.put("\u0128", "I");
+ UNICODE_CHARS.put("\u0129", "i");
+ UNICODE_CHARS.put("\u012A", "I");
+ UNICODE_CHARS.put("\u012B", "i");
+ UNICODE_CHARS.put("\u012C", "I");
+ UNICODE_CHARS.put("\u012D", "i");
+ //UNICODE_CHARS.put("\u0100", "");
+
+ RTFCHARS.put("`a", "\\'e0");
+ RTFCHARS.put("`e", "\\'e8");
+ RTFCHARS.put("`i", "\\'ec");
+ RTFCHARS.put("`o", "\\'f2");
+ RTFCHARS.put("`u", "\\'f9");
+ RTFCHARS.put("?a", "\\'e1");
+ RTFCHARS.put("?e", "\\'e9");
+ RTFCHARS.put("?i", "\\'ed");
+ RTFCHARS.put("?o", "\\'f3");
+ RTFCHARS.put("?u", "\\'fa");
+ RTFCHARS.put("^a", "\\'e2");
+ RTFCHARS.put("^e", "\\'ea");
+ RTFCHARS.put("^i", "\\'ee");
+ RTFCHARS.put("^o", "\\'f4");
+ RTFCHARS.put("^u", "\\'fa");
+ RTFCHARS.put("\"a", "\\'e4");
+ RTFCHARS.put("\"e", "\\'eb");
+ RTFCHARS.put("\"i", "\\'ef");
+ RTFCHARS.put("\"o", "\\'f6");
+ RTFCHARS.put("\"u", "\\uc0\\u252");
+ RTFCHARS.put("~n", "\\'f1");
+ RTFCHARS.put("`A", "\\'c0");
+ RTFCHARS.put("`E", "\\'c8");
+ RTFCHARS.put("`I", "\\'cc");
+ RTFCHARS.put("`O", "\\'d2");
+ RTFCHARS.put("`U", "\\'d9");
+ RTFCHARS.put("?A", "\\'c1");
+ RTFCHARS.put("?E", "\\'c9");
+ RTFCHARS.put("?I", "\\'cd");
+ RTFCHARS.put("?O", "\\'d3");
+ RTFCHARS.put("?U", "\\'da");
+ RTFCHARS.put("^A", "\\'c2");
+ RTFCHARS.put("^E", "\\'ca");
+ RTFCHARS.put("^I", "\\'ce");
+ RTFCHARS.put("^O", "\\'d4");
+ RTFCHARS.put("^U", "\\'db");
+ RTFCHARS.put("\"A", "\\'c4");
+ RTFCHARS.put("\"E", "\\'cb");
+ RTFCHARS.put("\"I", "\\'cf");
+ RTFCHARS.put("\"O", "\\'d6");
+ RTFCHARS.put("\"U", "\\'dc");
+ // Use UNICODE characters for RTF-Chars which can not be found in the standard codepage
+
+ // RTFCHARS.put("`A", "\\uc0\\u192"); // "Agrave" exists in standard codepage
+ RTFCHARS.put("'A", "\\uc0\\u193"); // "Aacute"
+// RTFCHARS.put("^A", "\\uc0\\u194"); // "Acirc" exists in standard codepage
+ RTFCHARS.put("~A", "\\uc0\\u195"); // "Atilde"
+// RTFCHARS.put("\"A", "\\uc0\\u196"); // "Auml" exists in standard codepage
+ RTFCHARS.put("AA", "\\uc0\\u197"); // "Aring"
+ RTFCHARS.put("AE", "\\uc0\\u198"); // "AElig"
+ RTFCHARS.put("cC", "\\uc0\\u199"); // "Ccedil"
+// RTFCHARS.put("`E", "\\uc0\\u200"); // "Egrave" exists in standard codepage
+ RTFCHARS.put("'E", "\\uc0\\u201"); // "Eacute"
+// RTFCHARS.put("^E", "\\uc0\\u202"); // "Ecirc" exists in standard codepage
+// RTFCHARS.put("\"E", "\\uc0\\u203"); // "Euml" exists in standard codepage
+// RTFCHARS.put("`I", "\\uc0\\u204"); // "Igrave" exists in standard codepage
+ RTFCHARS.put("'I", "\\uc0\\u205"); // "Iacute"
+// RTFCHARS.put("^I", "\\uc0\\u206"); // "Icirc" exists in standard codepage
+// RTFCHARS.put("\"I", "\\uc0\\u207"); // "Iuml" exists in standard codepage
+ RTFCHARS.put("DH", "\\uc0\\u208"); // "ETH"
+ RTFCHARS.put("~N", "\\uc0\\u209"); // "Ntilde"
+// RTFCHARS.put("`O", "\\uc0\\u210"); // "Ograve" exists in standard codepage
+ RTFCHARS.put("'O", "\\uc0\\u211"); // "Oacute"
+// RTFCHARS.put("^O", "\\uc0\\u212"); // "Ocirc" exists in standard codepage
+ RTFCHARS.put("~O", "\\uc0\\u213"); // "Otilde"
+// RTFCHARS.put("\"O", "\\uc0\\u214"); // "Ouml" exists in standard codepage
+ // According to ISO 8859-1 the "\times" symbol should be placed here (#215).
+ // Omitting this, because it is a mathematical symbol.
+ RTFCHARS.put("O", "\\uc0\\u216"); // "OSlash"
+// RTFCHARS.put("`U", "\\uc0\\u217"); // "Ugrave" exists in standard codepage
+ RTFCHARS.put("'U", "\\uc0\\u218"); // "Uacute"
+// RTFCHARS.put("^U", "\\uc0\\u219"); // "Ucirc" exists in standard codepage
+// RTFCHARS.put("\"U", "\\uc0\\u220"); // "Uuml" exists in standard codepage
+ RTFCHARS.put("'Y", "\\uc0\\u221"); // "Yacute"
+ RTFCHARS.put("TH", "\\uc0\\u222"); // "THORN"
+ RTFCHARS.put("ss", "\\uc0\\u223"); // "szlig"
+// RTFCHARS.put("`a", "\\uc0\\u224"); // "agrave" exists in standard codepage
+ RTFCHARS.put("'a", "\\uc0\\u225"); // "aacute"
+// RTFCHARS.put("^a", "\\uc0\\u226"); // "acirc" exists in standard codepage
+ RTFCHARS.put("~a", "\\uc0\\u227"); // "atilde"
+// RTFCHARS.put("\"a", "\\uc0\\u228"); // "auml" exists in standard codepage
+ RTFCHARS.put("aa", "\\uc0\\u229"); // "aring"
+ RTFCHARS.put("ae", "\\uc0\\u230"); // "aelig"
+ RTFCHARS.put("cc", "\\uc0\\u231"); // "ccedil"
+// RTFCHARS.put("`e", "\\uc0\\u232"); // "egrave" exists in standard codepage
+ RTFCHARS.put("'e", "\\uc0\\u233"); // "eacute"
+// RTFCHARS.put("^e", "\\uc0\\u234"); // "ecirc" exists in standard codepage
+// RTFCHARS.put("\"e", "\\uc0\\u235"); // "euml" exists in standard codepage
+// RTFCHARS.put("`i", "\\uc0\\u236"); // "igrave" exists in standard codepage
+ RTFCHARS.put("'i", "\\uc0\\u237"); // "iacute"
+// RTFCHARS.put("^i", "\\uc0\\u238"); // "icirc" exists in standard codepage
+// RTFCHARS.put("\"i", "\\uc0\\u239"); // "iuml" exists in standard codepage
+ RTFCHARS.put("dh", "\\uc0\\u240"); // "eth"
+// RTFCHARS.put("~n", "\\uc0\\u241"); // "ntilde" exists in standard codepage
+// RTFCHARS.put("`o", "\\uc0\\u242"); // "ograve" exists in standard codepage
+ RTFCHARS.put("'o", "\\uc0\\u243"); // "oacute"
+// RTFCHARS.put("^o", "\\uc0\\u244"); // "ocirc" exists in standard codepage
+ RTFCHARS.put("~o", "\\uc0\\u245"); // "otilde"
+// RTFCHARS.put("\"o", "\\uc0\\u246"); // "ouml" exists in standard codepage
+ // According to ISO 8859-1 the "\div" symbol should be placed here (#247).
+ // Omitting this, because it is a mathematical symbol.
+ RTFCHARS.put("o", "\\uc0\\u248"); // "oslash"
+// RTFCHARS.put("`u", "\\uc0\\u249"); // "ugrave" exists in standard codepage
+ RTFCHARS.put("'u", "\\uc0\\u250"); // "uacute"
+// RTFCHARS.put("^u", "\\uc0\\u251"); // "ucirc" exists in standard codepage
+// RTFCHARS.put("\"u", "\\uc0\\u252"); // "uuml" exists in standard codepage
+ RTFCHARS.put("'y", "\\uc0\\u253"); // "yacute"
+ RTFCHARS.put("th", "\\uc0\\u254"); // "thorn"
+ RTFCHARS.put("\"y", "\\uc0\\u255"); // "yuml"
+
+ RTFCHARS.put("=A", "\\uc0\\u256"); // "Amacr"
+ RTFCHARS.put("=a", "\\uc0\\u257"); // "amacr"
+ RTFCHARS.put("uA", "\\uc0\\u258"); // "Abreve"
+ RTFCHARS.put("ua", "\\uc0\\u259"); // "abreve"
+ RTFCHARS.put("kA", "\\uc0\\u260"); // "Aogon"
+ RTFCHARS.put("ka", "\\uc0\\u261"); // "aogon"
+ RTFCHARS.put("'C", "\\uc0\\u262"); // "Cacute"
+ RTFCHARS.put("'c", "\\uc0\\u263"); // "cacute"
+ RTFCHARS.put("^C", "\\uc0\\u264"); // "Ccirc"
+ RTFCHARS.put("^c", "\\uc0\\u265"); // "ccirc"
+ RTFCHARS.put(".C", "\\uc0\\u266"); // "Cdot"
+ RTFCHARS.put(".c", "\\uc0\\u267"); // "cdot"
+ RTFCHARS.put("vC", "\\uc0\\u268"); // "Ccaron"
+ RTFCHARS.put("vc", "\\uc0\\u269"); // "ccaron"
+ RTFCHARS.put("vD", "\\uc0\\u270"); // "Dcaron"
+ // Symbol #271 (d´) has no special Latex command
+ RTFCHARS.put("DJ", "\\uc0\\u272"); // "Dstrok"
+ RTFCHARS.put("dj", "\\uc0\\u273"); // "dstrok"
+ RTFCHARS.put("=E", "\\uc0\\u274"); // "Emacr"
+ RTFCHARS.put("=e", "\\uc0\\u275"); // "emacr"
+ RTFCHARS.put("uE", "\\uc0\\u276"); // "Ebreve"
+ RTFCHARS.put("ue", "\\uc0\\u277"); // "ebreve"
+ RTFCHARS.put(".E", "\\uc0\\u278"); // "Edot"
+ RTFCHARS.put(".e", "\\uc0\\u279"); // "edot"
+ RTFCHARS.put("kE", "\\uc0\\u280"); // "Eogon"
+ RTFCHARS.put("ke", "\\uc0\\u281"); // "eogon"
+ RTFCHARS.put("vE", "\\uc0\\u282"); // "Ecaron"
+ RTFCHARS.put("ve", "\\uc0\\u283"); // "ecaron"
+ RTFCHARS.put("^G", "\\uc0\\u284"); // "Gcirc"
+ RTFCHARS.put("^g", "\\uc0\\u285"); // "gcirc"
+ RTFCHARS.put("uG", "\\uc0\\u286"); // "Gbreve"
+ RTFCHARS.put("ug", "\\uc0\\u287"); // "gbreve"
+ RTFCHARS.put(".G", "\\uc0\\u288"); // "Gdot"
+ RTFCHARS.put(".g", "\\uc0\\u289"); // "gdot"
+ RTFCHARS.put("cG", "\\uc0\\u290"); // "Gcedil"
+ RTFCHARS.put("'g", "\\uc0\\u291"); // "gacute"
+ RTFCHARS.put("^H", "\\uc0\\u292"); // "Hcirc"
+ RTFCHARS.put("^h", "\\uc0\\u293"); // "hcirc"
+ RTFCHARS.put("Hstrok", "\\uc0\\u294"); // "Hstrok"
+ RTFCHARS.put("hstrok", "\\uc0\\u295"); // "hstrok"
+ RTFCHARS.put("~I", "\\uc0\\u296"); // "Itilde"
+ RTFCHARS.put("~i", "\\uc0\\u297"); // "itilde"
+ RTFCHARS.put("=I", "\\uc0\\u298"); // "Imacr"
+ RTFCHARS.put("=i", "\\uc0\\u299"); // "imacr"
+ RTFCHARS.put("uI", "\\uc0\\u300"); // "Ibreve"
+ RTFCHARS.put("ui", "\\uc0\\u301"); // "ibreve"
+ RTFCHARS.put("kI", "\\uc0\\u302"); // "Iogon"
+ RTFCHARS.put("ki", "\\uc0\\u303"); // "iogon"
+ RTFCHARS.put(".I", "\\uc0\\u304"); // "Idot"
+ RTFCHARS.put("i", "\\uc0\\u305"); // "inodot"
+ // Symbol #306 (IJ) has no special Latex command
+ // Symbol #307 (ij) has no special Latex command
+ RTFCHARS.put("^J", "\\uc0\\u308"); // "Jcirc"
+ RTFCHARS.put("^j", "\\uc0\\u309"); // "jcirc"
+ RTFCHARS.put("cK", "\\uc0\\u310"); // "Kcedil"
+ RTFCHARS.put("ck", "\\uc0\\u311"); // "kcedil"
+ // Symbol #312 (k) has no special Latex command
+ RTFCHARS.put("'L", "\\uc0\\u313"); // "Lacute"
+ RTFCHARS.put("'l", "\\uc0\\u314"); // "lacute"
+ RTFCHARS.put("cL", "\\uc0\\u315"); // "Lcedil"
+ RTFCHARS.put("cl", "\\uc0\\u316"); // "lcedil"
+ // Symbol #317 (L´) has no special Latex command
+ // Symbol #318 (l´) has no special Latex command
+ RTFCHARS.put("Lmidot", "\\uc0\\u319"); // "Lmidot"
+ RTFCHARS.put("lmidot", "\\uc0\\u320"); // "lmidot"
+ RTFCHARS.put("L", "\\uc0\\u321"); // "Lstrok"
+ RTFCHARS.put("l", "\\uc0\\u322"); // "lstrok"
+ RTFCHARS.put("'N", "\\uc0\\u323"); // "Nacute"
+ RTFCHARS.put("'n", "\\uc0\\u324"); // "nacute"
+ RTFCHARS.put("cN", "\\uc0\\u325"); // "Ncedil"
+ RTFCHARS.put("cn", "\\uc0\\u326"); // "ncedil"
+ RTFCHARS.put("vN", "\\uc0\\u327"); // "Ncaron"
+ RTFCHARS.put("vn", "\\uc0\\u328"); // "ncaron"
+ // Symbol #329 (´n) has no special Latex command
+ RTFCHARS.put("NG", "\\uc0\\u330"); // "ENG"
+ RTFCHARS.put("ng", "\\uc0\\u331"); // "eng"
+ RTFCHARS.put("=O", "\\uc0\\u332"); // "Omacr"
+ RTFCHARS.put("=o", "\\uc0\\u333"); // "omacr"
+ RTFCHARS.put("uO", "\\uc0\\u334"); // "Obreve"
+ RTFCHARS.put("uo", "\\uc0\\u335"); // "obreve"
+ RTFCHARS.put("HO", "\\uc0\\u336"); // "Odblac"
+ RTFCHARS.put("Ho", "\\uc0\\u337"); // "odblac"
+ RTFCHARS.put("OE", "\\uc0\\u338"); // "OElig"
+ RTFCHARS.put("oe", "\\uc0\\u339"); // "oelig"
+ RTFCHARS.put("'R", "\\uc0\\u340"); // "Racute"
+ RTFCHARS.put("'r", "\\uc0\\u341"); // "racute"
+ RTFCHARS.put("cR", "\\uc0\\u342"); // "Rcedil"
+ RTFCHARS.put("cr", "\\uc0\\u343"); // "rcedil"
+ RTFCHARS.put("vR", "\\uc0\\u344"); // "Rcaron"
+ RTFCHARS.put("vr", "\\uc0\\u345"); // "rcaron"
+ RTFCHARS.put("'S", "\\uc0\\u346"); // "Sacute"
+ RTFCHARS.put("'s", "\\uc0\\u347"); // "sacute"
+ RTFCHARS.put("^S", "\\uc0\\u348"); // "Scirc"
+ RTFCHARS.put("^s", "\\uc0\\u349"); // "scirc"
+ RTFCHARS.put("cS", "\\uc0\\u350"); // "Scedil"
+ RTFCHARS.put("cs", "\\uc0\\u351"); // "scedil"
+ RTFCHARS.put("vS", "\\uc0\\u352"); // "Scaron"
+ RTFCHARS.put("vs", "\\uc0\\u353"); // "scaron"
+ RTFCHARS.put("cT", "\\uc0\\u354"); // "Tcedil"
+ RTFCHARS.put("ct", "\\uc0\\u355"); // "tcedil"
+ RTFCHARS.put("vT", "\\uc0\\u356"); // "Tcaron"
+ // Symbol #357 (t´) has no special Latex command
+ RTFCHARS.put("Tstrok", "\\uc0\\u358"); // "Tstrok"
+ RTFCHARS.put("tstrok", "\\uc0\\u359"); // "tstrok"
+ RTFCHARS.put("~U", "\\uc0\\u360"); // "Utilde"
+ RTFCHARS.put("~u", "\\uc0\\u361"); // "utilde"
+ RTFCHARS.put("=U", "\\uc0\\u362"); // "Umacr"
+ RTFCHARS.put("=u", "\\uc0\\u363"); // "umacr"
+ RTFCHARS.put("uU", "\\uc0\\u364"); // "Ubreve"
+ RTFCHARS.put("uu", "\\uc0\\u365"); // "ubreve"
+ RTFCHARS.put("rU", "\\uc0\\u366"); // "Uring"
+ RTFCHARS.put("ru", "\\uc0\\u367"); // "uring"
+ RTFCHARS.put("HU", "\\uc0\\u368"); // "Odblac"
+ RTFCHARS.put("Hu", "\\uc0\\u369"); // "odblac"
+ RTFCHARS.put("kU", "\\uc0\\u370"); // "Uogon"
+ RTFCHARS.put("ku", "\\uc0\\u371"); // "uogon"
+ RTFCHARS.put("^W", "\\uc0\\u372"); // "Wcirc"
+ RTFCHARS.put("^w", "\\uc0\\u373"); // "wcirc"
+ RTFCHARS.put("^Y", "\\uc0\\u374"); // "Ycirc"
+ RTFCHARS.put("^y", "\\uc0\\u375"); // "ycirc"
+ RTFCHARS.put("\"Y", "\\uc0\\u376"); // "Yuml"
+ RTFCHARS.put("'Z", "\\uc0\\u377"); // "Zacute"
+ RTFCHARS.put("'z", "\\uc0\\u378"); // "zacute"
+ RTFCHARS.put(".Z", "\\uc0\\u379"); // "Zdot"
+ RTFCHARS.put(".z", "\\uc0\\u380"); // "zdot"
+ RTFCHARS.put("vZ", "\\uc0\\u381"); // "Zcaron"
+ RTFCHARS.put("vz", "\\uc0\\u382"); // "zcaron"
+ // Symbol #383 (f) has no special Latex command
+
+ //XML_CHARS.put("\\u00E1", "á");
+ }
+
+ public static void initializeJournalNames() {
+ journalAbbrev = new JournalAbbreviations();//"/resource/journalList.txt");
+
+ // Read external lists, if any (in reverse order, so the upper lists override the lower):
+ String[] lists = prefs.getStringArray("externalJournalLists");
+ if ((lists != null) && (lists.length > 0)) {
+ for (int i=lists.length-1; i>=0; i--) {
+ try {
+ journalAbbrev.readJournalList(new File(lists[i]));
+ } catch (FileNotFoundException e) {
+ // The file couldn't be found... should we tell anyone?
+ Globals.logger(e.getMessage());
+ }
+ }
+ }
+
+ // Read personal list, if set up:
+ if (prefs.get("personalJournalList") != null) {
+ try {
+ journalAbbrev.readJournalList(new File(prefs.get("personalJournalList")));
+ } catch (FileNotFoundException e) {
+ Globals.logger("Personal journal list file '"+prefs.get("personalJournalList")+
+ "' not found.");
+ }
+ }
+
+
+ }
+
+}
protected String helpFile;
public HelpAction(HelpDialog diag, String helpFile) {
- super(new ImageIcon(GUIGlobals.helpIconFile));
+ super(GUIGlobals.getImage("help"));
putValue(NAME, "Help");
this.diag = diag;
this.helpFile = helpFile;
}
public HelpAction(HelpDialog diag, String helpFile, String tooltip) {
- super(new ImageIcon(GUIGlobals.helpIconFile));
+ super(GUIGlobals.getImage("help"));
putValue(NAME, "Help");
putValue(SHORT_DESCRIPTION, Globals.lang(tooltip));
this.diag = diag;
}
public HelpAction(String title, HelpDialog diag, String helpFile, String tooltip) {
- super(new ImageIcon(GUIGlobals.helpIconFile));
+ super(GUIGlobals.getImage("help"));
putValue(NAME, title);
putValue(SHORT_DESCRIPTION, Globals.lang(tooltip));
this.diag = diag;
public HelpAction(String title, HelpDialog diag, String helpFile, String tooltip,
KeyStroke key) {
- super(new ImageIcon(GUIGlobals.helpIconFile));
+ super(GUIGlobals.getImage("help"));
putValue(NAME, title);
putValue(SHORT_DESCRIPTION, Globals.lang(tooltip));
putValue(ACCELERATOR_KEY, key);
class BackAction extends AbstractAction {
public BackAction() {
- super("Back", new ImageIcon(GUIGlobals.backIconFile));
+ super("Back", GUIGlobals.getImage("left"));
//putValue(SHORT_DESCRIPTION, "Show the previous page");
}
class ForwardAction extends AbstractAction {
public ForwardAction() {
- super("Forward", new ImageIcon(GUIGlobals.forwardIconFile));
+ super("Forward", GUIGlobals.getImage("right"));
}
public void actionPerformed(ActionEvent e) {
class ContentsAction extends AbstractAction {
public ContentsAction() {
- super("Contents", new ImageIcon(GUIGlobals.contentsIconFile));
+ super("Contents", GUIGlobals.getImage("helpContents"));
}
public void actionPerformed(ActionEvent e) {
import net.sf.jabref.remote.RemoteListener;
import gnu.dtools.ritopt.*;
-import java.awt.Font;
-import java.awt.Frame;
+import java.awt.*;
import java.io.*;
import java.io.File;
import java.util.*;
+import java.util.List;
import javax.swing.*;
+import javax.swing.plaf.metal.MetalLookAndFeel;
import com.jgoodies.looks.plastic.Plastic3DLookAndFeel;
+import com.jgoodies.looks.plastic.PlasticLookAndFeel;
import com.jgoodies.looks.windows.WindowsLookAndFeel;
-
+import com.jgoodies.looks.FontSet;
+import com.jgoodies.looks.FontSets;
+import com.jgoodies.looks.FontPolicy;
+import com.jgoodies.looks.FontPolicies;
//import javax.swing.UIManager;
//import javax.swing.UIDefaults;
boolean graphicFailure = false;
StringOption importFile, exportFile, exportPrefs, importPrefs, auxImExport, importToOpenBase;
- BooleanOption helpO, disableGui, blank, loadSess;
+ BooleanOption helpO, disableGui, blank, loadSess, showVersion;
/*
* class StringArrayOption extends ArrayOption { public public void
* modify(String value) { } public void modify(String[] value) { } public
disableGui = new BooleanOption();
blank = new BooleanOption();
loadSess = new BooleanOption();
+ showVersion = new BooleanOption();
exportPrefs = new StringOption("jabref_prefs.xml");
importPrefs = new StringOption("jabref_prefs.xml");
auxImExport = new StringOption("");
options.setVersion(GUIGlobals.version);
importFile.setDescription("imopoepuoeu"); //Globals.lang);
+ options.register("version", 'v',
+ Globals.lang("Display version"), showVersion);
options.register("nogui", 'n',
Globals.lang("No GUI. Only process command line options."), disableGui);
options.register("import", 'i',
setupOptions();
String[] leftOver = options.process(args);
+
+
//Util.pr(": Options processed");
+ if (initialStartup && showVersion.isInvoked()) {
+ options.displayVersion();
+ disableGui.setInvoked(true);
+ }
+
if (initialStartup && helpO.isInvoked()) {
System.out.println("jabref [options] [bibtex-file]\n");
System.out.println(options.getHelp());
return loaded;
}
+ ParserResult importFiletypeUnknown(String fname) {
+ Object[] o =
+ Globals.importFormatReader.importUnknownFormat(fname
+ .replaceAll("~", System.getProperty("user.home")));
+ String formatName = (String) o[0];
+
+ if (formatName == null) {
+ System.err.println(Globals.lang("Error opening file") + " '" + fname + "'");
+ } else if (formatName.equals(ImportFormatReader.BIBTEX_FORMAT)) {
+ ParserResult pr = (ParserResult) o[1];
+ return pr;
+ } else {
+ List entries = (java.util.List) o[1];
+ if (entries != null)
+ System.out.println(Globals.lang("Format used") + ": "
+ + formatName);
+ else
+ System.out.println(Globals.lang(
+ "Could not find a suitable import format."));
+
+ if (entries != null) {
+ BibtexDatabase base = ImportFormatReader.createDatabase(entries);
+ ParserResult pr = new ParserResult(base, null, new HashMap());
+ return pr;
+ }
+ }
+
+ // not reached
+ return null;
+ }
+
public void openWindow(Vector loaded) {
if (!graphicFailure && !disableGui.isInvoked()) {
// Call the method performCompatibilityUpdate(), which does any
// Jabref version.
Util.performCompatibilityUpdate();
+ // Set up custom or default icon theme:
+ GUIGlobals.setUpIconTheme();
+
// This property is set to make the Mac OSX Java VM move the menu bar to
// the top
// of the screen, where Mac users expect it to be.
// If we are not on Mac, deal with font sizes and LookAndFeels:
if (!Globals.ON_MAC) {
int fontSizes = Globals.prefs.getInt("menuFontSize");
-
+ boolean overrideDefaultFonts = Globals.prefs.getBoolean("overrideDefaultFonts");
String defaultLookAndFeel;
if (Globals.ON_WIN)
lnf = (LookAndFeel) objLnf;
// Set font sizes if we are using a JGoodies look and feel.
- /*if ((lnf != null) && (lnf instanceof Plastic3DLookAndFeel)) {
- //MetalLookAndFeel.setCurrentTheme(new
- // com.jgoodies.plaf.plastic.theme.SkyBluer());
- Plastic3DLookAndFeel plLnf = (Plastic3DLookAndFeel) lnf;
- //Plastic3DLookAndFeel.setFontPolicy();
- //Plastic3DLookAndFeel.setFontPolicy(FontPolicy.);
- //plLnf.setFontSizeHints(new FontSizeHints(fontSizes, fontSizes,
- // fontSizes, fontSizes));
- } else if ((lnf != null) && (lnf instanceof WindowsLookAndFeel)) {
- //System.out.println("ttt");
- //ExtWindowsLookAndFeel plLnf = (ExtWindowsLookAndFeel) lnf;
- //plLnf.setFontSizeHints(new FontSizeHints(fontSizes, fontSizes,
- // fontSizes, fontSizes));
- } */
+ if ((lnf != null) && (lnf instanceof Plastic3DLookAndFeel)) {
+
+ //UIManager.put("jgoodies.popupDropShadowEnabled", Boolean.TRUE);
+ MetalLookAndFeel.setCurrentTheme(new
+ com.jgoodies.looks.plastic.theme.SkyBluer());
+
+ // Set a "model" icon size, so menu items are evenly spaced even though
+ // only some items have icons. We load an arbitrary icon and look at
+ // its size to determine what size to use:
+ int defaultIconSize = GUIGlobals.getImage("open").getIconWidth();
+ com.jgoodies.looks.Options.setDefaultIconSize
+ (new Dimension(defaultIconSize, defaultIconSize));
+
+
+ if (overrideDefaultFonts) {
+ FontSet fontSet = FontSets.createDefaultFontSet(
+ new Font("Tahoma", Font.PLAIN, fontSizes), // control font
+ new Font("Tahoma", Font.PLAIN, fontSizes), // menu font
+ new Font("Tahoma", Font.BOLD, fontSizes) // title font
+ );
+ FontPolicy fixedPolicy = FontPolicies.createFixedPolicy(fontSet);
+ Plastic3DLookAndFeel.setFontPolicy(fixedPolicy);
+ }
+
+ //Plastic3DLookAndFeel plLnf = (Plastic3DLookAndFeel) lnf;
+ }
+ else if ((lnf != null) && (lnf instanceof WindowsLookAndFeel)) {
+
+ // Set a "model" icon size, so menu items are evenly spaced even though
+ // only some items have icons. We load an arbitrary icon and look at
+ // its size to determine what size to use:
+ int defaultIconSize = GUIGlobals.getImage("open").getIconWidth();
+ com.jgoodies.looks.Options.setDefaultIconSize
+ (new Dimension(defaultIconSize, defaultIconSize));
+
+ if (overrideDefaultFonts) {
+ FontSet fontSet = FontSets.createDefaultFontSet(
+ new Font("Tahoma", Font.PLAIN, fontSizes), // control font
+ new Font("Tahoma", Font.PLAIN, fontSizes), // menu font
+ new Font("Tahoma", Font.BOLD, fontSizes) // title font
+ );
+ FontPolicy fixedPolicy = FontPolicies.createFixedPolicy(fontSet);
+ WindowsLookAndFeel.setFontPolicy(fixedPolicy);
+ }
+
+ //WindowsLookAndFeel plLnf = (WindowsLookAndFeel) lnf;
+ }
if (lnf != null) {
try {
import javax.swing.event.*;
import net.sf.jabref.wizard.integrity.gui.*;
import net.sf.jabref.groups.GroupSelector;
+import net.sf.jabref.groups.EntryTableTransferHandler;
import net.sf.jabref.journals.ManageJournalsAction;
import net.sf.jabref.external.*;
import com.jgoodies.uif_lite.component.UIFSplitPane;
}
ToolBar tlb = new ToolBar();
- JMenuBar mb = new JMenuBar();/* {
- public void paintComponent(Graphics g) {
- Graphics2D g2 = (Graphics2D)g;
- g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_ON);
- g2.setRenderingHint(RenderingHints.KEY_RENDERING,
- RenderingHints.VALUE_RENDER_QUALITY);
- super.paintComponent(g2);
-
- }
-
- };*/
- GridBagLayout gbl = new GridBagLayout();
+ JMenuBar mb = new JMenuBar();
+ GridBagLayout gbl = new GridBagLayout();
GridBagConstraints con = new GridBagConstraints();
JLabel statusLine = new JLabel("", SwingConstants.LEFT),
prefs.getKey("Help")),
contents = new HelpAction("Help contents", helpDiag,
GUIGlobals.helpContents, "Help contents",
- GUIGlobals.helpContentsIconFile),
+ GUIGlobals.getIconUrl("helpContents")),
/* old about*/
about = new HelpAction("About JabRef", helpDiag,
GUIGlobals.aboutPage, "About JabRef",
- GUIGlobals.aboutIcon),
+ GUIGlobals.getIconUrl("about")),
/**/
// about2 = new NewAboutAction(),
editEntry = new GeneralAction("edit", "Edit entry",
- "Edit entry", GUIGlobals.editIconFile,
+ "Edit entry",
prefs.getKey("Edit entry")),
save = new GeneralAction("save", "Save database",
- "Save database", GUIGlobals.saveIconFile,
+ "Save database",
prefs.getKey("Save database")),
saveAs = new GeneralAction("saveAs", "Save database as ...",
"Save database as ...",
- GUIGlobals.saveAsIconFile,
prefs.getKey("Save database as ...")),
saveSelectedAs = new GeneralAction("saveSelectedAs",
"Save selected as ...",
"Save selected as ...",
- GUIGlobals.saveAsIconFile),
+ GUIGlobals.getIconUrl("saveAs")),
nextTab = new ChangeTabAction(true),
prevTab = new ChangeTabAction(false),
sortTabs = new SortTabsAction(this),
undo = new GeneralAction("undo", "Undo", "Undo",
- GUIGlobals.undoIconFile,
prefs.getKey("Undo")),
redo = new GeneralAction("redo", "Redo", "Redo",
- GUIGlobals.redoIconFile,
prefs.getKey("Redo")),
/*cut = new GeneralAction("cut", "Cut", "Cut",
GUIGlobals.cutIconFile,
prefs.getKey("Cut")),*/
delete = new GeneralAction("delete", "Delete", "Delete",
- GUIGlobals.removeIconFile,
prefs.getKey("Delete")),
/*copy = new GeneralAction("copy", "Copy", "Copy",
GUIGlobals.copyIconFile,
prefs.getKey("Copy")),*/
- copy = new EditAction("copy", GUIGlobals.copyIconFile),
- paste = new EditAction("paste", GUIGlobals.pasteIconFile),
- cut = new EditAction("cut", GUIGlobals.cutIconFile),
+ copy = new EditAction("copy", GUIGlobals.getIconUrl("copy")),
+ paste = new EditAction("paste", GUIGlobals.getIconUrl("paste")),
+ cut = new EditAction("cut", GUIGlobals.getIconUrl("cut")),
mark = new GeneralAction("markEntries", "Mark entries",
"Mark entries",
- GUIGlobals.markIcon,
prefs.getKey("Mark entries")),
unmark = new GeneralAction("unmarkEntries", "Unmark entries",
"Unmark entries",
- GUIGlobals.unmarkIcon,
prefs.getKey("Unmark entries")),
unmarkAll = new GeneralAction("unmarkAll", "Unmark all"),
manageSelectors = new GeneralAction("manageSelectors", "Manage content selectors"),
loadSessionAction = new LoadSessionAction(),
incrementalSearch = new GeneralAction("incSearch", "Incremental search",
"Start incremental search",
- GUIGlobals.searchIconFile,
prefs.getKey("Incremental search")),
normalSearch = new GeneralAction("search", "Search", "Search",
- GUIGlobals.searchIconFile,
prefs.getKey("Search")),
- toggleSearch = new GeneralAction("toggleSearch", "Search", "Toggle search panel",
- GUIGlobals.searchIconFile),
- // prefs.getKey("Search")),
+ toggleSearch = new GeneralAction("toggleSearch", "Search", "Toggle search panel"),
+
fetchCiteSeer = new FetchCiteSeerAction(),
importCiteSeer = new ImportCiteSeerAction(),
fetchMedline = new FetchMedlineAction(),
mergeDatabaseAction = new GeneralAction("mergeDatabase",
"Append database",
"Append contents from a BibTeX database into the currently viewed database",
- GUIGlobals.openIconFile),
+ GUIGlobals.getIconUrl("open")),
//prefs.getKey("Open")),
/*remove = new GeneralAction("remove", "Remove", "Remove selected entries",
GUIGlobals.removeIconFile),*/
editPreamble = new GeneralAction("editPreamble", "Edit preamble",
"Edit preamble",
- GUIGlobals.preambleIconFile,
prefs.getKey("Edit preamble")),
editStrings = new GeneralAction("editStrings", "Edit strings",
"Edit strings",
- GUIGlobals.stringsIconFile,
prefs.getKey("Edit strings")),
toggleGroups = new GeneralAction("toggleGroups",
"Toggle groups interface",
"Toggle groups interface",
- GUIGlobals.groupsIconFile,
prefs.getKey("Toggle groups interface")),
togglePreview = new GeneralAction("togglePreview",
"Toggle entry preview",
"Toggle entry preview",
- GUIGlobals.previewIconFile,
prefs.getKey("Toggle entry preview")),
toggleHighlightAny = new GeneralAction("toggleHighlightGroupsMatchingAny",
"Highlight groups matching any selected entry",
"Highlight groups matching any selected entry",
- GUIGlobals.groupsHighlightMatchingAnyFile),
+ GUIGlobals.getIconUrl("groupsHighlightAny")),
toggleHighlightAll = new GeneralAction("toggleHighlightGroupsMatchingAll",
"Highlight groups matching all selected entries",
"Highlight groups matching all selected entries",
- GUIGlobals.groupsHighlightMatchingAllFile),
+ GUIGlobals.getIconUrl("groupsHighlightAll")),
switchPreview = new GeneralAction("switchPreview",
"Switch preview layout",
prefs.getKey("Switch preview layout")),
makeKeyAction = new GeneralAction("makeKey", "Autogenerate BibTeX keys",
"Autogenerate BibTeX keys",
- GUIGlobals.genKeyIconFile,
prefs.getKey("Autogenerate BibTeX keys")),
lyxPushAction = new PushToApplicationAction(ths, new PushToLyx()),
latexEditorPushAction = new PushToApplicationAction(ths, new PushToLatexEditor()),
openFile = new GeneralAction("openFile", "Open PDF or PS",
"Open PDF or PS",
- GUIGlobals.pdfIcon,
prefs.getKey("Open PDF or PS")),
openUrl = new GeneralAction("openUrl", "Open URL or DOI",
"Open URL or DOI",
- GUIGlobals.wwwIcon,
prefs.getKey("Open URL or DOI")),
dupliCheck = new GeneralAction("dupliCheck", "Find duplicates"),
strictDupliCheck = new GeneralAction("strictDupliCheck", "Find and remove exact duplicates"),
// glassPane.setVisible(true);
setTitle(GUIGlobals.frameTitle);
- setIconImage(new ImageIcon(GUIGlobals.jabreflogo).getImage());
+ setIconImage(GUIGlobals.getImage("jabrefIcon").getImage());
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
}
private void setupLayout() {
+ tabbedPane.putClientProperty(Options.NO_CONTENT_BORDER_KEY, Boolean.TRUE);
fillMenu();
createToolBar();
getContentPane().setLayout(gbl);
con.weightx = 1;
con.weighty = 0;
con.gridwidth = GridBagConstraints.REMAINDER;
- mb.setMinimumSize(mb.getPreferredSize());
+
//gbl.setConstraints(mb, con);
//getContentPane().add(mb);
setJMenuBar(mb);
getContentPane().add(status);
-
+ // Drag and drop for tabbedPane:
+ TransferHandler xfer = new EntryTableTransferHandler(null, this);
+ tabbedPane.setTransferHandler(xfer);
+ tlb.setTransferHandler(xfer);
+ mb.setTransferHandler(xfer);
+ sidePaneManager.getPanel().setTransferHandler(xfer);
}
private void initLabelMaker() {
}
public GeneralAction(String command, String text,
- String description, URL icon,
+ String description, String imageName,
KeyStroke key) {
- super(new ImageIcon(icon));
+ super(GUIGlobals.getImage(imageName));
this.command = command;
putValue(NAME, text);
putValue(ACCELERATOR_KEY, key);
putValue(SHORT_DESCRIPTION, Globals.lang(description));
}
- public GeneralAction(String command, String text) {
- putValue(NAME, text);
- this.command = command;
- }
+ public GeneralAction(String command, String text) {
+ putValue(NAME, text);
+ this.command = command;
+ }
- public GeneralAction(String command, String text, KeyStroke key) {
- this.command = command;
- putValue(NAME, text);
- putValue(ACCELERATOR_KEY, key);
- }
+ public GeneralAction(String command, String text, KeyStroke key) {
+ this.command = command;
+ putValue(NAME, text);
+ putValue(ACCELERATOR_KEY, key);
+ }
- public GeneralAction(String command, String text, String description) {
- this.command = command;
- putValue(NAME, text);
- putValue(SHORT_DESCRIPTION, Globals.lang(description));
- }
- public GeneralAction(String command, String text, String description, KeyStroke key) {
+ public GeneralAction(String command, String text, String description) {
+ this.command = command;
+ ImageIcon icon = GUIGlobals.getImage(command);
+ if (icon != null)
+ putValue(SMALL_ICON, icon);
+ putValue(NAME, text);
+ putValue(SHORT_DESCRIPTION, Globals.lang(description));
+ }
+
+ public GeneralAction(String command, String text, String description, KeyStroke key) {
+ this.command = command;
+ ImageIcon icon = GUIGlobals.getImage(command);
+ if (icon != null)
+ putValue(SMALL_ICON, icon);
+ putValue(NAME, text);
+ putValue(SHORT_DESCRIPTION, Globals.lang(description));
+ putValue(ACCELERATOR_KEY, key);
+ }
+
+ /* public GeneralAction(String command, String text, String description,
+ URL imageUrl, KeyStroke key) {
this.command = command;
+ ImageIcon icon = GUIGlobals.getImage(command);
+ if (icon != null)
+ putValue(SMALL_ICON, icon);
putValue(NAME, text);
putValue(SHORT_DESCRIPTION, Globals.lang(description));
putValue(ACCELERATOR_KEY, key);
- }
+ }*/
public void actionPerformed(ActionEvent e) {
if (tabbedPane.getTabCount() > 0) {
public NewEntryAction(KeyStroke key) {
// This action leads to a dialog asking for entry type.
- super(new ImageIcon(GUIGlobals.addIconFile));
+ super(GUIGlobals.getImage("add"));
putValue(NAME, "New entry");
putValue(ACCELERATOR_KEY, key);
putValue(SHORT_DESCRIPTION, Globals.lang("New BibTeX entry"));
class CloseDatabaseAction
extends MnemonicAwareAction {
public CloseDatabaseAction() {
- super(new ImageIcon(GUIGlobals.closeIconFile));
+ super(GUIGlobals.getImage("close"));
putValue(NAME, "Close database");
putValue(SHORT_DESCRIPTION,
Globals.lang("Close the current database"));
class NewDatabaseAction
extends MnemonicAwareAction {
public NewDatabaseAction() {
- super(new ImageIcon(GUIGlobals.newIconFile));
+ super(GUIGlobals.getImage("new"));
putValue(NAME, "New database");
putValue(SHORT_DESCRIPTION, Globals.lang("New BibTeX database"));
//putValue(MNEMONIC_KEY, GUIGlobals.newKeyCode);
extends MnemonicAwareAction {
public ImportCiteSeerAction() {
- super(new ImageIcon(GUIGlobals.wwwCiteSeerIcon));
+ super(GUIGlobals.getImage("citeseer"));
putValue(NAME, "Import Fields from CiteSeer");
putValue(SHORT_DESCRIPTION, Globals.lang("Import Fields from CiteSeer Database"));
putValue(ACCELERATOR_KEY, prefs.getKey("Import Fields from CiteSeer")); // Key defined in MenuTitles!
extends MnemonicAwareAction {
public FetchCiteSeerAction() {
- super(new ImageIcon(GUIGlobals.wwwCiteSeerIcon));
+ super(GUIGlobals.getImage("citeseer"));
putValue(NAME, "Fetch citations from CiteSeer");
putValue(SHORT_DESCRIPTION, Globals.lang("Fetch Articles Citing your Database"));
{
public NewSubDatabaseAction()
{
- super(new ImageIcon( GUIGlobals.newBibFile));
+ super(GUIGlobals.getImage("new"));
putValue(NAME, "New subdatabase based on AUX file" );
putValue( SHORT_DESCRIPTION, Globals.lang( "New BibTeX subdatabase" ) ) ;
//putValue(MNEMONIC_KEY, GUIGlobals.newKeyCode);
public IntegrityCheckAction()
{
super(Globals.menuTitle("Integrity check"),
- new ImageIcon( GUIGlobals.integrityCheck ) ) ;
+ GUIGlobals.getImage("integrityCheck")) ;
//putValue( SHORT_DESCRIPTION, "integrity" ) ; //Globals.lang( "integrity" ) ) ;
//putValue(MNEMONIC_KEY, GUIGlobals.newKeyCode);
}
class FetchMedlineAction
extends MnemonicAwareAction {
public FetchMedlineAction() {
- super(new ImageIcon(GUIGlobals.fetchMedlineIcon));
+ super(GUIGlobals.getImage("medline"));
putValue(NAME, "Fetch Medline");
putValue(ACCELERATOR_KEY, prefs.getKey("Fetch Medline"));
putValue(SHORT_DESCRIPTION, Globals.lang("Fetch Medline by ID"));
class CiteSeerPanelAction
extends MnemonicAwareAction {
public CiteSeerPanelAction() {
- super(new ImageIcon(GUIGlobals.fetchMedlineIcon));
+ super(GUIGlobals.getImage("medline"));
putValue(NAME, "Fetch CiteSeer");
//System.out.println(Globals.menuTitle("Fetch CiteSeer"));
putValue(ACCELERATOR_KEY, prefs.getKey("Fetch CiteSeer"));
}
- /*class FetchAuthorMedlineAction
- extends AbstractAction {
- public FetchAuthorMedlineAction() {
- super(Globals.lang("Fetch Medline by author"),
- new ImageIcon(GUIGlobals.fetchMedlineIcon));
- putValue(SHORT_DESCRIPTION, Globals.lang("Fetch Medline by author"));
- }
-
- public void actionPerformed(ActionEvent e) {
- if (tabbedPane.getTabCount() > 0) {
- for (int i = 0; i < tabbedPane.getTabCount(); i++) {
- ( (BasePanel) tabbedPane.getComponentAt(i)).sidePaneManager.
- ensureVisible("fetchAuthorMedline");
- new FocusRequester(basePanel().medlineFetcher);
- }
- }
- }
-
- }*/
-
// The action for opening the preferences dialog.
-
AbstractAction showPrefs = new ShowPrefsAction();
class ShowPrefsAction
extends MnemonicAwareAction {
public ShowPrefsAction() {
- super(new ImageIcon(GUIGlobals.prefsIconFile));
+ super(GUIGlobals.getImage("preferences"));
putValue(NAME, "Preferences");
putValue(SHORT_DESCRIPTION, Globals.lang("Preferences"));
}
class SaveSessionAction
extends MnemonicAwareAction {
public SaveSessionAction() {
- super(new ImageIcon(GUIGlobals.saveIconFile));
+ super(GUIGlobals.getImage("save"));
putValue(NAME, "Save session");
putValue(ACCELERATOR_KEY, prefs.getKey("Save session"));
}
extends MnemonicAwareAction {
boolean running = false;
public LoadSessionAction() {
- super(new ImageIcon(GUIGlobals.openIconFile));
+ super(GUIGlobals.getImage("loadSession"));
putValue(NAME, "Load session");
putValue(ACCELERATOR_KEY, prefs.getKey("Load session"));
}
defaults.put("generalFields", "crossref;keywords;doi;url;urldate;citeseerurl;"+
"pdf;comment;owner");
+ defaults.put("useCustomIconTheme", Boolean.FALSE);
+ defaults.put("customIconThemeFile", "/home/alver/div/crystaltheme_16/Icons.properties");
+
// Entry editor tab 0:
defaults.put(CUSTOM_TAB_NAME+"_def0", Globals.lang("General"));
defaults.put(CUSTOM_TAB_FIELDS+"_def0", "crossref;keywords;doi;url;citeseerurl;"+
defaults.put("fontFamily", "Times");
defaults.put("fontStyle", new Integer(java.awt.Font.PLAIN));
defaults.put("fontSize", new Integer(12));
+ defaults.put("overrideDefaultFonts", Boolean.FALSE);
defaults.put("menuFontFamily", "Times");
defaults.put("menuFontStyle", new Integer(java.awt.Font.PLAIN));
defaults.put("menuFontSize", new Integer(11));
defaults.put("externalJournalLists", null);
defaults.put("citeCommand", "cite");
defaults.put("floatMarkedEntries", Boolean.TRUE);
+
+ defaults.put("useNativeFileDialogOnMac", Boolean.TRUE);
//defaults.put("tempDir", System.getProperty("java.io.tmpdir"));
//Util.pr(System.getProperty("java.io.tempdir"));
UndoAction undoAction = new UndoAction();
class UndoAction extends AbstractAction {
public UndoAction() {
- super("Undo", new ImageIcon(GUIGlobals.undoIconFile));
+ super("Undo", GUIGlobals.getImage("undo"));
putValue(SHORT_DESCRIPTION, "Undo");
}
public void actionPerformed(ActionEvent e) {
RedoAction redoAction = new RedoAction();
class RedoAction extends AbstractAction {
public RedoAction() {
- super("Undo", new ImageIcon(GUIGlobals.redoIconFile));
+ super("Undo", GUIGlobals.getImage("redo"));
putValue(SHORT_DESCRIPTION, "Redo");
}
public void actionPerformed(ActionEvent e) {
import net.sf.jabref.groups.GroupsPrefsTab;
import net.sf.jabref.gui.MainTable;
+import com.jgoodies.forms.builder.ButtonBarBuilder;
/**
* Preferences dialog. Contains a TabbedPane, and tabs will be defined
al.add(KEY);
//al.add(JOU);
al.add(PRE);
-
+ al.add(ADV);
main.setLayout(cardLayout);
main.add(new GeneralTab(frame, _prefs), GEN);
- if (!Globals.ON_MAC) {
- al.add(ADV);
- main.add(new AdvancedTab(_prefs, parent.helpDiag), ADV);
- }
+ main.add(new AdvancedTab(_prefs, parent.helpDiag), ADV);
+
upper.add(two, BorderLayout.WEST);
upper.add(main, BorderLayout.CENTER);
- // Add all panels to main panel:
- //for (Iterator i=panels.entrySet().iterator(); i.hasNext();) {
-
-
- //}
-
+
JButton
ok = new JButton(Globals.lang("Ok")),
cancel = new JButton(Globals.lang("Cancel"));
ok.addActionListener(new OkAction());
CancelAction cancelAction = new CancelAction();
cancel.addActionListener(cancelAction);
- lower.add(ok);
- lower.add(cancel);
+ lower.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
+ ButtonBarBuilder bb = new ButtonBarBuilder(lower);
+ bb.addGlue();
+ bb.addGridded(ok);
+ bb.addGridded(cancel);
+ bb.addGlue();
+ //lower.add(ok);
+ //lower.add(cancel);
// Key bindings:
ActionMap am = chooser.getActionMap();
addPopupMenuListener(this);
- add(new AbstractAction(Globals.lang("Copy"), new ImageIcon(GUIGlobals.copyIconFile)) {
+ add(new AbstractAction(Globals.lang("Copy"), GUIGlobals.getImage("copy")) {
public void actionPerformed(ActionEvent e) {
try {
panel.runCommand("copy");
} catch (Throwable ex) {}
}
});
- add(new AbstractAction(Globals.lang("Paste"), new ImageIcon(GUIGlobals.pasteIconFile)) {
+ add(new AbstractAction(Globals.lang("Paste"), GUIGlobals.getImage("paste")) {
public void actionPerformed(ActionEvent e) {
try {
panel.runCommand("paste");
} catch (Throwable ex) {}
}
});
- add(new AbstractAction(Globals.lang("Cut"), new ImageIcon(GUIGlobals.cutIconFile)) {
+ add(new AbstractAction(Globals.lang("Cut"), GUIGlobals.getImage("cut")) {
public void actionPerformed(ActionEvent e) {
try {
panel.runCommand("cut");
}
});
- add(new AbstractAction(Globals.lang("Delete"), new ImageIcon(GUIGlobals.removeIconFile)) {
+ add(new AbstractAction(Globals.lang("Delete"), GUIGlobals.getImage("delete")) {
public void actionPerformed(ActionEvent e) {
/*SwingUtilities.invokeLater(new Runnable () {
public void run() {*/
addSeparator();
if (multiple) {
- add(new AbstractAction(Globals.lang("Mark entries"), new ImageIcon(GUIGlobals.markIcon)) {
+ add(new AbstractAction(Globals.lang("Mark entries"), GUIGlobals.getImage("markEntries")) {
public void actionPerformed(ActionEvent e) {
try {
panel.runCommand("markEntries");
} catch (Throwable ex) {}
}
});
- add(new AbstractAction(Globals.lang("Unmark entries"), new ImageIcon(GUIGlobals.unmarkIcon)) {
+ add(new AbstractAction(Globals.lang("Unmark entries"), GUIGlobals.getImage("unmarkEntries")) {
public void actionPerformed(ActionEvent e) {
try {
panel.runCommand("unmarkEntries");
addSeparator();
} else if (be != null) {
if (be.getField(BibtexFields.MARKED) == null)
- add(new AbstractAction(Globals.lang("Mark entry"), new ImageIcon(GUIGlobals.markIcon)) {
+ add(new AbstractAction(Globals.lang("Mark entry"), GUIGlobals.getImage("markEntries")) {
public void actionPerformed(ActionEvent e) {
try {
panel.runCommand("markEntries");
}
});
else
- add(new AbstractAction(Globals.lang("Unmark entry"), new ImageIcon(GUIGlobals.unmarkIcon)) {
+ add(new AbstractAction(Globals.lang("Unmark entry"), GUIGlobals.getImage("unmarkEntries")) {
public void actionPerformed(ActionEvent e) {
try {
panel.runCommand("unmarkEntries");
addSeparator();
}
- add(new AbstractAction(Globals.lang("Open PDF or PS"), new ImageIcon(GUIGlobals.pdfIcon)) {
+ add(new AbstractAction(Globals.lang("Open PDF or PS"), GUIGlobals.getImage("openFile")) {
public void actionPerformed(ActionEvent e) {
try {
panel.runCommand("openFile");
}
});
- add(new AbstractAction(Globals.lang("Open URL or DOI"), new ImageIcon(GUIGlobals.wwwIcon)) {
+ add(new AbstractAction(Globals.lang("Open URL or DOI"), GUIGlobals.getImage("www")) {
public void actionPerformed(ActionEvent e) {
try {
panel.runCommand("openUrl");
}
});
- add(new AbstractAction(Globals.lang("Copy BibTeX key"), new ImageIcon(GUIGlobals.copyKeyIconFile)) {
+ add(new AbstractAction(Globals.lang("Copy BibTeX key")) {
public void actionPerformed(ActionEvent e) {
try {
panel.runCommand("copyKey");
}
});
- add(new AbstractAction(Globals.lang("Copy")+" \\cite{"+Globals.lang("BibTeX key")+"}", new ImageIcon(GUIGlobals.copyKeyIconFile)) {
+ add(new AbstractAction(Globals.lang("Copy")+" \\cite{"+Globals.lang("BibTeX key")+"}") {
public void actionPerformed(ActionEvent e) {
try {
panel.runCommand("copyCiteKey");
if (Globals.prefs.getBoolean("groupShowIcons")) {
switch (group.getHierarchicalContext()) {
case AbstractGroup.INCLUDING:
- menuItem.setIcon(GUIGlobals.groupIncludingIcon);
+ menuItem.setIcon(GUIGlobals.getImage("groupIncluding"));
break;
case AbstractGroup.REFINING:
- menuItem.setIcon(GUIGlobals.groupRefiningIcon);
+ menuItem.setIcon(GUIGlobals.getImage("groupRefining"));
break;
default:
- menuItem.setIcon(GUIGlobals.groupRegularIcon);
+ menuItem.setIcon(GUIGlobals.getImage("groupRegular"));
break;
}
}
//private JabRefFrame frame;
private JTextField searchField = new JTextField("", 12);
private JLabel lab = //new JLabel(Globals.lang("Search")+":");
- new JLabel(new ImageIcon(GUIGlobals.searchIconFile));
+ new JLabel(GUIGlobals.getImage("search"));
private JPopupMenu settings = new JPopupMenu();
private JButton openset = new JButton(Globals.lang("Settings"));
private JButton escape = new JButton(Globals.lang("Clear"));
- private JButton help = new JButton(new ImageIcon(GUIGlobals.helpIconFile));
+ private JButton help = new JButton(GUIGlobals.getImage("help"));
/** This button's text will be set later. */
private JButton search = new JButton();
private JCheckBoxMenuItem searchReq, searchOpt, searchGen,
public SearchManager2(JabRefFrame frame, SidePaneManager manager) {
- super(manager, GUIGlobals.searchIconFile, Globals.lang("Search"));
+ super(manager, GUIGlobals.getIconUrl("search"), Globals.lang("Search"));
this.frame = frame;
incSearcher = new IncrementalSearcher(Globals.prefs);
//search.setMargin(margin);
escape.setMargin(margin);
openset.setMargin(margin);
- Dimension butDim = new Dimension(20, 20);
+ int butSize = help.getIcon().getIconHeight() + 5;
+ Dimension butDim = new Dimension(butSize, butSize);
help.setPreferredSize(butDim);
help.setMinimumSize(butDim);
help.setMargin(margin);
public class SidePaneComponent extends SimpleInternalFrame {
- protected JButton close = new JButton(new ImageIcon(GUIGlobals.closeIconFile));
+ protected JButton close = new JButton(GUIGlobals.getImage("close"));
protected boolean visible = false;
protected SidePaneManager manager;
protected BasePanel panel = null;
public class SidePaneHeader extends JPanel implements ActionListener {
- private JButton close = new JButton(new ImageIcon(GUIGlobals.close2IconFile));
+ private JButton close = new JButton(GUIGlobals.getImage("close2"));
private JLabel nameLabel, imageIcon;
private SidePaneComponent parent;
private GridBagLayout gbl = new GridBagLayout();
public SplashScreen(Frame owner) {
super(owner);
- URL imageURL = SplashScreen.class.getResource("/images/splash-2.1beta.png");
+ URL imageURL = SplashScreen.class.getResource("/images/splash-2.1.png");
splashImage = Toolkit.getDefaultToolkit().createImage(imageURL);
// Load the image
--- /dev/null
+package net.sf.jabref;
+
+//import javax.swing.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.net.URL;
+
+/**
+ * <p>Title: </p>
+ * <p>Description: </p>
+ * <p>Copyright: Copyright (c) 2003</p>
+ * <p>Company: </p>
+ * @author not attributable
+ * @version 1.0
+ */
+
+public class SplashScreen extends Window {
+ private Image splashImage;
+ private boolean paintCalled = false;
+
+ public SplashScreen(Frame owner) {
+ super(owner);
+ URL imageURL = SplashScreen.class.getResource("/images/splash-2.1beta.png");
+ splashImage = Toolkit.getDefaultToolkit().createImage(imageURL);
+
+ // Load the image
+ MediaTracker mt = new MediaTracker(this);
+ mt.addImage(splashImage,0);
+ try {
+ mt.waitForID(0);
+ } catch(InterruptedException ie) {}
+
+
+ // Center the window on the screen.
+ int imgWidth = splashImage.getWidth(this);
+ int imgHeight = splashImage.getHeight(this);
+
+ setSize(imgWidth, imgHeight);
+ Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
+ setLocation(
+ (screenDim.width - imgWidth) / 2,
+ (screenDim.height - imgHeight) / 2
+ );
+
+ }
+
+
+ /**
+ * Updates the display area of the window.
+ */
+ public void update(Graphics g) {
+ // Note: Since the paint method is going to draw an
+ // image that covers the complete area of the component we
+ // do not fill the component with its background color
+ // here. This avoids flickering.
+
+ g.setColor(getForeground());
+ paint(g);
+ }
+ /**
+ * Paints the image on the window.
+ */
+
+ public void paint(Graphics g) {
+ g.drawImage(splashImage, 0, 0, this);
+
+ // Notify method splash that the window
+ // has been painted.
+ if (! paintCalled) {
+ paintCalled = true;
+ synchronized (this) { notifyAll(); }
+ }
+ }
+
+ /**
+ * Constructs and displays a SplashWindow.<p>
+ * This method is useful for startup splashs.
+ * Dispose the returned frame to get rid of the splash window.<p>
+ *
+ * @param splashImage The image to be displayed.
+ * @return Returns the frame that owns the SplashWindow.
+ */
+
+ public static Frame splash() {
+ Frame f = new Frame();
+ SplashScreen w = new SplashScreen(f);
+
+ // Show the window.
+ w.setVisible(true);
+ w.toFront();
+
+ // Note: To make sure the user gets a chance to see the
+ // splash window we wait until its paint method has been
+ // called at least once by the AWT event dispatcher thread.
+
+ // sebwills adds: However, just in case the paint method never gets called
+ // (e.g. if the splashscreen is completely obscured by an 'always on top'
+ // window of some other application), we time-out after 5 seconds.
+ if (! EventQueue.isDispatchThread()) {
+ synchronized (w) {
+ if (! w.paintCalled) {
+ try {
+ w.wait(5000);
+ } catch (InterruptedException e) {}
+ }
+ }
+ }
+ return f;
+ }
+}
StringDialog parent;
public NewStringAction(StringDialog parent) {
super("New string",
- new ImageIcon(GUIGlobals.addIconFile));
+ GUIGlobals.getImage("add"));
putValue(SHORT_DESCRIPTION, Globals.lang("New string"));
this.parent = parent;
}
StringDialog parent;
public StoreContentAction(StringDialog parent) {
super("Store string",
- new ImageIcon(GUIGlobals.addIconFile));
+ GUIGlobals.getImage("add"));
putValue(SHORT_DESCRIPTION, Globals.lang("Store string"));
this.parent = parent;
}
StringDialog parent;
public RemoveStringAction(StringDialog parent) {
super("Remove selected strings",
- new ImageIcon(GUIGlobals.removeIconFile));
+ GUIGlobals.getImage("remove"));
putValue(SHORT_DESCRIPTION, Globals.lang("Remove selected strings"));
this.parent = parent;
}
UndoAction undoAction = new UndoAction();
class UndoAction extends AbstractAction {
public UndoAction() {
- super("Undo", new ImageIcon(GUIGlobals.undoIconFile));
+ super("Undo", GUIGlobals.getImage("undo"));
putValue(SHORT_DESCRIPTION, Globals.lang("Undo"));
}
public void actionPerformed(ActionEvent e) {
RedoAction redoAction = new RedoAction();
class RedoAction extends AbstractAction {
public RedoAction() {
- super("Undo", new ImageIcon(GUIGlobals.redoIconFile));
+ super("Undo", GUIGlobals.getImage("redo"));
putValue(SHORT_DESCRIPTION, Globals.lang("Redo"));
}
public void actionPerformed(ActionEvent e) {
con.weighty = 0;
con.anchor = GridBagConstraints.SOUTHEAST;
con.insets = new Insets( 0,5,0,5 );
- JButton hlb = new JButton(new ImageIcon(GUIGlobals.helpSmallIconFile));
+ JButton hlb = new JButton(GUIGlobals.getImage("helpSmall"));
hlb.setToolTipText(Globals.lang("Help on key patterns"));
gbl.setConstraints( hlb, con );
add(hlb);
class DeleteRowAction extends AbstractAction {
public DeleteRowAction() {
- super("Delete row", new ImageIcon(GUIGlobals.delRowIconFile));
+ super("Delete row", GUIGlobals.getImage("remove"));
putValue(SHORT_DESCRIPTION, Globals.lang("Delete rows"));
}
public void actionPerformed(ActionEvent e) {
class AddRowAction extends AbstractAction {
public AddRowAction() {
- super("Add row", new ImageIcon(GUIGlobals.addIconFile));
+ super("Add row", GUIGlobals.getImage("add"));
putValue(SHORT_DESCRIPTION, Globals.lang("Insert rows"));
}
public void actionPerformed(ActionEvent e) {
class UpdateWidthsAction extends AbstractAction {
public UpdateWidthsAction() {
//super(Globals.lang("Update to current column widths"));
- super(Globals.lang("Update to current column widths"), new ImageIcon(GUIGlobals.sheetIcon));
+ super(Globals.lang("Update to current column widths"));
//putValue(SHORT_DESCRIPTION, Globals.lang("Update to current column widths"));
}
public void actionPerformed(ActionEvent e) {
public NewAboutAction()
{
// This action leads to a dialog asking for entry type.
- super( new ImageIcon( GUIGlobals.helpIconFile ) ) ;
+ super(GUIGlobals.getImage("about")) ;
putValue( NAME, "About JabRef" ) ;
// putValue( ACCELERATOR_KEY, key ) ;
putValue( SHORT_DESCRIPTION, Globals.lang( "About JabRef" ) ) ;
public FileUpdatePanel(JabRefFrame frame, BasePanel panel,
SidePaneManager manager, File file, ChangeScanner scanner) {
- super(manager, GUIGlobals.saveIconFile, Globals.lang("File changed"));
+ super(manager, GUIGlobals.getIconUrl("save"), Globals.lang("File changed"));
this.panel = panel;
this.frame = frame;
this.manager = manager;
import net.sf.jabref.JabRefFrame;
import net.sf.jabref.Util;
import net.sf.jabref.Globals;
+import com.jgoodies.forms.builder.ButtonBarBuilder;
+import com.jgoodies.forms.layout.Sizes;
/**
* Dialog for creating or modifying custom exports.
browse = new JButton(Globals.lang("Browse"));
JPanel
main = new JPanel(),
- opt = new JPanel();
+ buttons = new JPanel();
private boolean ok_pressed = false;
private Vector groups;
private int index;
// Layout starts here.
main.setLayout(gbl);
- //opt.setLayout(gbl);
main.setBorder(BorderFactory.createTitledBorder
(BorderFactory.createEtchedBorder(),
Globals.lang("Export properties")));
gbl.setConstraints(extension, con);
main.add(extension);
- // Option buttons:
- con.gridx = GridBagConstraints.RELATIVE;
- con.gridy = GridBagConstraints.RELATIVE;
- con.weightx = 1;
- con.gridwidth = 1;
- con.anchor = GridBagConstraints.EAST;
- con.fill = GridBagConstraints.NONE;
- //gbl.setConstraints(ok, con);
- opt.add(ok);
- con.anchor = GridBagConstraints.WEST;
- con.gridwidth = GridBagConstraints.REMAINDER;
- //gbl.setConstraints(cancel, con);
- opt.add(cancel);
-
+ ButtonBarBuilder bb = new ButtonBarBuilder(buttons);
+ buttons.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
+ bb.addGlue();
+ bb.addGridded(ok);
+ bb.addGridded(cancel);
+ bb.addGlue();
+
getContentPane().add(main, BorderLayout.CENTER);
- getContentPane().add(opt, BorderLayout.SOUTH);
+ getContentPane().add(buttons, BorderLayout.SOUTH);
//pack();
setSize(600, 170);
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableColumnModel;
+import com.jgoodies.forms.builder.ButtonBarBuilder;
+import com.jgoodies.forms.layout.Sizes;
+
/**
* <p>Title: </p>
* <p>Description: </p>
close = new JButton(Globals.lang("Close")),
help = new JButton(Globals.lang("Help"));
- JPanel options = new JPanel(),
+ JPanel buttons = new JPanel(),
main = new JPanel();
JTable table;
//am.put("close", closeAction);
main.setLayout(new BorderLayout());
main.add(sp, BorderLayout.CENTER);
- options.add(addExport);
- options.add(modify);
- options.add(remove);
- options.add(close);
- options.add(Box.createHorizontalStrut(5));
- options.add(help);
+ ButtonBarBuilder bb = new ButtonBarBuilder(buttons);
+ buttons.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
+ bb.addGlue();
+ bb.addGridded(addExport);
+ bb.addGridded(modify);
+ bb.addGridded(remove);
+ bb.addGridded(close);
+ bb.addUnrelatedGap();
+ bb.addGridded(help);
+ bb.addGlue();
getContentPane().add(main, BorderLayout.CENTER);
- getContentPane().add(options, BorderLayout.SOUTH);
+ getContentPane().add(buttons, BorderLayout.SOUTH);
pack();
Util.placeDialog(this, frame);
new FocusRequester(table);
}
public void commit() throws SaveException {
+ if (file == null)
+ return;
if (file.exists() && backup) {
String name = file.getName();
String path = file.getParent();
public String format(String fieldText)
{
- String[] authors = fieldText.split(" and ");
+ // It seems to me that this formatter and AuthorLastFirstAbbreviator
+ // are duplicates. Since the latter was patched to improve handling of
+ // some names, we refer the operation there:
+ return (new AuthorLastFirstAbbreviator()).format(fieldText);
+
+ /*String[] authors = fieldText.split(" and ");
String abbrev = getAbbreviations(authors);
return abbrev;
-
+ */
}
/**
*
* @param authors List of authors or editors.
* @return the names abbreviated.
- * @throws RequiredOrderException
- *
+ *
*/
private String getAbbreviations(String[] authors)
{
-/*
- * Created on 12/10/2004
- */
package net.sf.jabref.export.layout.format;
import net.sf.jabref.export.layout.LayoutFormatter;
/**
- *
- * Uses as input the fields (author or editor) in the LastFirst format.
+ * Uses as input the fields (author or editor) in the LastFirst format.
*
* This formater enables to abbreviate the authors name in the following way:
*
- * Ex: Someone, Van Something will be abbreviated as Someone, V. S.
+ * Ex: Someone, Van Something will be abbreviated as Someone, V.S.
*
* @author Carlos Silla
+ * @author Christopher Oezbek <oezi@oezi.de>
+ *
+ * @version 1.0 Created on 12/10/2004
+ * @version 1.1 Fixed bug
+ * http://sourceforge.net/tracker/index.php?func=detail&aid=1466924&group_id=92314&atid=600306
*/
public class AuthorLastFirstAbbreviator implements LayoutFormatter {
- /* (non-Javadoc)
+ /**
* @see net.sf.jabref.export.layout.LayoutFormatter#format(java.lang.String)
*/
- public String format(String fieldText)
- {
-
- String[] authors = fieldText.split(" and ");
-
- String abbrev = getAbbreviations(authors);
- return (abbrev==null ? "" : abbrev);
-
+ public String format(String fieldText) {
+ try {
+ return getAbbreviations(fieldText.split(" and "));
+ } catch(Exception e){
+ return fieldText;
+ //return "Author names must be formatted \"Last, First\" or \"Last, Jr., First\" before formatting with AuthorLastFirstAbbreviator";
+ }
}
-
+
/**
- * Abbreviates the names in the Last First format.
- *
- * @param authors List of authors or editors.
- * @return the names abbreviated.
- * @throws RequiredOrderException
+ * Abbreviates the names in the Last, First or Last, Jr, First format.
*
+ * @param authors
+ * List of authors.
+ * @return The abbreviated names.
*/
- private String getAbbreviations(String[] authors)
- {
- String s = null;
-
- try
- {
- verifyProperFormat(authors);
-
- String[] authors_abrv = new String[authors.length];
-
- int i = 0;
-
- for(i=0; i<authors.length; i++)
- {
- authors_abrv[i] = getAbbreviation(authors[i]);
- }
-
- //Faz o merge em um "unico string" usando " and "
- StringBuffer sb = new StringBuffer();
+ private String getAbbreviations(String[] authors) {
+ if (authors.length == 0)
+ return "";
- for(i=0; i<authors.length-1; i++)
- {
- sb.append(authors_abrv[i]).append(" and ");
- }
- sb.append(authors_abrv[i]);
+ /*if (!isProperFormat(authors)) {
+ return "Author names must be formatted \"Last, First\" or \"Last, Jr., First\" before formatting with AuthorLastFirstAbbreviator";
+ }*/
- s = new String(sb);
+ for (int i = 0; i < authors.length; i++) {
+ authors[i] = getAbbreviation(authors[i]);
}
- catch(Exception e)
- {
- e.printStackTrace();
- // System.out.println(e);
- //System.exit(-1);
+
+ StringBuffer sb = new StringBuffer();
+
+ for (int i = 0; i < authors.length - 1; i++) {
+ sb.append(authors[i]).append(" and ");
}
-
- return s;
+ sb.append(authors[authors.length - 1]);
+
+ return sb.toString();
}
/**
- * Method that verifies if the author names are in the Last First format.
+ * Method that verifies if the author names are in the Last, First or Last,
+ * Jr, First format.
+ *
+ * If the name contains a space, but does not have the comma it is not in
+ * the appropriate format.
*
- * @param authors List of author or editor names.
- * @throws Exception
+ * @param authors
+ * List of authors to verify
*/
- private void verifyProperFormat(String[] authors) throws Exception
- {
- int i = 0;
-
- for(i=0; i<authors.length; i++)
- {
- //If the name contains a space, but does not have the comma it is not in the
- // appropriate format.
- if((authors[i].indexOf(' ') >= 0) && (authors[i].lastIndexOf(',')==-1))
- {
- System.out.println(": '"+authors[i]+"'");
- Exception e = new Exception("Error: names must be rearranged in Last, First format before formatted with AuthorLastFirstAbbreviator");
- e.printStackTrace();
- throw e;
+ private boolean isProperFormat(String[] authors) {
+ for (int i = 0; i < authors.length; i++) {
+ if ((authors[i].indexOf(' ') >= 0)
+ && (authors[i].indexOf(',') == -1)) {
+ return false;
}
+
}
+ return true;
}
/**
+ * Abbreviates all first names of the author.
*
- * Abbreviates all but the last name of the author.
- *
- * @param string
+ * @param author
* @return
*/
- private String getAbbreviation(String string) {
- String[] author = string.split(", ");
-
- // If there is no comma in the name, we return it as it is:
- if (author.length < 2)
- return string;
-
- char c;
- String s;
- //Gets the name:
- StringBuffer sb = new StringBuffer(author[0] + ", ");
-
- int index = author[1].indexOf(" ");
-
- if(index==-1) {
- //Its a simple name like van Something, Someone or Something, Someone:
- c = author[1].charAt(0);
-// System.out.println("Char c: " + c + " Name: " + author[1]);
- sb.append(c).append(".");
+ private String getAbbreviation(String author) {
+
+ String[] parts = author.split(",");
+
+ String last, first;
+
+ switch (parts.length) {
+ case 1:
+ // If there is no comma in the name, we return it as it is
+ return author;
+ case 2:
+ last = parts[0].trim();
+ first = parts[1].trim();
+ break;
+ case 3:
+ last = parts[0].trim();
+ // jr = author[1];
+ first = parts[2].trim();
+ break;
+ default:
+ throw new IllegalArgumentException("Authorname contained 3 or more commas");
}
- else {
- //Its a "complex" name like van Something, Someone Something
- String[] nameParts = author[1].split(" ");
-
- int i = 0;
-
- for(i=0;i<nameParts.length;i++)
- {
- c = nameParts[i].charAt(0);
- // System.out.println("Char c: " + c + " Name: " + nameParts[i]);
- sb.append(c).append(".");
- }
+
+ StringBuffer sb = new StringBuffer();
+ sb.append(last);
+ sb.append(", ");
+
+ String[] firstNames = first.split(" ");
+ for (int i = 0; i < firstNames.length; i++) {
+ sb.append(firstNames[i].charAt(0));
+ sb.append('.');
}
-
- //Replaces each "part of the name" for the corresponding Letter Dot Space format:
- s = new String(sb);
-
- //System.out.println("The Abbreviated name is: " + s);
- return s;
- }
+ return sb.toString();
+ }
}
//System.out.println("next: "+(char)c);
String combody;
if (c == '{') {
- IntAndString part = getPart(field, i);
+ IntAndString part = getPart(field, i, false);
i += part.i;
combody = part.s;
}
}
else {
- //if (!incommand || ((c!='{') && !Character.isWhitespace(c)))
- testContent: if (!incommand || (!Character.isWhitespace(c) && (c != '{')))
+ String argument = null;
+
+ if (!incommand) {
sb.append((char)c);
- else {
+ }
+ else if (Character.isWhitespace(c) || c == '{') {
// First test if we are already at the end of the string.
- if (i >= field.length()-1)
- break testContent;
-
- if (c == '{') {
-
- String command = currentCommand.toString();
- // Then test if we are dealing with a italics or bold command. If so, handle.
- if (command.equals("emph") || command.equals("textit")) {
- IntAndString part = getPart(field, i);
- i += part.i;
- sb.append("<em>").append(part.s).append("</em>");
- }
- else if (command.equals("textbf")) {
- IntAndString part = getPart(field, i);
- i += part.i;
- sb.append("<b>").append(part.s).append("</b>");
- }
- } else
- sb.append((char)c);
-
+ //if (i >= field.length()-1)
+ // break testContent;
+
+ String command = currentCommand.toString();
+ // Then test if we are dealing with a italics or bold command.
+ // If so, handle.
+ if (command.equals("emph") || command.equals("textit")) {
+ IntAndString part = getPart(field, i, true);
+
+ i += part.i;
+ sb.append("<em>").append(part.s).append("</em>");
+ }
+ else if (command.equals("textbf")) {
+ IntAndString part = getPart(field, i, true);
+ i += part.i;
+ sb.append("<b>").append(part.s).append("</b>");
+ }
+ else {
+ IntAndString part = getPart(field, i, true);
+ i += part.i; argument = part.s;
+ }
+ }
+ else if (c == '}') {
+ argument = "";
+ }
+ else {
+ /* TODO: this point is reached, apparently, if a command is terminated in a
+ * strange way, such as with "$\omega$". Also, the command "\&" causes us
+ * to get here. The former issue is maybe a little difficult to address, since
+ * it involves the LaTeX math mode. We don't have a complete LaTeX parser, so
+ * maybe it's better to ignore these commands?
+ */
+ //System.err.println("Unreachable code?? '"+field+"'");
+ }
+ if (argument != null) {
+ // handle common case of general latex command
+ String command = currentCommand.toString();
+ Object result = Globals.HTMLCHARS.get(command+argument);
+ //System.out.print("command: "+command+", arg: "+argument);
+ //System.out.print(", result: ");
+ // If found, then use translated version. If not, then keep the
+ // text of the parameter intact.
+ if (result != null) {
+ //System.out.println((String)result);
+ sb.append((String)result);
+ } else {
+ //System.out.println(argument);
+ sb.append(argument);
+ }
}
incommand = false;
escaped = false;
return s.replaceAll("&|\\\\&","&").replaceAll("[\\n]{1,}","<p>");//.replaceAll("--", "—");
}
- private IntAndString getPart(String text, int i) {
+ private IntAndString getPart(String text, int i, boolean terminateOnEndBraceOnly) {
char c;
int count = 0;//, i=index;
StringBuffer part = new StringBuffer();
- while ((count >= 0) && (i < text.length())) {
- i++;
+ // advance to first char and skip wihitespace
+ i++;
+ for ( ; i < text.length() ; ++i) {
+ if (!Character.isWhitespace(text.charAt(i)))
+ break;
+ }
+ // then grab whathever is the first token (counting braces)
+ for ( ; i < text.length() ; ++i) {
c = text.charAt(i);
- if (c == '}')
- count--;
+ if (!terminateOnEndBraceOnly && count == 0 && Character.isWhitespace(c)) {
+ i--; // end argument and leave whitespace for further processing
+ break;
+ }
+ if (c == '}' && --count < 0)
+ break;
else if (c == '{')
count++;
-
part.append((char)c);
}
//System.out.println("part: "+part.toString()+"\nformatted: "+format(part.toString()));
}
- public void downLoadFile(final String fieldName, final FieldEditor editor, final Component parent) {
- String res =
- JOptionPane.showInputDialog(parent,
+ public void downLoadFile(final String fieldName,
+ final FieldEditor editor, final Component parent) {
+
+ String res = JOptionPane.showInputDialog(parent,
Globals.lang("Enter URL to download"));
if (res != null) {
class Downloader extends Thread {
String res;
+ BibtexEntry targetEntry = null;
public Downloader(String res) {
this.res = res;
+ // If this panel belongs in an entry editor, note which entry is
+ // currently shown:
+ if (entryEditor != null)
+ targetEntry = entryEditor.getEntry();
}
public void run() {
URL url;
String textToSet = editor.getText();
editor.setEnabled(false);
+ boolean updateEditor = true;
try {
editor.setText(Globals.lang("Downloading..."));
url = new URL(res);
Globals.logger("Error while downloading " + url.toString());
}
+ // Check if we should update the editor text field, or update the
+ // target entry directly:
+ updateEditor = (entryEditor == null) ||
+ (entryEditor.getEntry() == targetEntry);
output(Globals.lang("Download completed"));
String filename = file.getPath();
filename = relPath;
}
textToSet = filename;
- //editor.setText(filename);
- SwingUtilities.invokeLater(new Thread() {
- public void run() {
- if (entryEditor != null)
- entryEditor.updateField(editor);
- }
- });
+ if (updateEditor)
+ SwingUtilities.invokeLater(new Thread() {
+ public void run() {
+ if (entryEditor != null)
+ entryEditor.updateField(editor);
+ }
+ });
+ else {
+ // Editor has probably changed to show a different entry. So
+ // we must update the target entry directly and not set the
+ // text of the editor.
+ targetEntry.setField(fieldName, textToSet);
+ }
} catch (MalformedURLException e1) {
JOptionPane.showMessageDialog(parent, "Invalid URL: "+e1.getMessage(),
"Download file", JOptionPane.ERROR_MESSAGE);
} finally {
- editor.setText(textToSet);
- editor.setEnabled(true);
+ if (updateEditor) {
+ System.out.println("Juuu");
+ editor.setText(textToSet);
+ editor.setEnabled(true);
+ }
}
}
}
}
public Icon getIcon() {
- return new ImageIcon(GUIGlobals.emacsIcon);
+ return GUIGlobals.getImage("emacs");
}
public String getKeyStrokeName() {
}
public Icon getIcon() {
- return new ImageIcon(GUIGlobals.lyxIconFile);
+ return GUIGlobals.getImage("lyx");
}
public String getKeyStrokeName() {
}
public Icon getIcon() {
- return new ImageIcon(GUIGlobals.winEdtIcon);
+ return GUIGlobals.getImage("winedt");
}
public String getKeyStrokeName() {