Merge branch 'JAL-1286' into Release_2_8_1_Branch
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Thu, 7 Nov 2013 13:54:20 +0000 (13:54 +0000)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Thu, 7 Nov 2013 13:54:20 +0000 (13:54 +0000)
slightly dirty merge - JAL-1400 patches have been brought in too
Conflicts:
build.xml

122 files changed:
.classpath
.project
build.xml
doc/i18n.html [new file with mode: 0644]
examples/exampleFile_2_3.jar
examples/exampleFile_2_7.jar
examples/unfolded_RF00031.aln [new file with mode: 0644]
help/help.jhm
help/helpTOC.xml
help/html/menus/alignmentMenu.html
help/html/menus/alwselect.html
help/html/menus/popupMenu.html
help/html/webServices/RNAalifold.html [new file with mode: 0644]
help/html/webServices/RNAalifoldAnnotationRows.png [new file with mode: 0644]
lib/Jmol-12.2.4.jar
lib/min-jaba-client-2.0.jar [deleted file]
lib/min-jabaws-client-2.1.0.jar [new file with mode: 0644]
resources/lang/Messages.properties [new file with mode: 0644]
resources/lang/Messages_es.properties [new file with mode: 0644]
schemas/jalview.xsd
src/MCview/AppletPDBCanvas.java
src/MCview/AppletPDBViewer.java [changed mode: 0755->0644]
src/MCview/PDBViewer.java
src/jalview/analysis/AAFrequency.java
src/jalview/analysis/StructureFrequency.java
src/jalview/api/AlignViewControllerI.java [new file with mode: 0644]
src/jalview/api/AlignViewportI.java
src/jalview/appletgui/APopupMenu.java [changed mode: 0755->0644]
src/jalview/appletgui/AlignFrame.java
src/jalview/appletgui/AlignViewport.java
src/jalview/appletgui/AnnotationColourChooser.java [changed mode: 0755->0644]
src/jalview/appletgui/AnnotationLabels.java
src/jalview/appletgui/AnnotationPanel.java
src/jalview/appletgui/AppletJmol.java
src/jalview/appletgui/CutAndPasteTransfer.java [changed mode: 0755->0644]
src/jalview/appletgui/FeatureColourChooser.java
src/jalview/appletgui/FeatureRenderer.java [changed mode: 0755->0644]
src/jalview/appletgui/FeatureSettings.java
src/jalview/appletgui/Finder.java [changed mode: 0755->0644]
src/jalview/appletgui/FontChooser.java [changed mode: 0755->0644]
src/jalview/appletgui/PCAPanel.java [changed mode: 0755->0644]
src/jalview/appletgui/PairwiseAlignPanel.java [changed mode: 0755->0644]
src/jalview/appletgui/RedundancyPanel.java [changed mode: 0755->0644]
src/jalview/appletgui/RotatableCanvas.java
src/jalview/appletgui/ScalePanel.java
src/jalview/appletgui/SliderPanel.java [changed mode: 0755->0644]
src/jalview/appletgui/TreeCanvas.java
src/jalview/appletgui/TreePanel.java
src/jalview/appletgui/UserDefinedColours.java [changed mode: 0755->0644]
src/jalview/bin/Cache.java
src/jalview/bin/JalviewLite.java
src/jalview/controller/AlignViewController.java [new file with mode: 0644]
src/jalview/datamodel/Sequence.java
src/jalview/datamodel/SequenceGroup.java
src/jalview/gui/AlignFrame.java [changed mode: 0755->0644]
src/jalview/gui/AlignViewport.java
src/jalview/gui/AnnotationColourChooser.java [changed mode: 0755->0644]
src/jalview/gui/AnnotationExporter.java [changed mode: 0755->0644]
src/jalview/gui/AnnotationLabels.java
src/jalview/gui/AnnotationPanel.java
src/jalview/gui/AppJmol.java
src/jalview/gui/AppVarnaBinding.java
src/jalview/gui/AssociatePdbFileWithSeq.java
src/jalview/gui/BlogReader.java
src/jalview/gui/Console.java
src/jalview/gui/CutAndPasteHtmlTransfer.java
src/jalview/gui/CutAndPasteTransfer.java [changed mode: 0755->0644]
src/jalview/gui/DasSourceBrowser.java [changed mode: 0755->0644]
src/jalview/gui/Desktop.java
src/jalview/gui/EPSOptions.java [changed mode: 0755->0644]
src/jalview/gui/EditNameDialog.java
src/jalview/gui/FeatureColourChooser.java
src/jalview/gui/FeatureRenderer.java [changed mode: 0755->0644]
src/jalview/gui/FeatureSettings.java [changed mode: 0755->0644]
src/jalview/gui/Finder.java
src/jalview/gui/JDatabaseTree.java
src/jalview/gui/Jalview2XML.java
src/jalview/gui/Jalview2XML_V1.java
src/jalview/gui/JalviewDialog.java
src/jalview/gui/PCAPanel.java [changed mode: 0755->0644]
src/jalview/gui/PopupMenu.java
src/jalview/gui/Preferences.java
src/jalview/gui/RotatableCanvas.java
src/jalview/gui/ScalePanel.java
src/jalview/gui/SeqPanel.java
src/jalview/gui/SequenceFetcher.java
src/jalview/gui/TreeCanvas.java
src/jalview/gui/UserDefinedColours.java
src/jalview/gui/UserQuestionnaireCheck.java
src/jalview/gui/WebserviceInfo.java [changed mode: 0755->0644]
src/jalview/gui/WsJobParameters.java
src/jalview/gui/WsPreferences.java
src/jalview/io/FileLoader.java
src/jalview/jbgui/GAlignFrame.java
src/jalview/jbgui/GRestServiceEditorPane.java
src/jalview/schemabinding/version2/.castor.cdr
src/jalview/schemabinding/version2/AnnotationColours.java
src/jalview/schemabinding/version2/descriptors/AnnotationColoursDescriptor.java
src/jalview/schemes/AnnotationColourGradient.java
src/jalview/schemes/RNAHelicesColour.java
src/jalview/schemes/RNAHelicesColourChooser.java
src/jalview/structure/StructureSelectionManager.java
src/jalview/util/MessageManager.java [new file with mode: 0644]
src/jalview/viewmodel/AlignmentViewport.java
src/jalview/workers/ConsensusThread.java
src/jalview/workers/StrucConsensusThread.java
src/jalview/ws/jws2/AAConClient.java
src/jalview/ws/jws2/AADisorderClient.java
src/jalview/ws/jws2/JabaWsServerQuery.java
src/jalview/ws/jws2/JabawsAlignCalcWorker.java
src/jalview/ws/jws2/JabawsCalcWorker.java [new file with mode: 0644]
src/jalview/ws/jws2/Jws2Discoverer.java
src/jalview/ws/jws2/ParameterUtils.java
src/jalview/ws/jws2/RNAalifoldClient.java [new file with mode: 0644]
src/jalview/ws/jws2/SequenceAnnotationWSClient.java
src/jalview/ws/jws2/dm/JabaOption.java
src/jalview/ws/jws2/jabaws2/Jws2Instance.java
src/jalview/ws/jws2/jabaws2/Jws2InstanceFactory.java [new file with mode: 0644]
src/jalview/ws/uimodel/AlignAnalysisUIText.java [new file with mode: 0644]
test/jalview/gui/JAL1353bugdemo.java [new file with mode: 0644]
test/jalview/ws/jabaws/RNAStructExportImport.java [new file with mode: 0644]
utils/InstallAnywhere/Jalview.iap_xml

index 6cffc21..c22cae5 100644 (file)
        <classpathentry kind="lib" path="lib/miglayout-4.0-swing.jar"/>
        <classpathentry kind="lib" path="lib/jswingreader-0.3.jar" sourcepath="/jswingreader"/>
        <classpathentry kind="lib" path="lib/commons-codec-1.3.jar"/>
-       <classpathentry kind="lib" path="lib/min-jaba-client-2.0.jar" sourcepath="/clustengine2"/>
        <classpathentry kind="lib" path="lib/Jmol-12.2.4.jar"/>
        <classpathentry kind="lib" path="appletlib/JmolApplet-12.2.4.jar"/>
        <classpathentry kind="lib" path="lib/jdas-1.0.4.jar"/>
        <classpathentry kind="lib" path="lib/spring-core-3.0.5.RELEASE.jar"/>
        <classpathentry kind="lib" path="lib/spring-web-3.0.5.RELEASE.jar"/>
+       <classpathentry kind="lib" path="lib/VARNAv3-9-dev.jar"/>
+       <classpathentry kind="lib" path="lib/groovy-all-1.8.2.jar"/>
+       <classpathentry kind="lib" path="lib/min-jabaws-client-2.1.0.jar" sourcepath="/clustengine"/>
        <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/plugin.jar"/>
-       <classpathentry kind="lib" path="/Users/jimp/git/jalview_clean/lib/VARNAv3-9-dev.jar"/>
        <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
        <classpathentry kind="output" path="classes"/>
 </classpath>
index 5f4b511..aa7e6f2 100644 (file)
--- a/.project
+++ b/.project
                                </dictionary>
                        </arguments>
                </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
-                       <triggers>full,incremental,</triggers>
-                       <arguments>
-                               <dictionary>
-                                       <key>LaunchConfigHandle</key>
-                                       <value>&lt;project&gt;/.externalToolBuilders/buildapplet [Builder].launch</value>
-                               </dictionary>
-                       </arguments>
-               </buildCommand>
        </buildSpec>
        <natures>
                <nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
index 2673e9b..bf84feb 100755 (executable)
--- a/build.xml
+++ b/build.xml
        <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
                <copy file="${resourceDir}/images/idwidth.gif" toFile="${outputDir}/images/idwidth.gif" />
                <copy file="${resourceDir}/images/link.gif" toFile="${outputDir}/images/link.gif" />
+               <copy todir="${outputDir}/lang">
+                       <fileset dir="${resourceDir}/lang"><include name="**.*"/></fileset></copy>
                <jar destfile="in.jar" index="true">
                        <manifest>
                                <attribute name="Main-Class" value="jalview.bin.JalviewLite" />
                                <include name=".build_properties" />
                                <include name="images/idwidth.gif" />
                                <include name="images/link.gif" />
+                               <include name="lang/**" />
                        </fileset>
                </jar>
        </target>
diff --git a/doc/i18n.html b/doc/i18n.html
new file mode 100644 (file)
index 0000000..d2a7420
--- /dev/null
@@ -0,0 +1,47 @@
+<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<!--\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)\r
+ * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle\r
+ * \r
+ * This file is part of Jalview.\r
+ * \r
+ * Jalview is free software: you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License \r
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
+ *  \r
+ * Jalview is distributed in the hope that it will be useful, but \r
+ * WITHOUT ANY WARRANTY; without even the implied warranty \r
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
+ * PURPOSE.  See the GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.\r
+-->\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+  <head>Jalview i18n</head>\r
+  <body>\r
+<h1>Best practices</h1>\r
+<ol>\r
+<li>Follow the standards described in this guide</li>\r
+<li>Always use properties files for user interface text; never include displayable text in code</li>\r
+<li>Use properties files only for user interface text (Messages_xx.properties) and config files for configuration settings (jalview.properties).</li>\r
+<li>Use a proper naming schema for keys in your resource bundles. The name of the keys should provide some information about the context of the displayed text. This helps the translators during the translation process.</li>\r
+<li>Group keys by view, ie. edit.title, edit.instructions, list.title, list.instructions, create.title, etc</li>\r
+<li>Never use displayable text when executing comparisons within the logic of the tool (separate codified values from displayable text)</li>\r
+<li>Always use the MessageManager class for retrieving properties values, and invoke MessageManager methods dynamically, to accommodate dynamic user preferences (see MessageManager below).</li>\r
+<li>All numbers and dates should be formatted specific to the user's locale (e.g. java.text.NumberFormat and java.text.DateFormat)</li>\r
+<li>Test code in more than one language</li>\r
+</ol>\r
+<h1>MessageManager</h1>\r
+<p>The jalview.util.MessageManager class is a wrapper class for the ResourceBundle class. It provides dynamic language/locale support for individual users, and is recommended for all Jalview code.</p>\r
+<p>To use it within your code, you only have to invoke MessageManager with the text key in Messages_xx.properties:</p>\r
+<p>JButton ok = new JButton(MessageManager.getString("button.ok"));</p>\r
+<p>This will set JButton text to the one included at button.ok key. In English JButton text will be OK, while in Spanish will be Aceptar. This is the big thing of i18n. :)</p>\r
+<h1>How to translate Jalview</h1>\r
+<p>Anyone interested in localizing/translating Jalview is strongly encouraged to join the <a href="mailto:jalview-dev@jalview.org">Jalview Development List</a> list. We would recommend that you read this entire page before proceeding.</p>\r
+<p>If you are planning on working on a Jalview translation, please send us an email (<a href="mailto:jalview-dev@jalview.org">Jalview Development List</a>). There may be someone else already working on translating Jalview to your target language.</p>\r
+<p>Once you have downloaded the source code (available at <a href="http://www.jalview.org/download">http://www.jalview.org/download</a>), you must edit {jalview.home}/resources/lang/Messages_xx.properties, where xx refers to your language country code. If it doesn't exits, rename Messages.properties to Messages_xx.properties.</p>\r
+<p>Next step...start transtalation!</p>\r
+<p>Once you have it translated, we would appreciate if you contribute it forwarding the file to <a href="mailto:jalview-dev@jalview.org">Jalview Development List</a>. We will commit it to the code base as soon as possible. Thanks so much for this in advance!</p>\r
+</body>\r
+</html>\r
+\r
index 8c6114d..adf707e 100644 (file)
Binary files a/examples/exampleFile_2_3.jar and b/examples/exampleFile_2_3.jar differ
index 3c1ea42..71967a5 100644 (file)
Binary files a/examples/exampleFile_2_7.jar and b/examples/exampleFile_2_7.jar differ
diff --git a/examples/unfolded_RF00031.aln b/examples/unfolded_RF00031.aln
new file mode 100644 (file)
index 0000000..69a7850
--- /dev/null
@@ -0,0 +1,126 @@
+CLUSTAL
+
+B.taurus.1/1-64       C-UUGCGUU--AAUGAGAACAGAAACG-UAAA--CUAUAA-CCUAG-G---------GGU
+D.melanogaster.3/1-68 G-UGGCGCU--UAUGACGCAGUUGUCU-UAAA-CUCGAAC--UCGA-GC--------GGG
+D.melanogaster.2/1-63 C-AUUCAACU-UAUGAGGAUUAUUUCU-UAAA-GGCCUCU---GGC--U-------CGGA
+D.melanogaster.1/1-65 G-AGCC-CU---AUGAUCGAUGAUUGG-CAAA-UCCUCUC--GAGG--A-------ACCG
+R.norvegicus.7/1-66   C-CGGCACU--CAUGACGGUCUGCCUG-AAAA-CCAGCCC--GCUG-GU--------GGG
+R.norvegicus.6/1-67   G-CCGCUUC---AUGACAGGAAGGACU-GAAA-UGUCUCA-AAGAC--C-----UGUGGU
+R.norvegicus.5/1-62   G-UUUUUCC---AUGACGGUGUUUCCUCUAAA--UUUAC----AUG-----------GAG
+R.norvegicus.4/1-61   G-UCAGAUG---AUGACGGCCUGUGCA-GAAA-CCCCCAC-GUGGG--C--------UGC
+R.norvegicus.3/1-67   U-UUGCAUU--AAUGAGGAUUACACAG-AAAA-CCUUUGU--UAAGGGU--------UUG
+R.norvegicus.2/1-64   G-UUACAUU--GAUGAGAACAGAAACA-UAAA--CUAUGA-CCUAG-G---------GGU
+R.norvegicus.1/1-61   A-UAUUUGUU-UAUGAUGGUCACAGUG-UAAA--GUUCA----CAC-----------AGC
+O.aries.1/1-68        G-ACGCUUC---AUGACAGGAAGGACU-GAAA-UGUCUCU-UGGAC-GC------CUGGU
+M.musculus.9/1-66     C-CGGCACU--CAUGAAGGUCUGCUUG-AAAA-CCAGCCU--GCUG-GU--------GGG
+M.musculus.8/1-67     U-UUGCAUU--AAUGAGGAUUACACAG-AAAA-CCUUUGU--UAAG-GA-------CUUG
+O.niloticus.3/1-65    G-UGUCUCU---GUGAAGUUCGGUUUU-UAAA-AGGGUCA---UCC--A-------GAAA
+M.musculus.7/1-64     G-UGUCUCU---AUGAAGGAGGGGCCC-GAAG-CCCUUGU---GGG--C--------GGG
+O.niloticus.2/1-61    U-GUUUAUU--AAUGACGGCUACAGAU-UAAA--CCUUU----AGC-----------CUC
+M.musculus.6/1-61     G-UCAGAUG---AUGAUGGCCUGGGCA-GAAA-CCCCAUG--UGGG--C--------CGC
+O.niloticus.1/1-59    G-UUUCUCA---GUGAAGGCUACAGAU-UAAA--CCUCU----GGC-----------CUC
+M.musculus.5/1-66     G-CCGCUUC---AUGACAGGAAGGACU-GAAA-UGUCUUA---GAC--C-----UGUGGU
+M.musculus.4/1-65     G-UGUGCGA---AUGAUAACUACUGAC-GAAA-GAGCUGU-CUGCU--C-------AGUC
+M.musculus.3/1-64     G-GUUCUUC--CAUGAUGGUGUUUCCUCUAAA--UUUGC----ACG-----------GAG
+M.musculus.2/1-64     G-UUACAUU--AAUGAGAACAGAAACA-UAAA--CUAUGA-CCUAG-G---------GGU
+M.musculus.1/1-64     G-UCACCGA---AUGAUCUGCUCUGGU-CAAA-UCCUUCU---AUG--C------CAGCC
+C.elegans.1/1-64      G-AGGCAGCUUUGUGACGACCUUUGGC-UAAA-CUCCAUC--GUGA-GC--------GCC
+H.sapiens.15/1-63     U-UUUCAUC--UAUGAGGGUGUUUCCUCUAAA--CCUACG---AGG-----------GAG
+H.sapiens.14/1-62     C-ACUGCUG---AUGACGAACUAUCUC-UAAC-UGGUCUU--GACC--A-------CGAG
+H.sapiens.13/1-64     G-UCACUGC---AUGAUCCGCUCUGGU-CAAA-CCCUUCC---AGG--C------CAGCC
+H.sapiens.12/1-67     C-UCUGUUA---AUGACGUCUCUCCCUCUAAA-CCCCAUU-AAGGA--C--------UGG
+D.rerio.1/1-66        A-UGUGGUCUUUAUGAAGGCAGGUGCA-GAAA-CUAUGCA---CUA-GU--------GGU
+H.sapiens.11/1-63     G-CCGGAUG---AUGACGACCUGGGUG-GAAA-CCUACCC-UGUGG--G--------CAC
+H.sapiens.10/1-62     C-CGGCACU--CAUGACGGCCUGCCUG-CAAA--CCUGC----UGG--U--------GGG
+S.mansoni.1/1-67      C-UCGCUAU---AUGACGAUGGCAAUC-UCAA--AUGUU----CAU--U--------GGU
+S.scrofa.4/1-64       C-UGGCACC--CAUGACAGUCUGCCUA-AAAA-CCAGCC----CUG-GU--------GGG
+S.scrofa.3/1-63       A-UUUUAUC--CAUGAAAGUGUUUCCUCUAAA--CCUAU----GUG-----------GAG
+S.scrofa.2/1-65       C-UGGCACC--CAUGACAGUCUGCCUA-AAAA-CCAGCCC---CUG-GU--------GGG
+S.scrofa.1/1-68       G-ACGCUUC---AUGACAGGAAGGACU-GAAA-UGUCUUG-UGGAC-GC------CUGGU
+H.sapiens.9/1-58      U-AUUUGUU--UAUGAUGGCCACAGCC-UAAA--GUACA----CAC-----------GGC
+H.sapiens.8/1-67      U-UUGCUUU--AAUGAGAAUAGAAACG-UAAA--CUAUGA-CCUAG-G---------GGU
+X.laevis.1/1-67       G-UGUUUGCA-AAUGACGACCGAUUUU-GAAA-UGGUCUCACGGCC--A-------AAAA
+H.sapiens.7/1-70      U-GGCGUCUU-CAUGAGGGAGGGGCCC--AAA-GCCCUUG--UGGG--C--------GGA
+H.sapiens.6/1-66      G-UGUGCGG---AUGAUAACUACUGAC-GAAAGAGUCAUC---GAC--C-----UCAGUU
+H.sapiens.5/1-57      U-UCACAGA---AUGAUGGCACCUUCC-UAA---ACCCU----CAU-----------GGG
+H.sapiens.4/1-71      G-ACUGACAU-UAUGAAGGCCUGUACU-GAAG-ACAGCAA--GCUG--U-------UAGU
+H.sapiens.3/1-68      G-ACGCUUC---AUGAUAGGAAGGACU-GAAA-AGUCUUG-UGGAC--A-----CCUGGU
+H.sapiens.2/1-65      G-UGUGCGG---AUGAUAACUACUGAC-GAAA-GAGUCAU-CGACU--C-------AGUU
+H.sapiens.1/1-63      G-CCAGAUG---AUGACGACCUGGGUG-GAAA-CCUACCC-UGUGG--G--------CAC
+M.musculus.14/1-67    C-UCUGAUA---AUGAUGUCUCUCCCU-CUAA-CUCCCAGUAAGGA--C--------UGG
+M.musculus.13/1-60    C-AUGCGUC--CAUGAAGUCACUGGCC-UCAA-GCCCAA----GUG-GU--------GGG
+M.musculus.12/1-65    C-UCAGCAG--GAUGAUGAGAAGGGCU-GAAA-UGCUGCC--AAAC--C-------AGGU
+M.musculus.11/1-63    U-AUUUGUG--UAUGAUGGUCACAGUG-UAAA--GUUCC----CAC-----------AGC
+M.musculus.10/1-66    C-CGGCACU--CAUGAAGGUCUGCCUG-AAAA-CCAGCCU--GCUG-GU--------GGG
+B.taurus.7/1-61       U-UUUGCCC---AUGAAGGUGUUCCCUCUAAA--CCUAC----GUG-----------GAG
+B.taurus.6/1-67       G-AUGCGUC--CAUGAAGUCACCAGCC-CCAA-GCCCCUC---GUG-GU--------GGG
+B.taurus.5/1-61       G-CCAGAUG---AUGAGGACCUGUGCG-GAAA-CCCCCCG--CGGG--C--------UGC
+B.taurus.4/1-64       ACUUGCGUU--AAUGAGAACAGAAACG-UAAA--CUAUAA-CCUAG-G---------GGU
+G.gallus.3/1-73       U-AUUUCUU--UGUGAUGACCGAUUUU-GAAA-UGGGUUU---CUC--UAAUGCCAGGAA
+B.taurus.3/1-66       C-CCGGUGCC-UAUGACGGUCUGUCUG-AAAA-CCAGCCC---CUG-GU--------GGG
+G.gallus.2/1-60       U-AUUUGUC---AUGACAGUCACAGCA-UAAA--GCGCA----GAC-----------GGC
+B.taurus.2/1-64       C-UUGCGUU--AAUGAGAACAGAAACG-AAAA--CUAUAA-CCUAG-G---------GGU
+G.gallus.1/1-63       G-UGUGUUU---AUGAAGAGCACUAAC-AAAA-GAGUAAU-UGACU--C-------AGUU
+
+B.taurus.1/1-64       UUC-U-G-UUGGAU--GGUUG-------GCAAC
+D.melanogaster.3/1-68 CAA-U-U-GCUGAU---UACG---AUUAACCAC
+D.melanogaster.2/1-63 AAU-A-G-UCUGAA---CCU--------UAUUG
+D.melanogaster.1/1-65 AUC-G-U-UGAGAA--CCCCU-----UUGCCUU
+R.norvegicus.7/1-66   GCA-G-U-CCCGAG-GACCUG-------GCGUG
+R.norvegicus.6/1-67   CUU-U-C-UUCGAU--GUUCU-------GCGGC
+R.norvegicus.5/1-62   AAA-C-A-CCUGAU-UUCCAG------AAAAAU
+R.norvegicus.4/1-61   -CA-G-G-UUUGAA---CCC--------CUGGC
+R.norvegicus.3/1-67   UGUCG-A-UCUGCU--AAUUG-------GCAAA
+R.norvegicus.2/1-64   UUC-U-G-UUGGAU--AGCUC-------GUAAU
+R.norvegicus.1/1-61   UGU-G-A-CUUGAU--UUUUA-------AAAAU
+O.aries.1/1-68        CCU-U-C-CUUGAU--GUUCU------CACGGC
+M.musculus.9/1-66     GCA-G-U-CCUGAG-GACCUG-------GCGUG
+M.musculus.8/1-67     UGU-AGA-UCUGAU--AAUUG-------GCAAA
+O.niloticus.3/1-65    ACC-G-ACACUGAU--GUUUC------CGACAC
+M.musculus.7/1-64     CCU-C-C-CCUGAG---CCCG----UCUGUGGU
+O.niloticus.2/1-61    UGG-A-G-CCAGAU--GCAUU------CAAACA
+M.musculus.6/1-61     CCA-G-G-UUUGAA---CCC--------CUGGC
+O.niloticus.1/1-59    UGG-A-G-CCAGAU--GCAUU-------GAAAC
+M.musculus.5/1-66     CUU-U-C-CUCGAU--GUUCC------UGCGGC
+M.musculus.4/1-65     UGU-G-G-UUGGAU---GUAG------UCACAC
+M.musculus.3/1-64     AAA-C-A-CCUGAU-UUCCAG-----GAAAAUC
+M.musculus.2/1-64     UUC-U-G-UUGGAU--AGCUU-------GUAAU
+M.musculus.1/1-64     AGG-G-U-GGUGAU--GACCC-------GUGAC
+C.elegans.1/1-64      UCU-G-G-UCUGAU---GC---------GCCUC
+H.sapiens.15/1-63     GAA-C-A-CCUGAU---CUUA-----CAGAAAA
+H.sapiens.14/1-62     CUA-G-U-UCUGAA---UU-G-------CAGGG
+H.sapiens.13/1-64     AGA-G-U-GGGGAU--GGUCU-------GUGAC
+H.sapiens.12/1-67     GAG-A-G-GCAGAGCAAGCCU-------CAGAG
+D.rerio.1/1-66        GUC-U-G-UCUGAU--GUUUG-------GCCAU
+H.sapiens.11/1-63     CCA-U-G-UCCGAG---CCCC-------CUGGC
+H.sapiens.10/1-62     GCA-G-A-CCCGAA-AAUCCA-------GCGUG
+S.mansoni.1/1-67      UGC-C-A-UUUGAU--GAAAUCAGUUUUGUGUG
+S.scrofa.4/1-64       GCA-G-A-CUCGAG-AACCUG-------GCGUG
+S.scrofa.3/1-63       GAA-C-A-CCUGAU-GUCCAG------GAAAAU
+S.scrofa.2/1-65       GCA-G-A-CUCGAG-AACCUG-------GCGUG
+S.scrofa.1/1-68       CCU-U-C-CCUGAU--GUUCU------CAUGGC
+H.sapiens.9/1-58      UGU-G-A-CUUGAU---UCA--------AAAGA
+H.sapiens.8/1-67      UUC-U-G-UUGGAU-AAUUAG-----CAGUUUA
+X.laevis.1/1-67       CUC-GUG-UCCGAC---AUC--------AACCC
+H.sapiens.7/1-70      CCU-C-C-CCUGAG---CCUGUCUGAGGGGCCA
+H.sapiens.6/1-66      AGU-G-G-UUGGAU---GUAG------UCACAU
+H.sapiens.5/1-57      UGG-U-G-UCUGAG--AGGC--------GUGAA
+H.sapiens.4/1-71      ACA-G-A-CCAGAU--GCUUU--CUUGGCAGGC
+H.sapiens.3/1-68      CUU-U-C-CCUGAU--GUUCU------CGUGGC
+H.sapiens.2/1-65      AGU-G-G-UUGGAU---GUAG------UCACAU
+H.sapiens.1/1-63      CCA-U-G-UCCGAG---CCCC-------CUGGC
+M.musculus.14/1-67    GAG-A-G-GCUGAACAAACCU-------CAGAG
+M.musculus.13/1-60    CAG-U-G-ACAGAA---GA---------GCUGC
+M.musculus.12/1-65    CCU-U-U-UCUGAU--GGUGG-------CUGGG
+M.musculus.11/1-63    UGU-G-A-CUUGAU--UUUUA----AAAAUGUC
+M.musculus.10/1-66    GCA-G-U-CCUGAG-GACCUG-------GCGUG
+B.taurus.7/1-61       GAA-U-G-CCUGAU-GUCCAG-------GAAAA
+B.taurus.6/1-67       UGG-U-G-AUGGAA-CCGUCA-----AAGCAGU
+B.taurus.5/1-61       CCA-U-G-UCUGAG---CCC--------CUGGC
+B.taurus.4/1-64       UUC-U-G-UUGGAU--GGUUG-------GCAA-
+G.gallus.3/1-73       AUC-GUG-UCUGAU---GUUG-----UCAAGUA
+B.taurus.3/1-66       GCA-G-A-CCUGAG-AACCUG-------GCGUG
+G.gallus.2/1-60       UGU-G-A-CCUGAU--UUUAG------AAAAUA
+B.taurus.2/1-64       UUC-U-G-UUGGAU--GGUUG-------GCAAC
+G.gallus.1/1-63       GGU-G-U-UCAGAU--GCU---------CUCAC
+
index b850b79..aaaaaf8 100755 (executable)
@@ -37,6 +37,7 @@
    <mapID target="newsreader" url="html/webServices/newsreader.html"/>
    <mapID target="disorder" url="html/webServices/proteinDisorder.html"/>
    <mapID target="aacon" url="html/webServices/AACon.html"/>
+   <mapID target="rnaalifold" url="html/webServices/RNAalifold.html"/>
    <mapID target="seqfetch" url="html/features/seqfetch.html"/>
    <mapID target="dbreffetcher" url="html/webServices/dbreffetcher.html"/>
    <mapID target="seqmappings" url="html/features/seqmappings.html"/>
index 0d2e096..e27d41a 100755 (executable)
@@ -22,6 +22,7 @@
        <tocitem text="What's new" target="new" expand="true">
     <tocitem text="Protein Disorder Prediction" target="disorder"/>
     <tocitem text="Alignment Conservation Analysis" target="aacon"/>
+       <tocitem text="RNAalifold RNA Secondary Structure Prediction" target="rnaalifold"/>
                <tocitem text="Viewing RNA structure" target="varna" />
                <tocitem text="RNA Structure Consensus" target="calcs.alstrconsensus"/>
                <tocitem text="RNA Helices coloring" target="colours.rnahelices"/>
@@ -65,6 +66,7 @@
                 <tocitem text="Multiple Alignment Subjobs" target="msaservice"/>
             </tocitem>
           <tocitem text="Secondary Structure Prediction" target="jnet"/>
+          <tocitem text="RNAalifold RNA Secondary Structure Prediction" target="rnaalifold"/>
           <tocitem text="Protein Disorder Prediction" target="disorder"/>
           <tocitem text="Alignment Conservation Analysis" target="aacon"/>
           <tocitem text="Multi-Harmony Alignment Analysis" target="shmrws"/>
index 9ec5adc..d53b3eb 100755 (executable)
                                </strong><em>Any columns currently not selected will replace the current
                                                column selection. </em>
                                </li>
-                               <li><strong>Undefine Groups (Control U)<br> </strong><em>The
-                                               alignment will be reset with no defined groups.<br> <strong>WARNING</strong>:
-                                               This cannot be undone.</em>
-                               </li>
-                               <li><strong>Make Groups<br /> </strong> <em>The currently
+                                 <li><strong>Create Group (Control G)<br></strong>
+  <em>Create a group containing the currently selected sequences.</em></li>
+  <li><strong>Remove Group (Shift Control G)<br></strong>
+  <em>Ungroup the currently selected sequence group. (Create/Remove group new in Jalview 2.8.1)</em></li>
+                       <li><strong>Make Groups for selection<br /> </strong> <em>The currently
                                                selected groups of the alignment will be subdivided according to
                                                the contents of the currently selected region. <br />Use this to
                                                subdivide an alignment based on the different combinations of
                                                residues observed at specific positions. (new in jalview 2.5)</em>
                                </li>
-                       </ul></li>
+       <li><strong>Undefine Groups (Control U)<br> </strong><em>The
+            alignment will be reset with no defined groups.<br> <strong>WARNING</strong>:
+            This cannot be undone.</em>
+        </li>
+               </ul></li>
                <li><strong>View</strong>
                        <ul>
                                <li><strong>New View (Control T)</strong><em><br>
index c4b3002..bd17fa7 100644 (file)
        <li><strong>Invert Column Selection (Control Alt I)<br>
        </strong><em>Any columns currently not selected will replace the current
        column selection. </em></li>
-       <li><strong>Undefine Groups (Control U)<br>
-       </strong><em>The alignment will be reset with no defined groups.<br>
-       <strong>WARNING</strong>: This cannot be undone.</em></li>
-       <li><strong>Make Groups<br/></strong>
+       <li><strong>Create Group (Control G)<br></strong>
+       <em>Create a group containing the currently selected sequences.</em></li>
+  <li><strong>Remove Group (Shift Control G)<br></strong>
+  <em>Ungroup the currently selected sequence group. (Create/Remove group new in Jalview 2.8.1)</em></li>
+       <li><strong>Make Groups for selection<br/></strong>
        <em>The currently selected groups of the alignment will be subdivided according to the contents of the currently selected region. <br/>Use this to subdivide an alignment based on the different combinations of residues observed at specific positions. (new in jalview 2.5)</em></li>
+<li><strong>Undefine Groups (Control U)<br>
+  </strong><em>The alignment will be reset with no defined groups.<br>
+  <strong>WARNING</strong>: This cannot be undone.</em></li>
+  
 </ul>
 </body>
 </html>
index 7c3db2c..8eab2d0 100755 (executable)
@@ -59,18 +59,22 @@ not be accessible when in 'Cursor Mode' (toggled with the F2 key).</em></p>
       <li><strong><a href="../features/creatinFeatures.html">Create Sequence Feature...</a></strong><br>
         <em>Opens the dialog box for creating sequence features over the currently 
         selected region on each selected sequence.</em></li>
-      <li><strong>Group</strong><br>
-        <em>Group Operations</em> 
-        <ul>
-          <li><strong>Group</strong><em>This is the first entry in the
-         menu, and will display the currently selected group's
-         name. Selecting it displays a window allowing the name and
-         description for this group to be edited. Click OK to set the
-         new name and decription, and cancel to leave the existing
-         name and description unchanged.</em></li>
+      <li><strong>Create Group<br>
+            </strong><em>This will define a new group from the current selection.</em><strong> 
+            </strong></li>
           <li><strong>Remove Group<br>
             </strong><em>This will undefine the selected group. </em><strong> 
             </strong></li>
+          <li><strong>Edit (New) Group</strong><br>
+        <em>Group Editing Menu</em> <br />Options in this menu modify
+                                       the name and display properties of the currently selected group, or
+                                       a new group defined using the current selection.
+                                       <ul>
+          <li><strong>Name: &lt;Group&gt;</strong> or <strong>Edit name and description</strong><br><em>The first entry in the
+         menu displays the name for the currently selected group, if it has one. Selecting this option opens a window allowing the name and
+         description for this group to be edited. Click OK to set the
+         new name and decription, and cancel to leave the existing
+         name and description unchanged.</em></li>
           <li><strong>Group Colour<br>
             </strong><em>Sets the <a href="../colourSchemes/index.html">colour</a> 
             of the group.</em><strong> </strong></li>
diff --git a/help/html/webServices/RNAalifold.html b/help/html/webServices/RNAalifold.html
new file mode 100644 (file)
index 0000000..ac9df34
--- /dev/null
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="ISO-8859-1">
+<title>RNAalifold Web Service</title>
+</head>
+<body>
+       <strong>RNAalifold RNA Alignment Secondary Structure
+               Prediction Service</strong>
+       <p>
+               RNAalifold is part of the <a href="http://www.tbi.univie.ac.at/RNA/">Vienna
+                       RNA</a> Secondary Structure Prediction and Comparison Package. It was
+               described in 2008 by Ivo L. Hofacker, Sebastian Will, Andreas R.
+               Gruber, and Peter F. Stadler, <em>RNAalifold: Improved consensus
+               structure prediction for RNA alignments</em>. (<a
+                       href=http://www.biomedcentral.com/1471-2105/9/474>BMC
+                       Bioinformatics, 9:474, 2008</a>).
+       </p>
+       <p>
+               <strong>Example RNAalifold Output</strong><br />
+               RNAalifold prints a consensus alignment and mfe structure to stdout with its
+               associated energy. Depending on the arguments given, other information such as
+               alternate structures are displayed below while base pairing probabilities (-p or --MEA 
+               options) are stored in a separate 'alifold.out' file.<br />
+               <pre><br />
+G_UUUCAUU___AUGACGGCCUGUGCU_UAAA__CCUCC____GAG__C________GGGUCA_G_G_UCUGAU___CUUG_______GAGAC
+(.((((...........(((((((((........(((......)))............))))).).).))..................))))) (-19.16 = -11.80 +  -7.36) 
+(.((((...........(((((((((........(((......)))............))))).).).))..................))))) [-19.32]
+       frequency of mfe structure in ensemble 0.765639
+(.((((...........(((((((((........(((......)))............))))).).).))..................))))) -19.16 {-11.80 +  -7.36}
+(.((((...........(((((((((........(((......)))............))))).).).))..................))))) { 13.20 MEA=92.14}
+
+Alifold.out
+       6    89  9  99.2%   0.023 CG:29   GC:14   UA:9   
+       4    91 11  99.1%   0.028 CG:20   GC:11   UG:2    UA:17  
+       3    92 18  96.9%   0.090 CG:5    GC:2    GU:1    UG:4    AU:6    UA:25  
+       35    46  3  93.3%   0.195 CG:31   GC:16   UG:2    AU:5    UA:4   
+       36    45 10  93.6%   0.185 CG:16   GC:6    GU:1    UG:2    AU:8    UA:18  
+               .
+               .
+               .
+       </pre>
+       </p>
+       <p>
+               <strong>Running RNAalifold from Jalview</strong><br />
+               To run RNAalifold go to <strong>Webservices&rarr;RNA Structure Prediction</strong>
+               and choose <strong>RNAalifold Defaults</strong> to run with no arguments or 
+               <strong>edit settings and run ...</strong> to adjust the parameters before running.
+               Details of all the RNAalifold parameters can be found in the 
+               <a href=http://www.tbi.univie.ac.at/RNA/man/RNAalifold.html>RNAalifold Manpage</a>.
+               JABAWS and Jalview support a selection of the RNAalifold arguments only.
+       </p>
+       <p><strong>Supported Arguments which give alternate structures</strong></p>
+       <p>
+       <em>Partition Function (-p)</em><br />
+       Calculate the Partition Function and base pairing probability matrix in addition to the mfe 
+       structure. A coarse representation of the pair probabilities in the from of a psuedo
+       bracket notation, as well as the centroid structure derived from the pair probabilities
+       are displayed. The most likely base pairings are stored in a separate file by RNAalifold
+       and represented in Jalview by a bar graph annotation line labelled 'Contact Probabilities'.
+       </p>
+       <p>
+       <em>Maximum Expected Accuracy Structure (--MEA)</em><br />
+       Calculate an MEA structure where the expected Accuracy is computed from the base pair 
+       probabilities. A more detailed description is found in the <a href=http://www.tbi.univie.ac.at/RNA/man/RNAfold.html>
+       RNAfold documentation</a>.
+       </p>
+       <p><strong>Example RNAalifold Structure Annotation rows</strong><p>
+       
+               <div align="center">
+               <img src="RNAalifoldAnnotationRows.png" width="500" height="216"></div>
+       
+</body>
+</html>
\ No newline at end of file
diff --git a/help/html/webServices/RNAalifoldAnnotationRows.png b/help/html/webServices/RNAalifoldAnnotationRows.png
new file mode 100644 (file)
index 0000000..5077d19
Binary files /dev/null and b/help/html/webServices/RNAalifoldAnnotationRows.png differ
index 755365a..39019b4 100644 (file)
Binary files a/lib/Jmol-12.2.4.jar and b/lib/Jmol-12.2.4.jar differ
diff --git a/lib/min-jaba-client-2.0.jar b/lib/min-jaba-client-2.0.jar
deleted file mode 100644 (file)
index 4ba3f33..0000000
Binary files a/lib/min-jaba-client-2.0.jar and /dev/null differ
diff --git a/lib/min-jabaws-client-2.1.0.jar b/lib/min-jabaws-client-2.1.0.jar
new file mode 100644 (file)
index 0000000..7ad030a
Binary files /dev/null and b/lib/min-jabaws-client-2.1.0.jar differ
diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties
new file mode 100644 (file)
index 0000000..53a05dd
--- /dev/null
@@ -0,0 +1,389 @@
+action.cancel = Cancel\r
+action.create = Create\r
+action.update = Update\r
+action.delete = Delete\r
+action.snapshot = Snapshot\r
+action.clear = Clear\r
+action.accept = Accept\r
+action.select_ddbb = --- Select Database ---\r
+action.undo = Undo\r
+action.redo = Redo\r
+action.reset = Reset\r
+action.remove_left = Remove left\r
+action.remove_right = Remove right\r
+action.remove_empty_columns = Remove Empty Columns\r
+action.remove_all_gaps = Remove All Gaps\r
+action.boxes = Boxes\r
+action.text = Text\r
+action.by_pairwise_id = by Pairwise Identity\r
+action.by_id = by Id\r
+action.by_length = by Length\r
+action.by_group = by Group\r
+action.remove_redundancy = Remove Redundancy...\r
+action.pairwise_alignment = Pairwise Alignments...\r
+action.by_rna_helixes = by RNA Helices\r
+action.user_defined = User Defined...\r
+action.by_conservation = By Conservation\r
+action.wrap = Wrap\r
+action.show_gaps = Show Gaps\r
+action.find = Find...\r
+action.undefine_groups = Undefine Groups\r
+action.make_groups_selection = Make Groups For Selection\r
+action.copy = Copy\r
+action.cut = Cut\r
+action.paste = Paste\r
+action.font = Font...\r
+action.scale_above = Scale Above\r
+action.scale_left = Scale Left\r
+action.scale_right = Scale Right\r
+action.by_tree_order = By Tree Order\r
+action.sort = Sort\r
+action.calculate_tree = Calculate Tree\r
+action.help = Help\r
+action.by_annotation = by Annotation...\r
+action.invert_sequence_selection = Invert Sequence Selection\r
+action.invert_column_selection = Invert Column Selection\r
+action.show = Show\r
+action.hide = Hide\r
+action.ok = OK\r
+action.set_defaults = Defaults\r
+action.create_group = Create Group\r
+action.remove_group = Remove Group\r
+action.edit_group = Edit Group\r
+action.edit_new_group = Edit New Group\r
+action.hide_sequences = Hide Sequences\r
+action.reveal_all = Reveal All\r
+action.reveal_sequences = Reveal Sequences\r
+action.find_all = Find all\r
+action.find_next = Find next\r
+action.file = File\r
+action.view = View\r
+action.change_params = Change Parameters\r
+action.apply = Apply\r
+action.apply_threshold_all_groups = Apply threshold to all groups\r
+action.apply_all_groups = Apply to all Groups\r
+action.by_chain = By chain\r
+action.by_sequence = By Sequence\r
+action.paste_annotations = Paste Annotations\r
+action.format = Format\r
+action.select = Select\r
+action.new_view = New View\r
+action.close = Close\r
+action.add = Add\r
+action.save_as_default = Save as default\r
+action.cancel_fetch = Cancel Fetch\r
+action.save_omit_hidden_columns = Save / Omit Hidden Columns\r
+action.change_font = Change Font\r
+action.colour = Colour\r
+action.calculate = Calculate\r
+action.select_all = Select all\r
+action.deselect_all = Deselect all\r
+action.invert_selection = Invert selection\r
+action.using_jmol = Using Jmol\r
+action.link = Link\r
+action.show_chain = Show Chain\r
+label.str = Str:\r
+label.seq = Seq:\r
+label.structures_manager = Structures Manager\r
+label.nickname = Nickname:\r
+label.url = URL:\r
+label.input_file_url = Enter URL or Input File\r
+label.select_feature = Select feature:\r
+label.name = Name:\r
+label.name_param = Name: {0}\r
+label.group = Group:\r
+label.colour = Colour:\r
+label.description = Description:\r
+label.start = Start:\r
+label.end = End:\r
+label.current_parameter_set_name = Current parameter set name:\r
+label.service_action = Service Action:\r
+label.post_url = POST URL:\r
+label.url_suffix = URL Suffix\r
+label.sequence_source = Sequence Source\r
+label.per_seq = per Sequence\r
+label.result_vertically_separable = Results are vertically separable\r
+label.amend = Amend\r
+label.undo_command = Undo {0}\r
+label.redo_command = Redo {0}\r
+label.principal_component_analysis = Principal Component Analysis\r
+label.average_distance_identity = Average Distance Using % Identity\r
+label.neighbour_joining_identity = Neighbour Joining Using % Identity\r
+label.status_bar = Status bar\r
+label.out_to_textbox = Output to Textbox\r
+label.clustalx = Clustalx\r
+label.zappo = Zappo\r
+label.taylor = Taylor\r
+label.hydrophobicity = Hydrophobicity\r
+label.helix_propensity = Helix Propensity\r
+label.strand_propensity = Strand Propensity\r
+label.turn_propensity = Turn Propensity\r
+label.buried_index = Buried Index\r
+label.purine_pyrimidine = Purine/Pyrimidine\r
+label.percentage_identity = Percentage Identity\r
+label.blosum62_score = BLOSUM62 Score\r
+label.tcoffee_scores = T-Coffee Scores\r
+label.average_distance_bloslum62 = Average Distance Using BLOSUM62\r
+label.neighbour_blosum62 = Neighbour Joining Using BLOSUM62\r
+label.show_annotations = Show annotations\r
+label.colour_text = Colour Text\r
+label.show_non_conversed = Show nonconserved\r
+label.overview_window = Overview Window\r
+label.none = None\r
+label.above_identity_threshold = Above Identity Threshold\r
+label.nucleotide = Nucleotide\r
+label.to_new_alignment = To New Alignment\r
+label.to_this_alignment = Add To This Alignment\r
+label.apply_colour_to_all_groups = Apply Colour To All Groups\r
+label.modify_identity_thereshold = Modify Identity Threshold...\r
+label.modify_conservation_thereshold = Modify Conservation Threshold...\r
+label.input_from_textbox = Input from textbox\r
+label.centre_column_labels = Centre column labels\r
+label.automatic_scrolling = Automatic Scrolling\r
+label.documentation = Documentation\r
+label.about = About...\r
+label.show_sequence_limits = Show Sequence Limits\r
+label.feature_settings = Feature Settings...\r
+label.sequence_features = Sequence Features\r
+label.all_columns = All Columns\r
+label.all_sequences = All Sequences\r
+label.selected_columns = Selected Columns \r
+label.selected_sequences = Selected Sequences\r
+label.all_but_selected_region = All but Selected Region (Shift+Ctrl+H)\r
+label.selected_region = Selected Region\r
+label.all_sequences_columns = All Sequences and Columns\r
+label.group_consensus = Group Consensus\r
+label.group_conservation = Group Conservation\r
+label.show_consensus_histogram = Show Consensus Histogram\r
+label.show_consensus_logo = Show Consensus Logo\r
+label.norm_consensus_logo = Normalise Consensus Logo\r
+label.apply_all_groups = Apply to all groups\r
+label.autocalculated_annotation = Autocalculated Annotation\r
+label.min_colour = Min Colour\r
+label.max_colour = Max Colour\r
+label.use_original_colours = Use Original Colours\r
+label.threshold_minmax = Threshold is min/max\r
+label.represent_group_with = Represent Group with\r
+label.selection = Selection\r
+label.group_colour = Group Colour\r
+label.sequence = Sequence\r
+label.view_pdb_structure = View PDB Structure\r
+label.min = Min:\r
+label.max = Max:\r
+label.colour_by_label = Colour by label\r
+label.new_feature = New Feature\r
+label.match_case = Match Case\r
+label.view_alignment_editor = View in alignment editor\r
+label.labels = Labels\r
+label.output_values = Output Values...\r
+label.input_data = Input Data...\r
+label.nucleotide_matrix = Nucleotide matrix\r
+label.protein_matrix = Protein matrix\r
+label.show_bootstrap_values = Show Bootstrap Values\r
+label.show_distances = Show distances\r
+label.mark_unassociated_leaves = Mark Unassociated Leaves\r
+label.fit_to_window = Fit To Window\r
+label.newick_format = Newick Format\r
+label.colours = Colours\r
+label.view_mapping = View Mapping\r
+label.wireframe = Wireframe\r
+label.depthcue = Depthcue\r
+label.z_buffering = Z Buffering\r
+label.charge_cysteine = Charge & Cysteine\r
+label.all_chains_visible = All Chains Visible\r
+label.successfully_added_features_alignment = Successfully added features to alignment\r
+label.keyboard_editing_mode = Keyboard editing mode is {0}\r
+label.paste_features_annotations_Tcoffee_here = Paste your features / annotations / T-coffee score file here.\r
+label.removed_columns = Removed {0} columns.\r
+label.removed_empty_columns = Removed {0} empty columns.\r
+label.paste_newick_tree_file = Paste your Newick tree file here.\r
+label.order_by_params = Order by {0}\r
+label.html_content = <html>{0}</html>\r
+label.paste_pdb_file= Paste your PDB file here.\r
+label.paste_pdb_file_for_sequence = Paste PDB file for sequence {0}\r
+label.could_not_parse_newick_file  = Could not parse Newick file\!\n {0}\r
+label.successfully_pasted_tcoffee_scores_to_alignment= Successfully pasted T-Coffee scores to alignment.\r
+label.failed_add_tcoffee_scores = Failed to add T-Coffee scores: \r
+label.successfully_pasted_annotation_to_alignment= Successfully pasted annotation to alignment.\r
+label.successfully_pasted_alignment_file = Successfully pasted alignment file\r
+label.paste_your_alignment_file = Paste your alignment file here\r
+label.paste_your = Paste your\r
+label.finished_searching = Finished searching\r
+label.search_results= Search results {0} : {1}\r
+label.found_match_for = Found match for {0}\r
+label.font = Font:\r
+label.size = Size:\r
+label.style = Style:\r
+label.enter_redundancy_threshold = Enter the redundancy threshold\r
+label.calculating = Calculating....\r
+label.modify_conservation_visibility = Modify conservation visibility\r
+label.colour_residues_above_occurence = Colour residues above % occurence\r
+label.set_this_label_text = set this label text\r
+label.sequences_from = Sequences from {0}\r
+label.successfully_loaded_file  = Successfully loaded file {0}\r
+label.successfully_saved_to_file_in_format = Successfully saved to file: {0} in {1} format.\r
+label.copied_sequences_to_clipboard = Copied {0} sequences to clipboard.\r
+label.check_file_matches_sequence_ids_alignment = Check that the file matches sequence IDs in the alignment.\r
+label.problem_reading_tcoffee_score_file = Problem reading T-COFFEE score file\r
+label.source_to_target = {0} to '{1}'\r
+label.per_sequence_only= Per-sequence only\r
+label.to_file = to File\r
+label.to_textbox = to Textbox\r
+label.jalview = Jalview\r
+label.csv_spreadsheet = CSV (Spreadsheet)\r
+label.status =  [Status]\r
+label.channels = Channels\r
+label.channel_title_item_count = {0} ({1})\r
+label.blog_item_published_on_date = {0} {1} \r
+label.select_das_service_from_table = Select a DAS service from the table to read a full description here.</font></html>\r
+label.session_update = Session Update\r
+label.new_vamsas_session = New Vamsas Session\r
+label.groovy_console = Groovy Console...\r
+label.lineart = Lineart\r
+label.dont_ask_me_again = Don't ask me again\r
+label.select_eps_character_rendering_style = Select EPS character rendering style\r
+label.invert_selection = Invert Selection\r
+label.optimise_order = Optimise Order\r
+label.seq_sort_by_score = Seq sort by Score\r
+label.load_colours = Load Colours\r
+label.save_colours = Save Colours\r
+label.fetch_das_features = Fetch DAS Features\r
+label.selected_database_to_fetch_from = Selected {0} database {1} to fetch from {2} \r
+label.database_param = Database: {0}\r
+label.example_param = Example: {0}\r
+label.select_file_format_before_saving = You must select a file format before saving!\r
+label.file_format_not_specified = File format not specified\r
+label.alignment_contains_hidden_columns = The Alignment contains hidden columns.\nDo you want to save only the visible alignment?\r
+label.couldnt_save_file = Couldn't save file: {0}\r
+label.error_saving_file = Error Saving File\r
+label.remove_from_default_list = Remove from default list?\r
+label.remove_user_defined_colour = Remove user defined colour\r
+label.you_must_select_least_two_sequences = You must select at least 2 sequences.\r
+label.invalid_selection = Invalid Selection\r
+label.principal_component_analysis_must_take_least_four_input_sequences = Principal component analysis must take\nat least 4 input sequences.\r
+label.sequence_selection_insufficient = Sequence selection insufficient\r
+label.you_need_more_two_sequences_selected_build_tree = You need to have more than two sequences selected to build a tree!\r
+label.not_enough_sequences = Not enough sequences\r
+label.selected_region_to_tree_may_only_contain_residues_or_gaps =  The selected region to create a tree may\nonly contain residues or gaps.\nTry using the Pad function in the edit menu,\nor one of the multiple sequence alignment web services.\r
+label.sequences_selection_not_aligned = Sequences in selection are not aligned\r
+label.sequences_must_be_aligned_before_creating_tree = The sequences must be aligned before creating a tree.\nTry using the Pad function in the edit menu,\n or one of the multiple sequence alignment web services.\r
+label.sequences_not_aligned = Sequences not aligned\r
+label.problem_reading_tree_file =  Problem reading tree file\r
+label.possible_problem_with_tree_file = Possible problem with tree file\r
+label.select_at_least_three_bases_in_at_least_one_sequence_to_cDNA_translation = Please select at least three bases in at least one sequence in order to perform a cDNA translation.\r
+label.translation_failed = Translation Failed\r
+label.error_when_translating_sequences_submit_bug_report = Unfortunately, something went wrong when translating your sequences.\nPlease take a look in the Jalview java console\nand submit a bug report including the stacktrace.\r
+label.implementation_error  = Implementation error:\r
+label.automatically_associate_pdb_files_with_sequences_same_name = Do you want to automatically associate the {0} PDB files with sequences in the alignment that have the same name?\r
+label.automatically_associate_pdb_files_by_name = Automatically Associate PDB files by name\r
+label.ignore_unmatched_dropped_files_info = <html>Do you want to <em>ignore</em> the {0} files whose names did not match any sequence IDs ?</html>\r
+label.ignore_unmatched_dropped_files = Ignore unmatched dropped files?\r
+label.enter_view_name = Enter View Name\r
+label.enter_label = Enter label\r
+label.enter_label_for_the_structure = Enter a label for the structure?\r
+label.pdb_entry_is_already_displayed = {0} is already displayed.\nDo you want to re-use this viewer ?\r
+label.map_sequences_to_visible_window = Map Sequences to Visible Window: {0}\r
+label.add_pdbentry_to_view = Do you want to add {0} to the view called\n'{1}'\n\r
+label.align_to_existing_structure_view = Align to existing structure view\r
+label.pdb_entries_couldnt_be_retrieved = The following pdb entries could not be retrieved from the PDB\:\n{0}\nPlease try downloading them manually.\r
+label.couldnt_load_file = Couldn't load file\r
+label.couldnt_find_pdb_id_in_file = Couldn't find a PDB id in the file supplied. Please enter an Id to identify this structure.\r
+label.no_pdb_id_in_file = No PDB Id in File\r
+label.couldnt_read_pasted_text = Couldn't read the pasted text {0}\r
+label.error_parsing_text = Error parsing text\r
+label.enter_local_das_source = Enter Nickname & URL of Local DAS Source\r
+label.you_can_only_edit_or_remove_local_das_sources = You can only edit or remove local DAS Sources!\r
+label.public_das_source = Public DAS source - not editable\r
+label.input_alignment_from_url = Input Alignment From URL\r
+label.couldnt_import_as_vamsas_session = Couldn't import '{0}' as a new vamsas session.\r
+label.vamsas_document_import_failed = Vamsas Document Import Failed\r
+label.couldnt_locate = Couldn't locate {0}\r
+label.url_not_found = URL not found\r
+label.no_link_selected = No link selected\r
+label.new_sequence_url_link = New sequence URL link\r
+label.cannot_edit_annotations_in_wrapped_view = Cannot edit annotations in wrapped view\r
+label.wrapped_view_no_edit = Wrapped view - no edit\r
+label.error_retrieving_data = Error Retrieving Data\r
+label.user_colour_scheme_must_have_name = User colour scheme must have a name\r
+label.no_name_colour_scheme = No name for colour scheme\r
+label.invalid_url = Invalid URL !\r
+label.error_loading_file = Error loading file\r
+label.problems_opening_file = Encountered problems opening {0}!!\r
+label.file_open_error = File open error\r
+label.no_das_sources_selected_warn = No das sources were selected.\nPlease select some sources and\ntry again.\r
+label.no_das_sources_selected_title = No DAS Sources Selected\r
+label.colour_scheme_exists_overwrite = Colour scheme {0} exists.\nContinue saving colour scheme as {1}?"\r
+label.duplicate_scheme_name = Duplicate scheme name\r
+label.jalview_new_questionnaire = There is a new Questionnaire available. Would you like to complete it now ?\n\r
+label.jalview_user_survey = Jalview User Survey\r
+label.alignment_properties = Alignment Properties: {0}\r
+label.alignment_props = Alignment Properties\r
+label.input_cut_paste = Cut & Paste Input\r
+label.alignment_output_command = Alignment output - {0}\r
+label.annotations = Annotations\r
+label.features = Features\r
+label.overview_params = Overview {0}\r
+label.paste_newick_file = Paste Newick file\r
+label.load_tree_from_file = From File - \r
+label.colour_by_annotation = Colour by Annotation\r
+label.selection_output_command = Selection output - {0}\r
+label.annotation_for_displayid = <p><h2>Annotation for {0} </h2></p><p>\r
+label.pdb_sequence_mapping = PDB - Sequence Mapping\r
+label.pca_details = PCA details\r
+label.redundancy_threshold_selection = Redundancy threshold selection\r
+label.user_defined_colours = User defined colours\r
+label.jalviewLite_release = JalviewLite - Release {0}\r
+label.jaview_build_date = Build date: {0}\r
+label.jalview_authors_1 = Authors:  Jim Procter, Andrew Waterhouse, Jan Engelhardt, Lauren Lui,\r
+label.jalview_authors_2 = Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton.\r
+label.jalview_dev_managers = Development managed by The Barton Group, University of Dundee, Scotland, UK.\r
+label.jalview_distribution_lists = For help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list\r
+label.jalview_please_cite = If  you use Jalview, please cite:\r
+label.jalview_cite_1_authors = Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)\r
+label.jalview_cite_1_title = Jalview Version 2 - a multiple sequence alignment editor and analysis workbench\r
+label.jalview_cite_1_ref = Bioinformatics doi: 10.1093/bioinformatics/btp033\r
+label.right_click = Right click\r
+label.to_add_annotation = to add annotation\r
+label.alignment_has_no_annotations = Alignment has no annotations\r
+label.retrieving_pdb_data = Retrieving PDB data...\r
+label.label = Label\r
+label.no_features_added_to_this_alignment = No Features added to this alignment!!\r
+label.features_can_be_added_from_searches_1 = (Features can be added from searches or\r
+label.features_can_be_added_from_searches_2 = from Jalview / GFF features files)\r
+label.calculating_pca= Calculating PCA\r
+label.reveal_columns = Reveal Columns\r
+label.jalview_cannot_open_file = Jalview can't open file\r
+label.jalview_applet = Jalview applet\r
+label.loading_data = Loading data\r
+label.memory_stats = Total Free Memory: {0} MB; Max Memory: {1} MB; {2} %\r
+label.calculating_tree = Calculating tree\r
+label.state_queueing = queuing\r
+label.state_running = running\r
+label.state_complete = complete\r
+label.state_job_cancelled = job cancelled!!\r
+label.state_job_error = job error!\r
+label.server_error_try_later = Server Error! (try later)\r
+label.error_loading_pdb_data = Error loading PDB data!!\r
+label.fetching_pdb_data = Fetching PDB data...\r
+label.structure_type = Structure_type\r
+label.settings_for_type = Settings for {0}\r
+label.view_full_application = View in Full Application\r
+label.load_associated_tree = Load Associated Tree ...\r
+label.load_features_annotations = Load Features/Annotations ...\r
+label.export_features = Export Features ...\r
+label.export_annotations = Export Annotations ...\r
+label.jalview_copy = Copy (Jalview Only)\r
+label.jalview_cut = Cut (Jalview Only)\r
+label.to_upper_case = To Upper Case\r
+label.to_lower_case = To Lower Case\r
+label.toggle_case = Toggle Case\r
+label.edit_name_description = Edit Name/Description\r
+label.create_sequence_feature = Create Sequence Feature\r
+label.edit_sequence = Edit Sequence\r
+label.sequence_details = Sequence Details\r
+label.jmol_help = Jmol Help\r
+label.all = All\r
+label.sort_by_score = Sort by Score\r
+label.sort_by_density = Sort by Density\r
+label.reveal = Reveal\r
+label.hide_columns = Hide Columns\r
diff --git a/resources/lang/Messages_es.properties b/resources/lang/Messages_es.properties
new file mode 100644 (file)
index 0000000..c1fb406
--- /dev/null
@@ -0,0 +1,7 @@
+action.cancel = Cancelar\r
+action.create = Crear\r
+action.update = Actualizar\r
+action.delete = Borrar\r
+action.snapshot = Captura\r
+action.clear = Limpiar\r
+action.accept = Aceptar\r
index 03c5728..0138f63 100755 (executable)
                                                                                type="xs:string" />
                                                                        <xs:attribute name="threshold"
                                                                                type="xs:float" />
+                       <xs:attribute name="perSequence" 
+                       type="xs:boolean" 
+                       use="optional" />
+                       <xs:attribute name="predefinedColours" 
+                  type="xs:boolean" 
+                  use="optional" />
                                                                </xs:complexType>
                                                        </xs:element>
                                                        <xs:element name="hiddenColumns"
index 714c33f..40e99db 100644 (file)
@@ -29,6 +29,7 @@ import jalview.datamodel.*;
 
 import jalview.appletgui.*;
 import jalview.structure.*;
+import jalview.util.MessageManager;
 
 public class AppletPDBCanvas extends Panel implements MouseListener,
         MouseMotionListener, StructureListener
@@ -468,7 +469,7 @@ public class AppletPDBCanvas extends Panel implements MouseListener,
       g.fillRect(0, 0, getSize().width, getSize().height);
       g.setColor(Color.black);
       g.setFont(new Font("Verdana", Font.BOLD, 14));
-      g.drawString("Error loading PDB data!!", 50, getSize().height / 2);
+      g.drawString(MessageManager.getString("label.error_loading_pdb_data"), 50, getSize().height / 2);
       return;
     }
 
@@ -476,7 +477,7 @@ public class AppletPDBCanvas extends Panel implements MouseListener,
     {
       g.setColor(Color.black);
       g.setFont(new Font("Verdana", Font.BOLD, 14));
-      g.drawString("Fetching PDB data...", 50, getSize().height / 2);
+      g.drawString(MessageManager.getString("label.fetching_pdb_data"), 50, getSize().height / 2);
       return;
     }
 
old mode 100755 (executable)
new mode 100644 (file)
index 2872320..b2e1187
@@ -23,6 +23,7 @@ import java.awt.event.*;
 import jalview.appletgui.*;
 import jalview.datamodel.*;
 import jalview.schemes.*;
+import jalview.util.MessageManager;
 
 public class AppletPDBViewer extends EmbmenuFrame implements
         ActionListener, ItemListener
@@ -60,7 +61,7 @@ public class AppletPDBViewer extends EmbmenuFrame implements
               false, null);
       Frame frame = new Frame();
       frame.add(cap);
-      jalview.bin.JalviewLite.addFrame(frame, "PDB - Sequence Mapping",
+      jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.pdb_sequence_mapping"),
               500, 600);
       cap.setText(pdbcanvas.mappingDetails.toString());
 
@@ -146,42 +147,42 @@ public class AppletPDBViewer extends EmbmenuFrame implements
   private void jbInit() throws Exception
   {
     setMenuBar(jMenuBar1);
-    fileMenu.setLabel("File");
-    coloursMenu.setLabel("Colours");
-    mapping.setLabel("View Mapping");
+    fileMenu.setLabel(MessageManager.getString("action.file"));
+    coloursMenu.setLabel(MessageManager.getString("label.colours"));
+    mapping.setLabel(MessageManager.getString("label.view_mapping"));
     mapping.addActionListener(this);
-    wire.setLabel("Wireframe");
+    wire.setLabel(MessageManager.getString("label.wireframe"));
     wire.addItemListener(this);
     depth.setState(true);
-    depth.setLabel("Depthcue");
+    depth.setLabel(MessageManager.getString("label.depthcue"));
     depth.addItemListener(this);
     zbuffer.setState(true);
-    zbuffer.setLabel("Z Buffering");
+    zbuffer.setLabel(MessageManager.getString("label.z_buffering"));
     zbuffer.addItemListener(this);
-    charge.setLabel("Charge & Cysteine");
+    charge.setLabel(MessageManager.getString("label.charge_cysteine"));
     charge.addActionListener(this);
-    hydro.setLabel("Hydrophobicity");
+    hydro.setLabel(MessageManager.getString("label.hydrophobicity"));
     hydro.addActionListener(this);
-    chain.setLabel("By Chain");
+    chain.setLabel(MessageManager.getString("action.by_chain"));
     chain.addActionListener(this);
-    seqButton.setLabel("By Sequence");
+    seqButton.setLabel(MessageManager.getString("action.by_sequence"));
     seqButton.addActionListener(this);
-    allchains.setLabel("All Chains Visible");
+    allchains.setLabel(MessageManager.getString("label.all_chains_visible"));
     allchains.addItemListener(this);
-    viewMenu.setLabel("View");
-    zappo.setLabel("Zappo");
+    viewMenu.setLabel(MessageManager.getString("action.view"));
+    zappo.setLabel(MessageManager.getString("label.zappo"));
     zappo.addActionListener(this);
-    taylor.setLabel("Taylor");
+    taylor.setLabel(MessageManager.getString("label.taylor"));
     taylor.addActionListener(this);
-    helix.setLabel("Helix Propensity");
+    helix.setLabel(MessageManager.getString("label.helix_propensity"));
     helix.addActionListener(this);
-    strand.setLabel("Strand Propensity");
+    strand.setLabel(MessageManager.getString("label.strand_propensity"));
     strand.addActionListener(this);
-    turn.setLabel("Turn Propensity");
+    turn.setLabel(MessageManager.getString("label.turn_propensity"));
     turn.addActionListener(this);
-    buried.setLabel("Buried Index");
+    buried.setLabel(MessageManager.getString("label.buried_index"));
     buried.addActionListener(this);
-    user.setLabel("User Defined...");
+    user.setLabel(MessageManager.getString("action.user_defined"));
     user.addActionListener(this);
     jMenuBar1.add(fileMenu);
     jMenuBar1.add(coloursMenu);
index 8bfd7b5..b9cdaea 100755 (executable)
@@ -26,6 +26,7 @@ import jalview.datamodel.*;
 import jalview.gui.*;
 import jalview.io.*;
 import jalview.schemes.*;
+import jalview.util.MessageManager;
 import jalview.ws.ebi.EBIFetchClient;
 
 public class PDBViewer extends JInternalFrame implements Runnable
@@ -362,8 +363,8 @@ public class PDBViewer extends JInternalFrame implements Runnable
 
               int option = JOptionPane.showInternalConfirmDialog(
                       jalview.gui.Desktop.desktop,
-                      "Remove from default list?",
-                      "Remove user defined colour",
+                      MessageManager.getString("label.remove_from_default_list"),
+                      MessageManager.getString("label.remove_user_defined_colour"),
                       JOptionPane.YES_NO_OPTION);
               if (option == JOptionPane.YES_OPTION)
               {
index 50b1b4b..08a3f52 100755 (executable)
@@ -19,6 +19,7 @@ package jalview.analysis;
 
 import java.util.*;
 
+import jalview.util.Format;
 import jalview.datamodel.*;
 
 /**
@@ -90,7 +91,7 @@ public class AAFrequency
     Hashtable residueHash;
     int maxCount, nongap, i, j, v, jSize = sequences.length;
     String maxResidue;
-    char c;
+    char c='-';
     float percentage;
 
     int[] values = new int[255];
@@ -104,7 +105,7 @@ public class AAFrequency
       maxResidue = "";
       nongap = 0;
       values = new int[255];
-
+      
       for (j = 0; j < jSize; j++)
       {
         if (sequences[j] == null)
@@ -142,8 +143,11 @@ public class AAFrequency
           values['-']++;
         }
       }
-
-      for (v = 'A'; v < 'Z'; v++)
+      if (jSize==1)
+      {
+        maxResidue = String.valueOf(c);
+        maxCount=1;
+      } else {for (v = 'A'; v < 'Z'; v++)
       {
         if (values[v] < 2 || values[v] < maxCount)
         {
@@ -160,7 +164,7 @@ public class AAFrequency
         }
         maxCount = values[v];
       }
-
+      }
       if (maxResidue.length() == 0)
       {
         maxResidue = "-";
@@ -177,8 +181,10 @@ public class AAFrequency
       percentage = ((float) maxCount * 100) / jSize;
       residueHash.put(PID_GAPS, new Float(percentage));
 
-      percentage = ((float) maxCount * 100) / nongap;
-      residueHash.put(PID_NOGAPS, new Float(percentage));
+      if (nongap>0) {
+        percentage = ((float) maxCount * 100) / nongap;
+        residueHash.put(PID_NOGAPS, new Float(percentage));
+      }
       result[i] = residueHash;
     }
   }
@@ -194,14 +200,15 @@ public class AAFrequency
    * @param width
    * @param ignoreGapsInConsensusCalculation
    * @param includeAllConsSymbols
+   * @param nseq 
    */
   public static void completeConsensus(AlignmentAnnotation consensus,
           Hashtable[] hconsensus, int iStart, int width,
           boolean ignoreGapsInConsensusCalculation,
-          boolean includeAllConsSymbols)
+          boolean includeAllConsSymbols, long nseq)
   {
     completeConsensus(consensus, hconsensus, iStart, width,
-            ignoreGapsInConsensusCalculation, includeAllConsSymbols, null); // new
+            ignoreGapsInConsensusCalculation, includeAllConsSymbols, null, nseq); // new
                                                                             // char[]
     // { 'A', 'C', 'G', 'T', 'U' });
   }
@@ -209,7 +216,7 @@ public class AAFrequency
   public static void completeConsensus(AlignmentAnnotation consensus,
           Hashtable[] hconsensus, int iStart, int width,
           boolean ignoreGapsInConsensusCalculation,
-          boolean includeAllConsSymbols, char[] alphabet)
+          boolean includeAllConsSymbols, char[] alphabet, long nseq)
   {
     float tval, value;
     if (consensus == null || consensus.annotations == null
@@ -219,6 +226,23 @@ public class AAFrequency
       // initialised properly
       return;
     }
+    String fmtstr="%3.1f";
+    int precision=0;
+    while (nseq>=10) {
+      precision++;
+      nseq/=10;
+    }
+    final Format fmt;
+    if (precision>1)
+    {
+      //if (precision>2)
+      {
+        fmtstr = "%"+(2+precision)+"."+(precision)+"f";
+      }
+      fmt = new Format(fmtstr);
+    } else {
+      fmt = null;
+    }
     for (int i = iStart; i < width; i++)
     {
       Hashtable hci;
@@ -229,7 +253,6 @@ public class AAFrequency
         consensus.annotations[i] = null;
         continue;
       }
-
       value = 0;
       Float fv;
       if (ignoreGapsInConsensusCalculation)
@@ -265,7 +288,7 @@ public class AAFrequency
             tval = profile[0][alphabet[c]] * 100f
                     / profile[1][ignoreGapsInConsensusCalculation ? 1 : 0];
             mouseOver += ((c == 0) ? "" : "; ") + alphabet[c] + " "
-                    + ((int) tval) + "%";
+                    + ((fmt!=null) ? fmt.form(tval) : ((int) tval)) + "%";
           }
         }
         else
@@ -288,7 +311,7 @@ public class AAFrequency
                       * 100f
                       / profile[1][ignoreGapsInConsensusCalculation ? 1 : 0];
               mouseOver += ((p == 0) ? "" : "; ") + ((char[]) ca[c])[0]
-                      + " " + ((int) tval) + "%";
+                      + " " + ((fmt!=null) ? fmt.form(tval) : ((int) tval)) + "%";
               p++;
 
             }
@@ -298,7 +321,7 @@ public class AAFrequency
       }
       else
       {
-        mouseOver += ((int) value + "%");
+        mouseOver += ((fmt!=null) ? fmt.form(value) : ((int) value)) + "%";
       }
       consensus.annotations[i] = new Annotation(maxRes, mouseOver, ' ',
               value);
index 08bb3fd..948bdc1 100644 (file)
@@ -21,6 +21,7 @@ package jalview.analysis;
 
 import java.util.*;
 
+import jalview.util.Format;
 import jalview.datamodel.*;
 
 /**
@@ -299,7 +300,7 @@ public class StructureFrequency
   public static void completeConsensus(AlignmentAnnotation consensus,
           Hashtable[] hconsensus, int iStart, int width,
           boolean ignoreGapsInConsensusCalculation,
-          boolean includeAllConsSymbols)
+          boolean includeAllConsSymbols, long nseq)
   {
     float tval, value;
     if (consensus == null || consensus.annotations == null
@@ -309,6 +310,18 @@ public class StructureFrequency
       // initialised properly
       return;
     }
+    String fmtstr="%3.1f";
+    int precision=2;
+    while (nseq>100) {
+      precision++;
+      nseq/=10;
+    }
+    if (precision>2)
+    {
+      fmtstr = "%"+(2+precision)+"."+precision+"f";
+    }
+    Format fmt = new Format(fmtstr);
+    
     for (int i = iStart; i < width; i++)
     {
       Hashtable hci;
@@ -385,7 +398,7 @@ public class StructureFrequency
             tval = (vl[c] * 100f / profile[1][ignoreGapsInConsensusCalculation ? 1
                     : 0]);
             mouseOver += ((p == 0) ? "" : "; ") + (char) ((int[]) ca[c])[0]
-                    + (char) ((int[]) ca[c])[1] + " " + ((int) tval) + "%";
+                    + (char) ((int[]) ca[c])[1] + " " + fmt.form(tval) + "%";
             p++;
 
           }
@@ -395,7 +408,7 @@ public class StructureFrequency
       }
       else
       {
-        mouseOver += ((int) value + "%");
+        mouseOver += (fmt.form(value) + "%");
       }
       consensus.annotations[i] = new Annotation(maxRes, mouseOver, ' ',
               value);
diff --git a/src/jalview/api/AlignViewControllerI.java b/src/jalview/api/AlignViewControllerI.java
new file mode 100644 (file)
index 0000000..fc63fd6
--- /dev/null
@@ -0,0 +1,24 @@
+package jalview.api;
+
+/**
+ * prototype abstract controller for a Jalview alignment view
+ * @author jimp
+ * 
+ * All operations should return true if the view has changed as a result of the operation
+ * @param <ViewportI>
+ *
+ */
+public interface AlignViewControllerI<ViewportI>
+{
+
+  public boolean makeGroupsFromSelection();
+
+  public boolean createGroup();
+
+  public boolean unGroup();
+
+  public boolean deleteGroups();
+
+  public void setViewportAndAlignmentPanel(AlignViewportI viewport, AlignmentViewPanel alignPanel);
+
+}
index 15e5f1d..5f759b8 100644 (file)
@@ -159,11 +159,17 @@ public interface AlignViewportI
   void updateGroupAnnotationSettings(boolean applyGlobalSettings,
           boolean preserveNewGroupSettings);
 
+  void setSequenceColour(SequenceI seq, Color col);
+
+  Color getSequenceColour(SequenceI seq);
+
+  void updateSequenceIdColours();
 
   SequenceGroup getSelectionGroup();
 
   SequenceI[] getSequenceSelection();
 
+  void clearSequenceColours();
 
   CigarArray getViewAsCigars(boolean selectedRegionOnly);
 
old mode 100755 (executable)
new mode 100644 (file)
index c71818e..c51653d
@@ -26,6 +26,7 @@ import jalview.analysis.*;
 import jalview.commands.*;
 import jalview.datamodel.*;
 import jalview.schemes.*;
+import jalview.util.MessageManager;
 import jalview.util.UrlLink;
 import jalview.io.AppletFormatAdapter;
 import jalview.io.SequenceAnnotationReport;
@@ -69,6 +70,8 @@ public class APopupMenu extends java.awt.PopupMenu implements
 
   MenuItem unGroupMenuItem = new MenuItem();
 
+  MenuItem createGroupMenuItem = new MenuItem();
+
   MenuItem nucleotideMenuItem = new MenuItem();
 
   Menu colourMenu = new Menu();
@@ -81,17 +84,17 @@ public class APopupMenu extends java.awt.PopupMenu implements
 
   CheckboxMenuItem displayNonconserved = new CheckboxMenuItem();
 
-  Menu editMenu = new Menu("Edit");
+  Menu editMenu = new Menu(MessageManager.getString("action.edit"));
 
-  MenuItem copy = new MenuItem("Copy (Jalview Only)");
+  MenuItem copy = new MenuItem(MessageManager.getString("label.jalview_copy"));
 
-  MenuItem cut = new MenuItem("Cut (Jalview Only)");
+  MenuItem cut = new MenuItem(MessageManager.getString("label.jalview_cut"));
 
-  MenuItem toUpper = new MenuItem("To Upper Case");
+  MenuItem toUpper = new MenuItem(MessageManager.getString("label.to_upper_case"));
 
-  MenuItem toLower = new MenuItem("To Lower Case");
+  MenuItem toLower = new MenuItem(MessageManager.getString("label.to_lower_case"));
 
-  MenuItem toggleCase = new MenuItem("Toggle Case");
+  MenuItem toggleCase = new MenuItem(MessageManager.getString("label.toggle_case"));
 
   Menu outputmenu = new Menu();
 
@@ -103,15 +106,15 @@ public class APopupMenu extends java.awt.PopupMenu implements
 
   MenuItem repGroup = new MenuItem();
 
-  MenuItem sequenceName = new MenuItem("Edit Name/Description");
+  MenuItem sequenceName = new MenuItem(MessageManager.getString("label.edit_name_description"));
 
-  MenuItem sequenceFeature = new MenuItem("Create Sequence Feature");
+  MenuItem sequenceFeature = new MenuItem(MessageManager.getString("label.create_sequence_feature"));
 
-  MenuItem editSequence = new MenuItem("Edit Sequence");
+  MenuItem editSequence = new MenuItem(MessageManager.getString("label.edit_sequence"));
 
-  MenuItem sequenceDetails = new MenuItem("Sequence Details ...");
+  MenuItem sequenceDetails = new MenuItem(MessageManager.getString("label.sequence_details") + "...");
 
-  MenuItem selSeqDetails = new MenuItem("Sequence Details ...");
+  MenuItem selSeqDetails = new MenuItem(MessageManager.getString("label.sequence_details") + "...");
 
   Sequence seq;
 
@@ -159,14 +162,18 @@ public class APopupMenu extends java.awt.PopupMenu implements
 
     if (sg != null && sg.getSize() > 0)
     {
-      editGroupName.setLabel("Name: " + sg.getName());
+      editGroupName.setLabel(MessageManager.formatMessage("label.name_param", new String[]{sg.getName()}));
       showText.setState(sg.getDisplayText());
       showColourText.setState(sg.getColourText());
       showBoxes.setState(sg.getDisplayBoxes());
       displayNonconserved.setState(sg.getShowNonconserved());
       if (!ap.av.getAlignment().getGroups().contains(sg))
       {
+        menu1.setLabel(MessageManager.getString("action.edit_new_group"));
         groupMenu.remove(unGroupMenuItem);
+      } else {
+        menu1.setLabel(MessageManager.getString("action.edit_group"));
+        groupMenu.remove(createGroupMenuItem);
       }
 
     }
@@ -178,7 +185,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
 
     if (links != null && links.size() > 0)
     {
-      Menu linkMenu = new Menu("Link");
+      Menu linkMenu = new Menu(MessageManager.getString("action.link"));
       String link;
       for (int i = 0; i < links.size(); i++)
       {
@@ -300,7 +307,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
     if (seq != null)
     {
       seqMenu.setLabel(seq.getName());
-      repGroup.setLabel("Represent Group with " + seq.getName());
+      repGroup.setLabel(MessageManager.formatMessage("label.represent_group_with", new String[]{seq.getName()}));
     }
     else
     {
@@ -457,6 +464,11 @@ public class APopupMenu extends java.awt.PopupMenu implements
       unGroupMenuItem_actionPerformed();
     }
 
+    else if (source == createGroupMenuItem)
+    {
+      createGroupMenuItem_actionPerformed();
+    }
+
     else if (source == sequenceName)
     {
       editName();
@@ -635,7 +647,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
     Frame frame = new Frame();
     frame.add(cap);
     jalview.bin.JalviewLite.addFrame(frame,
-            "Selection output - " + e.getActionCommand(), 600, 500);
+               MessageManager.formatMessage("label.selection_output_command", new String[]{e.getActionCommand()}),600, 500);
     // JBPNote: getSelectionAsNewSequence behaviour has changed - this method
     // now returns a full copy of sequence data
     // TODO consider using getSequenceSelection instead here
@@ -666,8 +678,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
     StringBuffer contents = new StringBuffer();
     for (SequenceI seq : sequences)
     {
-      contents.append("<p><h2>Annotation for " + seq.getDisplayId(true)
-              + "</h2></p><p>");
+      contents.append(MessageManager.formatMessage("label.annotation_for_displayid",new String[]{seq.getDisplayId(true)}));
       new SequenceAnnotationReport(null)
               .createSequenceAnnotationReport(
                       contents,
@@ -684,7 +695,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
     jalview.bin.JalviewLite.addFrame(frame, "Sequence Details for "
             + (sequences.length == 1 ? sequences[0].getDisplayId(true)
                     : "Selection"), 600, 500);
-    cap.setText("<html>" + contents.toString() + "</html>");
+    cap.setText(MessageManager.formatMessage("label.html_content", new String[]{contents.toString()}));
   }
 
   void editName()
@@ -719,61 +730,64 @@ public class APopupMenu extends java.awt.PopupMenu implements
     else
     {
       CutAndPasteTransfer cap = new CutAndPasteTransfer(true, ap.alignFrame);
-      cap.setText("Paste your PDB file here.");
+      cap.setText(MessageManager.getString("label.paste_pdb_file"));
       cap.setPDBImport(seq);
       Frame frame = new Frame();
       frame.add(cap);
       jalview.bin.JalviewLite.addFrame(frame,
-              "Paste PDB file for sequence " + seq.getName(), 400, 300);
+              MessageManager.formatMessage("label.paste_pdb_file_for_sequence",  new String[]{seq.getName()}), 400, 300);
     }
   }
 
   private void jbInit() throws Exception
   {
-    groupMenu.setLabel("Group");
-    groupMenu.setLabel("Selection");
+    groupMenu.setLabel(MessageManager.getString("label.selection"));
     sequenceFeature.addActionListener(this);
 
     editGroupName.addActionListener(this);
-    unGroupMenuItem.setLabel("Remove Group");
+    unGroupMenuItem.setLabel(MessageManager.getString("action.remove_group"));
     unGroupMenuItem.addActionListener(this);
 
-    nucleotideMenuItem.setLabel("Nucleotide");
+    createGroupMenuItem.setLabel(MessageManager.getString("action.create_group"));
+    createGroupMenuItem.addActionListener(this);
+
+    nucleotideMenuItem.setLabel(MessageManager.getString("label.nucleotide"));
     nucleotideMenuItem.addActionListener(this);
     conservationMenuItem.addItemListener(this);
     abovePIDColour.addItemListener(this);
-    colourMenu.setLabel("Group Colour");
-    showBoxes.setLabel("Boxes");
+    colourMenu.setLabel(MessageManager.getString("label.group_colour"));
+    showBoxes.setLabel(MessageManager.getString("label.boxes"));
     showBoxes.setState(true);
     showBoxes.addItemListener(this);
     sequenceName.addActionListener(this);
     sequenceDetails.addActionListener(this);
     selSeqDetails.addActionListener(this);
-    displayNonconserved.setLabel("Show Nonconserved");
+    displayNonconserved.setLabel(MessageManager.getString("label.show_non_conversed"));
     displayNonconserved.setState(false);
     displayNonconserved.addItemListener(this);
-    showText.setLabel("Text");
+    showText.setLabel(MessageManager.getString("label.text"));
     showText.addItemListener(this);
-    showColourText.setLabel("Colour Text");
+    showColourText.setLabel(MessageManager.getString("label.colour_text"));
     showColourText.addItemListener(this);
-    outputmenu.setLabel("Output to Textbox...");
-    seqMenu.setLabel("Sequence");
-    pdb.setLabel("View PDB Structure");
-    hideSeqs.setLabel("Hide Sequences");
-    repGroup.setLabel("Represent Group with");
-    revealAll.setLabel("Reveal All");
-    revealSeq.setLabel("Reveal Sequences");
-    menu1.setLabel("Group");
+    outputmenu.setLabel(MessageManager.getString("label.out_to_textbox"));
+    seqMenu.setLabel(MessageManager.getString("label.sequence"));
+    pdb.setLabel(MessageManager.getString("label.view_pdb_structure"));
+    hideSeqs.setLabel(MessageManager.getString("action.hide_sequences"));
+    repGroup.setLabel(MessageManager.getString("label.represent_group_with"));
+    revealAll.setLabel(MessageManager.getString("action.reveal_all"));
+    revealSeq.setLabel(MessageManager.getString("action.reveal_sequences"));
+    menu1.setLabel(MessageManager.getString("label.group"));
     add(groupMenu);
     this.add(seqMenu);
     this.add(hideSeqs);
     this.add(revealSeq);
     this.add(revealAll);
     // groupMenu.add(selSeqDetails);
-    groupMenu.add(editGroupName);
     groupMenu.add(editMenu);
     groupMenu.add(outputmenu);
     groupMenu.add(sequenceFeature);
+    groupMenu.add(createGroupMenuItem);
+    groupMenu.add(unGroupMenuItem);
     groupMenu.add(menu1);
 
     colourMenu.add(noColourmenuItem);
@@ -843,7 +857,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
       seqMenu.add(pdb);
     }
     seqMenu.add(repGroup);
-    menu1.add(unGroupMenuItem);
+    menu1.add(editGroupName);
     menu1.add(colourMenu);
     menu1.add(showBoxes);
     menu1.add(showText);
@@ -1027,6 +1041,12 @@ public class APopupMenu extends java.awt.PopupMenu implements
     ap.paintAlignment(true);
   }
 
+  void createGroupMenuItem_actionPerformed()
+  {
+    getGroup(); // implicitly create group
+    refresh();
+  }
+
   public void showColourText_itemStateChanged()
   {
     getGroup().setColourText(showColourText.getState());
index 0f0ba4e..564f28c 100644 (file)
@@ -19,6 +19,7 @@ package jalview.appletgui;
 
 import jalview.analysis.AlignmentSorter;
 import jalview.analysis.Conservation;
+import jalview.api.AlignViewControllerI;
 import jalview.api.SequenceStructureBinding;
 import jalview.bin.JalviewLite;
 import jalview.commands.CommandI;
@@ -57,6 +58,7 @@ import jalview.schemes.TaylorColourScheme;
 import jalview.schemes.TurnColourScheme;
 import jalview.schemes.ZappoColourScheme;
 import jalview.structure.StructureSelectionManager;
+import jalview.util.MessageManager;
 
 import java.awt.BorderLayout;
 import java.awt.Canvas;
@@ -92,6 +94,7 @@ import java.util.Vector;
 public class AlignFrame extends EmbmenuFrame implements ActionListener,
         ItemListener, KeyListener
 {
+  public AlignViewControllerI avc;
   public AlignmentPanel alignPanel;
 
   public AlignViewport viewport;
@@ -120,7 +123,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 
     viewport = new AlignViewport(al, applet);
     alignPanel = new AlignmentPanel(this, viewport);
-
+    avc = new jalview.controller.AlignViewController(viewport, alignPanel);
     viewport.updateConservation(alignPanel);
     viewport.updateConsensus(alignPanel);
 
@@ -295,7 +298,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
         viewport.featureSettings.refreshTable();
       }
       alignPanel.paintAlignment(true);
-      statusBar.setText("Successfully added features to alignment.");
+      statusBar.setText(MessageManager.getString("label.successfully_added_features_alignment"));
     }
     return featuresFile;
   }
@@ -439,8 +442,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 
     case KeyEvent.VK_F2:
       viewport.cursorMode = !viewport.cursorMode;
-      statusBar.setText("Keyboard editing mode is "
-              + (viewport.cursorMode ? "on" : "off"));
+      statusBar.setText(MessageManager.formatMessage("label.keyboard_editing_mode", new String[]{(viewport.cursorMode ? "on" : "off")}));
       if (viewport.cursorMode)
       {
         alignPanel.seqPanel.seqCanvas.cursorX = viewport.startRes;
@@ -542,6 +544,20 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       }
       break;
 
+    case KeyEvent.VK_G:
+      if (evt.isControlDown())
+      {
+        if (evt.isShiftDown())
+        {
+          this.unGroup_actionPerformed();
+        }
+        else
+        {
+          this.createGroup_actionPerformed();
+        }
+      }
+      break;
+      
     case KeyEvent.VK_U:
       if (evt.isControlDown())
       {
@@ -970,8 +986,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       cap.setText(contents.toString());
       Frame frame = new Frame();
       frame.add(cap);
-      jalview.bin.JalviewLite.addFrame(frame, "Alignment Properties: "
-              + getTitle(), 400, 250);
+      jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage("label.alignment_properties", new String[]{getTitle()}),
+                 400, 250);
     }
     else if (source == overviewMenuItem)
     {
@@ -1114,7 +1130,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     CutAndPasteTransfer cap = new CutAndPasteTransfer(true, this);
     Frame frame = new Frame();
     frame.add(cap);
-    jalview.bin.JalviewLite.addFrame(frame, "Cut & Paste Input", 500, 500);
+    jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.input_cut_paste"), 500, 500);
   }
 
   protected void outputText_actionPerformed(ActionEvent e)
@@ -1123,7 +1139,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     Frame frame = new Frame();
     frame.add(cap);
     jalview.bin.JalviewLite.addFrame(frame,
-            "Alignment output - " + e.getActionCommand(), 600, 500);
+               MessageManager.formatMessage("label.alignment_output_command", new String[]{e.getActionCommand()}),600, 500);
     cap.setText(new AppletFormatAdapter().formatSequences(
             e.getActionCommand(), viewport.getAlignment(),
             viewport.showJVSuffix));
@@ -1132,11 +1148,11 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
   public void loadAnnotations()
   {
     CutAndPasteTransfer cap = new CutAndPasteTransfer(true, this);
-    cap.setText("Paste your features / annotations / T-coffee score file here.");
+    cap.setText(MessageManager.getString("label.paste_features_annotations_Tcoffee_here"));
     cap.setAnnotationImport();
     Frame frame = new Frame();
     frame.add(cap);
-    jalview.bin.JalviewLite.addFrame(frame, "Paste Annotations ", 400, 300);
+    jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("action.paste_annotations"), 400, 300);
 
   }
 
@@ -1153,7 +1169,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       CutAndPasteTransfer cap = new CutAndPasteTransfer(false, this);
       Frame frame = new Frame();
       frame.add(cap);
-      jalview.bin.JalviewLite.addFrame(frame, "Annotations", 600, 500);
+      jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.annotations"), 600, 500);
       cap.setText(annotation);
     }
 
@@ -1209,7 +1225,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       }
       Frame frame = new Frame();
       frame.add(cap);
-      jalview.bin.JalviewLite.addFrame(frame, "Features", 600, 500);
+      jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.features"), 600, 500);
       cap.setText(features);
     }
     else
@@ -1347,12 +1363,12 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     {
       undoMenuItem.setEnabled(true);
       CommandI command = (CommandI) viewport.historyList.peek();
-      undoMenuItem.setLabel("Undo " + command.getDescription());
+      undoMenuItem.setLabel(MessageManager.formatMessage("label.undo_command", new String[]{command.getDescription()}));
     }
     else
     {
       undoMenuItem.setEnabled(false);
-      undoMenuItem.setLabel("Undo");
+      undoMenuItem.setLabel(MessageManager.getString("action.undo"));
     }
 
     if (viewport.redoList.size() > 0)
@@ -1360,12 +1376,12 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       redoMenuItem.setEnabled(true);
 
       CommandI command = (CommandI) viewport.redoList.peek();
-      redoMenuItem.setLabel("Redo " + command.getDescription());
+      redoMenuItem.setLabel(MessageManager.formatMessage("label.redo_command", new String[]{command.getDescription()}));
     }
     else
     {
       redoMenuItem.setEnabled(false);
-      redoMenuItem.setLabel("Redo");
+      redoMenuItem.setLabel(MessageManager.getString("action.redo"));
     }
   }
 
@@ -1887,41 +1903,30 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 
   protected void makeGrpsFromSelection_actionPerformed()
   {
-    if (viewport.getSelectionGroup() != null)
-    {
-      SequenceGroup[] gps = jalview.analysis.Grouping.makeGroupsFrom(
-              viewport.getSequenceSelection(),
-              viewport.getAlignmentView(true).getSequenceStrings(
-                      viewport.getGapCharacter()), viewport.getAlignment()
-                      .getGroups());
-      viewport.getAlignment().deleteAllGroups();
-      viewport.sequenceColours = null;
-      viewport.setSelectionGroup(null);
-      // set view properties for each group
-      for (int g = 0; g < gps.length; g++)
-      {
-        // gps[g].setShowunconserved(viewport.getShowUnconserved());
-        gps[g].setshowSequenceLogo(viewport.isShowSequenceLogo());
-        viewport.getAlignment().addGroup(gps[g]);
-        Color col = new Color((int) (Math.random() * 255),
-                (int) (Math.random() * 255), (int) (Math.random() * 255));
-        col = col.brighter();
-        for (SequenceI sq : gps[g].getSequences(null))
-          viewport.setSequenceColour(sq, col);
-      }
+    if (avc.makeGroupsFromSelection()) {
       PaintRefresher.Refresh(this, viewport.getSequenceSetId());
       alignPanel.updateAnnotation();
       alignPanel.paintAlignment(true);
     }
   }
 
+  protected void createGroup_actionPerformed()
+  {
+    avc.createGroup();
+  }
+  protected void unGroup_actionPerformed()
+  {
+    if (avc.unGroup())
+    {
+      alignPanel.alignmentChanged();
+    }
+  }
   protected void deleteGroups_actionPerformed()
   {
-    viewport.getAlignment().deleteAllGroups();
-    viewport.sequenceColours = null;
-    viewport.setSelectionGroup(null);
-
-    alignPanel.paintAlignment(true);
+    if (avc.deleteGroups())
+    {
+      alignPanel.alignmentChanged();
+    }
   }
 
   public void selectAllSequenceMenuItem_actionPerformed()
@@ -2019,8 +2024,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
                 viewport.getSelectionGroup());
       }
 
-      statusBar.setText("Removed " + trimRegion.getSize() + " columns.");
-
+      statusBar.setText(MessageManager.formatMessage("label.removed_columns", new String[]{Integer.valueOf(trimRegion.getSize()).toString()}));
       addHistoryItem(trimRegion);
 
       for (SequenceGroup sg : viewport.getAlignment().getGroups())
@@ -2060,8 +2064,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 
     addHistoryItem(removeGapCols);
 
-    statusBar.setText("Removed " + removeGapCols.getSize()
-            + " empty columns.");
+    statusBar.setText(MessageManager.formatMessage("label.removed_empty_columns", new String[]{Integer.valueOf(removeGapCols.getSize()).toString()}));
 
     // This is to maintain viewport position on first residue
     // of first sequence
@@ -2288,7 +2291,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     OverviewPanel overview = new OverviewPanel(alignPanel);
     frame.add(overview);
     // +50 must allow for applet frame window
-    jalview.bin.JalviewLite.addFrame(frame, "Overview " + this.getTitle(),
+    jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage("label.overview_params", new String[]{this.getTitle()}),
             overview.getPreferredSize().width,
             overview.getPreferredSize().height + 50);
 
@@ -2466,7 +2469,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     {
       Frame frame = new Frame();
       frame.add(new PairwiseAlignPanel(alignPanel));
-      jalview.bin.JalviewLite.addFrame(frame, "Pairwise Alignment", 600,
+      jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("action.pairwise_alignment"), 600,
               500);
     }
   }
@@ -2564,16 +2567,16 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
   void loadTree_actionPerformed()
   {
     CutAndPasteTransfer cap = new CutAndPasteTransfer(true, this);
-    cap.setText("Paste your Newick tree file here.");
+    cap.setText(MessageManager.getString("label.paste_newick_tree_file"));
     cap.setTreeImport();
     Frame frame = new Frame();
     frame.add(cap);
-    jalview.bin.JalviewLite.addFrame(frame, "Paste Newick file ", 400, 300);
+    jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.paste_newick_file"), 400, 300);
   }
 
   public void loadTree(jalview.io.NewickFile tree, String treeFile)
   {
-    TreePanel tp = new TreePanel(alignPanel, treeFile, "From File - ", tree);
+    TreePanel tp = new TreePanel(alignPanel, treeFile, MessageManager.getString("label.load_tree_from_file"), tree);
     jalview.bin.JalviewLite.addFrame(tp, treeFile, 600, 500);
     addTreeMenuItem(tp, treeFile);
   }
@@ -2593,7 +2596,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
             .sortByTree(viewport.getAlignment(), treePanel.getTree());
     // addHistoryItem(new HistoryItem("Sort", viewport.alignment,
     // HistoryItem.SORT));
-    addHistoryItem(new OrderCommand("Order by " + title, oldOrder,
+    addHistoryItem(new OrderCommand(MessageManager.formatMessage("label.order_by_params", new String[]{title}), oldOrder,
             viewport.getAlignment()));
     alignPanel.paintAlignment(true);
   }
@@ -2690,28 +2693,28 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
         // TODO: update this text for each release or centrally store it for
         // lite and application
         g.setFont(new Font("Helvetica", Font.BOLD, 14));
-        g.drawString("JalviewLite - Release " + version, x, y += fh);
+        g.drawString(MessageManager.formatMessage("label.jalviewLite_release", new String[]{version}), x, y += fh);
         g.setFont(new Font("Helvetica", Font.BOLD, 12));
-        g.drawString("Build date: " + builddate, x, y += fh);
+        g.drawString(MessageManager.formatMessage("label.jaview_build_date", new String[]{builddate}), x, y += fh);
         g.setFont(new Font("Helvetica", Font.PLAIN, 12));
         g.drawString(
-                "Authors:  Jim Procter, Andrew Waterhouse, Jan Engelhardt, Lauren Lui,",
+                MessageManager.getString("label.jalview_authors_1"),
                 x, y += fh * 1.5);
-        g.drawString("Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton.", x + 50, y += fh+8);
+        g.drawString(MessageManager.getString("label.jalview_authors_2"), x + 50, y += fh+8);
         g.drawString(
-                "Development managed by The Barton Group, University of Dundee, Scotland, UK.",
+                MessageManager.getString("label.jalview_dev_managers"),
                 x, y += fh);
         g.drawString(
-                "For help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list",
+                MessageManager.getString("label.jalview_distribution_lists"),
                 x, y += fh);
-        g.drawString("If  you use Jalview, please cite:", x, y += fh + 8);
+        g.drawString(MessageManager.getString("label.jalview_please_cite"), x, y += fh + 8);
         g.drawString(
-                "Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)",
+                MessageManager.getString("label.jalview_cite_1_authors"),
                 x, y += fh);
         g.drawString(
-                "Jalview Version 2 - a multiple sequence alignment editor and analysis workbench",
+                MessageManager.getString("label.jalview_cite_1_title"),
                 x, y += fh);
-        g.drawString("Bioinformatics doi: 10.1093/bioinformatics/btp033",
+        g.drawString(MessageManager.getString("label.jalview_cite_1_ref"),
                 x, y += fh);
       }
     }
@@ -2719,7 +2722,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     Frame frame = new Frame();
     frame.add(new AboutPanel(JalviewLite.getVersion(), JalviewLite
             .getBuildDate()));
-    jalview.bin.JalviewLite.addFrame(frame, "Jalview", 580, 220);
+    jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.jalview"), 580, 220);
 
   }
 
@@ -2740,33 +2743,33 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 
   MenuBar alignFrameMenuBar = new MenuBar();
 
-  Menu fileMenu = new Menu("File");
+  Menu fileMenu = new Menu(MessageManager.getString("action.file"));
 
-  MenuItem loadApplication = new MenuItem("View in Full Application");
+  MenuItem loadApplication = new MenuItem(MessageManager.getString("label.view_full_application"));
 
-  MenuItem loadTree = new MenuItem("Load Associated Tree ...");
+  MenuItem loadTree = new MenuItem(MessageManager.getString("label.load_associated_tree"));
 
-  MenuItem loadAnnotations = new MenuItem("Load Features/Annotations ...");
+  MenuItem loadAnnotations = new MenuItem(MessageManager.getString("label.load_features_annotations"));
 
-  MenuItem outputFeatures = new MenuItem("Export Features ...");
+  MenuItem outputFeatures = new MenuItem(MessageManager.getString("label.export_features"));
 
-  MenuItem outputAnnotations = new MenuItem("Export Annotations ...");
+  MenuItem outputAnnotations = new MenuItem(MessageManager.getString("label.export_annotations"));
 
-  MenuItem closeMenuItem = new MenuItem("Close");
+  MenuItem closeMenuItem = new MenuItem(MessageManager.getString("action.close"));
 
-  Menu editMenu = new Menu("Edit");
+  Menu editMenu = new Menu(MessageManager.getString("action.edit"));
 
-  Menu viewMenu = new Menu("View");
+  Menu viewMenu = new Menu(MessageManager.getString("action.view"));
 
-  Menu colourMenu = new Menu("Colour");
+  Menu colourMenu = new Menu(MessageManager.getString("action.colour"));
 
-  Menu calculateMenu = new Menu("Calculate");
+  Menu calculateMenu = new Menu(MessageManager.getString("action.calculate"));
 
-  MenuItem selectAllSequenceMenuItem = new MenuItem("Select all");
+  MenuItem selectAllSequenceMenuItem = new MenuItem(MessageManager.getString("action.select_all"));
 
-  MenuItem deselectAllSequenceMenuItem = new MenuItem("Deselect All");
+  MenuItem deselectAllSequenceMenuItem = new MenuItem(MessageManager.getString("action.deselect_all"));
 
-  MenuItem invertSequenceMenuItem = new MenuItem("Invert Selection");
+  MenuItem invertSequenceMenuItem = new MenuItem(MessageManager.getString("action.invert_selection"));
 
   MenuItem remove2LeftMenuItem = new MenuItem();
 
@@ -2842,7 +2845,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 
   CheckboxMenuItem displayNonconservedMenuItem = new CheckboxMenuItem();
 
-  MenuItem alProperties = new MenuItem("Alignment Properties...");
+  MenuItem alProperties = new MenuItem(MessageManager.getString("label.alignment_props"));
 
   MenuItem overviewMenuItem = new MenuItem();
 
@@ -2868,6 +2871,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 
   MenuItem grpsFromSelection = new MenuItem();
 
+  MenuItem createGroup = new MenuItem();
+
+  MenuItem unGroup = new MenuItem();
+
   MenuItem delete = new MenuItem();
 
   MenuItem copy = new MenuItem();
@@ -2969,191 +2976,193 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     selectAllSequenceMenuItem.addActionListener(this);
     deselectAllSequenceMenuItem.addActionListener(this);
     invertSequenceMenuItem.addActionListener(this);
-    remove2LeftMenuItem.setLabel("Remove Left");
+    remove2LeftMenuItem.setLabel(MessageManager.getString("action.remove_left"));
     remove2LeftMenuItem.addActionListener(this);
-    remove2RightMenuItem.setLabel("Remove Right");
+    remove2RightMenuItem.setLabel(MessageManager.getString("action.remove_right"));
     remove2RightMenuItem.addActionListener(this);
-    removeGappedColumnMenuItem.setLabel("Remove Empty Columns");
+    removeGappedColumnMenuItem.setLabel(MessageManager.getString("action.remove_empty_columns"));
     removeGappedColumnMenuItem.addActionListener(this);
-    removeAllGapsMenuItem.setLabel("Remove All Gaps");
+    removeAllGapsMenuItem.setLabel(MessageManager.getString("action.remove_all_gaps"));
     removeAllGapsMenuItem.addActionListener(this);
-    viewBoxesMenuItem.setLabel("Boxes");
+    viewBoxesMenuItem.setLabel(MessageManager.getString("action.boxes"));
     viewBoxesMenuItem.setState(true);
     viewBoxesMenuItem.addItemListener(this);
-    viewTextMenuItem.setLabel("Text");
+    viewTextMenuItem.setLabel(MessageManager.getString("action.text"));
     viewTextMenuItem.setState(true);
     viewTextMenuItem.addItemListener(this);
-    sortPairwiseMenuItem.setLabel("by Pairwise Identity");
+    sortPairwiseMenuItem.setLabel(MessageManager.getString("action.by_pairwise_id"));
     sortPairwiseMenuItem.addActionListener(this);
-    sortIDMenuItem.setLabel("by ID");
+    sortIDMenuItem.setLabel(MessageManager.getString("action.by_id"));
     sortIDMenuItem.addActionListener(this);
-    sortLengthMenuItem.setLabel("by Length");
+    sortLengthMenuItem.setLabel(MessageManager.getString("action.by_length"));
     sortLengthMenuItem.addActionListener(this);
-    sortGroupMenuItem.setLabel("by Group");
+    sortGroupMenuItem.setLabel(MessageManager.getString("action.by_group"));
     sortGroupMenuItem.addActionListener(this);
-    removeRedundancyMenuItem.setLabel("Remove Redundancy...");
+    removeRedundancyMenuItem.setLabel(MessageManager.getString("action.remove_redundancy"));
     removeRedundancyMenuItem.addActionListener(this);
-    pairwiseAlignmentMenuItem.setLabel("Pairwise Alignments...");
+    pairwiseAlignmentMenuItem.setLabel(MessageManager.getString("action.pairwise_alignment"));
     pairwiseAlignmentMenuItem.addActionListener(this);
-    PCAMenuItem.setLabel("Principal Component Analysis");
+    PCAMenuItem.setLabel(MessageManager.getString("label.principal_component_analysis"));
     PCAMenuItem.addActionListener(this);
     averageDistanceTreeMenuItem
-            .setLabel("Average Distance Using % Identity");
+            .setLabel(MessageManager.getString("label.average_distance_identity"));
     averageDistanceTreeMenuItem.addActionListener(this);
-    neighbourTreeMenuItem.setLabel("Neighbour Joining Using % Identity");
+    neighbourTreeMenuItem.setLabel(MessageManager.getString("label.neighbour_joining_identity"));
     neighbourTreeMenuItem.addActionListener(this);
     statusBar.setBackground(Color.white);
     statusBar.setFont(new java.awt.Font("Verdana", 0, 11));
-    statusBar.setText("Status bar");
-    outputTextboxMenu.setLabel("Output to Textbox");
-    clustalColour.setLabel("Clustalx");
+    statusBar.setText(MessageManager.getString("label.status_bar"));
+    outputTextboxMenu.setLabel(MessageManager.getString("label.out_to_textbox"));
+    clustalColour.setLabel(MessageManager.getString("label.clustalx"));
 
     clustalColour.addActionListener(this);
-    zappoColour.setLabel("Zappo");
+    zappoColour.setLabel(MessageManager.getString("label.zappo"));
     zappoColour.addActionListener(this);
-    taylorColour.setLabel("Taylor");
+    taylorColour.setLabel(MessageManager.getString("label.taylor"));
     taylorColour.addActionListener(this);
-    hydrophobicityColour.setLabel("Hydrophobicity");
+    hydrophobicityColour.setLabel(MessageManager.getString("label.hydrophobicity"));
     hydrophobicityColour.addActionListener(this);
-    helixColour.setLabel("Helix Propensity");
+    helixColour.setLabel(MessageManager.getString("label.helix_propensity"));
     helixColour.addActionListener(this);
-    strandColour.setLabel("Strand Propensity");
+    strandColour.setLabel(MessageManager.getString("label.strand_propensity"));
     strandColour.addActionListener(this);
-    turnColour.setLabel("Turn Propensity");
+    turnColour.setLabel(MessageManager.getString("label.turn_propensity"));
     turnColour.addActionListener(this);
-    buriedColour.setLabel("Buried Index");
+    buriedColour.setLabel(MessageManager.getString("label.buried_index"));
     buriedColour.addActionListener(this);
-    purinePyrimidineColour.setLabel("Purine/Pyrimidine");
+    purinePyrimidineColour.setLabel(MessageManager.getString("label.purine_pyrimidine"));
     purinePyrimidineColour.addActionListener(this);
-    RNAHelixColour.setLabel("by RNA Helices");
+    RNAHelixColour.setLabel(MessageManager.getString("action.by_rna_helixes"));
     RNAHelixColour.addActionListener(this);
-    userDefinedColour.setLabel("User Defined...");
+    userDefinedColour.setLabel(MessageManager.getString("action.user_defined"));
     userDefinedColour.addActionListener(this);
-    PIDColour.setLabel("Percentage Identity");
+    PIDColour.setLabel(MessageManager.getString("label.percentage_identity"));
     PIDColour.addActionListener(this);
-    BLOSUM62Colour.setLabel("BLOSUM62 Score");
+    BLOSUM62Colour.setLabel(MessageManager.getString("label.blosum62_score"));
     BLOSUM62Colour.addActionListener(this);
-    tcoffeeColour.setLabel("T-Coffee Scores");
+    tcoffeeColour.setLabel(MessageManager.getString("label.tcoffee_scores"));
     tcoffeeColour.setEnabled(false); // it will enabled only if a score file is
                                      // provided
     tcoffeeColour.addActionListener(this);
     avDistanceTreeBlosumMenuItem
-            .setLabel("Average Distance Using BLOSUM62");
+            .setLabel(MessageManager.getString("label.average_distance_bloslum62"));
     avDistanceTreeBlosumMenuItem.addActionListener(this);
-    njTreeBlosumMenuItem.setLabel("Neighbour Joining Using BLOSUM62");
+    njTreeBlosumMenuItem.setLabel(MessageManager.getString("label.neighbour_blosum62"));
     njTreeBlosumMenuItem.addActionListener(this);
-    annotationPanelMenuItem.setLabel("Show Annotations");
+    annotationPanelMenuItem.setLabel(MessageManager.getString("label.show_annotations"));
     annotationPanelMenuItem.addItemListener(this);
-    colourTextMenuItem.setLabel("Colour Text");
+    colourTextMenuItem.setLabel(MessageManager.getString("label.colour_text"));
     colourTextMenuItem.addItemListener(this);
-    displayNonconservedMenuItem.setLabel("Show nonconserved");
+    displayNonconservedMenuItem.setLabel(MessageManager.getString("label.show_non_conversed"));
     displayNonconservedMenuItem.addItemListener(this);
     alProperties.addActionListener(this);
-    overviewMenuItem.setLabel("Overview Window");
+    overviewMenuItem.setLabel(MessageManager.getString("label.overview_window"));
     overviewMenuItem.addActionListener(this);
     undoMenuItem.setEnabled(false);
-    undoMenuItem.setLabel("Undo");
+    undoMenuItem.setLabel(MessageManager.getString("action.undo"));
     undoMenuItem.addActionListener(this);
     redoMenuItem.setEnabled(false);
-    redoMenuItem.setLabel("Redo");
+    redoMenuItem.setLabel(MessageManager.getString("action.redo"));
     redoMenuItem.addActionListener(this);
-    conservationMenuItem.setLabel("by Conservation");
+    conservationMenuItem.setLabel(MessageManager.getString("action.by_conservation"));
     conservationMenuItem.addItemListener(this);
-    noColourmenuItem.setLabel("None");
+    noColourmenuItem.setLabel(MessageManager.getString("label.none"));
     noColourmenuItem.addActionListener(this);
-    wrapMenuItem.setLabel("Wrap");
+    wrapMenuItem.setLabel(MessageManager.getString("action.wrap"));
     wrapMenuItem.addItemListener(this);
-    renderGapsMenuItem.setLabel("Show Gaps");
+    renderGapsMenuItem.setLabel(MessageManager.getString("action.show_gaps"));
     renderGapsMenuItem.setState(true);
     renderGapsMenuItem.addItemListener(this);
-    findMenuItem.setLabel("Find...");
+    findMenuItem.setLabel(MessageManager.getString("action.find"));
     findMenuItem.addActionListener(this);
-    abovePIDThreshold.setLabel("Above Identity Threshold");
+    abovePIDThreshold.setLabel(MessageManager.getString("label.above_identity_threshold"));
     abovePIDThreshold.addItemListener(this);
-    nucleotideColour.setLabel("Nucleotide");
+    nucleotideColour.setLabel(MessageManager.getString("label.nucleotide"));
     nucleotideColour.addActionListener(this);
-    deleteGroups.setLabel("Undefine Groups");
+    deleteGroups.setLabel(MessageManager.getString("action.undefine_groups"));
     deleteGroups.addActionListener(this);
-    grpsFromSelection.setLabel("Make Groups for selection");
+    grpsFromSelection.setLabel(MessageManager.getString("action.make_groups_selection"));
     grpsFromSelection.addActionListener(this);
-    copy.setLabel("Copy");
+    createGroup.setLabel(MessageManager.getString("action.create_group"));
+    unGroup.setLabel(MessageManager.getString("action.remove_group"));
+    copy.setLabel(MessageManager.getString("action.copy"));
     copy.addActionListener(this);
-    cut.setLabel("Cut");
+    cut.setLabel(MessageManager.getString("action.cut"));
     cut.addActionListener(this);
-    delete.setLabel("Delete");
+    delete.setLabel(MessageManager.getString("action.delete"));
     delete.addActionListener(this);
-    pasteMenu.setLabel("Paste");
-    pasteNew.setLabel("To New Alignment");
+    pasteMenu.setLabel(MessageManager.getString("action.paste"));
+    pasteNew.setLabel(MessageManager.getString("label.to_new_alignment"));
     pasteNew.addActionListener(this);
-    pasteThis.setLabel("Add To This Alignment");
+    pasteThis.setLabel(MessageManager.getString("label.to_this_alignment"));
     pasteThis.addActionListener(this);
-    applyToAllGroups.setLabel("Apply Colour To All Groups");
+    applyToAllGroups.setLabel(MessageManager.getString("label.apply_colour_to_all_groups"));
     applyToAllGroups.setState(true);
     applyToAllGroups.addItemListener(this);
-    font.setLabel("Font...");
+    font.setLabel(MessageManager.getString("action.font"));
     font.addActionListener(this);
-    scaleAbove.setLabel("Scale Above");
+    scaleAbove.setLabel(MessageManager.getString("action.scale_above"));
     scaleAbove.setState(true);
     scaleAbove.setEnabled(false);
     scaleAbove.addItemListener(this);
     scaleLeft.setEnabled(false);
     scaleLeft.setState(true);
-    scaleLeft.setLabel("Scale Left");
+    scaleLeft.setLabel(MessageManager.getString("action.scale_left"));
     scaleLeft.addItemListener(this);
     scaleRight.setEnabled(false);
     scaleRight.setState(true);
-    scaleRight.setLabel("Scale Right");
+    scaleRight.setLabel(MessageManager.getString("action.scale_right"));
     scaleRight.addItemListener(this);
-    modifyPID.setLabel("Modify Identity Threshold...");
+    modifyPID.setLabel(MessageManager.getString("label.modify_identity_thereshold"));
     modifyPID.addActionListener(this);
-    modifyConservation.setLabel("Modify Conservation Threshold...");
+    modifyConservation.setLabel(MessageManager.getString("label.modify_conservation_thereshold"));
     modifyConservation.addActionListener(this);
-    sortByTreeMenu.setLabel("By Tree Order");
-    sort.setLabel("Sort");
-    calculate.setLabel("Calculate Tree");
+    sortByTreeMenu.setLabel(MessageManager.getString("action.by_tree_order"));
+    sort.setLabel(MessageManager.getString("action.sort"));
+    calculate.setLabel(MessageManager.getString("action.calculate_tree"));
     autoCalculate.addItemListener(this);
     sortByTree.addItemListener(this);
-    inputText.setLabel("Input from textbox");
+    inputText.setLabel(MessageManager.getString("label.input_from_textbox"));
     inputText.addActionListener(this);
-    centreColumnLabelFlag.setLabel("Centre column labels");
+    centreColumnLabelFlag.setLabel(MessageManager.getString("label.centre_column_labels"));
     centreColumnLabelFlag.addItemListener(this);
-    followMouseOverFlag.setLabel("Automatic Scrolling");
+    followMouseOverFlag.setLabel(MessageManager.getString("label.automatic_scrolling"));
     followMouseOverFlag.addItemListener(this);
-    helpMenu.setLabel("Help");
-    documentation.setLabel("Documentation");
+    helpMenu.setLabel(MessageManager.getString("action.help"));
+    documentation.setLabel(MessageManager.getString("label.documentation"));
     documentation.addActionListener(this);
 
-    about.setLabel("About...");
+    about.setLabel(MessageManager.getString("label.about"));
     about.addActionListener(this);
     seqLimits.setState(true);
-    seqLimits.setLabel("Show Sequence Limits");
+    seqLimits.setLabel(MessageManager.getString("label.show_sequence_limits"));
     seqLimits.addItemListener(this);
-    featureSettings.setLabel("Feature Settings...");
+    featureSettings.setLabel(MessageManager.getString("label.feature_settings"));
     featureSettings.addActionListener(this);
-    sequenceFeatures.setLabel("Sequence Features");
+    sequenceFeatures.setLabel(MessageManager.getString("label.sequence_features"));
     sequenceFeatures.addItemListener(this);
     sequenceFeatures.setState(false);
-    annotationColour.setLabel("by Annotation...");
+    annotationColour.setLabel(MessageManager.getString("action.by_annotation"));
     annotationColour.addActionListener(this);
-    invertSequenceMenuItem.setLabel("Invert Sequence Selection");
-    invertColSel.setLabel("Invert Column Selection");
-    menu1.setLabel("Show");
-    showColumns.setLabel("All Columns ");
-    showSeqs.setLabel("All Sequences");
-    menu2.setLabel("Hide");
-    hideColumns.setLabel("Selected Columns");
-    hideSequences.setLabel("Selected Sequences");
-    hideAllButSelection.setLabel("All but Selected Region (Shift+Ctrl+H)");
-    hideAllSelection.setLabel("Selected Region");
-    showAllHidden.setLabel("All Sequences and Columns");
-    showGroupConsensus.setLabel("Group Consensus");
-    showGroupConservation.setLabel("Group Conservation");
-    showConsensusHistogram.setLabel("Show Consensus Histogram");
-    showSequenceLogo.setLabel("Show Consensus Logo");
-    normSequenceLogo.setLabel("Normalise Consensus Logo");
-    applyAutoAnnotationSettings.setLabel("Apply to all groups");
+    invertSequenceMenuItem.setLabel(MessageManager.getString("action.invert_sequence_selection"));
+    invertColSel.setLabel(MessageManager.getString("action.invert_column_selection"));
+    menu1.setLabel(MessageManager.getString("action.show"));
+    showColumns.setLabel(MessageManager.getString("label.all_columns"));
+    showSeqs.setLabel(MessageManager.getString("label.all_sequences"));
+    menu2.setLabel(MessageManager.getString("aciton.hide"));
+    hideColumns.setLabel(MessageManager.getString("label.selected_columns"));
+    hideSequences.setLabel(MessageManager.getString("label.selected_sequences"));
+    hideAllButSelection.setLabel(MessageManager.getString("label.all_but_selected_region"));
+    hideAllSelection.setLabel(MessageManager.getString("label.selected_region"));
+    showAllHidden.setLabel(MessageManager.getString("label.all_sequences_columns"));
+    showGroupConsensus.setLabel(MessageManager.getString("label.group_consensus"));
+    showGroupConservation.setLabel(MessageManager.getString("label.group_conservation"));
+    showConsensusHistogram.setLabel(MessageManager.getString("label.show_consensus_histogram"));
+    showSequenceLogo.setLabel(MessageManager.getString("label.show_consensus_logo"));
+    normSequenceLogo.setLabel(MessageManager.getString("label.norm_consensus_logo"));
+    applyAutoAnnotationSettings.setLabel(MessageManager.getString("label.apply_all_groups"));
     applyAutoAnnotationSettings.setState(true);
-    autoAnnMenu.setLabel("Autocalculated Annotation");
+    autoAnnMenu.setLabel(MessageManager.getString("label.autocalculated_annotation"));
 
     invertColSel.addActionListener(this);
     showColumns.addActionListener(this);
@@ -3170,9 +3179,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     normSequenceLogo.addItemListener(this);
 
     applyAutoAnnotationSettings.addItemListener(this);
-    formatMenu.setLabel("Format");
-    selectMenu.setLabel("Select");
-    newView.setLabel("New View");
+    formatMenu.setLabel(MessageManager.getString("action.format"));
+    selectMenu.setLabel(MessageManager.getString("action.select"));
+    newView.setLabel(MessageManager.getString("action.new_view"));
     newView.addActionListener(this);
     alignFrameMenuBar.add(fileMenu);
     alignFrameMenuBar.add(editMenu);
@@ -3304,6 +3313,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     selectMenu.add(deselectAllSequenceMenuItem);
     selectMenu.add(invertSequenceMenuItem);
     selectMenu.add(invertColSel);
+    selectMenu.add(createGroup);
+    selectMenu.add(unGroup);
     selectMenu.add(grpsFromSelection);
     selectMenu.add(deleteGroups);
 
index cc04b58..9e4f071 100644 (file)
@@ -91,8 +91,6 @@ public class AlignViewport extends AlignmentViewport implements
 
   public jalview.bin.JalviewLite applet;
 
-  Hashtable sequenceColours;
-
   boolean MAC = false;
 
   Stack historyList = new Stack();
@@ -592,35 +590,6 @@ public class AlignViewport extends AlignmentViewport implements
     showHiddenMarkers = show;
   }
 
-  public Color getSequenceColour(SequenceI seq)
-  {
-    if (sequenceColours == null || !sequenceColours.containsKey(seq))
-    {
-      return Color.white;
-    }
-    else
-    {
-      return (Color) sequenceColours.get(seq);
-    }
-  }
-
-  public void setSequenceColour(SequenceI seq, Color col)
-  {
-    if (sequenceColours == null)
-    {
-      sequenceColours = new Hashtable();
-    }
-
-    if (col == null)
-    {
-      sequenceColours.remove(seq);
-    }
-    else
-    {
-      sequenceColours.put(seq, col);
-    }
-  }
-
   boolean centreColumnLabels;
 
   public boolean getCentreColumnLabels()
@@ -628,21 +597,6 @@ public class AlignViewport extends AlignmentViewport implements
     return centreColumnLabels;
   }
 
-  public void updateSequenceIdColours()
-  {
-
-    for (SequenceGroup sg : alignment.getGroups())
-    {
-      if (sg.idColour != null)
-      {
-        for (SequenceI s : sg.getSequences(getHiddenRepSequences()))
-        {
-          this.setSequenceColour(s, sg.idColour);
-        }
-      }
-    }
-  }
-
   public boolean followHighlight = true;
 
   public boolean getFollowHighlight()
old mode 100755 (executable)
new mode 100644 (file)
index d26680d..3c0f704
@@ -24,6 +24,7 @@ import java.awt.event.*;
 
 import jalview.datamodel.*;
 import jalview.schemes.*;
+import jalview.util.MessageManager;
 
 public class AnnotationColourChooser extends Panel implements
         ActionListener, AdjustmentListener, ItemListener, MouseListener
@@ -80,18 +81,19 @@ public class AnnotationColourChooser extends Panel implements
 
     setDefaultMinMax();
 
+    adjusting = true;
     if (oldcs instanceof AnnotationColourGradient)
     {
       AnnotationColourGradient acg = (AnnotationColourGradient) oldcs;
-      currentColours.setState(acg.predefinedColours);
-      if (!acg.predefinedColours)
+      currentColours.setState(acg.isPredefinedColours() || acg.getBaseColour()!=null);
+      if (!acg.isPredefinedColours() && acg.getBaseColour()==null)
       {
         minColour.setBackground(acg.getMinColour());
         maxColour.setBackground(acg.getMaxColour());
       }
+      // seqAssociated.setState(acg.isSeqAssociated());
     }
 
-    adjusting = true;
 
     Vector list = new Vector();
     int index = 1;
@@ -142,7 +144,7 @@ public class AnnotationColourChooser extends Panel implements
 
     frame = new Frame();
     frame.add(this);
-    jalview.bin.JalviewLite.addFrame(frame, "Colour by Annotation", 560,
+    jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.colour_by_annotation"), 560,
             175);
     validate();
   }
@@ -170,21 +172,21 @@ public class AnnotationColourChooser extends Panel implements
   private void jbInit() throws Exception
   {
     minColour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
-    minColour.setLabel("Min Colour");
+    minColour.setLabel(MessageManager.getString("label.min_colour"));
     minColour.addActionListener(this);
 
     maxColour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
-    maxColour.setLabel("Max Colour");
+    maxColour.setLabel(MessageManager.getString("label.max_colour"));
     maxColour.addActionListener(this);
 
     thresholdIsMin.addItemListener(this);
-    ok.setLabel("OK");
+    ok.setLabel(MessageManager.getString("action.ok"));
     ok.addActionListener(this);
 
-    cancel.setLabel("Cancel");
+    cancel.setLabel(MessageManager.getString("action.cancel"));
     cancel.addActionListener(this);
 
-    defColours.setLabel("Defaults");
+    defColours.setLabel(MessageManager.getString("action.set_defaults"));
     defColours.addActionListener(this);
 
     annotations.addItemListener(this);
@@ -197,11 +199,11 @@ public class AnnotationColourChooser extends Panel implements
     thresholdValue.setEnabled(false);
     thresholdValue.setColumns(5);
     currentColours.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
-    currentColours.setLabel("Use Original Colours");
+    currentColours.setLabel(MessageManager.getString("label.use_original_colours"));
     currentColours.addItemListener(this);
 
     thresholdIsMin.setBackground(Color.white);
-    thresholdIsMin.setLabel("Threshold is min/max");
+    thresholdIsMin.setLabel(MessageManager.getString("label.threshold_minmax"));
 
     this.setLayout(borderLayout1);
 
@@ -457,13 +459,14 @@ public class AnnotationColourChooser extends Panel implements
     if (currentAnnotation.graphMin == 0f
             && currentAnnotation.graphMax == 0f)
     {
-      acg.predefinedColours = true;
+      acg.setPredefinedColours(true);
     }
 
     acg.thresholdIsMinMax = thresholdIsMin.getState();
 
     av.setGlobalColourScheme(acg);
 
+    // TODO: per group colour propagation not always desired
     if (av.getAlignment().getGroups() != null)
     {
       for (SequenceGroup sg : ap.av.getAlignment().getGroups())
@@ -490,6 +493,7 @@ public class AnnotationColourChooser extends Panel implements
     }
 
     // update colours in linked windows
+    ap.alignmentChanged();
     ap.paintAlignment(true);
   }
 
index 3d54ae1..a4b7af2 100755 (executable)
@@ -23,6 +23,7 @@ import java.awt.*;
 import java.awt.event.*;
 
 import jalview.datamodel.*;
+import jalview.util.MessageManager;
 import jalview.util.ParseHtmlBodyAndLinks;
 
 public class AnnotationLabels extends Panel implements ActionListener,
@@ -405,7 +406,7 @@ public class AnnotationLabels extends Panel implements ActionListener,
     if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
     {
 
-      PopupMenu popup = new PopupMenu("Annotations");
+      PopupMenu popup = new PopupMenu(MessageManager.getString("label.annotations"));
 
       MenuItem item = new MenuItem(ADDNEW);
       item.addActionListener(this);
@@ -765,8 +766,8 @@ public class AnnotationLabels extends Panel implements ActionListener,
     if (!av.wrapAlignment && ((aa == null) || (aa.length < 1)))
     {
       g.setColor(Color.black);
-      g.drawString("Right click", 2, 8);
-      g.drawString("to add annotation", 2, 18);
+      g.drawString(MessageManager.getString("label.right_click"), 2, 8);
+      g.drawString(MessageManager.getString("label.to_add_annotation"), 2, 18);
     }
   }
 }
index 154652d..7129eee 100755 (executable)
@@ -25,6 +25,7 @@ import java.awt.event.*;
 import jalview.datamodel.*;
 import jalview.renderer.AnnotationRenderer;
 import jalview.renderer.AwtRenderPanelI;
+import jalview.util.MessageManager;
 
 public class AnnotationPanel extends Panel implements AwtRenderPanelI,
         AdjustmentListener, ActionListener, MouseListener,
@@ -317,7 +318,7 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI,
         return;
       }
 
-      PopupMenu pop = new PopupMenu("Structure type");
+      PopupMenu pop = new PopupMenu(MessageManager.getString("label.structure_type"));
       MenuItem item;
       /*
        * Just display the needed structure options
@@ -618,7 +619,7 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI,
       g.setColor(Color.black);
       if (av.validCharWidth)
       {
-        g.drawString("Alignment has no annotations", 20, 15);
+        g.drawString(MessageManager.getString("label.alignment_has_no_annotations"), 20, 15);
       }
 
       return;
index a3dbe22..e109ae8 100644 (file)
@@ -27,51 +27,52 @@ import jalview.structure.*;
 import jalview.io.*;
 
 import jalview.schemes.*;
+import jalview.util.MessageManager;
 
 public class AppletJmol extends EmbmenuFrame implements
 // StructureListener,
         KeyListener, ActionListener, ItemListener, SequenceStructureBinding
 
 {
-  Menu fileMenu = new Menu("File");
+  Menu fileMenu = new Menu(MessageManager.getString("action.file"));
 
-  Menu viewMenu = new Menu("View");
+  Menu viewMenu = new Menu(MessageManager.getString("action.view"));
 
-  Menu coloursMenu = new Menu("Colours");
+  Menu coloursMenu = new Menu(MessageManager.getString("action.colour"));
 
-  Menu chainMenu = new Menu("Show Chain");
+  Menu chainMenu = new Menu(MessageManager.getString("action.show_chain"));
 
-  Menu helpMenu = new Menu("Help");
+  Menu helpMenu = new Menu(MessageManager.getString("action.help"));
 
-  MenuItem mappingMenuItem = new MenuItem("View Mapping");
+  MenuItem mappingMenuItem = new MenuItem(MessageManager.getString("label.view_mapping"));
 
-  CheckboxMenuItem seqColour = new CheckboxMenuItem("By Sequence", true);
+  CheckboxMenuItem seqColour = new CheckboxMenuItem(MessageManager.getString("action.by_sequence"), true);
 
-  CheckboxMenuItem jmolColour = new CheckboxMenuItem("Using Jmol", false);
+  CheckboxMenuItem jmolColour = new CheckboxMenuItem(MessageManager.getString("action.using_jmol"), false);
 
-  MenuItem chain = new MenuItem("By Chain");
+  MenuItem chain = new MenuItem(MessageManager.getString("action.by_chain"));
 
-  MenuItem charge = new MenuItem("Charge & Cysteine");
+  MenuItem charge = new MenuItem(MessageManager.getString("label.charge_cysteine"));
 
-  MenuItem zappo = new MenuItem("Zappo");
+  MenuItem zappo = new MenuItem(MessageManager.getString("label.zappo"));
 
-  MenuItem taylor = new MenuItem("Taylor");
+  MenuItem taylor = new MenuItem(MessageManager.getString("label.taylor"));
 
-  MenuItem hydro = new MenuItem("Hydrophobicity");
+  MenuItem hydro = new MenuItem(MessageManager.getString("label.hydrophobicity"));
 
-  MenuItem helix = new MenuItem("Helix Propensity");
+  MenuItem helix = new MenuItem(MessageManager.getString("label.helix_propensity"));
 
-  MenuItem strand = new MenuItem("Strand Propensity");
+  MenuItem strand = new MenuItem(MessageManager.getString("label.strand_propensity"));
 
-  MenuItem turn = new MenuItem("Turn Propensity");
+  MenuItem turn = new MenuItem(MessageManager.getString("label.turn_propensity"));
 
-  MenuItem buried = new MenuItem("Buried Index");
+  MenuItem buried = new MenuItem(MessageManager.getString("label.buried_index"));
 
-  MenuItem purinepyrimidine = new MenuItem("Purine/Pyrimidine");
+  MenuItem purinepyrimidine = new MenuItem(MessageManager.getString("label.purine_pyrimidine"));
 
-  MenuItem user = new MenuItem("User Defined Colours");
+  MenuItem user = new MenuItem(MessageManager.getString("label.user_defined_colours"));
 
-  MenuItem jmolHelp = new MenuItem("Jmol Help");
+  MenuItem jmolHelp = new MenuItem(MessageManager.getString("label.jmol_help"));
 
   Panel scriptWindow;
 
@@ -328,7 +329,7 @@ public class AppletJmol extends EmbmenuFrame implements
   {
     chainMenu.removeAll();
 
-    MenuItem menuItem = new MenuItem("All");
+    MenuItem menuItem = new MenuItem(MessageManager.getString("label.all"));
     menuItem.addActionListener(this);
 
     chainMenu.add(menuItem);
@@ -396,7 +397,7 @@ public class AppletJmol extends EmbmenuFrame implements
                 .println("Out of memory when trying to create dialog box with sequence-structure mapping.");
         return;
       }
-      jalview.bin.JalviewLite.addFrame(frame, "PDB - Sequence Mapping",
+      jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.pdb_sequence_mapping"),
               550, 600);
     }
     else if (evt.getSource() == charge)
@@ -615,7 +616,7 @@ public class AppletJmol extends EmbmenuFrame implements
         g.fillRect(0, 0, currentSize.width, currentSize.height);
         g.setColor(Color.white);
         g.setFont(new Font("Verdana", Font.BOLD, 14));
-        g.drawString("Retrieving PDB data....", 20, currentSize.height / 2);
+        g.drawString(MessageManager.getString("label.retrieving_pdb_data"), 20, currentSize.height / 2);
       }
       else
       {
old mode 100755 (executable)
new mode 100644 (file)
index c7a49f3..8e758e6
@@ -23,6 +23,7 @@ import java.awt.event.*;
 import jalview.datamodel.*;
 import jalview.io.*;
 import jalview.schemes.TCoffeeColourScheme;
+import jalview.util.MessageManager;
 
 public class CutAndPasteTransfer extends Panel implements ActionListener,
         MouseListener
@@ -68,7 +69,7 @@ public class CutAndPasteTransfer extends Panel implements ActionListener,
   public void setPDBImport(Sequence seq)
   {
     this.seq = seq;
-    accept.setLabel("Accept");
+    accept.setLabel(MessageManager.getString("action.accept"));
     addSequences.setVisible(false);
     pdbImport = true;
   }
@@ -76,14 +77,14 @@ public class CutAndPasteTransfer extends Panel implements ActionListener,
   public void setTreeImport()
   {
     treeImport = true;
-    accept.setLabel("Accept");
+    accept.setLabel(MessageManager.getString("action.accept"));
     addSequences.setVisible(false);
   }
 
   public void setAnnotationImport()
   {
     annotationImport = true;
-    accept.setLabel("Accept");
+    accept.setLabel(MessageManager.getString("action.accept"));
     addSequences.setVisible(false);
   }
 
@@ -153,7 +154,7 @@ public class CutAndPasteTransfer extends Panel implements ActionListener,
       {
         // TODO: JAL-1102 - should have a warning message in dialog, not simply
         // overwrite the broken input data with the exception
-        textarea.setText("Could not parse Newick file!\n" + ex);
+        textarea.setText(MessageManager.formatMessage("label.could_not_parse_newick_file", new String[]{ex.getMessage()}));
         return;
       }
     }
@@ -174,14 +175,12 @@ public class CutAndPasteTransfer extends Panel implements ActionListener,
             alignFrame.changeColour(new TCoffeeColourScheme(
                     alignFrame.viewport.getAlignment()));
             alignFrame.statusBar
-                    .setText("Successfully pasted T-Coffee scores to alignment.");
+                    .setText(MessageManager.getString("label.successfully_pasted_tcoffee_scores_to_alignment"));
           }
           else
           {
             // file valid but didn't get added to alignment for some reason
-            alignFrame.statusBar.setText("Failed to add T-Coffee scores: "
-                    + (tcf.getWarningMessage() != null ? tcf
-                            .getWarningMessage() : ""));
+            alignFrame.statusBar.setText(MessageManager.formatMessage("label.failed_add_tcoffee_scores", new String[]{(tcf.getWarningMessage() != null ? tcf.getWarningMessage() : "")}));
           }
         }
         else
@@ -236,13 +235,13 @@ public class CutAndPasteTransfer extends Panel implements ActionListener,
         {
           AlignFrame af = new AlignFrame(al, alignFrame.viewport.applet,
                   "Cut & Paste input - " + format, false);
-          af.statusBar.setText("Successfully pasted alignment file");
+          af.statusBar.setText(MessageManager.getString("label.successfully_pasted_annotation_to_alignment"));
         }
         else
         {
           alignFrame.addSequences(al.getSequencesArray());
           alignFrame.statusBar
-                  .setText("Successfully pasted alignment file");
+                  .setText(MessageManager.getString("label.successfully_pasted_alignment_file"));
         }
       }
     }
@@ -286,7 +285,7 @@ public class CutAndPasteTransfer extends Panel implements ActionListener,
   private void jbInit() throws Exception
   {
     textarea.setFont(new java.awt.Font("Monospaced", Font.PLAIN, 10));
-    textarea.setText("Paste your alignment file here");
+    textarea.setText(MessageManager.getString("label.paste_your_alignment_file"));
     textarea.addMouseListener(this);
     this.setLayout(borderLayout1);
     accept.addActionListener(this);
@@ -301,7 +300,7 @@ public class CutAndPasteTransfer extends Panel implements ActionListener,
 
   public void mousePressed(MouseEvent evt)
   {
-    if (textarea.getText().startsWith("Paste your"))
+    if (textarea.getText().startsWith(MessageManager.getString("label.paste_your")))
     {
       textarea.setText("");
     }
index 235e82c..c36d680 100644 (file)
@@ -24,6 +24,7 @@ import java.awt.event.*;
 
 import jalview.datamodel.*;
 import jalview.schemes.*;
+import jalview.util.MessageManager;
 
 public class FeatureColourChooser extends Panel implements ActionListener,
         AdjustmentListener, ItemListener, MouseListener
@@ -143,7 +144,7 @@ public class FeatureColourChooser extends Panel implements ActionListener,
 
   private void jbInit() throws Exception
   {
-    Label minLabel = new Label("Min:"), maxLabel = new Label("Max:");
+    Label minLabel = new Label(MessageManager.getString("label.min")), maxLabel = new Label(MessageManager.getString("label.max"));
     minLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
     maxLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
     // minColour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
@@ -182,11 +183,11 @@ public class FeatureColourChooser extends Panel implements ActionListener,
     jPanel3.setBackground(Color.white);
 
     colourFromLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
-    colourFromLabel.setLabel("Colour by Label");
+    colourFromLabel.setLabel(MessageManager.getString("label.colour_by_label"));
     colourFromLabel.setSize(new Dimension(139, 22));
     // threshold.setBounds(new Rectangle(11, 3, 139, 22));
     thresholdIsMin.setBackground(Color.white);
-    thresholdIsMin.setLabel("Threshold is min/max");
+    thresholdIsMin.setLabel(MessageManager.getString("label.threshold_minmax"));
     thresholdIsMin.setSize(new Dimension(135, 23));
     // thresholdIsMin.setBounds(new Rectangle(328, 3, 135, 23));
     jPanel1.add(minLabel);
old mode 100755 (executable)
new mode 100644 (file)
index dd236bd..a14c321
@@ -26,6 +26,7 @@ import java.awt.event.*;
 import jalview.datamodel.*;
 import jalview.schemes.AnnotationColourGradient;
 import jalview.schemes.GraduatedColor;
+import jalview.util.MessageManager;
 
 /**
  * DOCUMENT ME!
@@ -194,7 +195,7 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer
           g.setColor(Color.black);
           Font f = new Font("Verdana", Font.PLAIN, 10);
           g.setFont(f);
-          g.drawString("Label", 0, 0);
+          g.drawString(MessageManager.getString("label.label"), 0, 0);
         }
         else
         {
@@ -364,7 +365,7 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer
     }
     else
     {
-      dialog.ok.setLabel("Amend");
+      dialog.ok.setLabel(MessageManager.getString("label.amend"));
       dialog.buttonPanel.add(deleteButton, 1);
       deleteButton.addActionListener(new ActionListener()
       {
index db7d9b3..267a251 100755 (executable)
@@ -27,6 +27,7 @@ import jalview.commands.OrderCommand;
 import jalview.datamodel.*;
 import jalview.schemes.AnnotationColourGradient;
 import jalview.schemes.GraduatedColor;
+import jalview.util.MessageManager;
 
 public class FeatureSettings extends Panel implements ItemListener,
         MouseListener, MouseMotionListener, ActionListener,
@@ -146,16 +147,16 @@ public class FeatureSettings extends Panel implements ItemListener,
     height = Math.max(200, height);
     height = Math.min(400, height);
     int width = 300;
-    jalview.bin.JalviewLite.addFrame(frame, "Feature Settings", width,
+    jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.feature_settings"), width,
             height);
   }
 
   public void paint(Graphics g)
   {
     g.setColor(Color.black);
-    g.drawString("No Features added to this alignment!!", 10, 20);
-    g.drawString("(Features can be added from searches or", 10, 40);
-    g.drawString("from Jalview / GFF features files)", 10, 60);
+    g.drawString(MessageManager.getString("label.no_features_added_to_this_alignment"), 10, 20);
+    g.drawString(MessageManager.getString("label.features_can_be_added_from_searches_1"), 10, 40);
+    g.drawString(MessageManager.getString("label.features_can_be_added_from_searches_2"), 10, 60);
   }
 
   protected void popupSort(final MyCheckbox check, final Hashtable minmax,
@@ -163,8 +164,8 @@ public class FeatureSettings extends Panel implements ItemListener,
   {
     final String type = check.type;
     final Object typeCol = fr.getFeatureStyle(type);
-    java.awt.PopupMenu men = new PopupMenu("Settings for " + type);
-    java.awt.MenuItem scr = new MenuItem("Sort by Score");
+    java.awt.PopupMenu men = new PopupMenu(MessageManager.formatMessage("label.settings_for_type", new String[]{type}));
+    java.awt.MenuItem scr = new MenuItem(MessageManager.getString("label.sort_by_score"));
     men.add(scr);
     final FeatureSettings me = this;
     scr.addActionListener(new ActionListener()
@@ -177,7 +178,7 @@ public class FeatureSettings extends Panel implements ItemListener,
       }
 
     });
-    MenuItem dens = new MenuItem("Sort by Density");
+    MenuItem dens = new MenuItem(MessageManager.getString("label.sort_by_density"));
     dens.addActionListener(new ActionListener()
     {
 
old mode 100755 (executable)
new mode 100644 (file)
index 7722461..93ab314
@@ -23,6 +23,7 @@ import java.awt.*;
 import java.awt.event.*;
 
 import jalview.datamodel.*;
+import jalview.util.MessageManager;
 
 public class Finder extends Panel implements ActionListener
 {
@@ -53,7 +54,7 @@ public class Finder extends Panel implements ActionListener
     this.ap = ap;
     frame = new Frame();
     frame.add(this);
-    jalview.bin.JalviewLite.addFrame(frame, "Find", 340, 120);
+    jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("action.find"), 340, 120);
     frame.repaint();
     frame.addWindowListener(new WindowAdapter()
     {
@@ -163,7 +164,7 @@ public class Finder extends Panel implements ActionListener
     // 'SelectRegion' selection
     if (!haveResults)
     {
-      ap.alignFrame.statusBar.setText("Finished searching.");
+      ap.alignFrame.statusBar.setText(MessageManager.getString("label.finished_searching"));
       resIndex = -1;
       seqIndex = 0;
     }
@@ -182,14 +183,13 @@ public class Finder extends Panel implements ActionListener
         {
           message += searchResults.getSize() + " subsequence matches.";
         }
-        ap.alignFrame.statusBar.setText("Search results: " + searchString
-                + " : " + message);
+        ap.alignFrame.statusBar.setText(MessageManager.formatMessage("label.search_results", new String[] {searchString, message}));
 
       }
       else
       {
         // TODO: indicate sequence and matching position in status bar
-        ap.alignFrame.statusBar.setText("Found match for " + searchString);
+        ap.alignFrame.statusBar.setText(MessageManager.formatMessage("label.found_match_for", new String[]{searchString}));
       }
     }
   }
@@ -213,7 +213,7 @@ public class Finder extends Panel implements ActionListener
   private void jbInit() throws Exception
   {
     jLabel1.setFont(new java.awt.Font("Verdana", 0, 12));
-    jLabel1.setText("Find");
+    jLabel1.setText(MessageManager.getString("action.find"));
     jLabel1.setBounds(new Rectangle(3, 30, 34, 15));
     this.setLayout(null);
     textfield.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
@@ -228,11 +228,11 @@ public class Finder extends Panel implements ActionListener
     });
     textfield.addActionListener(this);
     findAll.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
-    findAll.setLabel("Find all");
+    findAll.setLabel(MessageManager.getString("action.find_all"));
     findAll.addActionListener(this);
     findNext.setEnabled(false);
     findNext.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
-    findNext.setLabel("Find Next");
+    findNext.setLabel(MessageManager.getString("action.find_next"));
     findNext.addActionListener(this);
     jPanel1.setBounds(new Rectangle(180, 5, 141, 64));
     jPanel1.setLayout(gridLayout1);
@@ -241,9 +241,9 @@ public class Finder extends Panel implements ActionListener
     gridLayout1.setVgap(2);
     createNewGroup.setEnabled(false);
     createNewGroup.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
-    createNewGroup.setLabel("New Feature");
+    createNewGroup.setLabel(MessageManager.getString("label.new_feature"));
     createNewGroup.addActionListener(this);
-    caseSensitive.setLabel("Match Case");
+    caseSensitive.setLabel(MessageManager.getString("label.match_case"));
     caseSensitive.setBounds(new Rectangle(40, 49, 126, 23));
     jPanel1.add(findNext, null);
     jPanel1.add(findAll, null);
old mode 100755 (executable)
new mode 100644 (file)
index 5df659b..7de8789
@@ -17,6 +17,8 @@
  */
 package jalview.appletgui;
 
+import jalview.util.MessageManager;
+
 import java.awt.*;
 import java.awt.event.*;
 
@@ -87,7 +89,7 @@ public class FontChooser extends Panel implements ActionListener,
     Frame frame = new Frame();
     this.frame = frame;
     frame.add(this);
-    jalview.bin.JalviewLite.addFrame(frame, "Change Font", 440, 115);
+    jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("action.change_font"), 440, 115);
 
     init = false;
   }
@@ -272,7 +274,7 @@ public class FontChooser extends Panel implements ActionListener,
   {
     label1.setFont(new java.awt.Font("Verdana", 0, 11));
     label1.setAlignment(Label.RIGHT);
-    label1.setText("Font: ");
+    label1.setText(MessageManager.getString("label.font"));
     this.setLayout(borderLayout4);
     fontSize.setFont(new java.awt.Font("Verdana", 0, 11));
     fontSize.addItemListener(this);
@@ -280,17 +282,17 @@ public class FontChooser extends Panel implements ActionListener,
     fontStyle.addItemListener(this);
     label2.setAlignment(Label.RIGHT);
     label2.setFont(new java.awt.Font("Verdana", 0, 11));
-    label2.setText("Size: ");
+    label2.setText(MessageManager.getString("label.size"));
     label3.setAlignment(Label.RIGHT);
     label3.setFont(new java.awt.Font("Verdana", 0, 11));
-    label3.setText("Style: ");
+    label3.setText(MessageManager.getString("label.style"));
     fontName.setFont(new java.awt.Font("Verdana", 0, 11));
     fontName.addItemListener(this);
     ok.setFont(new java.awt.Font("Verdana", 0, 11));
-    ok.setLabel("OK");
+    ok.setLabel(MessageManager.getString("action.ok"));
     ok.addActionListener(this);
     cancel.setFont(new java.awt.Font("Verdana", 0, 11));
-    cancel.setLabel("Cancel");
+    cancel.setLabel(MessageManager.getString("action.cancel"));
     cancel.addActionListener(this);
     this.setBackground(Color.white);
     panel1.setLayout(borderLayout1);
old mode 100755 (executable)
new mode 100644 (file)
index 9ddb132..bcd3634
@@ -21,6 +21,7 @@ import java.awt.*;
 import java.awt.event.*;
 
 import jalview.datamodel.*;
+import jalview.util.MessageManager;
 import jalview.viewmodel.PCAModel;
 
 public class PCAPanel extends EmbmenuFrame implements Runnable,
@@ -83,7 +84,7 @@ public class PCAPanel extends EmbmenuFrame implements Runnable,
     embedMenuIfNeeded(rc);
     add(rc, BorderLayout.CENTER);
 
-    jalview.bin.JalviewLite.addFrame(this, "Principal component analysis",
+    jalview.bin.JalviewLite.addFrame(this, MessageManager.getString("label.principal_component_analysis"),
             475, 400);
 
     Thread worker = new Thread(this);
@@ -217,7 +218,7 @@ public class PCAPanel extends EmbmenuFrame implements Runnable,
     CutAndPasteTransfer cap = new CutAndPasteTransfer(false, null);
     Frame frame = new Frame();
     frame.add(cap);
-    jalview.bin.JalviewLite.addFrame(frame, "PCA details", 500, 500);
+    jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.pca_details"), 500, 500);
 
     cap.setText(pcaModel.getDetails());
   }
@@ -314,20 +315,20 @@ public class PCAPanel extends EmbmenuFrame implements Runnable,
     xCombobox.setFont(new java.awt.Font("Verdana", 0, 12));
     xCombobox.addItemListener(this);
     resetButton.setFont(new java.awt.Font("Verdana", 0, 12));
-    resetButton.setLabel("Reset");
+    resetButton.setLabel(MessageManager.getString("action.reset"));
     resetButton.addActionListener(this);
     this.setMenuBar(menuBar1);
-    menu1.setLabel("File");
-    menu2.setLabel("View");
-    calcSettings.setLabel("Change Parameters");
-    labels.setLabel("Labels");
+    menu1.setLabel(MessageManager.getString("action.file"));
+    menu2.setLabel(MessageManager.getString("action.view"));
+    calcSettings.setLabel(MessageManager.getString("action.change_params"));
+    labels.setLabel(MessageManager.getString("label.labels"));
     labels.addItemListener(this);
-    values.setLabel("Output Values...");
+    values.setLabel(MessageManager.getString("label.output_values"));
     values.addActionListener(this);
-    inputData.setLabel("Input Data...");
-    nuclSetting.setLabel("Nucleotide matrix");
+    inputData.setLabel(MessageManager.getString("label.input_data"));
+    nuclSetting.setLabel(MessageManager.getString("label.nucleotide_matrix"));
     nuclSetting.addItemListener(this);
-    protSetting.setLabel("Protein matrix");
+    protSetting.setLabel(MessageManager.getString("label.protein_matrix"));
     protSetting.addItemListener(this);
     this.add(jPanel2, BorderLayout.SOUTH);
     jPanel2.add(jLabel1, null);
old mode 100755 (executable)
new mode 100644 (file)
index 8841864..a377892
@@ -24,6 +24,7 @@ import java.awt.event.*;
 
 import jalview.analysis.*;
 import jalview.datamodel.*;
+import jalview.util.MessageManager;
 
 public class PairwiseAlignPanel extends Panel implements ActionListener
 {
@@ -160,7 +161,7 @@ public class PairwiseAlignPanel extends Panel implements ActionListener
     textarea.setFont(new java.awt.Font("Monospaced", 0, 12));
     textarea.setText("");
     viewInEditorButton.setFont(new java.awt.Font("Verdana", 0, 12));
-    viewInEditorButton.setLabel("View in alignment editor");
+    viewInEditorButton.setLabel(MessageManager.getString("label.view_alignment_editor"));
     viewInEditorButton.addActionListener(this);
     this.add(scrollPane, BorderLayout.CENTER);
     scrollPane.add(textarea);
old mode 100755 (executable)
new mode 100644 (file)
index ef00017..d91e53b
@@ -25,6 +25,7 @@ import java.awt.event.*;
 import jalview.analysis.AlignSeq;
 import jalview.commands.*;
 import jalview.datamodel.*;
+import jalview.util.MessageManager;
 
 public class RedundancyPanel extends SliderPanel implements Runnable,
         WindowListener
@@ -49,7 +50,7 @@ public class RedundancyPanel extends SliderPanel implements Runnable,
     applyButton.setVisible(true);
     allGroupsCheck.setVisible(false);
 
-    label.setText("Enter the redundancy threshold");
+    label.setText(MessageManager.getString("label.enter_redundancy_threshold"));
     valueField.setText("100");
 
     slider.setVisibleAmount(1);
@@ -69,7 +70,7 @@ public class RedundancyPanel extends SliderPanel implements Runnable,
     frame = new Frame();
     frame.add(this);
     jalview.bin.JalviewLite.addFrame(frame,
-            "Redundancy threshold selection", 400, 100);
+            MessageManager.getString("label.redundancy_threshold_selection"), 400, 100);
 
     frame.addWindowListener(this);
 
@@ -91,7 +92,7 @@ public class RedundancyPanel extends SliderPanel implements Runnable,
    */
   public void run()
   {
-    label.setText("Calculating....");
+    label.setText(MessageManager.getString("label.calculating"));
 
     slider.setVisible(false);
     applyButton.setEnabled(false);
@@ -123,7 +124,7 @@ public class RedundancyPanel extends SliderPanel implements Runnable,
 
     redundancy = AlignSeq.computeRedundancyMatrix(originalSequences,
             omitHidden, start, end, false);
-    label.setText("Enter the redundancy threshold");
+    label.setText(MessageManager.getString("label.enter_redundancy_threshold"));
     slider.setVisible(true);
     applyButton.setEnabled(true);
     valueField.setVisible(true);
index e8294ba..86d06d9 100755 (executable)
@@ -316,7 +316,7 @@ public class RotatableCanvas extends Panel implements MouseListener,
     if (points == null)
     {
       g.setFont(new Font("Verdana", Font.PLAIN, 18));
-      g.drawString("Calculating PCA....", 20, getSize().height / 2);
+      g.drawString(MessageManager.getString("label.calculating_pca") + "....", 20, getSize().height / 2);
     }
     else
     {
index baa4165..cd78fab 100755 (executable)
@@ -21,6 +21,7 @@ import java.awt.*;
 import java.awt.event.*;
 
 import jalview.datamodel.*;
+import jalview.util.MessageManager;
 
 public class ScalePanel extends Panel implements MouseMotionListener,
         MouseListener
@@ -76,7 +77,7 @@ public class ScalePanel extends Panel implements MouseMotionListener,
       PopupMenu pop = new PopupMenu();
       if (reveal != null)
       {
-        MenuItem item = new MenuItem("Reveal");
+        MenuItem item = new MenuItem(MessageManager.getString("label.reveal"));
         item.addActionListener(new ActionListener()
         {
           public void actionPerformed(ActionEvent e)
@@ -94,7 +95,7 @@ public class ScalePanel extends Panel implements MouseMotionListener,
 
         if (av.getColumnSelection().getHiddenColumns().size() > 1)
         {
-          item = new MenuItem("Reveal All");
+          item = new MenuItem(MessageManager.getString("action.reveal_all"));
           item.addActionListener(new ActionListener()
           {
             public void actionPerformed(ActionEvent e)
@@ -115,7 +116,7 @@ public class ScalePanel extends Panel implements MouseMotionListener,
       }
       else if (av.getColumnSelection().contains(res))
       {
-        MenuItem item = new MenuItem("Hide Columns");
+        MenuItem item = new MenuItem(MessageManager.getString("label.hide_columns"));
         item.addActionListener(new ActionListener()
         {
           public void actionPerformed(ActionEvent e)
@@ -447,7 +448,7 @@ public class ScalePanel extends Panel implements MouseMotionListener,
 
       if (reveal != null && reveal[0] > startx && reveal[0] < endx)
       {
-        gg.drawString("Reveal Columns", reveal[0] * av.charWidth, 0);
+        gg.drawString(MessageManager.getString("label.reveal_columns"), reveal[0] * av.charWidth, 0);
       }
     }
 
old mode 100755 (executable)
new mode 100644 (file)
index d25caa4..886c194
@@ -24,6 +24,7 @@ import java.awt.event.*;
 
 import jalview.datamodel.*;
 import jalview.schemes.*;
+import jalview.util.MessageManager;
 
 public class SliderPanel extends Panel implements ActionListener,
         AdjustmentListener, MouseListener
@@ -167,14 +168,14 @@ public class SliderPanel extends Panel implements ActionListener,
     applyButton.setVisible(false);
     if (forConservation)
     {
-      label.setText("Modify conservation visibility");
+      label.setText(MessageManager.getString("label.modify_conservation_visibility"));
       slider.setMinimum(0);
       slider.setMaximum(50 + slider.getVisibleAmount());
       slider.setUnitIncrement(1);
     }
     else
     {
-      label.setText("Colour residues above % occurence");
+      label.setText(MessageManager.getString("label.colour_residues_above_occurence"));
       slider.setMinimum(0);
       slider.setMaximum(100 + slider.getVisibleAmount());
       slider.setBlockIncrement(1);
@@ -316,20 +317,20 @@ public class SliderPanel extends Panel implements ActionListener,
     valueField.setText("      ");
     valueField.addActionListener(this);
     label.setFont(new java.awt.Font("Verdana", 0, 11));
-    label.setText("set this label text");
+    label.setText(MessageManager.getString("label.set_this_label_text"));
     jPanel1.setLayout(borderLayout1);
     jPanel2.setLayout(flowLayout1);
     applyButton.setFont(new java.awt.Font("Verdana", 0, 11));
-    applyButton.setLabel("Apply");
+    applyButton.setLabel(MessageManager.getString("action.apply"));
     applyButton.addActionListener(this);
     undoButton.setEnabled(false);
     undoButton.setFont(new java.awt.Font("Verdana", 0, 11));
-    undoButton.setLabel("Undo");
+    undoButton.setLabel(MessageManager.getString("action.undo"));
     undoButton.addActionListener(this);
     allGroupsCheck.setEnabled(false);
     allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11));
-    allGroupsCheck.setLabel("Apply threshold to all groups");
-    allGroupsCheck.setName("Apply to all Groups");
+    allGroupsCheck.setLabel(MessageManager.getString("action.apply_threshold_all_groups"));
+    allGroupsCheck.setName(MessageManager.getString("action.apply_all_groups"));
     this.setBackground(Color.white);
     this.setForeground(Color.black);
     jPanel2.add(label, null);
index 5c62234..68ffd7a 100755 (executable)
@@ -578,7 +578,7 @@ public class TreeCanvas extends Panel implements MouseListener,
 
         av.setSelectionGroup(null);
         av.getAlignment().deleteAllGroups();
-        av.sequenceColours = null;
+        av.clearSequenceColours();
 
         colourGroups();
 
index 65f3d91..5f3f6f6 100644 (file)
@@ -23,6 +23,7 @@ import java.awt.event.*;
 import jalview.analysis.*;
 import jalview.datamodel.*;
 import jalview.io.*;
+import jalview.util.MessageManager;
 
 public class TreePanel extends EmbmenuFrame implements ActionListener,
         ItemListener
@@ -351,22 +352,22 @@ public class TreePanel extends EmbmenuFrame implements ActionListener,
     setLayout(borderLayout1);
     this.setBackground(Color.white);
     this.setFont(new java.awt.Font("Verdana", 0, 12));
-    jMenu2.setLabel("View");
-    fontSize.setLabel("Font...");
+    jMenu2.setLabel(MessageManager.getString("action.view"));
+    fontSize.setLabel(MessageManager.getString("action.font"));
     fontSize.addActionListener(this);
-    bootstrapMenu.setLabel("Show Bootstrap Values");
+    bootstrapMenu.setLabel(MessageManager.getString("label.show_bootstrap_values"));
     bootstrapMenu.addItemListener(this);
-    distanceMenu.setLabel("Show Distances");
+    distanceMenu.setLabel(MessageManager.getString("label.show_distances"));
     distanceMenu.addItemListener(this);
-    placeholdersMenu.setLabel("Mark Unassociated Leaves");
+    placeholdersMenu.setLabel(MessageManager.getString("label.mark_unassociated_leaves"));
     placeholdersMenu.addItemListener(this);
     fitToWindow.setState(true);
-    fitToWindow.setLabel("Fit To Window");
+    fitToWindow.setLabel(MessageManager.getString("label.fit_to_window"));
     fitToWindow.addItemListener(this);
-    fileMenu.setLabel("File");
-    newickOutput.setLabel("Newick Format");
+    fileMenu.setLabel(MessageManager.getString("action.file"));
+    newickOutput.setLabel(MessageManager.getString("label.newick_format"));
     newickOutput.addActionListener(this);
-    inputData.setLabel("Input Data...");
+    inputData.setLabel(MessageManager.getString("label.input_data"));
 
     add(scrollPane, BorderLayout.CENTER);
     jMenuBar1.add(fileMenu);
old mode 100755 (executable)
new mode 100644 (file)
index 4735006..55f7c65
@@ -22,6 +22,7 @@ import jalview.schemes.ColourSchemeI;
 import jalview.schemes.GraduatedColor;
 import jalview.schemes.ResidueProperties;
 import jalview.schemes.UserColourScheme;
+import jalview.util.MessageManager;
 
 import java.awt.Button;
 import java.awt.Color;
@@ -274,7 +275,7 @@ public class UserDefinedColours extends Panel implements ActionListener,
     }
     frame = new Frame();
     frame.add(this);
-    jalview.bin.JalviewLite.addFrame(frame, "User defined colours", 420,
+    jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.user_defined_colours"), 420,
             345);
 
     if (seqGroup != null)
@@ -630,13 +631,13 @@ public class UserDefinedColours extends Panel implements ActionListener,
     gridLayout.setColumns(6);
     gridLayout.setRows(4);
     okButton.setFont(new java.awt.Font("Verdana", 0, 11));
-    okButton.setLabel("OK");
+    okButton.setLabel(MessageManager.getString("action.ok"));
     okButton.addActionListener(this);
     applyButton.setFont(new java.awt.Font("Verdana", 0, 11));
-    applyButton.setLabel("Apply");
+    applyButton.setLabel(MessageManager.getString("action.apply"));
     applyButton.addActionListener(this);
     cancelButton.setFont(new java.awt.Font("Verdana", 0, 11));
-    cancelButton.setLabel("Cancel");
+    cancelButton.setLabel(MessageManager.getString("action.cancel"));
     cancelButton.addActionListener(this);
     this.setBackground(new Color(212, 208, 223));
     okcancelPanel.setBounds(new Rectangle(0, 265, 400, 35));
index 5d26b85..f3c8745 100755 (executable)
  */
 package jalview.bin;
 
+import jalview.util.MessageManager;
 import jalview.ws.dbsources.das.api.DasSourceRegistryI;
 import jalview.ws.dbsources.das.datamodel.DasSourceRegistry;
 
 import java.awt.Color;
 import java.io.*;
 import java.text.DateFormat;
-import java.text.SimpleDateFormat;
 import java.util.*;
 
 import org.apache.log4j.*;
@@ -780,8 +780,7 @@ public class Cache
     setProperty(property, jalview.util.Format.getHexString(colour));
   }
 
-  public static final DateFormat date_format = SimpleDateFormat
-          .getDateTimeInstance();
+  public static final DateFormat date_format = DateFormat.getDateInstance(DateFormat.LONG,MessageManager.getLocale());
 
   /**
    * store a date in a jalview property
index 8fe90f5..c3e56c6 100644 (file)
@@ -40,6 +40,7 @@ import jalview.javascript.JalviewLiteJsApi;
 import jalview.javascript.JsCallBack;
 import jalview.structure.SelectionListener;
 import jalview.structure.StructureSelectionManager;
+import jalview.util.MessageManager;
 
 import java.applet.Applet;
 import java.awt.Button;
@@ -1610,15 +1611,15 @@ public class JalviewLite extends Applet implements
       g.setColor(Color.cyan);
       g.fillRect(0, 0, getSize().width, getSize().height);
       g.setColor(Color.red);
-      g.drawString("Jalview can't open file", 5, 15);
+      g.drawString(MessageManager.getString("label.jalview_cannot_open_file"), 5, 15);
       g.drawString("\"" + file + "\"", 5, 30);
     }
     else if (embedded)
     {
       g.setColor(Color.black);
       g.setFont(new Font("Arial", Font.BOLD, 24));
-      g.drawString("Jalview Applet", 50, getSize().height / 2 - 30);
-      g.drawString("Loading Data...", 50, getSize().height / 2);
+      g.drawString(MessageManager.getString("label.jalview_applet"), 50, getSize().height / 2 - 30);
+      g.drawString(MessageManager.getString("label.loading_data") + "...", 50, getSize().height / 2);
     }
   }
 
@@ -1825,11 +1826,10 @@ public class JalviewLite extends Applet implements
 
         if (protocol == jalview.io.AppletFormatAdapter.PASTE)
         {
-          newAlignFrame.setTitle("Sequences from "
-                  + applet.getDocumentBase());
+          newAlignFrame.setTitle(MessageManager.formatMessage("label.sequences_from", new String[]{applet.getDocumentBase().toString()}));
         }
 
-        newAlignFrame.statusBar.setText("Successfully loaded file " + file);
+        newAlignFrame.statusBar.setText(MessageManager.formatMessage("label.successfully_loaded_file", new String []{file}));
 
         String treeFile = applet.getParameter("tree");
         if (treeFile == null)
diff --git a/src/jalview/controller/AlignViewController.java b/src/jalview/controller/AlignViewController.java
new file mode 100644 (file)
index 0000000..16e8cdd
--- /dev/null
@@ -0,0 +1,100 @@
+package jalview.controller;
+
+import java.awt.Color;
+
+import jalview.api.AlignViewControllerI;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+
+public class AlignViewController implements AlignViewControllerI
+{
+  AlignViewportI viewport=null;
+  AlignmentViewPanel alignPanel=null;
+  @Override
+  protected void finalize() throws Throwable {
+    viewport = null;
+    alignPanel = null;
+  };
+  
+  public AlignViewController(AlignViewportI viewport,
+          AlignmentViewPanel alignPanel)
+  {
+    this.viewport=viewport;
+    this.alignPanel = alignPanel;
+  }
+  @Override
+  public void setViewportAndAlignmentPanel(AlignViewportI viewport,AlignmentViewPanel alignPanel)
+  {
+    this.alignPanel = alignPanel;
+    this.viewport = viewport;
+    
+  }
+  @Override
+  public boolean makeGroupsFromSelection()
+  {
+
+    if (viewport.getSelectionGroup() != null)
+    {
+      SequenceGroup[] gps = jalview.analysis.Grouping.makeGroupsFrom(
+              viewport.getSequenceSelection(),
+              viewport.getAlignmentView(true).getSequenceStrings(
+                      viewport.getGapCharacter()), viewport.getAlignment()
+                      .getGroups());
+      viewport.getAlignment().deleteAllGroups();
+      viewport.clearSequenceColours();
+      viewport.setSelectionGroup(null);
+      // set view properties for each group
+      for (int g = 0; g < gps.length; g++)
+      {
+        // gps[g].setShowunconserved(viewport.getShowUnconserved());
+        gps[g].setshowSequenceLogo(viewport.isShowSequenceLogo());
+        viewport.getAlignment().addGroup(gps[g]);
+        Color col = new Color((int) (Math.random() * 255),
+                (int) (Math.random() * 255), (int) (Math.random() * 255));
+        col = col.brighter();
+        for (SequenceI sq : gps[g].getSequences(null))
+          viewport.setSequenceColour(sq, col);
+      }
+      return true;
+    }
+    return false;
+}
+  @Override
+  public boolean createGroup()
+  {
+
+    SequenceGroup sg = viewport.getSelectionGroup();
+    if (sg!=null)
+    {
+        viewport.getAlignment().addGroup(sg);
+        return true;
+      } 
+    return false;
+  }
+  @Override
+  public boolean unGroup()
+  {
+    SequenceGroup sg = viewport.getSelectionGroup();
+    if (sg!=null)
+    {
+        viewport.getAlignment().deleteGroup(sg);
+        return true;
+    }
+    return false;
+  }
+  @Override
+  public boolean deleteGroups()
+  {
+    if (viewport.getAlignment().getGroups()!=null && viewport.getAlignment().getGroups().size()>0)
+    {
+    viewport.getAlignment().deleteAllGroups();
+    viewport.clearSequenceColours();
+    viewport.setSelectionGroup(null);
+    return true;
+    }
+    return false;
+  }
+    
+  }
index 580c850..fa063ff 100755 (executable)
@@ -707,6 +707,7 @@ public class Sequence implements SequenceI
     {
       tmp = new char[i];
       System.arraycopy(sequence, 0, tmp, 0, i);
+      j=sequence.length;
     }
     else
     {
@@ -715,6 +716,9 @@ public class Sequence implements SequenceI
       System.arraycopy(sequence, j, tmp, i, sequence.length - j);
     }
     boolean createNewDs = false;
+    // TODO: take a look at the new dataset creation validation method below -
+    // this could become time comsuming for large sequences - consider making it
+    // more efficient
     for (int s = i; s < j; s++)
     {
       if (jalview.schemes.ResidueProperties.aaIndex[sequence[s]] != 23)
index 0bd7266..9ed3a53 100755 (executable)
@@ -493,7 +493,7 @@ public class SequenceGroup implements AnnotatedCollectionI
               endRes + 1, showSequenceLogo);
       if (consensus != null)
       {
-        _updateConsensusRow(cnsns);
+        _updateConsensusRow(cnsns, sequences.size());
       }
       if (cs != null)
       {
@@ -552,7 +552,7 @@ public class SequenceGroup implements AnnotatedCollectionI
 
   public Hashtable[] consensusData = null;
 
-  private void _updateConsensusRow(Hashtable[] cnsns)
+  private void _updateConsensusRow(Hashtable[] cnsns, long nseq)
   {
     if (consensus == null)
     {
@@ -569,7 +569,7 @@ public class SequenceGroup implements AnnotatedCollectionI
     consensus.annotations = new Annotation[aWidth]; // should be alignment width
 
     AAFrequency.completeConsensus(consensus, cnsns, startRes, endRes + 1,
-            ignoreGapsInConsensus, showSequenceLogo); // TODO: setting container
+            ignoreGapsInConsensus, showSequenceLogo, nseq); // TODO: setting container
                                                       // for
                                                       // ignoreGapsInConsensusCalculation);
   }
old mode 100755 (executable)
new mode 100644 (file)
index ceb08ee..62fd29d
@@ -24,6 +24,7 @@ import jalview.analysis.CrossRef;
 import jalview.analysis.NJTree;
 import jalview.analysis.ParseProperties;
 import jalview.analysis.SequenceIdMatcher;
+import jalview.api.AlignViewControllerI;
 import jalview.bin.Cache;
 import jalview.commands.CommandI;
 import jalview.commands.EditCommand;
@@ -75,8 +76,10 @@ import jalview.schemes.TaylorColourScheme;
 import jalview.schemes.TurnColourScheme;
 import jalview.schemes.UserColourScheme;
 import jalview.schemes.ZappoColourScheme;
+import jalview.util.MessageManager;
 import jalview.ws.jws1.Discoverer;
 import jalview.ws.jws2.Jws2Discoverer;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
 import jalview.ws.seqfetcher.DbSourceProxy;
 
 import java.awt.BorderLayout;
@@ -144,6 +147,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   public AlignmentPanel alignPanel;
 
   AlignViewport viewport;
+  public AlignViewControllerI avc;
 
   Vector alignPanels = new Vector();
 
@@ -287,6 +293,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    */
   void init()
   {
+    avc = new jalview.controller.AlignViewController(viewport, alignPanel);
     if (viewport.getAlignmentConservationAnnotation() == null)
     {
       BLOSUM62Colour.setEnabled(false);
@@ -329,7 +336,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     }
 
     addKeyListener();
-
+    
   }
 
   /**
@@ -475,8 +482,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
         case KeyEvent.VK_F2:
           viewport.cursorMode = !viewport.cursorMode;
-          statusBar.setText("Keyboard editing mode is "
-                  + (viewport.cursorMode ? "on" : "off"));
+          statusBar.setText(MessageManager.formatMessage("label.keyboard_editing_mode", new String[]{(viewport.cursorMode ? "on" : "off")}));
           if (viewport.cursorMode)
           {
             alignPanel.seqPanel.seqCanvas.cursorX = viewport.startRes;
@@ -557,6 +563,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   public void addAlignmentPanel(final AlignmentPanel ap, boolean newPanel)
   {
     ap.alignFrame = this;
+    avc = new jalview.controller.AlignViewController(viewport, alignPanel);
 
     alignPanels.addElement(ap);
 
@@ -734,7 +741,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     rnahelicesColour
             .setSelected(av.getGlobalColourScheme() instanceof jalview.schemes.RNAHelicesColour);
     setShowProductsEnabled();
-
     updateEditMenuBar();
   }
 
@@ -808,7 +814,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     final JPanel progressPanel = (JPanel) progressBars.get(new Long(id));
     if (handler.canCancel())
     {
-      JButton cancel = new JButton("Cancel");
+      JButton cancel = new JButton(MessageManager.getString("action.cancel"));
       final IProgressIndicator us = this;
       cancel.addActionListener(new ActionListener()
       {
@@ -988,8 +994,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       if (currentFileFormat == null)
       {
         JOptionPane.showInternalMessageDialog(Desktop.desktop,
-                "You must select a file format before saving!",
-                "File format not specified", JOptionPane.WARNING_MESSAGE);
+                MessageManager.getString("label.select_file_format_before_saving"),
+                MessageManager.getString("label.file_format_not_specified"), JOptionPane.WARNING_MESSAGE);
         value = chooser.showSaveDialog(this);
         return;
       }
@@ -1025,8 +1031,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
       success = new Jalview2XML().SaveAlignment(this, file, shortName);
 
-      statusBar.setText("Successfully saved to file: " + fileName + " in "
-              + format + " format.");
+      statusBar.setText(MessageManager.formatMessage("label.successfully_saved_to_file_in_format",new String[]{fileName, format}));
+
 
     }
     else
@@ -1047,9 +1053,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         int reply = JOptionPane
                 .showInternalConfirmDialog(
                         Desktop.desktop,
-                        "The Alignment contains hidden columns."
-                                + "\nDo you want to save only the visible alignment?",
-                        "Save / Omit Hidden Columns",
+                        MessageManager.getString("label.alignment_contains_hidden_columns"),
+                        MessageManager.getString("action.save_omit_hidden_columns"),
                         JOptionPane.YES_NO_OPTION,
                         JOptionPane.QUESTION_MESSAGE);
 
@@ -1079,8 +1084,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           out.print(output);
           out.close();
           this.setTitle(file);
-          statusBar.setText("Successfully saved to file: " + fileName
-                  + " in " + format + " format.");
+          statusBar.setText(MessageManager.formatMessage("label.successfully_saved_to_file_in_format",new String[]{fileName, format}));
         } catch (Exception ex)
         {
           success = false;
@@ -1091,8 +1095,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     if (!success)
     {
-      JOptionPane.showInternalMessageDialog(this, "Couldn't save file: "
-              + fileName, "Error Saving File", JOptionPane.WARNING_MESSAGE);
+      JOptionPane.showInternalMessageDialog(this, MessageManager.formatMessage("label.couldnt_save_file", new String[]{fileName}),
+              MessageManager.getString("label.error_saving_file"), JOptionPane.WARNING_MESSAGE);
     }
 
     return success;
@@ -1129,9 +1133,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       int reply = JOptionPane
               .showInternalConfirmDialog(
                       Desktop.desktop,
-                      "The Alignment contains hidden columns."
-                              + "\nDo you want to output only the visible alignment?",
-                      "Save / Omit Hidden Columns",
+                      MessageManager.getString("label.alignment_contains_hidden_columns"),
+                      MessageManager.getString("action.save_omit_hidden_columns"),
                       JOptionPane.YES_NO_OPTION,
                       JOptionPane.QUESTION_MESSAGE);
 
@@ -1347,12 +1350,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     {
       undoMenuItem.setEnabled(true);
       CommandI command = (CommandI) viewport.historyList.peek();
-      undoMenuItem.setText("Undo " + command.getDescription());
+      undoMenuItem.setText(MessageManager.formatMessage("label.undo_command", new String[]{command.getDescription()}));
     }
     else
     {
       undoMenuItem.setEnabled(false);
-      undoMenuItem.setText("Undo");
+      undoMenuItem.setText(MessageManager.getString("action.undo"));
     }
 
     if (viewport.redoList.size() > 0)
@@ -1360,12 +1363,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       redoMenuItem.setEnabled(true);
 
       CommandI command = (CommandI) viewport.redoList.peek();
-      redoMenuItem.setText("Redo " + command.getDescription());
+      redoMenuItem.setText(MessageManager.formatMessage("label.redo_command", new String[]{command.getDescription()}));
     }
     else
     {
       redoMenuItem.setEnabled(false);
-      redoMenuItem.setText("Redo");
+      redoMenuItem.setText(MessageManager.getString("action.redo"));
     }
   }
 
@@ -1693,7 +1696,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     Desktop.jalviewClipboard = new Object[]
     { seqs, viewport.getAlignment().getDataset(), hiddenColumns };
-    statusBar.setText("Copied " + seqs.length + " sequences to clipboard.");
+    statusBar.setText(MessageManager.formatMessage("label.copied_sequences_to_clipboard", new String[]{Integer.valueOf(seqs.length).toString()}));
   }
 
   /**
@@ -2135,12 +2138,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   @Override
   protected void deleteGroups_actionPerformed(ActionEvent e)
   {
-    viewport.getAlignment().deleteAllGroups();
-    viewport.sequenceColours = null;
-    viewport.setSelectionGroup(null);
-    PaintRefresher.Refresh(this, viewport.getSequenceSetId());
-    alignPanel.updateAnnotation();
-    alignPanel.paintAlignment(true);
+    if (avc.deleteGroups()) {
+      PaintRefresher.Refresh(this, viewport.getSequenceSetId());
+      alignPanel.updateAnnotation();
+      alignPanel.paintAlignment(true);
+    }
   }
 
   /**
@@ -2294,7 +2296,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                 viewport.getSelectionGroup());
       }
 
-      statusBar.setText("Removed " + trimRegion.getSize() + " columns.");
+      statusBar.setText(MessageManager.formatMessage("label.removed_columns", new String[]{Integer.valueOf(trimRegion.getSize()).toString()}));
 
       addHistoryItem(trimRegion);
 
@@ -2342,8 +2344,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     addHistoryItem(removeGapCols);
 
-    statusBar.setText("Removed " + removeGapCols.getSize()
-            + " empty columns.");
+    statusBar.setText(MessageManager.formatMessage("label.removed_empty_columns", new String[]{Integer.valueOf(removeGapCols.getSize()).toString()}));
 
     // This is to maintain viewport position on first residue
     // of first sequence
@@ -2537,7 +2538,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     newap.av.viewName = newViewName;
 
     addAlignmentPanel(newap, true);
-
+    newap.alignmentChanged();
+    
     if (alignPanels.size() == 2)
     {
       viewport.gatherViewsHere = true;
@@ -2951,7 +2953,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     editPane.setEditable(false);
     StringBuffer contents = new AlignmentProperties(viewport.getAlignment())
             .formatAsHtml();
-    editPane.setText("<html>" + contents.toString() + "</html>");
+    editPane.setText(MessageManager.formatMessage("label.html_content", new String[]{contents.toString()}));
     JInternalFrame frame = new JInternalFrame();
     frame.getContentPane().add(new JScrollPane(editPane));
 
@@ -3411,8 +3413,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
               int option = JOptionPane.showInternalConfirmDialog(
                       jalview.gui.Desktop.desktop,
-                      "Remove from default list?",
-                      "Remove user defined colour",
+                      MessageManager.getString("label.remove_from_default_list"),
+                      MessageManager.getString("label.remove_user_defined_colour"),
                       JOptionPane.YES_NO_OPTION);
               if (option == JOptionPane.YES_OPTION)
               {
@@ -3564,7 +3566,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
             || (viewport.getSelectionGroup().getSize() < 2))
     {
       JOptionPane.showInternalMessageDialog(this,
-              "You must select at least 2 sequences.", "Invalid Selection",
+              MessageManager.getString("label.you_must_select_least_two_sequences"), MessageManager.getString("label.invalid_selection"),
               JOptionPane.WARNING_MESSAGE);
     }
     else
@@ -3590,9 +3592,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
             || (viewport.getAlignment().getHeight() < 4))
     {
       JOptionPane.showInternalMessageDialog(this,
-              "Principal component analysis must take\n"
-                      + "at least 4 input sequences.",
-              "Sequence selection insufficient",
+              MessageManager.getString("label.principal_component_analysis_must_take_least_four_input_sequences"),
+              MessageManager.getString("label.sequence_selection_insufficient"),
               JOptionPane.WARNING_MESSAGE);
 
       return;
@@ -3694,8 +3695,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         JOptionPane
                 .showMessageDialog(
                         Desktop.desktop,
-                        "You need to have more than two sequences selected to build a tree!",
-                        "Not enough sequences", JOptionPane.WARNING_MESSAGE);
+                        MessageManager.getString("label.you_need_more_two_sequences_selected_build_tree"),
+                        MessageManager.getString("label.not_enough_sequences"), JOptionPane.WARNING_MESSAGE);
         return;
       }
 
@@ -3709,10 +3710,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           JOptionPane
                   .showMessageDialog(
                           Desktop.desktop,
-                          "The selected region to create a tree may\nonly contain residues or gaps.\n"
-                                  + "Try using the Pad function in the edit menu,\n"
-                                  + "or one of the multiple sequence alignment web services.",
-                          "Sequences in selection are not aligned",
+                          MessageManager.getString("label.selected_region_to_tree_may_only_contain_residues_or_gaps"),
+                          MessageManager.getString("label.sequences_selection_not_aligned"),
                           JOptionPane.WARNING_MESSAGE);
 
           return;
@@ -3730,10 +3729,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         JOptionPane
                 .showMessageDialog(
                         Desktop.desktop,
-                        "The sequences must be aligned before creating a tree.\n"
-                                + "Try using the Pad function in the edit menu,\n"
-                                + "or one of the multiple sequence alignment web services.",
-                        "Sequences not aligned",
+                        MessageManager.getString("label.sequences_must_be_aligned_before_creating_tree"),
+                        MessageManager.getString("label.sequences_not_aligned"),
                         JOptionPane.WARNING_MESSAGE);
 
         return;
@@ -4047,13 +4044,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       } catch (Exception ex)
       {
         JOptionPane.showMessageDialog(Desktop.desktop, ex.getMessage(),
-                "Problem reading tree file", JOptionPane.WARNING_MESSAGE);
+                MessageManager.getString("label.problem_reading_tree_file"), JOptionPane.WARNING_MESSAGE);
         ex.printStackTrace();
       }
       if (fin != null && fin.hasWarningMessage())
       {
         JOptionPane.showMessageDialog(Desktop.desktop,
-                fin.getWarningMessage(), "Possible problem with tree file",
+                fin.getWarningMessage(), MessageManager.getString("label.possible_problem_with_tree_file"),
                 JOptionPane.WARNING_MESSAGE);
       }
     }
@@ -4158,6 +4155,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       @Override
       public void run()
       {
+        final List<JMenuItem> legacyItems=new ArrayList<JMenuItem>();
         try
         {
           System.err.println("Building ws menu again "
@@ -4189,28 +4187,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
             // TODO: refactor to allow list of AbstractName/Handler bindings to
             // be
             // stored or retrieved from elsewhere
-            Vector msaws = null; // (Vector) Discoverer.services.get("MsaWS");
+            // No MSAWS used any more:
+            // Vector msaws = null; // (Vector) Discoverer.services.get("MsaWS");
             Vector secstrpr = (Vector) Discoverer.services
                     .get("SecStrPred");
-            Vector seqsrch = null; // (Vector)
-                                   // Discoverer.services.get("SeqSearch");
-            // TODO: move GUI generation code onto service implementation - so a
-            // client instance attaches itself to the GUI with method call like
-            // jalview.ws.MsaWSClient.bind(servicehandle, Desktop.instance,
-            // alignframe)
-            if (msaws != null)
-            {
-              // Add any Multiple Sequence Alignment Services
-              for (int i = 0, j = msaws.size(); i < j; i++)
-              {
-                final ext.vamsas.ServiceHandle sh = (ext.vamsas.ServiceHandle) msaws
-                        .get(i);
-                jalview.ws.WSMenuEntryProviderI impl = jalview.ws.jws1.Discoverer
-                        .getServiceClient(sh);
-                impl.attachWSMenuEntry(msawsmenu, me);
-
-              }
-            }
             if (secstrpr != null)
             {
               // Add any secondary structure prediction services
@@ -4220,35 +4200,23 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                         .get(i);
                 jalview.ws.WSMenuEntryProviderI impl = jalview.ws.jws1.Discoverer
                         .getServiceClient(sh);
+                int p=secstrmenu.getItemCount();
                 impl.attachWSMenuEntry(secstrmenu, me);
-              }
-            }
-            if (seqsrch != null)
-            {
-              // Add any sequence search services
-              for (int i = 0, j = seqsrch.size(); i < j; i++)
-              {
-                final ext.vamsas.ServiceHandle sh = (ext.vamsas.ServiceHandle) seqsrch
-                        .elementAt(i);
-                jalview.ws.WSMenuEntryProviderI impl = jalview.ws.jws1.Discoverer
-                        .getServiceClient(sh);
-                impl.attachWSMenuEntry(seqsrchmenu, me);
+                int q=secstrmenu.getItemCount();
+                for (int litm=p;litm<q; litm++)
+                {
+                  legacyItems.add(secstrmenu.getItem(litm));
+                }
               }
             }
           }
-
+          
           // Add all submenus in the order they should appear on the web
           // services menu
           wsmenu.add(msawsmenu);
           wsmenu.add(secstrmenu);
           wsmenu.add(dismenu);
           wsmenu.add(analymenu);
-          // final ArrayList<JMenu> submens=new ArrayList<JMenu>();
-          // submens.add(msawsmenu);
-          // submens.add(secstrmenu);
-          // submens.add(dismenu);
-          // submens.add(analymenu);
-
           // No search services yet
           // wsmenu.add(seqsrchmenu);
 
@@ -4273,6 +4241,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                   webService.add(me.webServiceNoServices);
                 }
                 // TODO: move into separate menu builder class.
+                boolean new_sspred=false;
                 if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
                 {
                   Jws2Discoverer jws2servs = Jws2Discoverer.getDiscoverer();
@@ -4281,6 +4250,16 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                     if (jws2servs.hasServices())
                     {
                       jws2servs.attachWSMenuEntry(webService, me);
+                      for (Jws2Instance sv:jws2servs.getServices()) {
+                        if (sv.description.toLowerCase().contains("jpred"))
+                        {
+                          for (JMenuItem jmi:legacyItems)
+                          {
+                            jmi.setVisible(false);
+                          }
+                        }
+                      }
+                      
                     }
                     if (jws2servs.isRunning())
                     {
@@ -4291,7 +4270,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                     }
                   }
                 }
-
                 build_urlServiceMenu(me.webService);
                 build_fetchdbmenu(webService);
                 for (JMenu item : wsmenu)
@@ -4573,8 +4551,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       JOptionPane
               .showMessageDialog(
                       Desktop.desktop,
-                      "Please select at least three bases in at least one sequence in order to perform a cDNA translation.",
-                      "Translation Failed", JOptionPane.WARNING_MESSAGE);
+                      MessageManager.getString("label.select_at_least_three_bases_in_at_least_one_sequence_to_cDNA_translation"),
+                      MessageManager.getString("label.translation_failed"), JOptionPane.WARNING_MESSAGE);
     }
     else
     {
@@ -4607,8 +4585,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       JOptionPane
       .showMessageDialog(
               Desktop.desktop,
-              "Unfortunately, something went wrong when translating your sequences.\nPlease take a look in the Jalview java console\nand submit a bug report including the stacktrace.",
-              "Implementation error: Translation Failed", JOptionPane.ERROR_MESSAGE);
+              MessageManager.getString("label.error_when_translating_sequences_submit_bug_report"),
+              MessageManager.getString("label.implementation_error") + MessageManager.getString("translation_failed"), JOptionPane.ERROR_MESSAGE);
       return;
     }
     if (al == null)
@@ -4616,8 +4594,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       JOptionPane
               .showMessageDialog(
                       Desktop.desktop,
-                      "Please select at least three bases in at least one sequence in order to perform a cDNA translation.",
-                      "Translation Failed", JOptionPane.WARNING_MESSAGE);
+                      MessageManager.getString("label.select_at_least_three_bases_in_at_least_one_sequence_to_cDNA_translation"),
+                      MessageManager.getString("label.translation_failed"), JOptionPane.WARNING_MESSAGE);
     }
     else
     {
@@ -4816,10 +4794,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                   || JOptionPane
                           .showConfirmDialog(
                                   this,
-                                  "Do you want to automatically associate the "
-                                          + filesmatched.size()
-                                          + " PDB files with sequences in the alignment that have the same name ?",
-                                  "Automatically Associate PDB files by name",
+                                  MessageManager.formatMessage("label.automatically_associate_pdb_files_with_sequences_same_name",
+                                                 new String[]{Integer.valueOf(filesmatched.size()).toString()}),
+                                  MessageManager.getString("label.automatically_associate_pdb_files_by_name"),
                                   JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)
 
           {
@@ -4852,10 +4829,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                           "AUTOASSOCIATE_PDBANDSEQS_IGNOREOTHERS", false) || JOptionPane
                           .showConfirmDialog(
                                   this,
-                                  "<html>Do you want to <em>ignore</em> the "
-                                          + filesnotmatched.size()
-                                          + " files whose names did not match any sequence IDs ?</html>",
-                                  "Ignore unmatched dropped files ?",
+                                  MessageManager.formatMessage("label.ignore_unmatched_dropped_files_info", new String[]{Integer.valueOf(filesnotmatched.size()).toString()}),
+                                  MessageManager.getString("label.ignore_unmatched_dropped_files"),
                                   JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION))
           {
             return;
@@ -4914,8 +4889,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               tcoffeeColour.setSelected(true);
               changeColour(new TCoffeeColourScheme(viewport.getAlignment()));
               isAnnotation = true;
-              statusBar
-                      .setText("Successfully pasted T-Coffee scores to alignment.");
+              statusBar.setText(MessageManager.getString("label.successfully_pasted_tcoffee_scores_to_alignment"));
             }
             else
             {
@@ -4924,9 +4898,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               JOptionPane
                       .showMessageDialog(
                               Desktop.desktop,
-                              tcf.getWarningMessage() == null ? "Check that the file matches sequence IDs in the alignment."
+                              tcf.getWarningMessage() == null ? MessageManager.getString("label.check_file_matches_sequence_ids_alignment")
                                       : tcf.getWarningMessage(),
-                              "Problem reading T-COFFEE score file",
+                              MessageManager.getString("label.problem_reading_tcoffee_score_file"),
                               JOptionPane.WARNING_MESSAGE);
             }
           }
@@ -5033,6 +5007,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     {
       alignPanel = (AlignmentPanel) alignPanels.elementAt(index);
       viewport = alignPanel.av;
+      avc.setViewportAndAlignmentPanel(viewport, alignPanel);
       setMenusFromViewport(viewport);
     }
   }
@@ -5043,7 +5018,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     if (SwingUtilities.isRightMouseButton(e))
     {
       String reply = JOptionPane.showInternalInputDialog(this,
-              "Enter View Name", "Edit View Name",
+              MessageManager.getString("label.enter_view_name"), MessageManager.getString("label.enter_view_name"),
               JOptionPane.QUESTION_MESSAGE);
 
       if (reply != null)
@@ -5323,7 +5298,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                   ++i;
                   if (++icomp >= mcomp || i == (otherdb.size()))
                   {
-                    ifetch.setText(imname + " to '" + sname + "'");
+                    ifetch.setText(MessageManager.formatMessage("label.source_to_target",new String[]{imname,sname}));
                     dfetch.add(ifetch);
                     ifetch = new JMenu();
                     imname = null;
@@ -5335,7 +5310,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               ++dbi;
               if (comp >= mcomp || dbi >= (dbclasses.length))
               {
-                dfetch.setText(mname + " to '" + dbclass + "'");
+                dfetch.setText(MessageManager.formatMessage("label.source_to_target",new String[]{mname,dbclass}));
                 rfetch.add(dfetch);
                 dfetch = new JMenu();
                 mname = null;
@@ -5473,34 +5448,31 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   @Override
   protected void makeGrpsFromSelection_actionPerformed(ActionEvent e)
   {
-    if (viewport.getSelectionGroup() != null)
-    {
-      SequenceGroup[] gps = jalview.analysis.Grouping.makeGroupsFrom(
-              viewport.getSequenceSelection(),
-              viewport.getAlignmentView(true).getSequenceStrings(
-                      viewport.getGapCharacter()), viewport.getAlignment()
-                      .getGroups());
-      viewport.getAlignment().deleteAllGroups();
-      viewport.sequenceColours = null;
-      viewport.setSelectionGroup(null);
-      // set view properties for each group
-      for (int g = 0; g < gps.length; g++)
-      {
-        gps[g].setShowNonconserved(viewport.getShowUnconserved());
-        gps[g].setshowSequenceLogo(viewport.isShowSequenceLogo());
-        viewport.getAlignment().addGroup(gps[g]);
-        Color col = new Color((int) (Math.random() * 255),
-                (int) (Math.random() * 255), (int) (Math.random() * 255));
-        col = col.brighter();
-        for (SequenceI s : gps[g].getSequences())
-          viewport.setSequenceColour(s, col);
-      }
+    if (avc.makeGroupsFromSelection()) {
       PaintRefresher.Refresh(this, viewport.getSequenceSetId());
       alignPanel.updateAnnotation();
       alignPanel.paintAlignment(true);
     }
   }
 
+  @Override
+  protected void createGroup_actionPerformed(ActionEvent e)
+  {
+    if (avc.createGroup())
+    {
+      alignPanel.alignmentChanged();
+    }
+  }
+
+  @Override
+  protected void unGroup_actionPerformed(ActionEvent e)
+  {
+    if (avc.unGroup())
+    {
+      alignPanel.alignmentChanged();
+    }
+  }
+
   /**
    * make the given alignmentPanel the currently selected tab
    * 
index 7a01b27..407fa94 100644 (file)
@@ -138,8 +138,6 @@ public class AlignViewport extends AlignmentViewport implements
 
   Stack redoList = new Stack();
 
-  Hashtable sequenceColours;
-
   int thresholdTextColour = 0;
 
   Color textColour = Color.black;
@@ -934,35 +932,6 @@ public class AlignViewport extends AlignmentViewport implements
     showHiddenMarkers = show;
   }
 
-  public Color getSequenceColour(SequenceI seq)
-  {
-    if (sequenceColours == null || !sequenceColours.containsKey(seq))
-    {
-      return Color.white;
-    }
-    else
-    {
-      return (Color) sequenceColours.get(seq);
-    }
-  }
-
-  public void setSequenceColour(SequenceI seq, Color col)
-  {
-    if (sequenceColours == null)
-    {
-      sequenceColours = new Hashtable();
-    }
-
-    if (col == null)
-    {
-      sequenceColours.remove(seq);
-    }
-    else
-    {
-      sequenceColours.put(seq, col);
-    }
-  }
-
   /**
    * returns the visible column regions of the alignment
    * 
@@ -1044,23 +1013,6 @@ public class AlignViewport extends AlignmentViewport implements
     centreColumnLabels = centrecolumnlabels;
   }
 
-  public void updateSequenceIdColours()
-  {
-    if (sequenceColours == null)
-    {
-      sequenceColours = new Hashtable();
-    }
-    for (SequenceGroup sg : alignment.getGroups())
-    {
-      if (sg.idColour != null)
-      {
-        for (SequenceI s : sg.getSequences(getHiddenRepSequences()))
-        {
-          sequenceColours.put(s, sg.idColour);
-        }
-      }
-    }
-  }
 
   /**
    * enable or disable the display of Database Cross References in the sequence
old mode 100755 (executable)
new mode 100644 (file)
index f2036de..5ee69f2
@@ -30,6 +30,8 @@ import net.miginfocom.swing.MigLayout;
 import jalview.bin.Cache;
 import jalview.datamodel.*;
 import jalview.schemes.*;
+import jalview.util.MessageManager;
+
 import java.awt.Dimension;
 
 public class AnnotationColourChooser extends JPanel
@@ -118,18 +120,19 @@ public class AnnotationColourChooser extends JPanel
     // Always get default shading from preferences.
     setDefaultMinMax();
 
+    adjusting = true;
     if (oldcs instanceof AnnotationColourGradient)
     {
       AnnotationColourGradient acg = (AnnotationColourGradient) oldcs;
-      currentColours.setSelected(acg.predefinedColours);
-      if (!acg.predefinedColours)
+      currentColours.setSelected(acg.isPredefinedColours() || acg.getBaseColour()!=null);
+      if (!acg.isPredefinedColours() && acg.getBaseColour()==null)
       {
         minColour.setBackground(acg.getMinColour());
         maxColour.setBackground(acg.getMaxColour());
       }
       seqAssociated.setSelected(acg.isSeqAssociated());
+      
     }
-    adjusting = true;
     annotations = new JComboBox(
             getAnnotationItems(seqAssociated.isSelected()));
 
@@ -265,7 +268,7 @@ public class AnnotationColourChooser extends JPanel
       }
     });
     ok.setOpaque(false);
-    ok.setText("OK");
+    ok.setText(MessageManager.getString("action.ok"));
     ok.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -274,7 +277,7 @@ public class AnnotationColourChooser extends JPanel
       }
     });
     cancel.setOpaque(false);
-    cancel.setText("Cancel");
+    cancel.setText(MessageManager.getString("action.cancel"));
     cancel.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -283,7 +286,7 @@ public class AnnotationColourChooser extends JPanel
       }
     });
     defColours.setOpaque(false);
-    defColours.setText("Defaults");
+    defColours.setText(MessageManager.getString("action.set_defaults"));
     defColours
             .setToolTipText("Reset min and max colours to defaults from user preferences.");
     defColours.addActionListener(new ActionListener()
@@ -327,7 +330,7 @@ public class AnnotationColourChooser extends JPanel
     thresholdValue.setColumns(7);
     currentColours.setFont(JvSwingUtils.getLabelFont());
     currentColours.setOpaque(false);
-    currentColours.setText("Use Original Colours");
+    currentColours.setText(MessageManager.getString("label.use_original_colours"));
     currentColours.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -337,7 +340,7 @@ public class AnnotationColourChooser extends JPanel
     });
     thresholdIsMin.setBackground(Color.white);
     thresholdIsMin.setFont(JvSwingUtils.getLabelFont());
-    thresholdIsMin.setText("Threshold is Min/Max");
+    thresholdIsMin.setText(MessageManager.getString("label.threshold_minmax"));
     thresholdIsMin.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent actionEvent)
@@ -347,7 +350,7 @@ public class AnnotationColourChooser extends JPanel
     });
     seqAssociated.setBackground(Color.white);
     seqAssociated.setFont(JvSwingUtils.getLabelFont());
-    seqAssociated.setText("Per-sequence only");
+    seqAssociated.setText(MessageManager.getString("label.per_sequence_only"));
     seqAssociated.addActionListener(new ActionListener()
     {
 
@@ -548,7 +551,7 @@ public class AnnotationColourChooser extends JPanel
     if (currentAnnotation.graphMin == 0f
             && currentAnnotation.graphMax == 0f)
     {
-      acg.predefinedColours = true;
+      acg.setPredefinedColours(true);
     }
 
     acg.thresholdIsMinMax = thresholdIsMin.isSelected();
old mode 100755 (executable)
new mode 100644 (file)
index e255cd6..02758fa
@@ -26,6 +26,7 @@ import javax.swing.*;
 
 import jalview.datamodel.*;
 import jalview.io.*;
+import jalview.util.MessageManager;
 
 /**
  * 
@@ -229,7 +230,7 @@ public class AnnotationExporter extends JPanel
   {
     this.setLayout(new BorderLayout());
 
-    toFile.setText("to File");
+    toFile.setText(MessageManager.getString("label.to_file"));
     toFile.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -237,7 +238,7 @@ public class AnnotationExporter extends JPanel
         toFile_actionPerformed(e);
       }
     });
-    toTextbox.setText("to Textbox");
+    toTextbox.setText(MessageManager.getString("label.to_textbox"));
     toTextbox.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -245,7 +246,7 @@ public class AnnotationExporter extends JPanel
         toTextbox_actionPerformed(e);
       }
     });
-    close.setText("Close");
+    close.setText(MessageManager.getString("action.close"));
     close.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -259,9 +260,9 @@ public class AnnotationExporter extends JPanel
     GFFFormat.setOpaque(false);
     GFFFormat.setText("GFF");
     CSVFormat.setOpaque(false);
-    CSVFormat.setText("CSV(Spreadsheet)");
+    CSVFormat.setText(MessageManager.getString("label.csv_spreadsheet"));
     jLabel1.setHorizontalAlignment(SwingConstants.TRAILING);
-    jLabel1.setText("Format: ");
+    jLabel1.setText(MessageManager.getString("action.format") + " ");
     this.setBackground(Color.white);
     jPanel3.setBorder(BorderFactory.createEtchedBorder());
     jPanel3.setOpaque(false);
index 8566e57..c7fd4fe 100755 (executable)
@@ -29,6 +29,7 @@ import javax.swing.*;
 
 import jalview.datamodel.*;
 import jalview.io.*;
+import jalview.util.MessageManager;
 
 /**
  * DOCUMENT ME!
@@ -1009,8 +1010,8 @@ public class AnnotationLabels extends JPanel implements MouseListener,
 
     if (!av.wrapAlignment && ((aa == null) || (aa.length < 1)))
     {
-      g.drawString("Right click", 2, 8);
-      g.drawString("to add annotation", 2, 18);
+      g.drawString(MessageManager.getString("label.right_click"), 2, 8);
+      g.drawString(MessageManager.getString("label.to_add_annotation"), 2, 18);
     }
   }
 }
index ed899b1..ce731ad 100755 (executable)
@@ -20,11 +20,13 @@ package jalview.gui;
 import java.awt.*;
 import java.awt.event.*;
 import java.awt.image.*;
+
 import javax.swing.*;
 
 import jalview.datamodel.*;
 import jalview.renderer.AnnotationRenderer;
 import jalview.renderer.AwtRenderPanelI;
+import jalview.util.MessageManager;
 
 /**
  * AnnotationPanel displays visible portion of annotation rows below unwrapped
@@ -266,7 +268,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
     else if (evt.getActionCommand().equals(LABEL))
     {
       String exMesg = collectAnnotVals(anot, av.getColumnSelection(), LABEL);
-      String label = JOptionPane.showInputDialog(this, "Enter label",
+      String label = JOptionPane.showInputDialog(this, MessageManager.getString("label.enter_label"),
               exMesg);
 
       if (label == null)
@@ -348,7 +350,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
       }
 
       String label = JOptionPane.showInputDialog(
-              "Enter a label for the structure?", symbol);
+              MessageManager.getString("label.enter_label_for_the_structure"), symbol);
 
       if (label == null)
       {
@@ -663,7 +665,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
               && aa[row].annotations[res].description != null
               && aa[row].annotations[res].description.length() > 0)
       {
-        this.setToolTipText(aa[row].annotations[res].description);
+        this.setToolTipText("<html>"+JvSwingUtils.wrapTooltip(aa[row].annotations[res].description)+"</html>");
       }
       else
       {
@@ -922,7 +924,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
       g.setColor(Color.black);
       if (av.validCharWidth)
       {
-        g.drawString("Alignment has no annotations", 20, 15);
+        g.drawString(MessageManager.getString("label.alignment_has_no_annotations"), 20, 15);
       }
 
       return;
index b1f7e4c..3b4b738 100644 (file)
@@ -33,6 +33,7 @@ import jalview.gui.ViewSelectionMenu.ViewSetProvider;
 import jalview.datamodel.PDBEntry;
 import jalview.io.*;
 import jalview.schemes.*;
+import jalview.util.MessageManager;
 import jalview.util.Platform;
 
 public class AppJmol extends GStructureViewer implements Runnable,
@@ -251,9 +252,8 @@ public class AppJmol extends GStructureViewer implements Runnable,
     if (alreadyMapped != null)
     {
       int option = JOptionPane.showInternalConfirmDialog(Desktop.desktop,
-              pdbentry.getId() + " is already displayed."
-                      + "\nDo you want to re-use this viewer ?",
-              "Map Sequences to Visible Window: " + pdbentry.getId(),
+                 MessageManager.formatMessage("label.pdb_entry_is_already_displayed",  new String[]{pdbentry.getId()}),
+              MessageManager.formatMessage("label.map_sequences_to_visible_window", new String[]{pdbentry.getId()}),
               JOptionPane.YES_NO_OPTION);
 
       if (option == JOptionPane.YES_OPTION)
@@ -310,9 +310,8 @@ public class AppJmol extends GStructureViewer implements Runnable,
         AppJmol topJmol = (AppJmol) jm.nextElement();
         // TODO: highlight topJmol in view somehow
         int option = JOptionPane.showInternalConfirmDialog(Desktop.desktop,
-                "Do you want to add " + pdbentry.getId()
-                        + " to the view called\n'" + topJmol.getTitle()
-                        + "'\n", "Align to existing structure view",
+                       MessageManager.formatMessage("label.add_pdbentry_to_view", new String[]{pdbentry.getId(),topJmol.getTitle()}),
+                       MessageManager.getString("label.align_to_existing_structure_view"),
                 JOptionPane.YES_NO_OPTION);
         if (option == JOptionPane.YES_OPTION)
         {
@@ -781,10 +780,8 @@ public class AppJmol extends GStructureViewer implements Runnable,
     {
 
       JOptionPane.showInternalMessageDialog(Desktop.desktop,
-              "The following pdb entries could not be retrieved from the PDB:\n"
-                      + errormsgs.toString()
-                      + "\nPlease try downloading them manually.",
-              "Couldn't load file", JOptionPane.ERROR_MESSAGE);
+                 MessageManager.formatMessage("label.pdb_entries_couldnt_be_retrieved", new String[]{errormsgs.toString()}),
+              MessageManager.getString("label.couldnt_load_file"), JOptionPane.ERROR_MESSAGE);
 
     }
     long lastnotify = jmb.getLoadNotifiesHandled();
@@ -1145,7 +1142,7 @@ public class AppJmol extends GStructureViewer implements Runnable,
         g.fillRect(0, 0, currentSize.width, currentSize.height);
         g.setColor(Color.white);
         g.setFont(new Font("Verdana", Font.BOLD, 14));
-        g.drawString("Error loading file...", 20, currentSize.height / 2);
+        g.drawString(MessageManager.getString("label.error_loading_file") + "...", 20, currentSize.height / 2);
         StringBuffer sb = new StringBuffer();
         int lines = 0;
         for (int e = 0; e < jmb.pdbentry.length; e++)
@@ -1170,7 +1167,7 @@ public class AppJmol extends GStructureViewer implements Runnable,
         g.fillRect(0, 0, currentSize.width, currentSize.height);
         g.setColor(Color.white);
         g.setFont(new Font("Verdana", Font.BOLD, 14));
-        g.drawString("Retrieving PDB data....", 20, currentSize.height / 2);
+        g.drawString(MessageManager.getString("label.retrieving_pdb_data"), 20, currentSize.height / 2);
       }
       else
       {
index 81452af..d19a711 100644 (file)
@@ -17,6 +17,8 @@
  */
 package jalview.gui;
 
+import jalview.util.MessageManager;
+
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Component;
@@ -104,17 +106,17 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding
 
   private JTextField _seq = new JTextField();
 
-  private JLabel _strLabel = new JLabel(" Str:");
+  private JLabel _strLabel = new JLabel(MessageManager.getString("label.str"));
 
-  private JLabel _seqLabel = new JLabel(" Seq:");
+  private JLabel _seqLabel = new JLabel(MessageManager.getString("label.seq"));
 
-  private JButton _createButton = new JButton("Create");
+  private JButton _createButton = new JButton(MessageManager.getString("action.create"));
 
-  private JButton _updateButton = new JButton("Update");
+  private JButton _updateButton = new JButton(MessageManager.getString("action.update"));
 
-  private JButton _deleteButton = new JButton("Delete");
+  private JButton _deleteButton = new JButton(MessageManager.getString("action.delete"));
 
-  private JButton _duplicateButton = new JButton("Snapshot");
+  private JButton _duplicateButton = new JButton(MessageManager.getString("action.snapshot"));
 
   protected JPanel _listPanel = new JPanel();
 
@@ -339,7 +341,7 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding
     ops.add(_deleteButton);
     ops.add(_duplicateButton);
 
-    JLabel j = new JLabel("Structures Manager", JLabel.CENTER);
+    JLabel j = new JLabel(MessageManager.getString("label.structures_manager"), JLabel.CENTER);
     _listPanel.setLayout(new BorderLayout());
 
     // _listPanel.add(ops, BorderLayout.SOUTH);
index 6896863..bf0957e 100644 (file)
@@ -21,6 +21,7 @@ import javax.swing.JOptionPane;
 
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.SequenceI;
+import jalview.util.MessageManager;
 
 /**
  * GUI related routines for associating PDB files with sequences
@@ -54,9 +55,8 @@ public class AssociatePdbFileWithSeq
           reply = JOptionPane
                   .showInternalInputDialog(
                           Desktop.desktop,
-                          "Couldn't find a PDB id in the file supplied."
-                                  + "Please enter an Id to identify this structure.",
-                          "No PDB Id in File", JOptionPane.QUESTION_MESSAGE);
+                          MessageManager.getString("label.couldnt_find_pdb_id_in_file"),
+                          MessageManager.getString("label.no_pdb_id_in_file"), JOptionPane.QUESTION_MESSAGE);
         }
         if (reply == null)
         {
index 7b6567d..c0cfb78 100644 (file)
@@ -18,6 +18,8 @@
 package jalview.gui;
 
 import jalview.bin.Cache;
+import jalview.util.MessageManager;
+
 import java.awt.BorderLayout;
 import java.awt.Component;
 import java.awt.Dimension;
@@ -349,7 +351,7 @@ public class BlogReader extends JPanel
     java.util.Date earliest = null;
     try
     {
-      earliest = new SimpleDateFormat("YYYY-MM-DD").parse(chan
+      earliest = new SimpleDateFormat("YYYY-MM-DD",MessageManager.getLocale()).parse(chan
               .getHTTPLastModified());
     } catch (Exception x)
     {
@@ -435,7 +437,7 @@ public class BlogReader extends JPanel
     topBottomSplitPane.setBottomComponent(bottomPanel);
     JScrollPane spTextDescription = new JScrollPane(textDescription);
     textDescription.setText("");
-    statusBar.setText(" [Status] ");
+    statusBar.setText(MessageManager.getString("label.status"));
     buttonRefresh.addActionListener(new ActionListener()
     {
 
@@ -477,7 +479,7 @@ public class BlogReader extends JPanel
             _popupChannels);
     listItems.addMouseListener(popupAdapter);
     listItems.setCellRenderer(new ItemsRenderer());
-    lblChannels.setText("Channels");
+    lblChannels.setText(MessageManager.getString("label.channels"));
   }
 
   private void postInit()
@@ -811,8 +813,7 @@ class ChannelsRenderer extends DefaultListCellRenderer
     if (value instanceof Channel)
     {
       Channel channel = (Channel) value;
-      component.setText(channel.getTitle() + " ("
-              + channel.getUnreadItemCount() + ")");
+      component.setText(MessageManager.formatMessage("label.channel_title_item_count", new String[]{channel.getTitle(),Integer.valueOf(channel.getUnreadItemCount()).toString()}));
       component.setToolTipText(channel.getURL());
     }
     return component;
@@ -835,9 +836,7 @@ class ItemsRenderer extends DefaultListCellRenderer
       Item item = (Item) value;
       if (item.getPublishDate() != null)
       {
-        component.setText(DateFormat.getDateInstance().format(
-                item.getPublishDate())
-                + " " + item.getTitle());
+        component.setText(MessageManager.formatMessage("label.blog_item_published_on_date", new String[]{DateFormat.getDateInstance(DateFormat.LONG, MessageManager.getLocale()).format(item.getPublishDate()).toString(),item.getTitle()}));
       }
       component.setToolTipText(item.getLink());
       if (!item.isRead())
index 19526aa..965d010 100644 (file)
@@ -17,6 +17,8 @@
  */
 package jalview.gui;
 
+import jalview.util.MessageManager;
+
 import java.io.*;
 import java.awt.*;
 import java.awt.event.*;
@@ -91,7 +93,7 @@ public class Console extends WindowAdapter implements WindowListener,
     // textArea = cpt.getTextArea();
     textArea = new JTextArea();
     textArea.setEditable(false);
-    JButton button = new JButton("clear");
+    JButton button = new JButton(MessageManager.getString("action.clear"));
 
     // frame = cpt;
     frame.getContentPane().setLayout(new BorderLayout());
index ccb6c59..02b375f 100644 (file)
@@ -29,6 +29,7 @@ import javax.swing.event.HyperlinkEvent.EventType;
 
 import jalview.io.*;
 import jalview.jbgui.*;
+import jalview.util.MessageManager;
 
 /**
  * Cut'n'paste files into the desktop See JAL-1105
@@ -103,7 +104,7 @@ public class CutAndPasteHtmlTransfer extends GCutAndPasteHtmlTransfer
     this.viewport = viewport;
     if (viewport != null)
     {
-      ok.setText("Add");
+      ok.setText(MessageManager.getString("action.add"));
     }
 
     getContentPane().add(inputButtonPanel, java.awt.BorderLayout.SOUTH);
old mode 100755 (executable)
new mode 100644 (file)
index cb71128..2a555d0
@@ -25,6 +25,7 @@ import javax.swing.*;
 import jalview.datamodel.*;
 import jalview.io.*;
 import jalview.jbgui.*;
+import jalview.util.MessageManager;
 
 /**
  * Cut'n'paste files into the desktop See JAL-1105
@@ -57,7 +58,7 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer
     this.viewport = viewport;
     if (viewport != null)
     {
-      ok.setText("Add");
+      ok.setText(MessageManager.getString("action.add"));
     }
 
     getContentPane().add(inputButtonPanel, java.awt.BorderLayout.SOUTH);
@@ -176,8 +177,8 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer
       } catch (java.io.IOException ex)
       {
         JOptionPane.showInternalMessageDialog(Desktop.desktop,
-                "Couldn't read the pasted text.\n" + ex.toString(),
-                "Error parsing text", JOptionPane.WARNING_MESSAGE);
+                       MessageManager.formatMessage("label.couldnt_read_pasted_text", new String[]{ex.toString()}),
+                MessageManager.getString("label.error_parsing_text"), JOptionPane.WARNING_MESSAGE);
       }
     }
 
@@ -200,7 +201,7 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer
         af.currentFileFormat = format;
         Desktop.addInternalFrame(af, "Cut & Paste input - " + format,
                 AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
-        af.statusBar.setText("Successfully pasted alignment file");
+        af.statusBar.setText(MessageManager.getString("label.successfully_pasted_alignment_file"));
 
         try
         {
old mode 100755 (executable)
new mode 100644 (file)
index 3efde6a..293f9db
@@ -18,6 +18,7 @@
 package jalview.gui;
 
 import jalview.jbgui.GDasSourceBrowser;
+import jalview.util.MessageManager;
 import jalview.util.TableSorter;
 import jalview.ws.dbsources.das.api.DasSourceRegistryI;
 import jalview.ws.dbsources.das.api.jalviewSourceI;
@@ -170,8 +171,7 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
 
     if (nickName == null)
     {
-      fullDetails.setText(text + "Select a DAS service from the table"
-              + " to read a full description here.</font></html>");
+      fullDetails.setText(text + MessageManager.getString("label.select_das_service_from_table"));
       return;
     }
 
@@ -430,21 +430,21 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
 
     JTextField nametf = new JTextField(nickname, 40);
     JTextField urltf = new JTextField(url, 40);
-    JCheckBox seqs = new JCheckBox("Sequence Source");
+    JCheckBox seqs = new JCheckBox(MessageManager.getString("label.sequence_source"));
     seqs.setSelected(seqsrc);
     JPanel panel = new JPanel(new BorderLayout());
     JPanel pane12 = new JPanel(new BorderLayout());
-    pane12.add(new JLabel("Nickname: "), BorderLayout.CENTER);
+    pane12.add(new JLabel(MessageManager.getString("label.structure_manager")), BorderLayout.CENTER);
     pane12.add(nametf, BorderLayout.EAST);
     panel.add(pane12, BorderLayout.NORTH);
     pane12 = new JPanel(new BorderLayout());
-    pane12.add(new JLabel("URL: "), BorderLayout.NORTH);
+    pane12.add(new JLabel(MessageManager.getString("label.url")), BorderLayout.NORTH);
     pane12.add(seqs, BorderLayout.SOUTH);
     pane12.add(urltf, BorderLayout.EAST);
     panel.add(pane12, BorderLayout.SOUTH);
 
     int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop,
-            panel, "Enter Nickname & URL of Local DAS Source",
+            panel, MessageManager.getString("label.enter_local_das_source"),
             JOptionPane.OK_CANCEL_OPTION);
 
     if (reply != JOptionPane.OK_OPTION)
@@ -517,8 +517,8 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
     if (!sourceRegistry.getSource(nickname).isLocal())
     {
       JOptionPane.showInternalMessageDialog(Desktop.desktop,
-              "You can only edit or remove local DAS Sources!",
-              "Public DAS source - not editable",
+              MessageManager.getString("label.you_can_only_edit_or_remove_local_das_sources"),
+              MessageManager.getString("label.public_das_source"),
               JOptionPane.WARNING_MESSAGE);
       return;
     }
index 877aebb..f4d1885 100644 (file)
@@ -23,6 +23,7 @@ import jalview.io.FormatAdapter;
 import jalview.io.IdentifyFile;
 import jalview.io.JalviewFileChooser;
 import jalview.io.JalviewFileView;
+import jalview.util.MessageManager;
 import jalview.ws.params.ParamManager;
 
 import java.awt.BorderLayout;
@@ -647,8 +648,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     // A HEADLESS STATE WHEN NO DESKTOP EXISTS. MUST RETURN
     // IF JALVIEW IS RUNNING HEADLESS
     // ///////////////////////////////////////////////
-    if (System.getProperty("java.awt.headless") != null
-            && System.getProperty("java.awt.headless").equals("true"))
+    if (instance == null || (System.getProperty("java.awt.headless") != null
+            && System.getProperty("java.awt.headless").equals("true")))
     {
       return;
     }
@@ -943,7 +944,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
   {
     // This construct allows us to have a wider textfield
     // for viewing
-    JLabel label = new JLabel("Enter URL of Input File");
+    JLabel label = new JLabel(MessageManager.getString("label.input_file_url"));
     final JComboBox history = new JComboBox();
 
     JPanel panel = new JPanel(new GridLayout(2, 1));
@@ -968,7 +969,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     }
 
     int reply = JOptionPane.showInternalConfirmDialog(desktop, panel,
-            "Input Alignment From URL", JOptionPane.OK_CANCEL_OPTION);
+            MessageManager.getString("label.input_alignment_from_url"), JOptionPane.OK_CANCEL_OPTION);
 
     if (reply != JOptionPane.OK_OPTION)
     {
@@ -1721,8 +1722,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements
         if (!vamsasImport(chooser.getSelectedFile()))
         {
           JOptionPane.showInternalMessageDialog(Desktop.desktop,
-                  "Couldn't import '" + fle + "' as a new vamsas session.",
-                  "Vamsas Document Import Failed",
+                  MessageManager.formatMessage("label.couldnt_import_as_vamsas_session", new String[]{fle}),
+                  MessageManager.getString("label.vamsas_document_import_failed"),
                   JOptionPane.ERROR_MESSAGE);
         }
       }
@@ -1865,7 +1866,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
 
   protected void setupVamsasConnectedGui()
   {
-    vamsasStart.setText("Session Update");
+    vamsasStart.setText(MessageManager.getString("label.session_update"));
     vamsasSave.setVisible(true);
     vamsasStop.setVisible(true);
     vamsasImport.setVisible(false); // Document import to existing session is
@@ -1877,7 +1878,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     vamsasSave.setVisible(false);
     vamsasStop.setVisible(false);
     vamsasImport.setVisible(true);
-    vamsasStart.setText("New Vamsas Session");
+    vamsasStart.setText(MessageManager.getString("label.new_vamsas_session"));
   }
 
   public void vamsasStop_actionPerformed(ActionEvent e)
@@ -2136,9 +2137,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
         if (fm != null)
         {
           g.drawString(
-                  "Total Free Memory: " + df.format(totalFreeMemory)
-                          + "MB; Max Memory: " + df.format(maxMemory)
-                          + "MB; " + df.format(percentUsage) + "%", 10,
+                         MessageManager.formatMessage("label.memory_stats", new String[]{df.format(totalFreeMemory),df.format(maxMemory),df.format(percentUsage)}), 10,
                   getHeight() - fm.getHeight());
         }
       }
@@ -2161,7 +2160,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     if (jalview.bin.Cache.groovyJarsPresent())
     {
       groovyShell = new JMenuItem();
-      groovyShell.setText("Groovy Console...");
+      groovyShell.setText(MessageManager.getString("label.groovy_console"));
       groovyShell.addActionListener(new ActionListener()
       {
         public void actionPerformed(ActionEvent e)
@@ -2341,7 +2340,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     final JPanel progressPanel = (JPanel) progressBars.get(new Long(id));
     if (handler.canCancel())
     {
-      JButton cancel = new JButton("Cancel");
+      JButton cancel = new JButton(MessageManager.getString("action.cancel"));
       final IProgressIndicator us = this;
       cancel.addActionListener(new ActionListener()
       {
@@ -2436,7 +2435,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements
   {
     boolean alive = true;
     Thread t0 = null, t1 = null, t2 = null;
-
+    // JAL-940 - JALVIEW 1 services are now being EOLed as of JABA 2.1 release
+    if (true)
+    {
     // todo: changesupport handlers need to be transferred
     if (discoverer == null)
     {
@@ -2446,28 +2447,31 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     }
     // JAL-940 - disabled JWS1 service configuration - always start discoverer
     // until we phase out completely
-    if (true)
-    {
       (t0 = new Thread(discoverer)).start();
     }
 
-    try
+    // ENFIN services are EOLed as of Jalview 2.8.1 release
+    if (false)
     {
-      if (Cache.getDefault("SHOW_ENFIN_SERVICES", true))
+      try
       {
-        // EnfinEnvision web service menu entries are rebuild every time the
-        // menu is shown, so no changeSupport events are needed.
-        jalview.ws.EnfinEnvision2OneWay.getInstance();
-        (t1 = new Thread(jalview.ws.EnfinEnvision2OneWay.getInstance()))
-                .start();
+        if (Cache.getDefault("SHOW_ENFIN_SERVICES", true))
+        {
+          // EnfinEnvision web service menu entries are rebuild every time the
+          // menu is shown, so no changeSupport events are needed.
+          jalview.ws.EnfinEnvision2OneWay.getInstance();
+          (t1 = new Thread(jalview.ws.EnfinEnvision2OneWay.getInstance()))
+                  .start();
+        }
+      } catch (Exception e)
+      {
+        Cache.log
+                .info("Exception when trying to launch Envision2 workflow discovery.",
+                        e);
+        Cache.log.info(e.getStackTrace());
       }
-    } catch (Exception e)
-    {
-      Cache.log
-              .info("Exception when trying to launch Envision2 workflow discovery.",
-                      e);
-      Cache.log.info(e.getStackTrace());
     }
+
     if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
     {
       if (jalview.ws.jws2.Jws2Discoverer.getDiscoverer().isRunning())
old mode 100755 (executable)
new mode 100644 (file)
index 127e5cf..89e34f7
@@ -17,6 +17,8 @@
  */
 package jalview.gui;
 
+import jalview.util.MessageManager;
+
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
@@ -55,13 +57,13 @@ public class EPSOptions extends JPanel
   private void jbInit() throws Exception
   {
     lineart.setFont(JvSwingUtils.getLabelFont());
-    lineart.setText("Lineart");
+    lineart.setText(MessageManager.getString("label.lineart"));
     text.setFont(JvSwingUtils.getLabelFont());
-    text.setText("Text");
+    text.setText(MessageManager.getString("action.text"));
     text.setSelected(true);
     askAgain.setFont(JvSwingUtils.getLabelFont());
-    askAgain.setText("Don\'t ask me again");
-    ok.setText("OK");
+    askAgain.setText(MessageManager.getString("label.dont_ask_me_again"));
+    ok.setText(MessageManager.getString("action.ok"));
     ok.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -69,7 +71,7 @@ public class EPSOptions extends JPanel
         ok_actionPerformed(e);
       }
     });
-    cancel.setText("Cancel");
+    cancel.setText(MessageManager.getString("action.cancel"));
     cancel.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -78,7 +80,7 @@ public class EPSOptions extends JPanel
       }
     });
     jLabel1.setFont(JvSwingUtils.getLabelFont());
-    jLabel1.setText("Select EPS character rendering style");
+    jLabel1.setText(MessageManager.getString("label.select_eps_character_rendering_style"));
     this.setLayout(borderLayout1);
     jPanel3.setBorder(BorderFactory.createEtchedBorder());
     jPanel2.add(text);
index 18076e6..f3aefe4 100644 (file)
@@ -17,6 +17,8 @@
  */
 package jalview.gui;
 
+import jalview.util.MessageManager;
+
 import java.awt.*;
 import javax.swing.*;
 
@@ -24,9 +26,9 @@ public class EditNameDialog
 {
   JTextField id, description;
 
-  JButton ok = new JButton("Accept");
+  JButton ok = new JButton(MessageManager.getString("action.accept"));
 
-  JButton cancel = new JButton("Cancel");
+  JButton cancel = new JButton(MessageManager.getString("action.cancel"));
 
   boolean accept = false;
 
index 1fb53e4..0fc55e1 100644 (file)
@@ -27,6 +27,8 @@ import javax.swing.event.*;
 
 import jalview.datamodel.*;
 import jalview.schemes.*;
+import jalview.util.MessageManager;
+
 import java.awt.Dimension;
 
 public class FeatureColourChooser extends JalviewDialog
@@ -207,9 +209,9 @@ public class FeatureColourChooser extends JalviewDialog
       }
     });
     maxColour.setBorder(new LineBorder(Color.black));
-    minText.setText("Min:");
+    minText.setText(MessageManager.getString("label.min"));
     minText.setFont(JvSwingUtils.getLabelFont());
-    maxText.setText("Max:");
+    maxText.setText(MessageManager.getString("label.max"));
     maxText.setFont(JvSwingUtils.getLabelFont());
     this.setLayout(borderLayout1);
     jPanel2.setLayout(flowLayout1);
@@ -245,7 +247,7 @@ public class FeatureColourChooser extends JalviewDialog
     thresholdValue.setColumns(7);
     jPanel3.setBackground(Color.white);
     thresholdIsMin.setBackground(Color.white);
-    thresholdIsMin.setText("Threshold is Min/Max");
+    thresholdIsMin.setText(MessageManager.getString("label.threshold_minmax"));
     thresholdIsMin
             .setToolTipText("Toggle between absolute and relative display threshold.");
     thresholdIsMin.addActionListener(new ActionListener()
@@ -256,7 +258,7 @@ public class FeatureColourChooser extends JalviewDialog
       }
     });
     colourByLabel.setBackground(Color.white);
-    colourByLabel.setText("Colour by Label");
+    colourByLabel.setText(MessageManager.getString("label.colour_by_label"));
     colourByLabel
             .setToolTipText("Display features of the same type with a different label using a different colour. (e.g. domain features)");
     colourByLabel.addActionListener(new ActionListener()
old mode 100755 (executable)
new mode 100644 (file)
index cc2c048..587c12f
@@ -30,6 +30,7 @@ import javax.swing.*;
 
 import jalview.datamodel.*;
 import jalview.schemes.GraduatedColor;
+import jalview.util.MessageManager;
 
 /**
  * DOCUMENT ME!
@@ -1061,7 +1062,7 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer
     {
       panel = new JPanel(new GridLayout(4, 1));
       tmp = new JPanel();
-      tmp.add(new JLabel("Select Feature: "));
+      tmp.add(new JLabel(MessageManager.getString("label.select_feature")));
       overlaps = new JComboBox();
       for (int i = 0; i < features.length; i++)
       {
@@ -1111,17 +1112,17 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer
 
     tmp = new JPanel();
     panel.add(tmp);
-    tmp.add(new JLabel("Name: ", JLabel.RIGHT));
+    tmp.add(new JLabel(MessageManager.getString("label.name"), JLabel.RIGHT));
     tmp.add(name);
 
     tmp = new JPanel();
     panel.add(tmp);
-    tmp.add(new JLabel("Group: ", JLabel.RIGHT));
+    tmp.add(new JLabel(MessageManager.getString("label.group"), JLabel.RIGHT));
     tmp.add(source);
 
     tmp = new JPanel();
     panel.add(tmp);
-    tmp.add(new JLabel("Colour: ", JLabel.RIGHT));
+    tmp.add(new JLabel(MessageManager.getString("label.colour"), JLabel.RIGHT));
     tmp.add(colour);
     colour.setPreferredSize(new Dimension(150, 15));
     colour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 9));
@@ -1133,7 +1134,7 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer
     bigPanel.add(panel, BorderLayout.NORTH);
 
     panel = new JPanel();
-    panel.add(new JLabel("Description: ", JLabel.RIGHT));
+    panel.add(new JLabel(MessageManager.getString("label.description"), JLabel.RIGHT));
     description.setFont(JvSwingUtils.getTextAreaFont());
     description.setLineWrap(true);
     panel.add(new JScrollPane(description));
@@ -1143,9 +1144,9 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer
       bigPanel.add(panel, BorderLayout.SOUTH);
 
       panel = new JPanel();
-      panel.add(new JLabel(" Start:", JLabel.RIGHT));
+      panel.add(new JLabel(MessageManager.getString("label.start"), JLabel.RIGHT));
       panel.add(start);
-      panel.add(new JLabel("  End:", JLabel.RIGHT));
+      panel.add(new JLabel(MessageManager.getString("label.end"), JLabel.RIGHT));
       panel.add(end);
       bigPanel.add(panel, BorderLayout.CENTER);
     }
old mode 100755 (executable)
new mode 100644 (file)
index 3ce17e2..106ced9
@@ -37,6 +37,7 @@ import jalview.datamodel.*;
 import jalview.io.*;
 import jalview.schemes.AnnotationColourGradient;
 import jalview.schemes.GraduatedColor;
+import jalview.util.MessageManager;
 import jalview.ws.dbsources.das.api.jalviewSourceI;
 
 public class FeatureSettings extends JPanel
@@ -905,7 +906,7 @@ public class FeatureSettings extends JPanel
     dasSettingsPane.setLayout(borderLayout3);
     bigPanel.setLayout(borderLayout4);
     invert.setFont(JvSwingUtils.getLabelFont());
-    invert.setText("Invert Selection");
+    invert.setText(MessageManager.getString("label.invert_selection"));
     invert.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -914,7 +915,7 @@ public class FeatureSettings extends JPanel
       }
     });
     optimizeOrder.setFont(JvSwingUtils.getLabelFont());
-    optimizeOrder.setText("Optimise Order");
+    optimizeOrder.setText(MessageManager.getString("label.optimise_order"));
     optimizeOrder.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -923,7 +924,7 @@ public class FeatureSettings extends JPanel
       }
     });
     sortByScore.setFont(JvSwingUtils.getLabelFont());
-    sortByScore.setText("Seq sort by Score");
+    sortByScore.setText(MessageManager.getString("label.seq_sort_by_score"));
     sortByScore.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -941,7 +942,7 @@ public class FeatureSettings extends JPanel
       }
     });
     cancel.setFont(JvSwingUtils.getLabelFont());
-    cancel.setText("Cancel");
+    cancel.setText(MessageManager.getString("action.cancel"));
     cancel.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -951,7 +952,7 @@ public class FeatureSettings extends JPanel
       }
     });
     ok.setFont(JvSwingUtils.getLabelFont());
-    ok.setText("OK");
+    ok.setText(MessageManager.getString("action.ok"));
     ok.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -960,7 +961,7 @@ public class FeatureSettings extends JPanel
       }
     });
     loadColours.setFont(JvSwingUtils.getLabelFont());
-    loadColours.setText("Load Colours");
+    loadColours.setText(MessageManager.getString("label.load_colours"));
     loadColours.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -969,7 +970,7 @@ public class FeatureSettings extends JPanel
       }
     });
     saveColours.setFont(JvSwingUtils.getLabelFont());
-    saveColours.setText("Save Colours");
+    saveColours.setText(MessageManager.getString("label.save_colours"));
     saveColours.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -987,7 +988,7 @@ public class FeatureSettings extends JPanel
     });
 
     transparency.setMaximum(70);
-    fetchDAS.setText("Fetch DAS Features");
+    fetchDAS.setText(MessageManager.getString("label.fetch_das_features"));
     fetchDAS.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -995,7 +996,7 @@ public class FeatureSettings extends JPanel
         fetchDAS_actionPerformed(e);
       }
     });
-    saveDAS.setText("Save as default");
+    saveDAS.setText(MessageManager.getString("action.save_as_default"));
     saveDAS.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -1006,7 +1007,7 @@ public class FeatureSettings extends JPanel
     dasButtonPanel.setBorder(BorderFactory.createEtchedBorder());
     dasSettingsPane.setBorder(null);
     cancelDAS.setEnabled(false);
-    cancelDAS.setText("Cancel Fetch");
+    cancelDAS.setText(MessageManager.getString("action.cancel_fetch"));
     cancelDAS.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -1311,9 +1312,8 @@ public class FeatureSettings extends JPanel
   {
     complete();
     JOptionPane.showInternalConfirmDialog(Desktop.desktop,
-            "No das sources were selected.\n"
-                    + "Please select some sources and\n" + " try again.",
-            "No Sources Selected", JOptionPane.DEFAULT_OPTION,
+            MessageManager.getString("label.no_das_sources_selected_warn"),
+            MessageManager.getString("label.no_das_sources_selected_title"), JOptionPane.DEFAULT_OPTION,
             JOptionPane.INFORMATION_MESSAGE);
   }
 
@@ -1593,7 +1593,7 @@ class FeatureIcon implements Icon
       // width/g.getFontMetrics().stringWidth("Label"),
       // height/g.getFontMetrics().getHeight())));
 
-      g.drawString("Label", 0, 0);
+      g.drawString(MessageManager.getString("label.label"), 0, 0);
 
     }
     else
index 069c1f9..f63f74f 100755 (executable)
 package jalview.gui;
 
 import java.util.*;
-
 import java.awt.event.*;
+
 import javax.swing.*;
 
 import jalview.datamodel.*;
 import jalview.jbgui.*;
+import jalview.util.MessageManager;
 
 /**
  * DOCUMENT ME!
@@ -235,7 +236,7 @@ public class Finder extends GFinder
     // 'SelectRegion' selection
     if (!haveResults)
     {
-      JOptionPane.showInternalMessageDialog(this, "Finished searching",
+      JOptionPane.showInternalMessageDialog(this, MessageManager.getString("label.finished_searching"),
               null, JOptionPane.INFORMATION_MESSAGE);
       resIndex = -1;
       seqIndex = 0;
index d954b76..e747055 100644 (file)
@@ -18,6 +18,7 @@
 package jalview.gui;
 
 import jalview.bin.Cache;
+import jalview.util.MessageManager;
 import jalview.ws.seqfetcher.DbSourceProxy;
 
 import java.awt.BorderLayout;
@@ -58,7 +59,7 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener
 
   JButton getDatabaseSelectorButton()
   {
-    final JButton viewdbs = new JButton("--- Select Database ---");
+    final JButton viewdbs = new JButton(MessageManager.getString("action.select_ddbb"));
     viewdbs.addActionListener(new ActionListener()
     {
 
@@ -405,23 +406,17 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener
 
     if (allowMultiSelections)
     {
-      dbstatus.setText("Selected "
-              + srcs.size()
-              + " database"
-              + (srcs.size() == 1 ? "" : "s")
-              + " to fetch from"
-              + (srcs.size() > 0 ? " with " + x + " test quer"
-                      + (x == 1 ? "y" : "ies") : "."));
+      dbstatus.setText(MessageManager.formatMessage("label.selected_database_to_fetch_from", new String[]{Integer.valueOf(srcs.size()).toString(),(srcs.size() == 1 ? "" : "s"),(srcs.size() > 0 ? " with " + x + " test quer" + (x == 1 ? "y" : "ies") : ".")}));
       dbstatex.setText(" ");
     }
     else
     {
       if (nm.length() > 0)
       {
-        dbstatus.setText("Database: " + nm);
+        dbstatus.setText(MessageManager.formatMessage("label.database_param",new String[]{nm}));
         if (qr.length() > 0)
         {
-          dbstatex.setText("Example: " + qr);
+          dbstatex.setText(MessageManager.formatMessage("label.example_param", new String[]{qr}));
         }
         else
         {
index e88b190..45e8102 100644 (file)
@@ -429,7 +429,7 @@ public class Jalview2XML
     object.setVamsasModel(new jalview.schemabinding.version2.VamsasModel());
 
     object.setCreationDate(new java.util.Date(System.currentTimeMillis()));
-    object.setVersion(jalview.bin.Cache.getProperty("VERSION"));
+    object.setVersion(jalview.bin.Cache.getDefault("VERSION","Development Build"));
 
     jalview.datamodel.AlignmentI jal = av.getAlignment();
 
@@ -1069,6 +1069,8 @@ public class Jalview2XML
 
       ac.setMaxColour(acg.getMaxColour().getRGB());
       ac.setMinColour(acg.getMinColour().getRGB());
+      ac.setPerSequence(acg.isSeqAssociated());
+      ac.setPredefinedColours(acg.isPredefinedColours());
       view.setAnnotationColours(ac);
       view.setBgColour("AnnotationColourGradient");
     }
@@ -3238,7 +3240,14 @@ public class Jalview2XML
                                 .getAnnotationColours().getColourScheme()),
                         view.getAnnotationColours().getAboveThreshold());
               }
-
+              if (view.getAnnotationColours().hasPerSequence())
+              {
+                ((AnnotationColourGradient)cs).setSeqAssociated(view.getAnnotationColours().isPerSequence());
+              }
+              if (view.getAnnotationColours().hasPredefinedColours())
+              {
+                ((AnnotationColourGradient)cs).setPredefinedColours(view.getAnnotationColours().isPredefinedColours());
+              }
               // Also use these settings for all the groups
               if (al.getGroups() != null)
               {
@@ -3268,6 +3277,17 @@ public class Jalview2XML
                             .getAlignment().getAlignmentAnnotation()[i],
                             sg.cs, view.getAnnotationColours()
                                     .getAboveThreshold());
+                    if (cs instanceof AnnotationColourGradient) 
+                    {
+                      if (view.getAnnotationColours().hasPerSequence())
+                      { 
+                        ((AnnotationColourGradient)cs).setSeqAssociated(view.getAnnotationColours().isPerSequence());
+                      }
+                      if (view.getAnnotationColours().hasPredefinedColours())
+                      {
+                        ((AnnotationColourGradient)cs).setPredefinedColours(view.getAnnotationColours().isPredefinedColours());
+                      }
+                    }
                   }
 
                 }
@@ -3467,6 +3487,7 @@ public class Jalview2XML
             view.getHeight());
     af.alignPanel.updateAnnotation(false, true); // recompute any autoannotation
     reorderAutoannotation(af, al, autoAlan);
+    af.alignPanel.alignmentChanged();
     return af;
   }
 
index 639b9b2..3b6678d 100755 (executable)
@@ -26,6 +26,7 @@ import javax.swing.*;
 import org.exolab.castor.xml.*;
 import jalview.binding.*;
 import jalview.schemes.*;
+import jalview.util.MessageManager;
 import jalview.util.jarInputStreamProvider;
 
 /**
@@ -135,7 +136,8 @@ public class Jalview2XML_V1
             System.err.println("Couldn't locate Jalview XML file : " + ex
                     + "\n");
             JOptionPane.showInternalMessageDialog(Desktop.desktop,
-                    "Couldn't locate " + file, "URL not found",
+                       MessageManager.formatMessage("label.couldnt_locate", new String[]{file}),
+                    MessageManager.getString("label.url_not_found"),
                     JOptionPane.WARNING_MESSAGE);
           }
         });
index a74c435..7356f3a 100644 (file)
@@ -17,6 +17,8 @@
  */
 package jalview.gui;
 
+import jalview.util.MessageManager;
+
 import java.awt.Container;
 import java.awt.Rectangle;
 import java.awt.event.ActionEvent;
@@ -87,7 +89,7 @@ public abstract class JalviewDialog extends JPanel
     this.block = block;
 
     ok.setOpaque(false);
-    ok.setText("OK");
+    ok.setText(MessageManager.getString("action.ok"));
     ok.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -97,7 +99,7 @@ public abstract class JalviewDialog extends JPanel
       }
     });
     cancel.setOpaque(false);
-    cancel.setText("Cancel");
+    cancel.setText(MessageManager.getString("action.cancel"));
     cancel.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent e)
old mode 100755 (executable)
new mode 100644 (file)
index d2a6426..663c262
@@ -26,6 +26,7 @@ import javax.swing.*;
 
 import jalview.datamodel.*;
 import jalview.jbgui.*;
+import jalview.util.MessageManager;
 import jalview.viewmodel.PCAModel;
 
 /**
@@ -624,7 +625,7 @@ public class PCAPanel extends GPCAPanel implements Runnable,
     final JPanel progressPanel = (JPanel) progressBars.get(new Long(id));
     if (handler.canCancel())
     {
-      JButton cancel = new JButton("Cancel");
+      JButton cancel = new JButton(MessageManager.getString("action.cancel"));
       final IProgressIndicator us = this;
       cancel.addActionListener(new ActionListener()
       {
index 1a367c5..3bc7c5c 100644 (file)
@@ -89,7 +89,7 @@ public class PopupMenu extends JPopupMenu
   JMenuItem sequenceSelDetails = new JMenuItem();
 
   SequenceI sequence;
-
+  JMenuItem createGroupMenuItem = new JMenuItem();
   JMenuItem unGroupMenuItem = new JMenuItem();
 
   JMenuItem outline = new JMenuItem();
@@ -392,9 +392,10 @@ public class PopupMenu extends JPopupMenu
     }
 
     SequenceGroup sg = ap.av.getSelectionGroup();
+    boolean isDefinedGroup = (sg!=null) ? ap.av.getAlignment().getGroups().contains(sg) : false;
 
     if (sg != null && sg.getSize() > 0)
-    {
+    {      
       groupName.setText("Name: " + sg.getName());
       groupName.setText("Edit name and description of current group.");
 
@@ -520,9 +521,15 @@ public class PopupMenu extends JPopupMenu
       editMenu.setVisible(false);
     }
 
-    if (!ap.av.getAlignment().getGroups().contains(sg))
+    if (!isDefinedGroup)
     {
+      createGroupMenuItem.setVisible(true);
       unGroupMenuItem.setVisible(false);
+      jMenu1.setText("Edit New Group");
+    } else {
+      createGroupMenuItem.setVisible(false);
+      unGroupMenuItem.setVisible(true);
+      jMenu1.setText("Edit Group");
     }
 
     if (seq == null)
@@ -935,6 +942,14 @@ public class PopupMenu extends JPopupMenu
         unGroupMenuItem_actionPerformed();
       }
     });
+    createGroupMenuItem.setText("Create Group");
+    createGroupMenuItem.addActionListener(new java.awt.event.ActionListener()
+    {
+      public void actionPerformed(ActionEvent e)
+      {
+        createGroupMenuItem_actionPerformed();
+      }
+    });
 
     outline.setText("Border colour");
     outline.addActionListener(new java.awt.event.ActionListener()
@@ -1097,6 +1112,8 @@ public class PopupMenu extends JPopupMenu
     groupMenu.add(editMenu);
     groupMenu.add(outputMenu);
     groupMenu.add(sequenceFeature);
+    groupMenu.add(createGroupMenuItem);
+    groupMenu.add(unGroupMenuItem);
     groupMenu.add(jMenu1);
     sequenceMenu.add(sequenceName);
     sequenceMenu.add(sequenceDetails);
@@ -1153,7 +1170,6 @@ public class PopupMenu extends JPopupMenu
     pdbMenu.add(enterPDB);
     pdbMenu.add(discoverPDB);
     jMenu1.add(groupName);
-    jMenu1.add(unGroupMenuItem);
     jMenu1.add(colourMenu);
     jMenu1.add(showBoxes);
     jMenu1.add(showText);
@@ -1626,7 +1642,7 @@ public class PopupMenu extends JPopupMenu
             sequence.getAnnotation()[0], null,
             AnnotationColourGradient.NO_THRESHOLD);
 
-    acg.predefinedColours = true;
+    acg.setPredefinedColours(true);
     sg.cs = acg;
 
     refresh();
@@ -1726,6 +1742,11 @@ public class PopupMenu extends JPopupMenu
     ap.av.setSelectionGroup(null);
     refresh();
   }
+  void createGroupMenuItem_actionPerformed()
+  {
+    getGroup(); // implicitly creates group - note - should apply defaults / use standard alignment window logic for this
+    refresh();
+  }
 
   /**
    * DOCUMENT ME!
index a0fa216..f8932d1 100755 (executable)
@@ -28,6 +28,7 @@ import jalview.bin.*;
 import jalview.io.*;
 import jalview.jbgui.*;
 import jalview.schemes.*;
+import jalview.util.MessageManager;
 
 /**
  * DOCUMENT ME!
@@ -553,7 +554,7 @@ public class Preferences extends GPreferences
     while (!valid)
     {
       if (JOptionPane.showInternalConfirmDialog(Desktop.desktop, link,
-              "New sequence URL link", JOptionPane.OK_CANCEL_OPTION, -1,
+              MessageManager.getString("label.new_sequence_url_link"), JOptionPane.OK_CANCEL_OPTION, -1,
               null) == JOptionPane.OK_OPTION)
       {
         if (link.checkValid())
@@ -579,7 +580,7 @@ public class Preferences extends GPreferences
     if (index == -1)
     {
       JOptionPane.showInternalMessageDialog(Desktop.desktop,
-              "No link selected!", "No link selected",
+              MessageManager.getString("label.no_link_selected"), MessageManager.getString("label.no_link_selected"),
               JOptionPane.WARNING_MESSAGE);
       return;
     }
@@ -592,7 +593,7 @@ public class Preferences extends GPreferences
     {
 
       if (JOptionPane.showInternalConfirmDialog(Desktop.desktop, link,
-              "New sequence URL link", JOptionPane.OK_CANCEL_OPTION, -1,
+              MessageManager.getString("label.new_sequence_url_link"), JOptionPane.OK_CANCEL_OPTION, -1,
               null) == JOptionPane.OK_OPTION)
       {
         if (link.checkValid())
@@ -617,7 +618,7 @@ public class Preferences extends GPreferences
     if (index == -1)
     {
       JOptionPane.showInternalMessageDialog(Desktop.desktop,
-              "No link selected!", "No link selected",
+              MessageManager.getString("label.no_link_selected"), MessageManager.getString("label.no_link_selected"),
               JOptionPane.WARNING_MESSAGE);
       return;
     }
index 9f9f39c..91eb991 100755 (executable)
 package jalview.gui;
 
 import java.util.*;
-
 import java.awt.*;
 import java.awt.event.*;
+
 import javax.swing.*;
 
 import jalview.api.RotatableCanvasI;
 import jalview.datamodel.*;
 import jalview.math.*;
+import jalview.util.MessageManager;
 
 /**
  * DOCUMENT ME!
@@ -369,7 +370,7 @@ public class RotatableCanvas extends JPanel implements MouseListener,
     if (points == null)
     {
       g.setFont(new Font("Verdana", Font.PLAIN, 18));
-      g.drawString("Calculating PCA....", 20, getHeight() / 2);
+      g.drawString(MessageManager.getString("label.calculating_pca")+ "....", 20, getHeight() / 2);
     }
     else
     {
index 89d315c..abd41c0 100755 (executable)
@@ -19,9 +19,11 @@ package jalview.gui;
 
 import java.awt.*;
 import java.awt.event.*;
+
 import javax.swing.*;
 
 import jalview.datamodel.*;
+import jalview.util.MessageManager;
 
 /**
  * DOCUMENT ME!
@@ -503,7 +505,7 @@ public class ScalePanel extends JPanel implements MouseMotionListener,
 
       if (reveal != null && reveal[0] > startx && reveal[0] < endx)
       {
-        gg.drawString("Reveal Columns", reveal[0] * av.charWidth, 0);
+        gg.drawString(MessageManager.getString("label.reveal_columns"), reveal[0] * av.charWidth, 0);
       }
     }
 
index 86c52b3..c71b154 100644 (file)
@@ -31,6 +31,7 @@ import jalview.datamodel.*;
 import jalview.io.SequenceAnnotationReport;
 import jalview.schemes.*;
 import jalview.structure.*;
+import jalview.util.MessageManager;
 
 /**
  * DOCUMENT ME!
@@ -129,8 +130,7 @@ public class SeqPanel extends JPanel implements MouseListener,
       addMouseMotionListener(this);
       addMouseListener(this);
       addMouseWheelListener(this);
-      ssm = StructureSelectionManager
-              .getStructureSelectionManager(Desktop.instance);
+      ssm = av.getStructureSelectionManager();
       ssm.addStructureViewerListener(this);
       ssm.addSelectionListener(this);
     }
@@ -1431,8 +1431,8 @@ public class SeqPanel extends JPanel implements MouseListener,
     if (av.wrapAlignment && seq > av.getAlignment().getHeight())
     {
       JOptionPane.showInternalMessageDialog(Desktop.desktop,
-              "Cannot edit annotations in wrapped view.",
-              "Wrapped view - no edit", JOptionPane.WARNING_MESSAGE);
+              MessageManager.getString("label.cannot_edit_annotations_in_wrapped_view"),
+              MessageManager.getString("label.wrapped_view_no_edit"), JOptionPane.WARNING_MESSAGE);
       return;
     }
 
index faebb1a..c069adb 100755 (executable)
@@ -31,6 +31,7 @@ import com.stevesoft.pat.Regex;
 import jalview.datamodel.*;
 import jalview.io.*;
 import jalview.util.DBRefUtils;
+import jalview.util.MessageManager;
 import jalview.ws.dbsources.das.api.DasSourceRegistryI;
 import jalview.ws.seqfetcher.DbSourceProxy;
 import java.awt.BorderLayout;
@@ -843,7 +844,7 @@ public class SequenceFetcher extends JPanel implements Runnable
       public void run()
       {
         JOptionPane.showInternalMessageDialog(Desktop.desktop, error,
-                "Error Retrieving Data", JOptionPane.WARNING_MESSAGE);
+                MessageManager.getString("label.error_retrieving_data"), JOptionPane.WARNING_MESSAGE);
       }
     });
   }
index d1003e5..09708da 100755 (executable)
@@ -608,7 +608,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
 
     if (tree == null)
     {
-      g.drawString("Calculating tree....", 20, getHeight() / 2);
+      g.drawString(MessageManager.getString("label.calculating_tree") + "....", 20, getHeight() / 2);
     }
     else
     {
@@ -852,7 +852,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
         {
           aps[a].av.setSelectionGroup(null);
           aps[a].av.getAlignment().deleteAllGroups();
-          aps[a].av.sequenceColours = null;
+          aps[a].av.clearSequenceColours();
         }
         colourGroups();
       }
index 60c45c5..a104ad9 100755 (executable)
@@ -23,6 +23,7 @@ import jalview.jbgui.GUserDefinedColours;
 import jalview.schemes.ColourSchemeI;
 import jalview.schemes.ResidueProperties;
 import jalview.schemes.UserColourScheme;
+import jalview.util.MessageManager;
 
 import java.awt.Color;
 import java.awt.Font;
@@ -710,8 +711,8 @@ public class UserDefinedColours extends GUserDefinedColours implements
     if (schemeName.getText().trim().length() < 1)
     {
       JOptionPane.showInternalMessageDialog(Desktop.desktop,
-              "User colour scheme must have a name!",
-              "No name for colour scheme", JOptionPane.WARNING_MESSAGE);
+              MessageManager.getString("label.user_colour_scheme_must_have_name"),
+              MessageManager.getString("label.no_name_colour_scheme"), JOptionPane.WARNING_MESSAGE);
       return;
     }
 
@@ -720,10 +721,8 @@ public class UserDefinedColours extends GUserDefinedColours implements
     {
       int reply = JOptionPane.showInternalConfirmDialog(
               Desktop.desktop,
-              "Colour scheme " + schemeName.getText() + " exists."
-                      + "\nContinue saving colour scheme as "
-                      + schemeName.getText() + "?",
-              "Duplicate scheme name", JOptionPane.YES_NO_OPTION);
+              MessageManager.formatMessage("label.colour_scheme_exists_overwrite", new String[]{schemeName.getText(),schemeName.getText()}),
+              MessageManager.getString("label.duplicate_scheme_name"), JOptionPane.YES_NO_OPTION);
       if (reply != JOptionPane.YES_OPTION)
       {
         return;
index a232987..92dd354 100644 (file)
@@ -17,6 +17,8 @@
  */
 package jalview.gui;
 
+import jalview.util.MessageManager;
+
 import java.io.*;
 import java.net.*;
 
@@ -137,9 +139,8 @@ public class UserQuestionnaireCheck implements Runnable
         jalview.bin.Cache.log.info("Prompting user for questionnaire at "
                 + qurl);
         int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop,
-                "There is a new Questionnaire available."
-                        + "Would you like to complete it now ?\n",
-                "Jalview User Survey", JOptionPane.YES_NO_OPTION,
+                MessageManager.getString("label.jalview_new_questionnaire"),
+                MessageManager.getString("label.jalview_user_survey"), JOptionPane.YES_NO_OPTION,
                 JOptionPane.QUESTION_MESSAGE);
 
         if (reply == JOptionPane.YES_OPTION)
old mode 100755 (executable)
new mode 100644 (file)
index c44e041..ea2bacb
@@ -29,6 +29,7 @@ import javax.swing.text.html.HTMLEditorKit;
 import javax.swing.text.html.StyleSheet;
 
 import jalview.jbgui.*;
+import jalview.util.MessageManager;
 import jalview.ws.WSClientI;
 
 /**
@@ -766,32 +767,32 @@ public class WebserviceInfo extends GWebserviceInfo implements
       switch (currentStatus)
       {
       case STATE_QUEUING:
-        g.drawString(title.concat(" - queuing"), 60, 30);
+        g.drawString(title.concat(" - ").concat(MessageManager.getString("label.state_queueing")), 60, 30);
 
         break;
 
       case STATE_RUNNING:
-        g.drawString(title.concat(" - running"), 60, 30);
+        g.drawString(title.concat(" - ").concat(MessageManager.getString("label.state_running")), 60, 30);
 
         break;
 
       case STATE_STOPPED_OK:
-        g.drawString(title.concat(" - complete"), 60, 30);
+        g.drawString(title.concat(" - ").concat(MessageManager.getString("label.state_completed")), 60, 30);
 
         break;
 
       case STATE_CANCELLED_OK:
-        g.drawString(title.concat(" - job cancelled!"), 60, 30);
+        g.drawString(title.concat(" - ").concat(MessageManager.getString("label.state_job_cancelled")), 60, 30);
 
         break;
 
       case STATE_STOPPED_ERROR:
-        g.drawString(title.concat(" - job error!"), 60, 30);
+        g.drawString(title.concat(" - ").concat(MessageManager.getString("label.state_job_error")), 60, 30);
 
         break;
 
       case STATE_STOPPED_SERVERERROR:
-        g.drawString(title.concat(" - Server Error! (try later)"), 60, 30);
+        g.drawString(title.concat(" - ").concat(MessageManager.getString("label.server_error_try_later")), 60, 30);
 
         break;
       }
@@ -895,7 +896,7 @@ public class WebserviceInfo extends GWebserviceInfo implements
     final JPanel progressPanel = (JPanel) progressBars.get(new Long(id));
     if (handler.canCancel())
     {
-      JButton cancel = new JButton("Cancel");
+      JButton cancel = new JButton(MessageManager.getString("action.cancel"));
       final IProgressIndicator us = this;
       cancel.addActionListener(new ActionListener()
       {
index 77f3155..4f222bf 100644 (file)
@@ -19,6 +19,7 @@ package jalview.gui;
 
 import jalview.gui.OptsAndParamsPage.OptionBox;
 import jalview.gui.OptsAndParamsPage.ParamBox;
+import jalview.util.MessageManager;
 import jalview.ws.jws2.JabaParamStore;
 import jalview.ws.jws2.JabaPreset;
 import jalview.ws.jws2.Jws2Discoverer;
@@ -337,7 +338,7 @@ public class WsJobParameters extends JPanel implements ItemListener,
     GridBagLayout gbl = new GridBagLayout();
     SetNamePanel.setLayout(gbl);
 
-    JLabel setNameLabel = new JLabel("Current parameter set name :");
+    JLabel setNameLabel = new JLabel(MessageManager.getString("label.current_parameter_set_name"));
     setNameLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
 
     setNameInfo.add(setNameLabel);
index 6be5d44..744cd8f 100644 (file)
@@ -19,6 +19,7 @@ package jalview.gui;
 
 import jalview.bin.Cache;
 import jalview.jbgui.GWsPreferences;
+import jalview.util.MessageManager;
 import jalview.ws.jws2.Jws2Discoverer;
 import jalview.ws.rest.RestServiceDescription;
 
@@ -445,7 +446,7 @@ public class WsPreferences extends GWsPreferences
     JTextField urltf = new JTextField(url, 40);
     JPanel panel = new JPanel(new BorderLayout());
     JPanel pane12 = new JPanel(new BorderLayout());
-    pane12.add(new JLabel("URL: "), BorderLayout.CENTER);
+    pane12.add(new JLabel(MessageManager.getString("label.url")), BorderLayout.CENTER);
     pane12.add(urltf, BorderLayout.EAST);
     panel.add(pane12, BorderLayout.NORTH);
     boolean valid = false;
@@ -471,7 +472,7 @@ public class WsPreferences extends GWsPreferences
       {
         valid = false;
         JOptionPane.showInternalMessageDialog(Desktop.desktop,
-                "Invalid URL !");
+                MessageManager.getString("label.invalid_url"));
       }
     }
     if (valid && resp == JOptionPane.OK_OPTION)
index 6f07b69..a8c60fd 100755 (executable)
@@ -23,6 +23,7 @@ import javax.swing.*;
 
 import jalview.datamodel.*;
 import jalview.gui.*;
+import jalview.util.MessageManager;
 
 public class FileLoader implements Runnable
 {
@@ -356,7 +357,7 @@ public class FileLoader implements Runnable
               public void run()
               {
                 JOptionPane.showInternalMessageDialog(Desktop.desktop,
-                        errorMessage, "Error loading file",
+                        errorMessage, MessageManager.getString("label.error_loading_file"),
                         JOptionPane.WARNING_MESSAGE);
               }
             });
@@ -381,8 +382,8 @@ public class FileLoader implements Runnable
           public void run()
           {
             javax.swing.JOptionPane.showInternalMessageDialog(
-                    Desktop.desktop, "Encountered problems opening " + file
-                            + "!!", "File open error",
+                    Desktop.desktop, MessageManager.formatMessage("label.problems_opening_file", new String[]{file}),
+                    MessageManager.getString("label.file_open_error"),
                     javax.swing.JOptionPane.WARNING_MESSAGE);
           }
         });
index b523763..f070c84 100755 (executable)
@@ -18,6 +18,7 @@
 package jalview.jbgui;
 
 import jalview.schemes.ColourSchemeProperty;
+import jalview.util.MessageManager;
 
 import java.awt.BorderLayout;
 import java.awt.Color;
@@ -181,6 +182,9 @@ public class GAlignFrame extends JInternalFrame
   public JCheckBoxMenuItem showSeqFeaturesHeight = new JCheckBoxMenuItem();
 
   JMenuItem deleteGroups = new JMenuItem();
+  
+  JMenuItem createGroup = new JMenuItem();
+  JMenuItem unGroup = new JMenuItem();
 
   JMenuItem delete = new JMenuItem();
 
@@ -404,8 +408,8 @@ public class GAlignFrame extends JInternalFrame
 
               int option = JOptionPane.showInternalConfirmDialog(
                       jalview.gui.Desktop.desktop,
-                      "Remove from default list?",
-                      "Remove user defined colour",
+                      MessageManager.getString("label.remove_from_default_list"),
+                      MessageManager.getString("label.remove_user_defined_colour"),
                       JOptionPane.YES_NO_OPTION);
               if (option == JOptionPane.YES_OPTION)
               {
@@ -617,7 +621,7 @@ public class GAlignFrame extends JInternalFrame
                 invertSequenceMenuItem_actionPerformed(e);
               }
             });
-    grpsFromSelection.setText("Make Groups for selection");
+    grpsFromSelection.setText("Make Groups For Selection");
     grpsFromSelection.addActionListener(new java.awt.event.ActionListener()
     {
       public void actionPerformed(ActionEvent e)
@@ -1199,6 +1203,28 @@ public class GAlignFrame extends JInternalFrame
         deleteGroups_actionPerformed(e);
       }
     });
+    createGroup.setText("Create group");
+    createGroup.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
+            java.awt.event.KeyEvent.VK_G, Toolkit.getDefaultToolkit()
+                    .getMenuShortcutKeyMask(), false));
+    createGroup.addActionListener(new java.awt.event.ActionListener()
+    {
+      public void actionPerformed(ActionEvent e)
+      {
+        createGroup_actionPerformed(e);
+      }
+    });
+    unGroup.setText("Remove Group");
+    unGroup.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
+            java.awt.event.KeyEvent.VK_G,Toolkit.getDefaultToolkit()
+                    .getMenuShortcutKeyMask() | java.awt.event.KeyEvent.SHIFT_MASK, false));
+    unGroup.addActionListener(new java.awt.event.ActionListener()
+    {
+      public void actionPerformed(ActionEvent e)
+      {
+        unGroup_actionPerformed(e);
+      }
+    });
     copy.setText("Copy");
     copy.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
             java.awt.event.KeyEvent.VK_C, Toolkit.getDefaultToolkit()
@@ -1946,8 +1972,10 @@ public class GAlignFrame extends JInternalFrame
     selectMenu.add(deselectAllSequenceMenuItem);
     selectMenu.add(invertSequenceMenuItem);
     selectMenu.add(invertColSel);
-    selectMenu.add(deleteGroups);
+    selectMenu.add(createGroup);
+    selectMenu.add(unGroup);
     selectMenu.add(grpsFromSelection);
+    selectMenu.add(deleteGroups);
     // TODO - determine if the listenToViewSelections button is needed : see bug
     // JAL-574
     // selectMenu.addSeparator();
@@ -2307,6 +2335,14 @@ public class GAlignFrame extends JInternalFrame
   protected void deleteGroups_actionPerformed(ActionEvent e)
   {
   }
+  
+  protected void createGroup_actionPerformed(ActionEvent e)
+  {
+  }
+  
+  protected void unGroup_actionPerformed(ActionEvent e)
+  {
+  }
 
   protected void copy_actionPerformed(ActionEvent e)
   {
index a403088..92747b5 100644 (file)
@@ -18,6 +18,7 @@
 package jalview.jbgui;
 
 import jalview.gui.JvSwingUtils;
+import jalview.util.MessageManager;
 
 import java.awt.BorderLayout;
 import java.awt.event.ActionEvent;
@@ -106,14 +107,14 @@ public class GRestServiceEditorPane extends JPanel
     name = new JTextArea(1, 12);
 
     JvSwingUtils.mgAddtoLayout(cpanel,
-            "Short descriptive name for service", new JLabel("Name:"),
+            "Short descriptive name for service", new JLabel(MessageManager.getString("label.name")),
             name, "wrap");
     action = new JComboBox();
     JvSwingUtils
             .mgAddtoLayout(
                     cpanel,
                     "What kind of function the service performs (e.g. alignment, analysis, search, etc).",
-                    new JLabel("Service Action:"), action, "wrap");
+                    new JLabel(MessageManager.getString("label.service_action")), action, "wrap");
     descr = new JTextArea(4, 60);
     descrVp = new JScrollPane();
     descrVp.setViewportView(descr);
@@ -127,7 +128,7 @@ public class GRestServiceEditorPane extends JPanel
             .mgAddtoLayout(
                     cpanel,
                     "URL to post data to service. Include any special parameters needed here",
-                    new JLabel("POST URL:"), urlVp, "wrap");
+                    new JLabel(MessageManager.getString("label.post_url")), urlVp, "wrap");
 
     urlsuff = new JTextArea();
     urlsuff.setColumns(60);
@@ -136,12 +137,12 @@ public class GRestServiceEditorPane extends JPanel
             .mgAddtoLayout(
                     cpanel,
                     "Optional suffix added to URL when retrieving results from service",
-                    new JLabel("URL Suffix:"), urlsuff, "wrap");
+                    new JLabel(MessageManager.getString("label.url_suffix")), urlsuff, "wrap");
 
     // input options
     // details.add(cpanel = new JPanel(), BorderLayout.CENTER);
     // cpanel.setLayout(new FlowLayout());
-    hSeparable = new JCheckBox("per Sequence");
+    hSeparable = new JCheckBox(MessageManager.getString("label.per_seq"));
     hSeparable
             .setToolTipText("<html>"
                     + JvSwingUtils
@@ -157,7 +158,7 @@ public class GRestServiceEditorPane extends JPanel
 
       }
     });
-    vSeparable = new JCheckBox("Results are vertically separable");
+    vSeparable = new JCheckBox(MessageManager.getString("label.result_vertically_separable"));
     vSeparable
             .setToolTipText("<html>"
                     + JvSwingUtils
index abf5fc6..af45e9d 100644 (file)
@@ -1,4 +1,4 @@
-#Thu Sep 06 17:55:29 BST 2012
+#Thu Oct 17 10:35:33 BST 2013
 jalview.schemabinding.version2.ThresholdLine=jalview.schemabinding.version2.descriptors.ThresholdLineDescriptor
 jalview.schemabinding.version2.SequenceSetProperties=jalview.schemabinding.version2.descriptors.SequenceSetPropertiesDescriptor
 jalview.schemabinding.version2.StructureState=jalview.schemabinding.version2.descriptors.StructureStateDescriptor
index 805e70c..9eef6f0 100644 (file)
@@ -1,24 +1,14 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
- * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
- * 
- * This file is part of Jalview.
- * 
- * Jalview 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 3 of the License, or (at your option) any later version.
- *  
- * Jalview 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 Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
  */
+
 package jalview.schemabinding.version2;
 
-//---------------------------------/
-//- Imported classes and packages -/
+  //---------------------------------/
+ //- Imported classes and packages -/
 //---------------------------------/
 
 import org.exolab.castor.xml.Marshaller;
@@ -29,360 +19,461 @@ import org.exolab.castor.xml.Unmarshaller;
  * 
  * @version $Revision$ $Date$
  */
-public class AnnotationColours implements java.io.Serializable
-{
-
-  // --------------------------/
-  // - Class/Member Variables -/
-  // --------------------------/
-
-  /**
-   * Field _aboveThreshold.
-   */
-  private int _aboveThreshold;
-
-  /**
-   * keeps track of state for field: _aboveThreshold
-   */
-  private boolean _has_aboveThreshold;
-
-  /**
-   * Field _annotation.
-   */
-  private java.lang.String _annotation;
-
-  /**
-   * Field _minColour.
-   */
-  private int _minColour;
-
-  /**
-   * keeps track of state for field: _minColour
-   */
-  private boolean _has_minColour;
-
-  /**
-   * Field _maxColour.
-   */
-  private int _maxColour;
-
-  /**
-   * keeps track of state for field: _maxColour
-   */
-  private boolean _has_maxColour;
-
-  /**
-   * Field _colourScheme.
-   */
-  private java.lang.String _colourScheme;
-
-  /**
-   * Field _threshold.
-   */
-  private float _threshold;
-
-  /**
-   * keeps track of state for field: _threshold
-   */
-  private boolean _has_threshold;
-
-  // ----------------/
-  // - Constructors -/
-  // ----------------/
-
-  public AnnotationColours()
-  {
-    super();
-  }
-
-  // -----------/
-  // - Methods -/
-  // -----------/
-
-  /**
-     */
-  public void deleteAboveThreshold()
-  {
-    this._has_aboveThreshold = false;
-  }
-
-  /**
-     */
-  public void deleteMaxColour()
-  {
-    this._has_maxColour = false;
-  }
-
-  /**
-     */
-  public void deleteMinColour()
-  {
-    this._has_minColour = false;
-  }
-
-  /**
-     */
-  public void deleteThreshold()
-  {
-    this._has_threshold = false;
-  }
-
-  /**
-   * Returns the value of field 'aboveThreshold'.
-   * 
-   * @return the value of field 'AboveThreshold'.
-   */
-  public int getAboveThreshold()
-  {
-    return this._aboveThreshold;
-  }
-
-  /**
-   * Returns the value of field 'annotation'.
-   * 
-   * @return the value of field 'Annotation'.
-   */
-  public java.lang.String getAnnotation()
-  {
-    return this._annotation;
-  }
-
-  /**
-   * Returns the value of field 'colourScheme'.
-   * 
-   * @return the value of field 'ColourScheme'.
-   */
-  public java.lang.String getColourScheme()
-  {
-    return this._colourScheme;
-  }
-
-  /**
-   * Returns the value of field 'maxColour'.
-   * 
-   * @return the value of field 'MaxColour'.
-   */
-  public int getMaxColour()
-  {
-    return this._maxColour;
-  }
-
-  /**
-   * Returns the value of field 'minColour'.
-   * 
-   * @return the value of field 'MinColour'.
-   */
-  public int getMinColour()
-  {
-    return this._minColour;
-  }
-
-  /**
-   * Returns the value of field 'threshold'.
-   * 
-   * @return the value of field 'Threshold'.
-   */
-  public float getThreshold()
-  {
-    return this._threshold;
-  }
-
-  /**
-   * Method hasAboveThreshold.
-   * 
-   * @return true if at least one AboveThreshold has been added
-   */
-  public boolean hasAboveThreshold()
-  {
-    return this._has_aboveThreshold;
-  }
-
-  /**
-   * Method hasMaxColour.
-   * 
-   * @return true if at least one MaxColour has been added
-   */
-  public boolean hasMaxColour()
-  {
-    return this._has_maxColour;
-  }
-
-  /**
-   * Method hasMinColour.
-   * 
-   * @return true if at least one MinColour has been added
-   */
-  public boolean hasMinColour()
-  {
-    return this._has_minColour;
-  }
-
-  /**
-   * Method hasThreshold.
-   * 
-   * @return true if at least one Threshold has been added
-   */
-  public boolean hasThreshold()
-  {
-    return this._has_threshold;
-  }
-
-  /**
-   * Method isValid.
-   * 
-   * @return true if this object is valid according to the schema
-   */
-  public boolean isValid()
-  {
-    try
-    {
-      validate();
-    } catch (org.exolab.castor.xml.ValidationException vex)
-    {
-      return false;
-    }
-    return true;
-  }
-
-  /**
-   * 
-   * 
-   * @param out
-   * @throws org.exolab.castor.xml.MarshalException
-   *           if object is null or if any SAXException is thrown during
-   *           marshaling
-   * @throws org.exolab.castor.xml.ValidationException
-   *           if this object is an invalid instance according to the schema
-   */
-  public void marshal(final java.io.Writer out)
-          throws org.exolab.castor.xml.MarshalException,
-          org.exolab.castor.xml.ValidationException
-  {
-    Marshaller.marshal(this, out);
-  }
-
-  /**
-   * 
-   * 
-   * @param handler
-   * @throws java.io.IOException
-   *           if an IOException occurs during marshaling
-   * @throws org.exolab.castor.xml.ValidationException
-   *           if this object is an invalid instance according to the schema
-   * @throws org.exolab.castor.xml.MarshalException
-   *           if object is null or if any SAXException is thrown during
-   *           marshaling
-   */
-  public void marshal(final org.xml.sax.ContentHandler handler)
-          throws java.io.IOException,
-          org.exolab.castor.xml.MarshalException,
-          org.exolab.castor.xml.ValidationException
-  {
-    Marshaller.marshal(this, handler);
-  }
-
-  /**
-   * Sets the value of field 'aboveThreshold'.
-   * 
-   * @param aboveThreshold
-   *          the value of field 'aboveThreshold'.
-   */
-  public void setAboveThreshold(final int aboveThreshold)
-  {
-    this._aboveThreshold = aboveThreshold;
-    this._has_aboveThreshold = true;
-  }
-
-  /**
-   * Sets the value of field 'annotation'.
-   * 
-   * @param annotation
-   *          the value of field 'annotation'.
-   */
-  public void setAnnotation(final java.lang.String annotation)
-  {
-    this._annotation = annotation;
-  }
-
-  /**
-   * Sets the value of field 'colourScheme'.
-   * 
-   * @param colourScheme
-   *          the value of field 'colourScheme'.
-   */
-  public void setColourScheme(final java.lang.String colourScheme)
-  {
-    this._colourScheme = colourScheme;
-  }
-
-  /**
-   * Sets the value of field 'maxColour'.
-   * 
-   * @param maxColour
-   *          the value of field 'maxColour'.
-   */
-  public void setMaxColour(final int maxColour)
-  {
-    this._maxColour = maxColour;
-    this._has_maxColour = true;
-  }
-
-  /**
-   * Sets the value of field 'minColour'.
-   * 
-   * @param minColour
-   *          the value of field 'minColour'.
-   */
-  public void setMinColour(final int minColour)
-  {
-    this._minColour = minColour;
-    this._has_minColour = true;
-  }
-
-  /**
-   * Sets the value of field 'threshold'.
-   * 
-   * @param threshold
-   *          the value of field 'threshold'.
-   */
-  public void setThreshold(final float threshold)
-  {
-    this._threshold = threshold;
-    this._has_threshold = true;
-  }
-
-  /**
-   * Method unmarshal.
-   * 
-   * @param reader
-   * @throws org.exolab.castor.xml.MarshalException
-   *           if object is null or if any SAXException is thrown during
-   *           marshaling
-   * @throws org.exolab.castor.xml.ValidationException
-   *           if this object is an invalid instance according to the schema
-   * @return the unmarshaled jalview.schemabinding.version2.AnnotationColours
-   */
-  public static jalview.schemabinding.version2.AnnotationColours unmarshal(
-          final java.io.Reader reader)
-          throws org.exolab.castor.xml.MarshalException,
-          org.exolab.castor.xml.ValidationException
-  {
-    return (jalview.schemabinding.version2.AnnotationColours) Unmarshaller
-            .unmarshal(
-                    jalview.schemabinding.version2.AnnotationColours.class,
-                    reader);
-  }
-
-  /**
-   * 
-   * 
-   * @throws org.exolab.castor.xml.ValidationException
-   *           if this object is an invalid instance according to the schema
-   */
-  public void validate() throws org.exolab.castor.xml.ValidationException
-  {
-    org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
-    validator.validate(this);
-  }
+public class AnnotationColours implements java.io.Serializable {
+
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * Field _aboveThreshold.
+     */
+    private int _aboveThreshold;
+
+    /**
+     * keeps track of state for field: _aboveThreshold
+     */
+    private boolean _has_aboveThreshold;
+
+    /**
+     * Field _annotation.
+     */
+    private java.lang.String _annotation;
+
+    /**
+     * Field _minColour.
+     */
+    private int _minColour;
+
+    /**
+     * keeps track of state for field: _minColour
+     */
+    private boolean _has_minColour;
+
+    /**
+     * Field _maxColour.
+     */
+    private int _maxColour;
+
+    /**
+     * keeps track of state for field: _maxColour
+     */
+    private boolean _has_maxColour;
+
+    /**
+     * Field _colourScheme.
+     */
+    private java.lang.String _colourScheme;
+
+    /**
+     * Field _threshold.
+     */
+    private float _threshold;
+
+    /**
+     * keeps track of state for field: _threshold
+     */
+    private boolean _has_threshold;
+
+    /**
+     * Field _perSequence.
+     */
+    private boolean _perSequence;
+
+    /**
+     * keeps track of state for field: _perSequence
+     */
+    private boolean _has_perSequence;
+
+    /**
+     * Field _predefinedColours.
+     */
+    private boolean _predefinedColours;
+
+    /**
+     * keeps track of state for field: _predefinedColours
+     */
+    private boolean _has_predefinedColours;
+
+
+      //----------------/
+     //- Constructors -/
+    //----------------/
+
+    public AnnotationColours() {
+        super();
+    }
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     */
+    public void deleteAboveThreshold(
+    ) {
+        this._has_aboveThreshold= false;
+    }
+
+    /**
+     */
+    public void deleteMaxColour(
+    ) {
+        this._has_maxColour= false;
+    }
+
+    /**
+     */
+    public void deleteMinColour(
+    ) {
+        this._has_minColour= false;
+    }
+
+    /**
+     */
+    public void deletePerSequence(
+    ) {
+        this._has_perSequence= false;
+    }
+
+    /**
+     */
+    public void deletePredefinedColours(
+    ) {
+        this._has_predefinedColours= false;
+    }
+
+    /**
+     */
+    public void deleteThreshold(
+    ) {
+        this._has_threshold= false;
+    }
+
+    /**
+     * Returns the value of field 'aboveThreshold'.
+     * 
+     * @return the value of field 'AboveThreshold'.
+     */
+    public int getAboveThreshold(
+    ) {
+        return this._aboveThreshold;
+    }
+
+    /**
+     * Returns the value of field 'annotation'.
+     * 
+     * @return the value of field 'Annotation'.
+     */
+    public java.lang.String getAnnotation(
+    ) {
+        return this._annotation;
+    }
+
+    /**
+     * Returns the value of field 'colourScheme'.
+     * 
+     * @return the value of field 'ColourScheme'.
+     */
+    public java.lang.String getColourScheme(
+    ) {
+        return this._colourScheme;
+    }
+
+    /**
+     * Returns the value of field 'maxColour'.
+     * 
+     * @return the value of field 'MaxColour'.
+     */
+    public int getMaxColour(
+    ) {
+        return this._maxColour;
+    }
+
+    /**
+     * Returns the value of field 'minColour'.
+     * 
+     * @return the value of field 'MinColour'.
+     */
+    public int getMinColour(
+    ) {
+        return this._minColour;
+    }
+
+    /**
+     * Returns the value of field 'perSequence'.
+     * 
+     * @return the value of field 'PerSequence'.
+     */
+    public boolean getPerSequence(
+    ) {
+        return this._perSequence;
+    }
+
+    /**
+     * Returns the value of field 'predefinedColours'.
+     * 
+     * @return the value of field 'PredefinedColours'.
+     */
+    public boolean getPredefinedColours(
+    ) {
+        return this._predefinedColours;
+    }
+
+    /**
+     * Returns the value of field 'threshold'.
+     * 
+     * @return the value of field 'Threshold'.
+     */
+    public float getThreshold(
+    ) {
+        return this._threshold;
+    }
+
+    /**
+     * Method hasAboveThreshold.
+     * 
+     * @return true if at least one AboveThreshold has been added
+     */
+    public boolean hasAboveThreshold(
+    ) {
+        return this._has_aboveThreshold;
+    }
+
+    /**
+     * Method hasMaxColour.
+     * 
+     * @return true if at least one MaxColour has been added
+     */
+    public boolean hasMaxColour(
+    ) {
+        return this._has_maxColour;
+    }
+
+    /**
+     * Method hasMinColour.
+     * 
+     * @return true if at least one MinColour has been added
+     */
+    public boolean hasMinColour(
+    ) {
+        return this._has_minColour;
+    }
+
+    /**
+     * Method hasPerSequence.
+     * 
+     * @return true if at least one PerSequence has been added
+     */
+    public boolean hasPerSequence(
+    ) {
+        return this._has_perSequence;
+    }
+
+    /**
+     * Method hasPredefinedColours.
+     * 
+     * @return true if at least one PredefinedColours has been added
+     */
+    public boolean hasPredefinedColours(
+    ) {
+        return this._has_predefinedColours;
+    }
+
+    /**
+     * Method hasThreshold.
+     * 
+     * @return true if at least one Threshold has been added
+     */
+    public boolean hasThreshold(
+    ) {
+        return this._has_threshold;
+    }
+
+    /**
+     * Returns the value of field 'perSequence'.
+     * 
+     * @return the value of field 'PerSequence'.
+     */
+    public boolean isPerSequence(
+    ) {
+        return this._perSequence;
+    }
+
+    /**
+     * Returns the value of field 'predefinedColours'.
+     * 
+     * @return the value of field 'PredefinedColours'.
+     */
+    public boolean isPredefinedColours(
+    ) {
+        return this._predefinedColours;
+    }
+
+    /**
+     * Method isValid.
+     * 
+     * @return true if this object is valid according to the schema
+     */
+    public boolean isValid(
+    ) {
+        try {
+            validate();
+        } catch (org.exolab.castor.xml.ValidationException vex) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * 
+     * 
+     * @param out
+     * @throws org.exolab.castor.xml.MarshalException if object is
+     * null or if any SAXException is thrown during marshaling
+     * @throws org.exolab.castor.xml.ValidationException if this
+     * object is an invalid instance according to the schema
+     */
+    public void marshal(
+            final java.io.Writer out)
+    throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
+        Marshaller.marshal(this, out);
+    }
+
+    /**
+     * 
+     * 
+     * @param handler
+     * @throws java.io.IOException if an IOException occurs during
+     * marshaling
+     * @throws org.exolab.castor.xml.ValidationException if this
+     * object is an invalid instance according to the schema
+     * @throws org.exolab.castor.xml.MarshalException if object is
+     * null or if any SAXException is thrown during marshaling
+     */
+    public void marshal(
+            final org.xml.sax.ContentHandler handler)
+    throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
+        Marshaller.marshal(this, handler);
+    }
+
+    /**
+     * Sets the value of field 'aboveThreshold'.
+     * 
+     * @param aboveThreshold the value of field 'aboveThreshold'.
+     */
+    public void setAboveThreshold(
+            final int aboveThreshold) {
+        this._aboveThreshold = aboveThreshold;
+        this._has_aboveThreshold = true;
+    }
+
+    /**
+     * Sets the value of field 'annotation'.
+     * 
+     * @param annotation the value of field 'annotation'.
+     */
+    public void setAnnotation(
+            final java.lang.String annotation) {
+        this._annotation = annotation;
+    }
+
+    /**
+     * Sets the value of field 'colourScheme'.
+     * 
+     * @param colourScheme the value of field 'colourScheme'.
+     */
+    public void setColourScheme(
+            final java.lang.String colourScheme) {
+        this._colourScheme = colourScheme;
+    }
+
+    /**
+     * Sets the value of field 'maxColour'.
+     * 
+     * @param maxColour the value of field 'maxColour'.
+     */
+    public void setMaxColour(
+            final int maxColour) {
+        this._maxColour = maxColour;
+        this._has_maxColour = true;
+    }
+
+    /**
+     * Sets the value of field 'minColour'.
+     * 
+     * @param minColour the value of field 'minColour'.
+     */
+    public void setMinColour(
+            final int minColour) {
+        this._minColour = minColour;
+        this._has_minColour = true;
+    }
+
+    /**
+     * Sets the value of field 'perSequence'.
+     * 
+     * @param perSequence the value of field 'perSequence'.
+     */
+    public void setPerSequence(
+            final boolean perSequence) {
+        this._perSequence = perSequence;
+        this._has_perSequence = true;
+    }
+
+    /**
+     * Sets the value of field 'predefinedColours'.
+     * 
+     * @param predefinedColours the value of field
+     * 'predefinedColours'.
+     */
+    public void setPredefinedColours(
+            final boolean predefinedColours) {
+        this._predefinedColours = predefinedColours;
+        this._has_predefinedColours = true;
+    }
+
+    /**
+     * Sets the value of field 'threshold'.
+     * 
+     * @param threshold the value of field 'threshold'.
+     */
+    public void setThreshold(
+            final float threshold) {
+        this._threshold = threshold;
+        this._has_threshold = true;
+    }
+
+    /**
+     * Method unmarshal.
+     * 
+     * @param reader
+     * @throws org.exolab.castor.xml.MarshalException if object is
+     * null or if any SAXException is thrown during marshaling
+     * @throws org.exolab.castor.xml.ValidationException if this
+     * object is an invalid instance according to the schema
+     * @return the unmarshaled
+     * jalview.schemabinding.version2.AnnotationColours
+     */
+    public static jalview.schemabinding.version2.AnnotationColours unmarshal(
+            final java.io.Reader reader)
+    throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
+        return (jalview.schemabinding.version2.AnnotationColours) Unmarshaller.unmarshal(jalview.schemabinding.version2.AnnotationColours.class, reader);
+    }
+
+    /**
+     * 
+     * 
+     * @throws org.exolab.castor.xml.ValidationException if this
+     * object is an invalid instance according to the schema
+     */
+    public void validate(
+    )
+    throws org.exolab.castor.xml.ValidationException {
+        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+        validator.validate(this);
+    }
 
 }
index 876e928..196ad60 100644 (file)
@@ -1,24 +1,14 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
- * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
- * 
- * This file is part of Jalview.
- * 
- * Jalview 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 3 of the License, or (at your option) any later version.
- *  
- * Jalview 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 Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * This class was automatically generated with 
+ * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
+ * Schema.
+ * $Id$
  */
+
 package jalview.schemabinding.version2.descriptors;
 
-//---------------------------------/
-//- Imported classes and packages -/
+  //---------------------------------/
+ //- Imported classes and packages -/
 //---------------------------------/
 
 import jalview.schemabinding.version2.AnnotationColours;
@@ -28,447 +18,468 @@ import jalview.schemabinding.version2.AnnotationColours;
  * 
  * @version $Revision$ $Date$
  */
-public class AnnotationColoursDescriptor extends
-        org.exolab.castor.xml.util.XMLClassDescriptorImpl
-{
-
-  // --------------------------/
-  // - Class/Member Variables -/
-  // --------------------------/
-
-  /**
-   * Field _elementDefinition.
-   */
-  private boolean _elementDefinition;
-
-  /**
-   * Field _nsPrefix.
-   */
-  private java.lang.String _nsPrefix;
-
-  /**
-   * Field _nsURI.
-   */
-  private java.lang.String _nsURI;
-
-  /**
-   * Field _xmlName.
-   */
-  private java.lang.String _xmlName;
-
-  // ----------------/
-  // - Constructors -/
-  // ----------------/
-
-  public AnnotationColoursDescriptor()
-  {
-    super();
-    _nsURI = "www.jalview.org";
-    _xmlName = "AnnotationColours";
-    _elementDefinition = true;
-    org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
-    org.exolab.castor.mapping.FieldHandler handler = null;
-    org.exolab.castor.xml.FieldValidator fieldValidator = null;
-    // -- initialize attribute descriptors
-
-    // -- _aboveThreshold
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.Integer.TYPE, "_aboveThreshold", "aboveThreshold",
-            org.exolab.castor.xml.NodeType.Attribute);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        AnnotationColours target = (AnnotationColours) object;
-        if (!target.hasAboveThreshold())
-        {
-          return null;
+public class AnnotationColoursDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * Field _elementDefinition.
+     */
+    private boolean _elementDefinition;
+
+    /**
+     * Field _nsPrefix.
+     */
+    private java.lang.String _nsPrefix;
+
+    /**
+     * Field _nsURI.
+     */
+    private java.lang.String _nsURI;
+
+    /**
+     * Field _xmlName.
+     */
+    private java.lang.String _xmlName;
+
+
+      //----------------/
+     //- Constructors -/
+    //----------------/
+
+    public AnnotationColoursDescriptor() {
+        super();
+        _nsURI = "www.jalview.org";
+        _xmlName = "AnnotationColours";
+        _elementDefinition = true;
+        org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
+        org.exolab.castor.mapping.FieldHandler             handler        = null;
+        org.exolab.castor.xml.FieldValidator               fieldValidator = null;
+        //-- initialize attribute descriptors
+        
+        //-- _aboveThreshold
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_aboveThreshold", "aboveThreshold", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                AnnotationColours target = (AnnotationColours) object;
+                if (!target.hasAboveThreshold()) { return null; }
+                return new java.lang.Integer(target.getAboveThreshold());
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    AnnotationColours target = (AnnotationColours) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteAboveThreshold();
+                        return;
+                    }
+                    target.setAboveThreshold( ((java.lang.Integer) value).intValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _aboveThreshold
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.IntValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+            fieldValidator.setValidator(typeValidator);
+            typeValidator.setMinInclusive(-2147483648);
+            typeValidator.setMaxInclusive(2147483647);
         }
-        return new java.lang.Integer(target.getAboveThreshold());
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          AnnotationColours target = (AnnotationColours) object;
-          // if null, use delete method for optional primitives
-          if (value == null)
-          {
-            target.deleteAboveThreshold();
-            return;
-          }
-          target.setAboveThreshold(((java.lang.Integer) value).intValue());
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
+        desc.setValidator(fieldValidator);
+        //-- _annotation
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_annotation", "annotation", org.exolab.castor.xml.NodeType.Attribute);
+        desc.setImmutable(true);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                AnnotationColours target = (AnnotationColours) object;
+                return target.getAnnotation();
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    AnnotationColours target = (AnnotationColours) object;
+                    target.setAnnotation( (java.lang.String) value);
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _annotation
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.StringValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+            fieldValidator.setValidator(typeValidator);
+            typeValidator.setWhiteSpace("preserve");
         }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _aboveThreshold
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.IntValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
-      fieldValidator.setValidator(typeValidator);
-      typeValidator.setMinInclusive(-2147483648);
-      typeValidator.setMaxInclusive(2147483647);
-    }
-    desc.setValidator(fieldValidator);
-    // -- _annotation
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.String.class, "_annotation", "annotation",
-            org.exolab.castor.xml.NodeType.Attribute);
-    desc.setImmutable(true);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        AnnotationColours target = (AnnotationColours) object;
-        return target.getAnnotation();
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          AnnotationColours target = (AnnotationColours) object;
-          target.setAnnotation((java.lang.String) value);
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
+        desc.setValidator(fieldValidator);
+        //-- _minColour
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_minColour", "minColour", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                AnnotationColours target = (AnnotationColours) object;
+                if (!target.hasMinColour()) { return null; }
+                return new java.lang.Integer(target.getMinColour());
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    AnnotationColours target = (AnnotationColours) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteMinColour();
+                        return;
+                    }
+                    target.setMinColour( ((java.lang.Integer) value).intValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _minColour
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.IntValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+            fieldValidator.setValidator(typeValidator);
+            typeValidator.setMinInclusive(-2147483648);
+            typeValidator.setMaxInclusive(2147483647);
         }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _annotation
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.StringValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
-      fieldValidator.setValidator(typeValidator);
-      typeValidator.setWhiteSpace("preserve");
-    }
-    desc.setValidator(fieldValidator);
-    // -- _minColour
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.Integer.TYPE, "_minColour", "minColour",
-            org.exolab.castor.xml.NodeType.Attribute);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        AnnotationColours target = (AnnotationColours) object;
-        if (!target.hasMinColour())
-        {
-          return null;
+        desc.setValidator(fieldValidator);
+        //-- _maxColour
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_maxColour", "maxColour", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                AnnotationColours target = (AnnotationColours) object;
+                if (!target.hasMaxColour()) { return null; }
+                return new java.lang.Integer(target.getMaxColour());
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    AnnotationColours target = (AnnotationColours) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteMaxColour();
+                        return;
+                    }
+                    target.setMaxColour( ((java.lang.Integer) value).intValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _maxColour
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.IntValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+            fieldValidator.setValidator(typeValidator);
+            typeValidator.setMinInclusive(-2147483648);
+            typeValidator.setMaxInclusive(2147483647);
         }
-        return new java.lang.Integer(target.getMinColour());
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          AnnotationColours target = (AnnotationColours) object;
-          // if null, use delete method for optional primitives
-          if (value == null)
-          {
-            target.deleteMinColour();
-            return;
-          }
-          target.setMinColour(((java.lang.Integer) value).intValue());
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
+        desc.setValidator(fieldValidator);
+        //-- _colourScheme
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_colourScheme", "colourScheme", org.exolab.castor.xml.NodeType.Attribute);
+        desc.setImmutable(true);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                AnnotationColours target = (AnnotationColours) object;
+                return target.getColourScheme();
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    AnnotationColours target = (AnnotationColours) object;
+                    target.setColourScheme( (java.lang.String) value);
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _colourScheme
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.StringValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+            fieldValidator.setValidator(typeValidator);
+            typeValidator.setWhiteSpace("preserve");
         }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _minColour
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.IntValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
-      fieldValidator.setValidator(typeValidator);
-      typeValidator.setMinInclusive(-2147483648);
-      typeValidator.setMaxInclusive(2147483647);
-    }
-    desc.setValidator(fieldValidator);
-    // -- _maxColour
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.Integer.TYPE, "_maxColour", "maxColour",
-            org.exolab.castor.xml.NodeType.Attribute);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        AnnotationColours target = (AnnotationColours) object;
-        if (!target.hasMaxColour())
-        {
-          return null;
+        desc.setValidator(fieldValidator);
+        //-- _threshold
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_threshold", "threshold", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                AnnotationColours target = (AnnotationColours) object;
+                if (!target.hasThreshold()) { return null; }
+                return new java.lang.Float(target.getThreshold());
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    AnnotationColours target = (AnnotationColours) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deleteThreshold();
+                        return;
+                    }
+                    target.setThreshold( ((java.lang.Float) value).floatValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _threshold
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.FloatValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
+            fieldValidator.setValidator(typeValidator);
+            typeValidator.setMinInclusive((float) -3.4028235E38);
+            typeValidator.setMaxInclusive((float) 3.4028235E38);
         }
-        return new java.lang.Integer(target.getMaxColour());
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          AnnotationColours target = (AnnotationColours) object;
-          // if null, use delete method for optional primitives
-          if (value == null)
-          {
-            target.deleteMaxColour();
-            return;
-          }
-          target.setMaxColour(((java.lang.Integer) value).intValue());
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
+        desc.setValidator(fieldValidator);
+        //-- _perSequence
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_perSequence", "perSequence", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                AnnotationColours target = (AnnotationColours) object;
+                if (!target.hasPerSequence()) { return null; }
+                return (target.getPerSequence() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    AnnotationColours target = (AnnotationColours) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deletePerSequence();
+                        return;
+                    }
+                    target.setPerSequence( ((java.lang.Boolean) value).booleanValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _perSequence
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+            fieldValidator.setValidator(typeValidator);
         }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _maxColour
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.IntValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.IntValidator();
-      fieldValidator.setValidator(typeValidator);
-      typeValidator.setMinInclusive(-2147483648);
-      typeValidator.setMaxInclusive(2147483647);
-    }
-    desc.setValidator(fieldValidator);
-    // -- _colourScheme
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.String.class, "_colourScheme", "colourScheme",
-            org.exolab.castor.xml.NodeType.Attribute);
-    desc.setImmutable(true);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        AnnotationColours target = (AnnotationColours) object;
-        return target.getColourScheme();
-      }
-
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          AnnotationColours target = (AnnotationColours) object;
-          target.setColourScheme((java.lang.String) value);
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
+        desc.setValidator(fieldValidator);
+        //-- _predefinedColours
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_predefinedColours", "predefinedColours", org.exolab.castor.xml.NodeType.Attribute);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                AnnotationColours target = (AnnotationColours) object;
+                if (!target.hasPredefinedColours()) { return null; }
+                return (target.getPredefinedColours() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    AnnotationColours target = (AnnotationColours) object;
+                    // if null, use delete method for optional primitives 
+                    if (value == null) {
+                        target.deletePredefinedColours();
+                        return;
+                    }
+                    target.setPredefinedColours( ((java.lang.Boolean) value).booleanValue());
+                } catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance(java.lang.Object parent) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _predefinedColours
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        { //-- local scope
+            org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+            typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+            fieldValidator.setValidator(typeValidator);
         }
-      }
-
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
-
-    // -- validation code for: _colourScheme
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.StringValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.StringValidator();
-      fieldValidator.setValidator(typeValidator);
-      typeValidator.setWhiteSpace("preserve");
+        desc.setValidator(fieldValidator);
+        //-- initialize element descriptors
+        
     }
-    desc.setValidator(fieldValidator);
-    // -- _threshold
-    desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
-            java.lang.Float.TYPE, "_threshold", "threshold",
-            org.exolab.castor.xml.NodeType.Attribute);
-    handler = new org.exolab.castor.xml.XMLFieldHandler()
-    {
-      public java.lang.Object getValue(java.lang.Object object)
-              throws IllegalStateException
-      {
-        AnnotationColours target = (AnnotationColours) object;
-        if (!target.hasThreshold())
-        {
-          return null;
-        }
-        return new java.lang.Float(target.getThreshold());
-      }
 
-      public void setValue(java.lang.Object object, java.lang.Object value)
-              throws IllegalStateException, IllegalArgumentException
-      {
-        try
-        {
-          AnnotationColours target = (AnnotationColours) object;
-          // if null, use delete method for optional primitives
-          if (value == null)
-          {
-            target.deleteThreshold();
-            return;
-          }
-          target.setThreshold(((java.lang.Float) value).floatValue());
-        } catch (java.lang.Exception ex)
-        {
-          throw new IllegalStateException(ex.toString());
-        }
-      }
 
-      public java.lang.Object newInstance(java.lang.Object parent)
-      {
-        return null;
-      }
-    };
-    desc.setHandler(handler);
-    desc.setMultivalued(false);
-    addFieldDescriptor(desc);
+      //-----------/
+     //- Methods -/
+    //-----------/
 
-    // -- validation code for: _threshold
-    fieldValidator = new org.exolab.castor.xml.FieldValidator();
-    { // -- local scope
-      org.exolab.castor.xml.validators.FloatValidator typeValidator;
-      typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
-      fieldValidator.setValidator(typeValidator);
-      typeValidator.setMinInclusive((float) -3.4028235E38);
-      typeValidator.setMaxInclusive((float) 3.4028235E38);
+    /**
+     * Method getAccessMode.
+     * 
+     * @return the access mode specified for this class.
+     */
+    public org.exolab.castor.mapping.AccessMode getAccessMode(
+    ) {
+        return null;
     }
-    desc.setValidator(fieldValidator);
-    // -- initialize element descriptors
-
-  }
 
-  // -----------/
-  // - Methods -/
-  // -----------/
-
-  /**
-   * Method getAccessMode.
-   * 
-   * @return the access mode specified for this class.
-   */
-  public org.exolab.castor.mapping.AccessMode getAccessMode()
-  {
-    return null;
-  }
-
-  /**
-   * Method getIdentity.
-   * 
-   * @return the identity field, null if this class has no identity.
-   */
-  public org.exolab.castor.mapping.FieldDescriptor getIdentity()
-  {
-    return super.getIdentity();
-  }
+    /**
+     * Method getIdentity.
+     * 
+     * @return the identity field, null if this class has no
+     * identity.
+     */
+    public org.exolab.castor.mapping.FieldDescriptor getIdentity(
+    ) {
+        return super.getIdentity();
+    }
 
-  /**
-   * Method getJavaClass.
-   * 
-   * @return the Java class represented by this descriptor.
-   */
-  public java.lang.Class getJavaClass()
-  {
-    return jalview.schemabinding.version2.AnnotationColours.class;
-  }
+    /**
+     * Method getJavaClass.
+     * 
+     * @return the Java class represented by this descriptor.
+     */
+    public java.lang.Class getJavaClass(
+    ) {
+        return jalview.schemabinding.version2.AnnotationColours.class;
+    }
 
-  /**
-   * Method getNameSpacePrefix.
-   * 
-   * @return the namespace prefix to use when marshaling as XML.
-   */
-  public java.lang.String getNameSpacePrefix()
-  {
-    return _nsPrefix;
-  }
+    /**
+     * Method getNameSpacePrefix.
+     * 
+     * @return the namespace prefix to use when marshaling as XML.
+     */
+    public java.lang.String getNameSpacePrefix(
+    ) {
+        return _nsPrefix;
+    }
 
-  /**
-   * Method getNameSpaceURI.
-   * 
-   * @return the namespace URI used when marshaling and unmarshaling as XML.
-   */
-  public java.lang.String getNameSpaceURI()
-  {
-    return _nsURI;
-  }
+    /**
+     * Method getNameSpaceURI.
+     * 
+     * @return the namespace URI used when marshaling and
+     * unmarshaling as XML.
+     */
+    public java.lang.String getNameSpaceURI(
+    ) {
+        return _nsURI;
+    }
 
-  /**
-   * Method getValidator.
-   * 
-   * @return a specific validator for the class described by this
-   *         ClassDescriptor.
-   */
-  public org.exolab.castor.xml.TypeValidator getValidator()
-  {
-    return this;
-  }
+    /**
+     * Method getValidator.
+     * 
+     * @return a specific validator for the class described by this
+     * ClassDescriptor.
+     */
+    public org.exolab.castor.xml.TypeValidator getValidator(
+    ) {
+        return this;
+    }
 
-  /**
-   * Method getXMLName.
-   * 
-   * @return the XML Name for the Class being described.
-   */
-  public java.lang.String getXMLName()
-  {
-    return _xmlName;
-  }
+    /**
+     * Method getXMLName.
+     * 
+     * @return the XML Name for the Class being described.
+     */
+    public java.lang.String getXMLName(
+    ) {
+        return _xmlName;
+    }
 
-  /**
-   * Method isElementDefinition.
-   * 
-   * @return true if XML schema definition of this Class is that of a global
-   *         element or element with anonymous type definition.
-   */
-  public boolean isElementDefinition()
-  {
-    return _elementDefinition;
-  }
+    /**
+     * Method isElementDefinition.
+     * 
+     * @return true if XML schema definition of this Class is that
+     * of a global
+     * element or element with anonymous type definition.
+     */
+    public boolean isElementDefinition(
+    ) {
+        return _elementDefinition;
+    }
 
 }
index 729065c..9c5512c 100755 (executable)
@@ -17,6 +17,7 @@
  */
 package jalview.schemes;
 
+import jalview.analysis.Conservation;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AnnotatedCollectionI;
 import jalview.datamodel.GraphLine;
@@ -24,6 +25,7 @@ import jalview.datamodel.SequenceCollectionI;
 import jalview.datamodel.SequenceI;
 
 import java.awt.Color;
+import java.util.Hashtable;
 import java.util.IdentityHashMap;
 import java.util.Map;
 
@@ -47,9 +49,9 @@ public class AnnotationColourGradient extends ResidueColourScheme
 
   ColourSchemeI colourScheme;
 
-  public boolean predefinedColours = false;
+  private boolean predefinedColours = false;
 
-  public boolean seqAssociated = false;
+  private boolean seqAssociated = false;
 
   IdentityHashMap<SequenceI, AlignmentAnnotation> seqannot = null;
 
@@ -270,6 +272,16 @@ public class AnnotationColourGradient extends ResidueColourScheme
     return currentColour;
   }
 
+  public boolean isPredefinedColours()
+  {
+    return predefinedColours;
+  }
+
+  public void setPredefinedColours(boolean predefinedColours)
+  {
+    this.predefinedColours = predefinedColours;
+  }
+
   public boolean isSeqAssociated()
   {
     return seqAssociated;
@@ -279,4 +291,28 @@ public class AnnotationColourGradient extends ResidueColourScheme
   {
     seqAssociated = sassoc;
   }
+  @Override
+  public void setConsensus(Hashtable[] consensus)
+  {
+    if (colourScheme!=null)
+    {
+      colourScheme.setConsensus(consensus);
+    }
+  }
+  @Override
+  public void setConservation(Conservation cons)
+  {
+    if (colourScheme!=null)
+    {
+      colourScheme.setConservation(cons);
+    }
+  }
+  @Override
+  public void setConservationInc(int i)
+  {
+    if (colourScheme!=null)
+    {
+      colourScheme.setConservationInc(i);
+    }
+  }
 }
index 168aa31..a2ffff5 100644 (file)
@@ -66,7 +66,8 @@ public class RNAHelicesColour extends ResidueColourScheme
 
   public void refresh()
   {
-    if (lastrefresh != annotation._rnasecstr.hashCode()
+    if ((annotation._rnasecstr == null
+               || lastrefresh != annotation._rnasecstr.hashCode())
             && annotation.isValidStruc())
     {
       annotation.getRNAStruc();
index 25b65b3..cef7eb6 100644 (file)
@@ -97,8 +97,24 @@ public class RNAHelicesColourChooser
       return;
     }
 
-    currentAnnotation = av.getAlignment().getAlignmentAnnotation()[0];// annotations.getSelectedIndex()];
-
+    // This loop will find the first rna structure annotation by which to colour
+    //  the sequences.
+    AlignmentAnnotation[] annotations = av.getAlignment().getAlignmentAnnotation();
+    for (int i = 0; i < annotations.length; i++) {
+       
+       // is this a sensible way of determining type of annotation?
+       if (annotations[i].getRNAStruc() != null) { 
+               currentAnnotation = annotations[i];
+               break;
+       }
+    }
+    if (currentAnnotation == null)   
+    {
+       System.err.println("Jalview is about to try and colour by RNAHelices even"
+                       + " though there are no RNA secondary structure annotations present!");
+       currentAnnotation = av.getAlignment().getAlignmentAnnotation()[0];// annotations.getSelectedIndex()];
+    }
+    
     RNAHelicesColour rhc = null;
 
     rhc = new RNAHelicesColour(currentAnnotation);
index 7415712..8d684c1 100644 (file)
@@ -53,13 +53,25 @@ public class StructureSelectionManager
   }
 
   Hashtable mappingData = new Hashtable();
-
+  private static StructureSelectionManager nullProvider = null;
   public static StructureSelectionManager getStructureSelectionManager(
           StructureSelectionManagerProvider context)
   {
-    if (context==null)
-    {
-      throw new Error("Implementation error. Structure selection manager's context is 'null'", new NullPointerException("SSM context is null"));
+    if (context==null) { 
+      if (nullProvider == null)
+      {
+        if (instances != null)
+        {
+          throw new Error(
+                  "Implementation error. Structure selection manager's context is 'null'",
+                  new NullPointerException("SSM context is null"));
+        }
+        else
+        {
+          nullProvider = new StructureSelectionManager();
+        }
+        return nullProvider;
+      }
     }
     if (instances == null)
     {
@@ -68,7 +80,13 @@ public class StructureSelectionManager
     StructureSelectionManager instance = instances.get(context);
     if (instance == null)
     {
-      instances.put(context, instance = new StructureSelectionManager());
+      if (nullProvider!=null)
+      {
+        instance = nullProvider;
+      } else {
+        instance = new StructureSelectionManager();
+      }
+      instances.put(context, instance);
     }
     return instance;
   }
diff --git a/src/jalview/util/MessageManager.java b/src/jalview/util/MessageManager.java
new file mode 100644 (file)
index 0000000..fcf2bfa
--- /dev/null
@@ -0,0 +1,67 @@
+package jalview.util;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.ResourceBundle;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * 
+ * @author David Roldan Martinez
+ * @author Thomas Abeel
+ * 
+ *
+ */
+public class MessageManager {
+
+       private static ResourceBundle rb;    
+               
+       private static Logger log=Logger.getLogger(MessageManager.class.getCanonicalName());
+       
+       private static Locale loc;
+       
+       
+       
+    static{
+      try {
+       /* Localize Java dialogs */
+        loc = Locale.getDefault();
+       // Locale.setDefault(loc);
+       /* Getting messages for GV */
+       log.info("Getting messages for lang: "+loc);
+        rb = ResourceBundle.getBundle("lang.Messages", loc);
+        if (log.isLoggable(Level.FINEST)) {
+          // this might take a while, so we only do it if it will be shown
+          log.finest("Language keys: "+rb.keySet());
+        }
+      } catch (Exception q) {
+        log.warning("Exception when initting Locale for i18n messages\n"+q.getMessage());
+        q.printStackTrace();
+      }
+      catch (Error v)
+      {
+        log.warning("Error when initting Locale for i18n messages\n"+v.getMessage());
+        v.printStackTrace();
+      }
+      
+     
+    }
+    
+    public static String getString(String key){
+       String value = "[missing key] " + key;
+       try{
+               value = rb.getString(key);
+       }catch(Exception e){
+         log.warning("I18N missing: "+loc+"\t"+key);
+       }
+       return value;
+    }
+    
+       public static Locale getLocale() {
+               return loc;
+       }
+       public static String formatMessage(String key, Object[] params){
+               return MessageFormat.format(rb.getString(key), params);
+       }
+}
index dca968e..6f3a2af 100644 (file)
@@ -40,6 +40,7 @@ import jalview.workers.AlignCalcManager;
 import jalview.workers.ConsensusThread;
 import jalview.workers.StrucConsensusThread;
 
+import java.awt.Color;
 import java.util.ArrayList;
 import java.util.BitSet;
 import java.util.Hashtable;
@@ -784,6 +785,8 @@ public abstract class AlignmentViewport implements AlignViewportI
 
   protected boolean showConsensus = true;
 
+  Hashtable sequenceColours;
+
   /**
    * Property change listener for changes in alignment
    * 
@@ -1539,4 +1542,60 @@ public abstract class AlignmentViewport implements AlignViewportI
     oldrfs.clear();
   }
 
+  @Override
+  public Color getSequenceColour(SequenceI seq)
+  {
+    Color sqc=Color.white;
+    if (sequenceColours != null)
+    {
+      sqc = (Color) sequenceColours.get(seq);
+      if (sqc == null) {
+        sqc = Color.white;
+      }
+    }
+    return sqc;
+  }
+
+  @Override
+  public void setSequenceColour(SequenceI seq, Color col)
+  {
+    if (sequenceColours == null)
+    {
+      sequenceColours = new Hashtable();
+    }
+
+    if (col == null)
+    {
+      sequenceColours.remove(seq);
+    }
+    else
+    {
+      sequenceColours.put(seq, col);
+    }
+  }
+
+  @Override
+  public void updateSequenceIdColours()
+  {
+    if (sequenceColours == null)
+    {
+      sequenceColours = new Hashtable();
+    }
+    for (SequenceGroup sg : alignment.getGroups())
+    {
+      if (sg.idColour != null)
+      {
+        for (SequenceI s : sg.getSequences(getHiddenRepSequences()))
+        {
+          sequenceColours.put(s, sg.idColour);
+        }
+      }
+    }
+  }
+
+  @Override
+  public void clearSequenceColours()
+  {
+    sequenceColours = null;
+  };
 }
index 343e64d..c2b4d66 100644 (file)
@@ -24,6 +24,7 @@ import jalview.api.AlignmentViewPanel;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.Annotation;
+import jalview.datamodel.SequenceI;
 import jalview.schemes.ColourSchemeI;
 
 import java.util.Hashtable;
@@ -31,6 +32,8 @@ import java.util.Hashtable;
 public class ConsensusThread extends AlignCalcWorker implements
         AlignCalcWorkerI
 {
+  private long nseq=-1;
+
   public ConsensusThread(AlignViewportI alignViewport,
           AlignmentViewPanel alignPanel)
   {
@@ -94,7 +97,9 @@ public class ConsensusThread extends AlignCalcWorker implements
       hconsensus = new Hashtable[aWidth];
       try
       {
-        AAFrequency.calculate(alignment.getSequencesArray(), 0,
+        SequenceI aseqs[] = alignment.getSequencesArray();
+        nseq = aseqs.length;
+        AAFrequency.calculate(aseqs, 0,
                 alignment.getWidth(), hconsensus, true);
       } catch (ArrayIndexOutOfBoundsException x)
       {
@@ -150,7 +155,7 @@ public class ConsensusThread extends AlignCalcWorker implements
     {
       AAFrequency.completeConsensus(consensus, hconsensus, 0,
               hconsensus.length, alignViewport.getIgnoreGapsConsensus(),
-              alignViewport.isShowSequenceLogo());
+              alignViewport.isShowSequenceLogo(), nseq);
     }
   }
 }
index 86c3336..25e5cde 100644 (file)
@@ -26,6 +26,7 @@ import jalview.api.AlignmentViewPanel;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.Annotation;
+import jalview.datamodel.SequenceI;
 
 public class StrucConsensusThread extends AlignCalcWorker implements
         AlignCalcWorkerI
@@ -40,6 +41,8 @@ public class StrucConsensusThread extends AlignCalcWorker implements
 
   Hashtable[] hStrucConsensus;
 
+  private long nseq=-1;
+
   @Override
   public void run()
   {
@@ -107,8 +110,10 @@ public class StrucConsensusThread extends AlignCalcWorker implements
 
       try
       {
-        jalview.analysis.StructureFrequency.calculate(
-                alignment.getSequencesArray(), 0, alignment.getWidth(),
+        final SequenceI[] arr=
+                alignment.getSequencesArray();
+        nseq = arr.length;
+        jalview.analysis.StructureFrequency.calculate(arr, 0, alignment.getWidth(),
                 hStrucConsensus, true, rnaStruc);
       } catch (ArrayIndexOutOfBoundsException x)
       {
@@ -159,7 +164,7 @@ public class StrucConsensusThread extends AlignCalcWorker implements
       StructureFrequency.completeConsensus(strucConsensus, hStrucConsensus,
               0, hStrucConsensus.length,
               alignViewport.getIgnoreGapsConsensus(),
-              alignViewport.isShowSequenceLogo());
+              alignViewport.isShowSequenceLogo(), nseq);
     }
   }
 
index 7f3847b..2750293 100644 (file)
@@ -23,6 +23,7 @@ import jalview.gui.AlignmentPanel;
 import jalview.ws.jws2.dm.AAConSettings;
 import jalview.ws.jws2.jabaws2.Jws2Instance;
 import jalview.ws.params.WsParamSetI;
+import jalview.ws.uimodel.AlignAnalysisUIText;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -48,23 +49,6 @@ public class AAConClient extends JabawsAlignCalcWorker
     initViewportParams();
   }
 
-  protected void initViewportParams()
-  {
-    ((jalview.gui.AlignViewport) alignViewport).setCalcIdSettingsFor(
-            getCalcId(),
-            new AAConSettings(true, service, this.preset,
-                    (arguments != null) ? JabaParamStore
-                            .getJwsArgsfromJaba(arguments) : null), true);
-  }
-
-  @Override
-  public void updateParameters(WsParamSetI newpreset,
-          java.util.List<Argument> newarguments)
-  {
-    super.updateParameters(newpreset, newarguments);
-    initViewportParams();
-  };
-
   public String getServiceActionText()
   {
     return "calculating Amino acid consensus using AACon service";
@@ -114,17 +98,21 @@ public class AAConClient extends JabawsAlignCalcWorker
     }
   }
 
+  @Override
   public String getCalcId()
   {
-    return SequenceAnnotationWSClient.AAConCalcId;
+    return CALC_ID;
   }
+  private static String CALC_ID="jabaws2.AACon";
 
-  public static void removeAAConsAnnotation(AlignmentPanel alignPanel)
+  public static AlignAnalysisUIText getAlignAnalysisUITest()
   {
-    for (AlignmentAnnotation aa : alignPanel.getAlignment().findAnnotation(
-            SequenceAnnotationWSClient.AAConCalcId))
-    {
-      alignPanel.getAlignment().deleteAnnotation(aa);
-    }
+    return new AlignAnalysisUIText(
+            compbio.ws.client.Services.AAConWS.toString(),
+            jalview.ws.jws2.AAConClient.class, CALC_ID, false, true, true,
+            "AACon Calculations",
+            "When checked, AACon calculations are updated automatically.",
+            "Change AACon Settings...",
+            "Modify settings for AACon calculations.");
   }
 }
index 96635c9..41f0fd5 100644 (file)
@@ -41,7 +41,7 @@ import compbio.data.sequence.Score;
 import compbio.data.sequence.ScoreManager.ScoreHolder;
 import compbio.metadata.Argument;
 
-public class AADisorderClient extends JabawsAlignCalcWorker implements
+public class AADisorderClient extends JabawsCalcWorker implements
         AlignCalcWorkerI
 {
 
index 73d5654..fe61ff3 100644 (file)
@@ -22,6 +22,7 @@ package jalview.ws.jws2;
 
 import jalview.bin.Cache;
 import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.jws2.jabaws2.Jws2InstanceFactory;
 
 import java.util.HashSet;
 import java.util.Set;
@@ -75,7 +76,7 @@ public class JabaWsServerQuery implements Runnable
   { Services.ClustalWS, Services.MuscleWS, Services.MafftWS,
       Services.ProbconsWS, Services.TcoffeeWS, Services.AAConWS,
       Services.DisemblWS, Services.GlobPlotWS, Services.IUPredWS,
-      Services.JronnWS };
+      Services.JronnWS, Services.RNAalifoldWS };
 
   /*
    * (non-Javadoc)
@@ -115,7 +116,14 @@ public class JabaWsServerQuery implements Runnable
 
             jabasws2 = true;
             srv_set = registry.getSupportedServices();
+            
+            // dan test
+            System.out.println("registry.getSupportedServices: " + srv_set.toString());
+            
             svccategories = registry.getServiceCategories();
+            
+            // dan test
+//            System.out.println("registry.getServiceCategories: " + svccategories.toString());
 
           }
         } catch (Exception ex)
@@ -170,12 +178,12 @@ public class JabaWsServerQuery implements Runnable
 
                 String description = registry.getServiceDescription(srv);
 
-                svc = new Jws2Instance(jwsservers, srv.toString(),
+                svc = Jws2InstanceFactory.newJws2Instance(jwsservers, srv.toString(),
                         cat.name, description, service);
               }
               if (svc == null)
               {
-                svc = new Jws2Instance(jwsservers, srv.toString(),
+                svc = Jws2InstanceFactory.newJws2Instance(jwsservers, srv.toString(),
                         cat.name, "JABAWS 1 Alignment Service", service);
               }
               jws2Discoverer.addService(jwsservers, svc);
index 926256d..d500406 100644 (file)
  */
 package jalview.ws.jws2;
 
-import jalview.analysis.AlignSeq;
-import jalview.analysis.SeqsetUtils;
 import jalview.api.AlignViewportI;
 import jalview.api.AlignmentViewPanel;
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.AnnotatedCollectionI;
-import jalview.datamodel.Annotation;
-import jalview.datamodel.SequenceI;
 import jalview.gui.AlignFrame;
-import jalview.gui.IProgressIndicator;
-import jalview.workers.AlignCalcWorker;
-import jalview.ws.jws2.dm.JabaWsParamSet;
+import jalview.ws.jws2.dm.AAConSettings;
 import jalview.ws.jws2.jabaws2.Jws2Instance;
 import jalview.ws.params.WsParamSetI;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 
-import compbio.data.msa.SequenceAnnotation;
-import compbio.data.sequence.FastaSequence;
-import compbio.data.sequence.Score;
-import compbio.data.sequence.ScoreManager;
 import compbio.metadata.Argument;
-import compbio.metadata.ChunkHolder;
-import compbio.metadata.JobStatus;
-import compbio.metadata.JobSubmissionException;
-import compbio.metadata.Option;
-import compbio.metadata.ResultNotAvailableException;
-import compbio.metadata.WrongParameterException;
 
-public abstract class JabawsAlignCalcWorker extends AlignCalcWorker
+public abstract class JabawsAlignCalcWorker extends JabawsCalcWorker
 {
-  Jws2Instance service;
-
-  @SuppressWarnings("unchecked")
-  protected SequenceAnnotation aaservice;
-
-  protected ScoreManager scoremanager;
-
-  protected WsParamSetI preset;
-
-  protected List<Argument> arguments;
 
   public JabawsAlignCalcWorker(AlignViewportI alignViewport,
           AlignmentViewPanel alignPanel)
   {
     super(alignViewport, alignPanel);
   }
-
-  IProgressIndicator guiProgress;
-
+  
+  
+  
+  
   public JabawsAlignCalcWorker(Jws2Instance service, AlignFrame alignFrame,
           WsParamSetI preset, List<Argument> paramset)
   {
-    this(alignFrame.getCurrentView(), alignFrame.alignPanel);
-    this.guiProgress = alignFrame;
-    this.preset = preset;
-    this.arguments = paramset;
-    this.service = service;
-    aaservice = (SequenceAnnotation) service.service;
-
-  }
-
-  public WsParamSetI getPreset()
-  {
-    return preset;
-  }
-
-  public List<Argument> getArguments()
-  {
-    return arguments;
+    super(service, alignFrame, preset, paramset);
   }
 
   /**
-   * reconfigure and restart the AAConClient. This method will spawn a new
-   * thread that will wait until any current jobs are finished, modify the
-   * parameters and restart the conservation calculation with the new values.
-   * 
-   * @param newpreset
-   * @param newarguments
+   * Recover any existing parameters for this service 
    */
-  public void updateParameters(final WsParamSetI newpreset,
-          final List<Argument> newarguments)
-  {
-    preset = newpreset;
-    arguments = newarguments;
-    calcMan.startWorker(this);
-  }
-
-  public List<Option> getJabaArguments()
+  protected void initViewportParams()
   {
-    List<Option> newargs = new ArrayList<Option>();
-    if (preset != null && preset instanceof JabaWsParamSet)
-    {
-      newargs.addAll(((JabaWsParamSet) preset).getjabaArguments());
-    }
-    if (arguments != null && arguments.size() > 0)
-    {
-      for (Argument rg : arguments)
-      {
-        if (Option.class.isAssignableFrom(rg.getClass()))
-        {
-          newargs.add((Option) rg);
-        }
-      }
-    }
-    return newargs;
+    ((jalview.gui.AlignViewport) alignViewport).setCalcIdSettingsFor(
+            getCalcId(),
+            new AAConSettings(true, service, this.preset,
+                    (arguments != null) ? JabaParamStore
+                            .getJwsArgsfromJaba(arguments) : null), true);
   }
 
-  @Override
-  public void run()
-  {
-    if (aaservice == null)
-    {
-      return;
-    }
-    long progressId = -1;
-
-    int serverErrorsLeft = 3;
-
-    String rslt = "JOB NOT DEFINED";
-    StringBuffer msg = new StringBuffer();
-    try
-    {
-      if (checkDone())
-      {
-        return;
-      }
-      List<compbio.data.sequence.FastaSequence> seqs = getInputSequences(alignViewport
-              .getAlignment(), bySequence ? alignViewport.getSelectionGroup() : null);
-
-      if (seqs == null)
-      {
-        calcMan.workerComplete(this);
-        return;
-      }
-
-      AlignmentAnnotation[] aa = alignViewport.getAlignment()
-              .getAlignmentAnnotation();
-      if (guiProgress != null)
-      {
-        guiProgress.setProgressBar("JABA " + getServiceActionText(),
-                progressId = System.currentTimeMillis());
-      }
-      if (preset == null && arguments == null)
-      {
-        rslt = aaservice.analize(seqs);
-      }
-      else
-      {
-        try
-        {
-          rslt = aaservice.customAnalize(seqs, getJabaArguments());
-        } catch (WrongParameterException x)
-        {
-          throw new JobSubmissionException(
-                  "Invalid parameter set. Check Jalview implementation.", x);
-
-        }
-      }
-      boolean finished = false;
-      long rpos = 0;
-      do
-      {
-        JobStatus status = aaservice.getJobStatus(rslt);
-        if (status.equals(JobStatus.FINISHED))
-        {
-          finished = true;
-        }
-        if (calcMan.isPending(this) && this instanceof AAConClient)
-        {
-          finished = true;
-          // cancel this job and yield to the new job
-          try
-          {
-            if (aaservice.cancelJob(rslt))
-            {
-              System.err.println("Cancelled AACon job: " + rslt);
-            }
-            else
-            {
-              System.err.println("FAILED TO CANCEL AACon job: " + rslt);
-            }
-
-          } catch (Exception x)
-          {
-
-          }
-
-          return;
-        }
-        long cpos;
-        ChunkHolder stats = null;
-        do
-        {
-          cpos = rpos;
-          boolean retry = false;
-          do
-          {
-            try
-            {
-              stats = aaservice.pullExecStatistics(rslt, rpos);
-            } catch (Exception x)
-            {
-
-              if (x.getMessage().contains(
-                      "Position in a file could not be negative!"))
-              {
-                // squash index out of bounds exception- seems to happen for
-                // disorder predictors which don't (apparently) produce any
-                // progress information and JABA server throws an exception
-                // because progress length is -1.
-                stats = null;
-              }
-              else
-              {
-                if (--serverErrorsLeft > 0)
-                {
-                  retry = true;
-                  try
-                  {
-                    Thread.sleep(200);
-                  } catch (InterruptedException q)
-                  {
-                  }
-                  ;
-                }
-                else
-                {
-                  throw x;
-                }
-              }
-            }
-          } while (retry);
-          if (stats != null)
-          {
-            System.out.print(stats.getChunk());
-            msg.append(stats);
-            rpos = stats.getNextPosition();
-          }
-        } while (stats != null && rpos > cpos);
-
-        if (!finished && status.equals(JobStatus.FAILED))
-        {
-          try
-          {
-            Thread.sleep(200);
-          } catch (InterruptedException x)
-          {
-          }
-          ;
-        }
-      } while (!finished);
-      if (serverErrorsLeft > 0)
-      {
-        try
-        {
-          Thread.sleep(200);
-        } catch (InterruptedException x)
-        {
-        }
-        ;
-        scoremanager = aaservice.getAnnotation(rslt);
-        if (scoremanager != null)
-        {
-          jalview.bin.Cache.log
-                  .debug("Updating result annotation from Job " + rslt
-                          + " at " + service.getUri());
-          updateResultAnnotation(true);
-          ap.adjustAnnotationHeight();
-        }
-      }
-    }
-
-    catch (JobSubmissionException x)
-    {
-
-      System.err.println("submission error with " + getServiceActionText()
-              + " :");
-      x.printStackTrace();
-      calcMan.workerCannotRun(this);
-    } catch (ResultNotAvailableException x)
-    {
-      System.err.println("collection error:\nJob ID: " + rslt);
-      x.printStackTrace();
-      calcMan.workerCannotRun(this);
-
-    } catch (OutOfMemoryError error)
-    {
-      calcMan.workerCannotRun(this);
-
-      // consensus = null;
-      // hconsensus = null;
-      ap.raiseOOMWarning(getServiceActionText(), error);
-    } catch (Exception x)
-    {
-      calcMan.workerCannotRun(this);
-
-      // consensus = null;
-      // hconsensus = null;
-      System.err
-              .println("Blacklisting worker due to unexpected exception:");
-      x.printStackTrace();
-    } finally
-    {
-
-      calcMan.workerComplete(this);
-      if (ap != null)
-      {
-        calcMan.workerComplete(this);
-        if (guiProgress != null && progressId != -1)
-        {
-          guiProgress.setProgressBar("", progressId);
-        }
-        ap.paintAlignment(true);
-      }
-      if (msg.length() > 0)
-      {
-        // TODO: stash message somewhere in annotation or alignment view.
-        // code below shows result in a text box popup
-        /*
-         * jalview.gui.CutAndPasteTransfer cap = new
-         * jalview.gui.CutAndPasteTransfer(); cap.setText(msg.toString());
-         * jalview.gui.Desktop.addInternalFrame(cap,
-         * "Job Status for "+getServiceActionText(), 600, 400);
-         */
-      }
-    }
-
-  }
-
-  @Override
-  public void updateAnnotation()
-  {
-    updateResultAnnotation(false);
-  }
-
-  public abstract void updateResultAnnotation(boolean immediate);
-
-  public abstract String getServiceActionText();
-
-  boolean submitGaps = true;
-
-  boolean alignedSeqs = true;
-
-  boolean nucleotidesAllowed = false;
-
-  boolean proteinAllowed = false;
-
   /**
-   * record sequences for mapping result back to afterwards
-   */
-  protected boolean bySequence = false;
-
-  Map<String, SequenceI> seqNames;
-
-  boolean[] gapMap;
-
-  int realw;
-  
-  int start,end;
-
-  public List<FastaSequence> getInputSequences(AlignmentI alignment, AnnotatedCollectionI inputSeqs)
-  {
-    if (alignment == null || alignment.getWidth() <= 0
-            || alignment.getSequences() == null
-            // || (alignedSeqs && !alignment.isAligned() && !submitGaps)
-            || alignment.isNucleotide() ? !nucleotidesAllowed
-            : !proteinAllowed)
-    {
-      return null;
-    }
-    if (inputSeqs==null || inputSeqs.getWidth()<=0 || inputSeqs.getSequences()==null || inputSeqs.getSequences().size()<1)
-    {
-      inputSeqs = alignment;
-    }
-    
-    List<compbio.data.sequence.FastaSequence> seqs = new ArrayList<compbio.data.sequence.FastaSequence>();
-
-    int minlen = 10;
-    int ln = -1;
-    if (bySequence)
-    {
-      seqNames = new HashMap<String, SequenceI>();
-    }
-    gapMap = new boolean[0];
-    start=inputSeqs.getStartRes();
-    end=inputSeqs.getEndRes();
-    
-    for (SequenceI sq : (List<SequenceI>) inputSeqs.getSequences())
-    {
-      if (sq.findPosition(end+1) -sq.findPosition(start+1) > minlen - 1)
-      {
-        String newname = SeqsetUtils.unique_name(seqs.size() + 1);
-        // make new input sequence with or without gaps
-        if (seqNames != null)
-        {
-          seqNames.put(newname, sq);
-        }
-        FastaSequence seq;
-        if (submitGaps)
-        {
-          seqs.add(seq = new compbio.data.sequence.FastaSequence(newname,
-                  sq.getSequenceAsString()));
-          if (gapMap == null || gapMap.length < seq.getSequence().length())
-          {
-            boolean[] tg = gapMap;
-            gapMap = new boolean[seq.getLength()];
-            System.arraycopy(tg, 0, gapMap, 0, tg.length);
-            for (int p = tg.length; p < gapMap.length; p++)
-            {
-              gapMap[p] = false; // init as a gap
-            }
-          }
-          for (int apos : sq.gapMap())
-          {
-            gapMap[apos] = true; // aligned.
-          }
-        }
-        else
-        {
-          seqs.add(seq = new compbio.data.sequence.FastaSequence(newname,
-                  AlignSeq.extractGaps(jalview.util.Comparison.GapChars,
-                          sq.getSequenceAsString(start,end+1))));
-        }
-        if (seq.getSequence().length() > ln)
-        {
-          ln = seq.getSequence().length();
-        }
-      }
-    }
-    if (alignedSeqs && submitGaps)
-    {
-      realw = 0;
-      for (int i = 0; i < gapMap.length; i++)
-      {
-        if (gapMap[i])
-        {
-          realw++;
-        }
-      }
-      // try real hard to return something submittable
-      // TODO: some of AAcon measures need a minimum of two or three amino
-      // acids at each position, and AAcon doesn't gracefully degrade.
-      for (int p = 0; p < seqs.size(); p++)
-      {
-        FastaSequence sq = seqs.get(p);
-        int l = sq.getSequence().length();
-        // strip gapped columns
-        char[] padded = new char[realw], orig = sq.getSequence()
-                .toCharArray();
-        for (int i = 0, pp = 0; i < realw; pp++)
-        {
-          if (gapMap[pp])
-          {
-            if (orig.length > pp)
-            {
-              padded[i++] = orig[pp];
-            }
-            else
-            {
-              padded[i++] = '-';
-            }
-          }
-        }
-        seqs.set(p, new compbio.data.sequence.FastaSequence(sq.getId(),
-                new String(padded)));
-      }
-    }
-    return seqs;
-  }
-
-  /**
-   * notify manager that we have started, and wait for a free calculation slot
    * 
-   * @return true if slot is obtained and work still valid, false if another
-   *         thread has done our work for us.
+   * @return
    */
-  boolean checkDone()
-  {
-    calcMan.notifyStart(this);
-    ap.paintAlignment(false);
-    while (!calcMan.notifyWorking(this))
-    {
-      if (calcMan.isWorking(this))
-      {
-        return true;
-      }
-      try
-      {
-        if (ap != null)
-        {
-          ap.paintAlignment(false);
-        }
-
-        Thread.sleep(200);
-      } catch (Exception ex)
-      {
-        ex.printStackTrace();
-      }
-    }
-    if (alignViewport.isClosed())
-    {
-      abortAndDestroy();
-      return true;
-    }
-    return false;
-  }
+  public abstract String getCalcId();
 
-  protected void createAnnotationRowsForScores(
-          List<AlignmentAnnotation> ourAnnot, String calcId, int alWidth,
-          Score scr)
-  {
-    // simple annotation row
-    AlignmentAnnotation annotation = alignViewport.getAlignment()
-            .findOrCreateAnnotation(scr.getMethod(), calcId, true, null,
-                    null);
-    if (alWidth == gapMap.length) // scr.getScores().size())
-    {
-      constructAnnotationFromScore(annotation, 0, alWidth, scr);
-      ourAnnot.add(annotation);
-    }
-  }
 
-  protected AlignmentAnnotation createAnnotationRowsForScores(
-          List<AlignmentAnnotation> ourAnnot, String typeName,
-          String calcId, SequenceI dseq, int base, Score scr)
-  {
-    System.out.println("Creating annotation on dseq:" + dseq.getStart()
-            + " base is " + base + " and length=" + dseq.getLength()
-            + " == " + scr.getScores().size());
-    // AlignmentAnnotation annotation = new AlignmentAnnotation(
-    // scr.getMethod(), typeName, new Annotation[]
-    // {}, 0, -1, AlignmentAnnotation.LINE_GRAPH);
-    // annotation.setCalcId(calcId);
-    AlignmentAnnotation annotation = alignViewport.getAlignment()
-            .findOrCreateAnnotation(typeName, calcId, false, dseq, null);
-    constructAnnotationFromScore(annotation, 0, dseq.getLength(), scr);
-    annotation.createSequenceMapping(dseq, base, false);
-    annotation.adjustForAlignment();
-    dseq.addAlignmentAnnotation(annotation);
-    ourAnnot.add(annotation);
-    return annotation;
-  }
 
-  private void constructAnnotationFromScore(AlignmentAnnotation annotation,
-          int base, int alWidth, Score scr)
-  {
-    Annotation[] elm = new Annotation[alWidth];
-    Iterator<Float> vals = scr.getScores().iterator();
-    float m = 0f, x = 0f;
-    for (int i = 0; vals.hasNext(); i++)
-    {
-      float val = vals.next().floatValue();
-      if (i == 0)
-      {
-        m = val;
-        x = val;
-      }
-      else
-      {
-        if (m > val)
-        {
-          m = val;
-        }
-        ;
-        if (x < val)
-        {
-          x = val;
-        }
-      }
-      // if we're at a gapped column then skip to next ungapped position
-      if (gapMap != null && gapMap.length > 0)
-      {
-        while (!gapMap[i])
-        {
-          elm[i++] = new Annotation("", "", ' ', Float.NaN);
-        }
-      }
-      elm[i] = new Annotation("", "" + val, ' ', val);
-    }
 
-    annotation.annotations = elm;
-    annotation.belowAlignment = true;
-    if (x < 0)
-    {
-      x = 0;
-    }
-    x += (x - m) * 0.1;
-    annotation.graphMax = x;
-    annotation.graphMin = m;
-    annotation.validateRangeAndDisplay();
-  }
-
-  protected void updateOurAnnots(List<AlignmentAnnotation> ourAnnot)
+  @Override
+  public void updateParameters(WsParamSetI newpreset, java.util.List<Argument> newarguments)
   {
-    List<AlignmentAnnotation> our = ourAnnots;
-    ourAnnots = ourAnnot;
-    AlignmentI alignment = alignViewport.getAlignment();
-    if (our != null)
-    {
-      if (our.size() > 0)
-      {
-        for (AlignmentAnnotation an : our)
-        {
-          if (!ourAnnots.contains(an))
-          {
-            // remove the old annotation
-            alignment.deleteAnnotation(an);
-          }
-        }
-      }
-      our.clear();
-
-      ap.adjustAnnotationHeight();
-    }
+    super.updateParameters(newpreset, newarguments);
+    initViewportParams();
   }
 }
diff --git a/src/jalview/ws/jws2/JabawsCalcWorker.java b/src/jalview/ws/jws2/JabawsCalcWorker.java
new file mode 100644 (file)
index 0000000..8515dbc
--- /dev/null
@@ -0,0 +1,609 @@
+package jalview.ws.jws2;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import compbio.data.msa.SequenceAnnotation;
+import compbio.data.sequence.FastaSequence;
+import compbio.data.sequence.Score;
+import compbio.data.sequence.ScoreManager;
+import compbio.metadata.Argument;
+import compbio.metadata.ChunkHolder;
+import compbio.metadata.JobStatus;
+import compbio.metadata.JobSubmissionException;
+import compbio.metadata.Option;
+import compbio.metadata.ResultNotAvailableException;
+import compbio.metadata.WrongParameterException;
+import jalview.analysis.AlignSeq;
+import jalview.analysis.SeqsetUtils;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.AnnotatedCollectionI;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.SequenceI;
+import jalview.gui.AlignFrame;
+import jalview.gui.IProgressIndicator;
+import jalview.workers.AlignCalcWorker;
+import jalview.ws.jws2.dm.JabaWsParamSet;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.WsParamSetI;
+
+public abstract class JabawsCalcWorker extends AlignCalcWorker
+{
+
+  protected Jws2Instance service;
+  @SuppressWarnings("unchecked")
+  protected SequenceAnnotation aaservice;
+  protected ScoreManager scoremanager;
+  protected WsParamSetI preset;
+  protected List<Argument> arguments;
+  protected IProgressIndicator guiProgress;
+
+  public JabawsCalcWorker(AlignViewportI alignViewport,
+          AlignmentViewPanel alignPanel)
+  {
+    super(alignViewport, alignPanel);
+  }
+
+  public JabawsCalcWorker(Jws2Instance service, AlignFrame alignFrame,
+          WsParamSetI preset, List<Argument> paramset)
+  {
+    this(alignFrame.getCurrentView(), alignFrame.alignPanel);
+    this.guiProgress = alignFrame;
+    this.preset = preset;
+    this.arguments = paramset;
+    this.service = service;
+    aaservice = (SequenceAnnotation) service.service;
+
+  }
+
+  public WsParamSetI getPreset()
+  {
+    return preset;
+  }
+
+  public List<Argument> getArguments()
+  {
+    return arguments;
+  }
+
+  /**
+   * reconfigure and restart the AAConClient. This method will spawn a new
+   * thread that will wait until any current jobs are finished, modify the
+   * parameters and restart the conservation calculation with the new values.
+   * 
+   * @param newpreset
+   * @param newarguments
+   */
+  public void updateParameters(final WsParamSetI newpreset, final List<Argument> newarguments)
+  {
+    preset = newpreset;
+    arguments = newarguments;
+    calcMan.startWorker(this);
+  }
+
+  public List<Option> getJabaArguments()
+  {
+    List<Option> newargs = new ArrayList<Option>();
+    if (preset != null && preset instanceof JabaWsParamSet)
+    {
+      newargs.addAll(((JabaWsParamSet) preset).getjabaArguments());
+    }
+    if (arguments != null && arguments.size() > 0)
+    {
+      for (Argument rg : arguments)
+      {
+        if (Option.class.isAssignableFrom(rg.getClass()))
+        {
+          newargs.add((Option) rg);
+        }
+      }
+    }
+    return newargs;
+  }
+
+  @Override
+  public void run()
+  {
+    if (aaservice == null)
+    {
+      return;
+    }
+    long progressId = -1;
+  
+    int serverErrorsLeft = 3;
+  
+    String rslt = "JOB NOT DEFINED";
+    StringBuffer msg = new StringBuffer();
+    try
+    {
+      if (checkDone())
+      {
+        return;
+      }
+      List<compbio.data.sequence.FastaSequence> seqs = getInputSequences(alignViewport
+              .getAlignment(), bySequence ? alignViewport.getSelectionGroup() : null);
+  
+      if (seqs == null)
+      {
+        calcMan.workerComplete(this);
+        return;
+      }
+  
+      AlignmentAnnotation[] aa = alignViewport.getAlignment()
+              .getAlignmentAnnotation();
+      if (guiProgress != null)
+      {
+        guiProgress.setProgressBar("JABA " + getServiceActionText(),
+                progressId = System.currentTimeMillis());
+      }
+      if (preset == null && arguments == null)
+      {
+        rslt = aaservice.analize(seqs);
+      }
+      else
+      {
+        try
+        {
+          rslt = aaservice.customAnalize(seqs, getJabaArguments());
+        } catch (WrongParameterException x)
+        {
+          throw new JobSubmissionException(
+                  "Invalid parameter set. Check Jalview implementation.", x);
+  
+        }
+      }
+      boolean finished = false;
+      long rpos = 0;
+      do
+      {
+        JobStatus status = aaservice.getJobStatus(rslt);
+        if (status.equals(JobStatus.FINISHED))
+        {
+          finished = true;
+        }
+        if (calcMan.isPending(this) && this instanceof AAConClient)
+        {
+          finished = true;
+          // cancel this job and yield to the new job
+          try
+          {
+            if (aaservice.cancelJob(rslt))
+            {
+              System.err.println("Cancelled AACon job: " + rslt);
+            }
+            else
+            {
+              System.err.println("FAILED TO CANCEL AACon job: " + rslt);
+            }
+  
+          } catch (Exception x)
+          {
+  
+          }
+  
+          return;
+        }
+        long cpos;
+        ChunkHolder stats = null;
+        do
+        {
+          cpos = rpos;
+          boolean retry = false;
+          do
+          {
+            try
+            {
+              stats = aaservice.pullExecStatistics(rslt, rpos);
+            } catch (Exception x)
+            {
+  
+              if (x.getMessage().contains(
+                      "Position in a file could not be negative!"))
+              {
+                // squash index out of bounds exception- seems to happen for
+                // disorder predictors which don't (apparently) produce any
+                // progress information and JABA server throws an exception
+                // because progress length is -1.
+                stats = null;
+              }
+              else
+              {
+                if (--serverErrorsLeft > 0)
+                {
+                  retry = true;
+                  try
+                  {
+                    Thread.sleep(200);
+                  } catch (InterruptedException q)
+                  {
+                  }
+                  ;
+                }
+                else
+                {
+                  throw x;
+                }
+              }
+            }
+          } while (retry);
+          if (stats != null)
+          {
+            System.out.print(stats.getChunk());
+            msg.append(stats);
+            rpos = stats.getNextPosition();
+          }
+        } while (stats != null && rpos > cpos);
+  
+        if (!finished && status.equals(JobStatus.FAILED))
+        {
+          try
+          {
+            Thread.sleep(200);
+          } catch (InterruptedException x)
+          {
+          }
+          ;
+        }
+      } while (!finished);
+      if (serverErrorsLeft > 0)
+      {
+        try
+        {
+          Thread.sleep(200);
+        } catch (InterruptedException x)
+        {
+        }
+        ;
+        scoremanager = aaservice.getAnnotation(rslt);
+        if (scoremanager != null)
+        {
+          jalview.bin.Cache.log
+                  .debug("Updating result annotation from Job " + rslt
+                          + " at " + service.getUri());
+          updateResultAnnotation(true);
+          ap.adjustAnnotationHeight();
+        }
+      }
+    }
+  
+    catch (JobSubmissionException x)
+    {
+  
+      System.err.println("submission error with " + getServiceActionText()
+              + " :");
+      x.printStackTrace();
+      calcMan.workerCannotRun(this);
+    } catch (ResultNotAvailableException x)
+    {
+      System.err.println("collection error:\nJob ID: " + rslt);
+      x.printStackTrace();
+      calcMan.workerCannotRun(this);
+  
+    } catch (OutOfMemoryError error)
+    {
+      calcMan.workerCannotRun(this);
+  
+      // consensus = null;
+      // hconsensus = null;
+      ap.raiseOOMWarning(getServiceActionText(), error);
+    } catch (Exception x)
+    {
+      calcMan.workerCannotRun(this);
+  
+      // consensus = null;
+      // hconsensus = null;
+      System.err
+              .println("Blacklisting worker due to unexpected exception:");
+      x.printStackTrace();
+    } finally
+    {
+  
+      calcMan.workerComplete(this);
+      if (ap != null)
+      {
+        calcMan.workerComplete(this);
+        if (guiProgress != null && progressId != -1)
+        {
+          guiProgress.setProgressBar("", progressId);
+        }
+        ap.paintAlignment(true);
+      }
+      if (msg.length() > 0)
+      {
+        // TODO: stash message somewhere in annotation or alignment view.
+        // code below shows result in a text box popup
+        /*
+         * jalview.gui.CutAndPasteTransfer cap = new
+         * jalview.gui.CutAndPasteTransfer(); cap.setText(msg.toString());
+         * jalview.gui.Desktop.addInternalFrame(cap,
+         * "Job Status for "+getServiceActionText(), 600, 400);
+         */
+      }
+    }
+  
+  }
+
+  @Override
+  public void updateAnnotation()
+  {
+    updateResultAnnotation(false);
+  }
+
+  public abstract void updateResultAnnotation(boolean immediate);
+
+  public abstract String getServiceActionText();
+
+  protected boolean submitGaps = true;
+  protected boolean alignedSeqs = true;
+  protected boolean nucleotidesAllowed = false;
+  protected boolean proteinAllowed = false;
+  /**
+   * record sequences for mapping result back to afterwards
+   */
+  protected boolean bySequence = false;
+  protected Map<String, SequenceI> seqNames;
+  protected boolean[] gapMap;
+  int realw;
+  int start,end;
+
+  public List<FastaSequence> getInputSequences(AlignmentI alignment, AnnotatedCollectionI inputSeqs)
+  {
+    if (alignment == null || alignment.getWidth() <= 0
+            || alignment.getSequences() == null
+            || alignment.isNucleotide() ? !nucleotidesAllowed
+            : !proteinAllowed)
+    {
+      return null;
+    }
+    if (inputSeqs==null || inputSeqs.getWidth()<=0 || inputSeqs.getSequences()==null || inputSeqs.getSequences().size()<1)
+    {
+      inputSeqs = alignment;
+    }
+    
+    List<compbio.data.sequence.FastaSequence> seqs = new ArrayList<compbio.data.sequence.FastaSequence>();
+
+    int minlen = 10;
+    int ln = -1;
+    if (bySequence)
+    {
+      seqNames = new HashMap<String, SequenceI>();
+    }
+    gapMap = new boolean[0];
+    start=inputSeqs.getStartRes();
+    end=inputSeqs.getEndRes();
+    
+
+    for (SequenceI sq : ((List<SequenceI>) alignment.getSequences()))
+    {
+      if (bySequence ? sq.findPosition(end+1) -sq.findPosition(start+1) > minlen - 1 : sq.getEnd() - sq.getStart() > minlen - 1)
+      {
+        String newname = SeqsetUtils.unique_name(seqs.size() + 1);
+        // make new input sequence with or without gaps
+        if (seqNames != null)
+        {
+          seqNames.put(newname, sq);
+        }
+        FastaSequence seq;
+        if (submitGaps)
+        {
+          seqs.add(seq = new compbio.data.sequence.FastaSequence(newname,
+                  sq.getSequenceAsString()));
+          if (gapMap == null || gapMap.length < seq.getSequence().length())
+          {
+            boolean[] tg = gapMap;
+            gapMap = new boolean[seq.getLength()];
+            System.arraycopy(tg, 0, gapMap, 0, tg.length);
+            for (int p = tg.length; p < gapMap.length; p++)
+            {
+              gapMap[p] = false; // init as a gap
+            }
+          }
+          for (int apos : sq.gapMap())
+          {
+            gapMap[apos] = true; // aligned.
+          }
+        }
+        else
+        {
+          seqs.add(seq = new compbio.data.sequence.FastaSequence(newname,
+                  AlignSeq.extractGaps(jalview.util.Comparison.GapChars,
+                          sq.getSequenceAsString(start,end+1))));
+        }
+        if (seq.getSequence().length() > ln)
+        {
+          ln = seq.getSequence().length();
+        }
+      }
+    }
+    if (alignedSeqs && submitGaps)
+    {
+      realw = 0;
+      for (int i = 0; i < gapMap.length; i++)
+      {
+        if (gapMap[i])
+        {
+          realw++;
+        }
+      }
+      // try real hard to return something submittable
+      // TODO: some of AAcon measures need a minimum of two or three amino
+      // acids at each position, and AAcon doesn't gracefully degrade.
+      for (int p = 0; p < seqs.size(); p++)
+      {
+        FastaSequence sq = seqs.get(p);
+        int l = sq.getSequence().length();
+        // strip gapped columns
+        char[] padded = new char[realw], orig = sq.getSequence()
+                .toCharArray();
+        for (int i = 0, pp = 0; i < realw; pp++)
+        {
+          if (gapMap[pp])
+          {
+            if (orig.length > pp)
+            {
+              padded[i++] = orig[pp];
+            }
+            else
+            {
+              padded[i++] = '-';
+            }
+          }
+        }
+        seqs.set(p, new compbio.data.sequence.FastaSequence(sq.getId(),
+                new String(padded)));
+      }
+    }
+    return seqs;
+  }
+
+  /**
+   * notify manager that we have started, and wait for a free calculation slot
+   * 
+   * @return true if slot is obtained and work still valid, false if another
+   *         thread has done our work for us.
+   */
+  boolean checkDone()
+  {
+    calcMan.notifyStart(this);
+    ap.paintAlignment(false);
+    while (!calcMan.notifyWorking(this))
+    {
+      if (calcMan.isWorking(this))
+      {
+        return true;
+      }
+      try
+      {
+        if (ap != null)
+        {
+          ap.paintAlignment(false);
+        }
+  
+        Thread.sleep(200);
+      } catch (Exception ex)
+      {
+        ex.printStackTrace();
+      }
+    }
+    if (alignViewport.isClosed())
+    {
+      abortAndDestroy();
+      return true;
+    }
+    return false;
+  }
+
+  protected void createAnnotationRowsForScores(List<AlignmentAnnotation> ourAnnot, String calcId,
+          int alWidth, Score scr)
+  {
+    // simple annotation row
+    AlignmentAnnotation annotation = alignViewport.getAlignment()
+            .findOrCreateAnnotation(scr.getMethod(), calcId, true, null,
+                    null);
+    if (alWidth == gapMap.length) // scr.getScores().size())
+    {
+      constructAnnotationFromScore(annotation, 0, alWidth, scr);
+      ourAnnot.add(annotation);
+    }
+  }
+
+  protected AlignmentAnnotation createAnnotationRowsForScores(List<AlignmentAnnotation> ourAnnot, String typeName,
+          String calcId, SequenceI dseq, int base, Score scr)
+  {
+    System.out.println("Creating annotation on dseq:" + dseq.getStart()
+            + " base is " + base + " and length=" + dseq.getLength()
+            + " == " + scr.getScores().size());
+    // AlignmentAnnotation annotation = new AlignmentAnnotation(
+    // scr.getMethod(), typeName, new Annotation[]
+    // {}, 0, -1, AlignmentAnnotation.LINE_GRAPH);
+    // annotation.setCalcId(calcId);
+    AlignmentAnnotation annotation = alignViewport.getAlignment()
+            .findOrCreateAnnotation(typeName, calcId, false, dseq, null);
+    constructAnnotationFromScore(annotation, 0, dseq.getLength(), scr);
+    annotation.createSequenceMapping(dseq, base, false);
+    annotation.adjustForAlignment();
+    dseq.addAlignmentAnnotation(annotation);
+    ourAnnot.add(annotation);
+    return annotation;
+  }
+
+  private void constructAnnotationFromScore(AlignmentAnnotation annotation, int base,
+          int alWidth, Score scr)
+  {
+    Annotation[] elm = new Annotation[alWidth];
+    Iterator<Float> vals = scr.getScores().iterator();
+    float m = 0f, x = 0f;
+    for (int i = 0; vals.hasNext(); i++)
+    {
+      float val = vals.next().floatValue();
+      if (i == 0)
+      {
+        m = val;
+        x = val;
+      }
+      else
+      {
+        if (m > val)
+        {
+          m = val;
+        }
+        ;
+        if (x < val)
+        {
+          x = val;
+        }
+      }
+      // if we're at a gapped column then skip to next ungapped position
+      if (gapMap != null && gapMap.length > 0)
+      {
+        while (!gapMap[i])
+        {
+          elm[i++] = new Annotation("", "", ' ', Float.NaN);
+        }
+      }
+      elm[i] = new Annotation("", "" + val, ' ', val);
+    }
+  
+    annotation.annotations = elm;
+    annotation.belowAlignment = true;
+    if (x < 0)
+    {
+      x = 0;
+    }
+    x += (x - m) * 0.1;
+    annotation.graphMax = x;
+    annotation.graphMin = m;
+    annotation.validateRangeAndDisplay();
+  }
+
+  protected void updateOurAnnots(List<AlignmentAnnotation> ourAnnot)
+  {
+    List<AlignmentAnnotation> our = ourAnnots;
+    ourAnnots = ourAnnot;
+    AlignmentI alignment = alignViewport.getAlignment();
+    if (our != null)
+    {
+      if (our.size() > 0)
+      {
+        for (AlignmentAnnotation an : our)
+        {
+          if (!ourAnnots.contains(an))
+          {
+            // remove the old annotation
+            alignment.deleteAnnotation(an);
+          }
+        }
+      }
+      our.clear();
+  
+      ap.adjustAnnotationHeight();
+    }
+  }
+
+}
index 8ad14e0..8f56e2f 100644 (file)
@@ -38,6 +38,7 @@ import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.StringTokenizer;
 import java.util.Vector;
 
@@ -105,6 +106,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
 
   public void run()
   {
+
     if (running && oldthread != null && oldthread.isAlive())
     {
       if (!aborted)
@@ -126,6 +128,15 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
       Cache.log.debug("Old discovery thread has finished.");
     }
     running = true;
+    
+    // first set up exclusion list if needed
+    final Set<String> ignoredServices = new HashSet<String>();
+    for (String ignored:jalview.bin.Cache.getDefault("IGNORED_JABAWS_SERVICETYPES", Services.JpredWS.toString()).split("\\|"))
+    {
+      ignoredServices.add(ignored);
+    }
+
+    
     changeSupport.firePropertyChange("services", services, new Vector());
     oldthread = Thread.currentThread();
     try
@@ -169,7 +180,10 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
         // for all possible services
         for (Services sv : squery.JABAWS2SERVERS)
         {
-          svctypes.add(sv.toString());
+          if (!ignoredServices.contains(sv.toString()))
+          {
+            svctypes.add(sv.toString());
+          }
         }
 
       }
@@ -189,7 +203,9 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
       ;
       for (JabaWsServerQuery squery : qrys)
       {
-        finished = finished && !squery.isRunning();
+        if (squery.isRunning()){
+          finished=false;
+        }
       }
       if (aborted)
       {
@@ -222,7 +238,10 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
         services = new Vector<Jws2Instance>();
         for (Jws2Instance svc : svcs)
         {
-          services.add(svc);
+          if (!ignoredServices.contains(svc.serviceType))
+          {
+            services.add(svc);
+          }
         }
       }
     }
index 16959ff..e6b9f53 100644 (file)
@@ -17,6 +17,7 @@
  */
 package jalview.ws.jws2;
 
+import java.net.MalformedURLException;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
@@ -126,6 +127,7 @@ public class ParameterUtils
   {
     copy.setName(option.getName());
     copy.setDescription(option.getDescription());
+    copy.setBasicURL(option.getBasicURL());
     copy.setFurtherDetails(option.getFurtherDetails());
     copy.setRequired(option.isRequired());
     List<String> names = option.getOptionNames();
diff --git a/src/jalview/ws/jws2/RNAalifoldClient.java b/src/jalview/ws/jws2/RNAalifoldClient.java
new file mode 100644 (file)
index 0000000..ec40552
--- /dev/null
@@ -0,0 +1,371 @@
+package jalview.ws.jws2;
+
+import jalview.api.AlignCalcWorkerI;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.Annotation;
+import jalview.gui.AlignFrame;
+import jalview.ws.jws2.dm.AAConSettings;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.WsParamSetI;
+import jalview.ws.uimodel.AlignAnalysisUIText;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.TreeSet;
+import java.util.regex.Pattern;
+
+import compbio.data.sequence.RNAStructReader.AlifoldResult;
+import compbio.data.sequence.RNAStructScoreManager;
+import compbio.data.sequence.Range;
+import compbio.data.sequence.Score;
+import compbio.metadata.Argument;
+
+/**
+ * Client for the JABA RNA Alifold Service
+ * @author daluke - Daniel Barton
+ *
+ */
+
+public class RNAalifoldClient extends JabawsAlignCalcWorker implements
+        AlignCalcWorkerI
+{
+
+  String methodName;
+
+  AlignFrame af;
+
+  // keeps track of whether the RNAalifold result includes base contact
+  // probabilities
+  boolean bpScores;
+
+  public RNAalifoldClient(Jws2Instance sh, AlignFrame alignFrame,
+          WsParamSetI preset, List<Argument> paramset)
+  {
+    super(sh, alignFrame, preset, paramset);
+
+    //if (arguments == null)
+    //  arguments = new ArrayList<Argument>();
+
+    af = alignFrame;
+    methodName = sh.serviceType;
+    alignedSeqs=true;
+    submitGaps=true;
+    nucleotidesAllowed = true;
+    proteinAllowed = false;
+    initViewportParams();
+  }
+  
+  public String getCalcId()
+  {
+    return CALC_ID;
+  }
+  private static String CALC_ID="jalview.ws.jws2.RNAalifoldClient";
+
+  public static AlignAnalysisUIText getAlignAnalysisUITest()
+  {
+    return new AlignAnalysisUIText(
+            compbio.ws.client.Services.RNAalifoldWS.toString(),
+            jalview.ws.jws2.RNAalifoldClient.class,
+            CALC_ID,
+            true,
+            false,
+            true,
+            "RNAAliFold Prediction",
+            "When checked, RNA secondary structure predictions will be calculated for the alignment, and updated when edits are made.",
+            "Change RNAAliFold settings...",
+            "Modify settings for the RNAAliFold prediction. Use this to hide or show different results of the RNA calculation, and change RNA folding parameters");
+
+  }
+
+  @Override
+  public String getServiceActionText()
+  {
+    return "Submitting RNA alignment for Secondary Structure prediction using "
+            + "RNAalifold Service";
+  }
+
+  @Override
+  public void updateResultAnnotation(boolean immediate)
+  {
+
+    if (immediate || !calcMan.isWorking(this) && scoremanager != null)
+    {
+
+      List<AlignmentAnnotation> ourAnnot = new ArrayList<AlignmentAnnotation>();
+
+      // Unpack the ScoreManager
+      List<String> structs = ((RNAStructScoreManager) scoremanager)
+              .getStructs();
+      List<TreeSet<Score>> data = ((RNAStructScoreManager) scoremanager)
+              .getData();
+
+      // test to see if this data object contains base pair contacts
+      Score fscore = data.get(0).first();
+      this.bpScores = (fscore.getMethod()
+              .equals(AlifoldResult.contactProbabilities.toString()));
+
+      // add annotation for the consensus sequence alignment
+      createAnnotationRowforScoreHolder(ourAnnot, getCalcId(),
+              structs.get(0), null, null);
+
+      // Add annotations for the mfe Structure
+      createAnnotationRowforScoreHolder(ourAnnot, getCalcId(),
+              structs.get(1), data.get(1), null);
+
+      // decide whether to add base pair contact probability histogram
+      int count = 2;
+      if (bpScores)
+      {
+        createAnnotationRowforScoreHolder(ourAnnot, getCalcId(),
+                structs.get(2), data.get(0), data.get(2));
+        count++;
+      }
+
+      // Now loop for the rest of the Annotations (if there it isn't stochastic
+      // output
+      // only the centroid and MEA structures remain anyway)
+      for (int i = count; i < structs.size(); i++)
+      {
+        // The ensemble values should be displayed in the description of the
+        // first (or all?) Stochastic Backtrack Structures.
+        if (!data.get(i).first().getMethod()
+                .equals(AlifoldResult.ensembleValues.toString()))
+        {
+
+          createAnnotationRowforScoreHolder(ourAnnot, getCalcId(),
+                  structs.get(i), data.get(i), null);
+        }
+      }
+
+      if (ourAnnot.size() > 0)
+      {
+
+        updateOurAnnots(ourAnnot);
+        ap.adjustAnnotationHeight();
+      }
+    }
+  }
+
+  protected void createAnnotationRowforScoreHolder(
+          List<AlignmentAnnotation> ourAnnot, String calcId, String struct,
+          TreeSet<Score> data, TreeSet<Score> descriptionData)
+  {
+    /*
+     * If contactProbability information is returned from RNAalifold it is
+     * stored in the first TreeSet<Score> object corresponding to the String Id
+     * which holds the consensus alignment. The method enumeration is then
+     * updated to AlifoldResult.contactProbabilties. This line recreates the
+     * same data object as was overwritten with the contact probabilites data.
+     */
+    if (data == null)
+      data = compbio.data.sequence.RNAStructReader
+              .newEmptyScore(AlifoldResult.consensusAlignment);
+
+    if (descriptionData == null)
+      descriptionData = data;
+
+    String[] typenameAndDescription = constructTypenameAndDescription(descriptionData
+            .first());
+    String typename = typenameAndDescription[0];
+    String description = typenameAndDescription[1];
+
+    AlignmentAnnotation annotation = alignViewport.getAlignment()
+            .findOrCreateAnnotation(typename, calcId, false, null, null);
+
+    constructAnnotationFromScoreHolder(annotation, struct, data);
+
+    /*
+     * update annotation description with the free Energy, frequency in ensemble
+     * or other data where appropriate.
+     * 
+     * Doesnt deal with AlifoldResult.ensembleValues, the free energy of
+     * ensemble and frequency of mfe structure in ensemble. How to deal with
+     * these?
+     */
+    annotation.description = description;
+
+    annotation.belowAlignment = false;
+    // annotation.showAllColLabels = true;
+
+    alignViewport.getAlignment().validateAnnotation(annotation);
+    af.setMenusForViewport();
+
+    ourAnnot.add(annotation);
+  }
+
+  private AlignmentAnnotation constructAnnotationFromScoreHolder(
+          AlignmentAnnotation annotation, String struct, TreeSet<Score> data)
+  {
+    Annotation[] anns = new Annotation[struct.length()];
+
+    if (data != null
+            && data.size() > 1
+            && data.first().getMethod()
+                    .equals(AlifoldResult.contactProbabilities.toString()))
+    {
+
+      // The base pair probabilities are stored in a set in scoreholder. we want
+      // a map
+      LinkedHashMap<Range, Float> basePairs = new LinkedHashMap<Range, Float>();
+      for (Score score : data)
+      {
+        // The Score objects contain a set of size one containing the range and
+        // an ArrayList<float> of size one containing the probabilty
+        basePairs.put(score.getRanges().first(), new Float(score
+                .getScores().get(0)));
+      }
+      
+      for (int i = 0,ri=0,iEnd=struct.length();i<iEnd; i++,ri++)
+      {
+        if (gapMap!=null)
+        {
+          // skip any gapped columns in the input data
+          while (!gapMap[ri])
+          {
+            ri++;
+          }
+        }
+        // Return all the contacts associated with position i
+        LinkedHashMap<Range, Float> contacts = isContact(basePairs, i + 1);
+
+        String description = "";
+        float prob = 0f;
+
+        if (contacts.size() == 0)
+        {
+          description = "No Data";
+        }
+        else
+        {
+          for (Range contact : contacts.keySet())
+          {
+            float t = contacts.get(contact);
+            if (t > prob)
+              prob = t;
+            description += Integer.toString(contact.from) + "->"
+                    + Integer.toString(contact.to) + ": "
+                    + Float.toString(t) + "%  |  ";
+          }
+        }
+
+        anns[ri] = new Annotation(struct.substring(i, i + 1), description,
+                isSS(struct.charAt(i)), prob);
+      }
+    }
+    else if (data == null || data.size() == 1)
+    {
+      for (int i = 0,ri=0,iEnd=struct.length();i<iEnd; i++,ri++)
+      {
+        if (gapMap!=null)
+        {
+          // skip any gapped columns in the input data
+          while (!gapMap[ri])
+          {
+            ri++;
+          }
+        }
+        anns[ri] = new Annotation(struct.substring(i, i + 1), "",
+                isSS(struct.charAt(i)), Float.NaN);
+      }
+
+      annotation.graph = 0; // No graph
+    }
+
+    annotation.annotations = anns;
+
+    return annotation;
+  }
+
+  private String[] constructTypenameAndDescription(Score score)
+  {
+    String description = "";
+    String typename = "";
+    String datatype = score.getMethod();
+
+    // Look up java switch syntax and use one here
+    if (datatype.equals(AlifoldResult.mfeStructure.toString()))
+    {
+
+      description = MessageFormat.format(
+              "Minimum Free Energy Structure. Energy: {0} = {1} + {2}",
+              score.getScores().get(0), score.getScores().get(1), score
+                      .getScores().get(2));
+      typename = "MFE Structure";
+    }
+    else if (datatype.equals(AlifoldResult.contactProbabilityStructure
+            .toString()))
+    {
+      description = MessageFormat
+              .format("Base Pair Contact Probabilities. "
+                      + "Energy of Ensemble: {0}  Frequency of Ensemble: {1}",
+                      score.getScores().get(0), score.getScores().get(1));
+      typename = "Contact Probabilities";
+    }
+    else if (datatype.equals(AlifoldResult.centroidStructure.toString()))
+    {
+      description = MessageFormat.format(
+              "Centroid Structure. Energy: {0} = {1} + {2}", score
+                      .getScores().get(0), score.getScores().get(1), score
+                      .getScores().get(2));
+      typename = "Centroid Structure";
+    }
+    else if (datatype.equals(AlifoldResult.stochBTStructure.toString()))
+    {
+      if (score.getScores().size() > 0)
+      {
+        description = MessageFormat.format("Probability: {0}  Energy: {1}",
+                score.getScores().get(0), score.getScores().get(1));
+      }
+      else
+        description = "Stochastic Backtrack Structure";
+    }
+    else if (datatype.equals(AlifoldResult.MEAStucture.toString()))
+    {
+      description = MessageFormat.format(
+              "Maximum Expected Accuracy Values: '{' {0} MEA={1} '}", score
+                      .getScores().get(0), score.getScores().get(1));
+      typename = "MEA Structure";
+    }
+    else if (datatype.equals(AlifoldResult.consensusAlignment.toString()))
+    {
+      typename = "RNAalifold Consensus";
+      description = "Consensus Alignment Produced by RNAalifold";
+    }
+    else
+    {
+      typename = datatype;
+      description = typename;
+    }
+
+    return new String[]
+    { typename, description };
+  }
+
+  // Check whether, at position i there is a base contact and return all the
+  // contacts at this position. Should be in order of descending probability.
+  private LinkedHashMap<Range, Float> isContact(
+          LinkedHashMap<Range, Float> basePairs, int i)
+  {
+    LinkedHashMap<Range, Float> contacts = new LinkedHashMap<Range, Float>();
+
+    for (Range contact : basePairs.keySet())
+    {
+      // finds the contacts associtated with position i ordered by the natural
+      // ordering of the Scores TreeSet in ScoreManager which is, descending
+      // probability
+      if (contact.from == i || contact.to == i)
+        contacts.put(contact, basePairs.get(contact));
+    }
+
+    return contacts;
+  }
+
+  private char isSS(char chr)
+  {
+    String regex = "\\(|\\)|\\{|\\}|\\[|\\]";
+    char ss = (Pattern.matches(regex, Character.toString(chr))) ? 'S' : ' ';
+    return ss;
+  }
+}
index d57eae4..59cc962 100644 (file)
@@ -25,6 +25,7 @@ import jalview.gui.JvSwingUtils;
 import jalview.ws.jws2.dm.AAConSettings;
 import jalview.ws.jws2.jabaws2.Jws2Instance;
 import jalview.ws.params.WsParamSetI;
+import jalview.ws.uimodel.AlignAnalysisUIText;
 
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -43,9 +44,6 @@ import javax.swing.event.MenuListener;
  */
 public class SequenceAnnotationWSClient extends Jws2Client
 {
-
-  public static final String AAConCalcId = "jabaws2.AACon";
-
   /**
    * initialise a client so its attachWSMenuEntry method can be called.
    */
@@ -61,44 +59,59 @@ public class SequenceAnnotationWSClient extends Jws2Client
     initSequenceAnnotationWSClient(sh, alignFrame, preset, editParams);
   }
 
+  // dan think. Do I need to change this method to run RNAalifold through the GUI
+  
   public void initSequenceAnnotationWSClient(final Jws2Instance sh,
           AlignFrame alignFrame, WsParamSetI preset, boolean editParams)
   {
-    if (alignFrame.getViewport().getAlignment().isNucleotide())
-    {
-      JOptionPane.showMessageDialog(Desktop.desktop, sh.serviceType
-              + " can only be used\nfor amino acid alignments.",
-              "Wrong type of sequences!", JOptionPane.WARNING_MESSAGE);
-      return;
-
-    }
-    if (sh.action.toLowerCase().contains("conservation"))
+       // dan changed! dan test. comment out if conditional
+//    if (alignFrame.getViewport().getAlignment().isNucleotide())
+//    {
+//      JOptionPane.showMessageDialog(Desktop.desktop, sh.serviceType
+//              + " can only be used\nfor amino acid alignments.",
+//              "Wrong type of sequences!", JOptionPane.WARNING_MESSAGE);
+//      return;
+//
+//    }
+    AlignAnalysisUIText aaui = sh.getAlignAnalysisUI();
+    if (aaui!=null)
     {
+      Class clientClass = aaui.getClient();
+      
       // Build an AACon style client - take alignment, return annotation for
       // columns
 
       List<AlignCalcWorkerI> clnts = alignFrame.getViewport()
               .getCalcManager()
-              .getRegisteredWorkersOfClass(AAConClient.class);
+              .getRegisteredWorkersOfClass(clientClass);
+      JabawsAlignCalcWorker worker;
       if (clnts == null || clnts.size() == 0)
       {
         if (!processParams(sh, editParams))
         {
           return;
         }
-        AAConClient worker;
+        try {
+          worker = (JabawsAlignCalcWorker) (clientClass.getConstructor(
+                  new Class[] { Jws2Instance.class, 
+                          AlignFrame.class, WsParamSetI.class, 
+                          List.class }).newInstance(new Object[] { sh, alignFrame, this.preset, paramset}));
+        } catch (Exception x)
+        {
+          x.printStackTrace();
+          throw new Error("Implementation error",x);
+        }
         alignFrame
                 .getViewport()
                 .getCalcManager()
                 .registerWorker(
-                        worker = new AAConClient(sh, alignFrame,
-                                this.preset, paramset));
+                        worker);
         alignFrame.getViewport().getCalcManager().startWorker(worker);
 
       }
       else
       {
-        AAConClient worker = (AAConClient) clnts.get(0);
+        worker = (JabawsAlignCalcWorker) clnts.get(0);
         if (editParams)
         {
           paramset = worker.getArguments();
@@ -113,7 +126,6 @@ public class SequenceAnnotationWSClient extends Jws2Client
         // invalid parameters)
         alignFrame.getViewport().getCalcManager().workerMayRun(worker);
         worker.updateParameters(this.preset, paramset);
-
       }
     }
     if (sh.action.toLowerCase().contains("disorder"))
@@ -131,7 +143,6 @@ public class SequenceAnnotationWSClient extends Jws2Client
               .startWorker(
                       new AADisorderClient(sh, alignFrame, preset, paramset));
     }
-
   }
 
   public SequenceAnnotationWSClient(AAConSettings fave,
@@ -151,10 +162,8 @@ public class SequenceAnnotationWSClient extends Jws2Client
   public void attachWSMenuEntry(JMenu wsmenu, final Jws2Instance service,
           final AlignFrame alignFrame)
   {
-    if (service.serviceType.equals(compbio.ws.client.Services.AAConWS
-            .toString()))
-    {
-      registerAAConWSInstance(wsmenu, service, alignFrame);
+    if (registerAAConWSInstance(wsmenu, service, alignFrame)) {
+      // Alignment dependent analysis calculation WS gui
       return;
     }
     boolean hasparams = service.hasParameters();
@@ -240,21 +249,24 @@ public class SequenceAnnotationWSClient extends Jws2Client
     }
   }
 
-  private final String AAconToggle = "AACon Calculations",
-          AAconToggleTooltip = "When checked, AACon calculations are updated automatically.",
-          AAeditSettings = "Change AACon Settings...",
-          AAeditSettingsTooltip = "Modify settings for AACon calculations.";
-
-  private void registerAAConWSInstance(final JMenu wsmenu,
+  
+  private boolean registerAAConWSInstance(final JMenu wsmenu,
           final Jws2Instance service, final AlignFrame alignFrame)
   {
-    // register this in the AACon settings set
+    final AlignAnalysisUIText aaui = service.getAlignAnalysisUI(); // null ; // AlignAnalysisUIText.aaConGUI.get(service.serviceType.toString());
+    if (aaui==null)
+    {
+      // not an instantaneous calculation GUI type service
+      return false;
+    }
+    // create the instaneous calculation GUI bits and update state if existing GUI elements already present
+    
     JCheckBoxMenuItem _aaConEnabled = null;
     for (int i = 0; i < wsmenu.getItemCount(); i++)
     {
       JMenuItem item = wsmenu.getItem(i);
       if (item instanceof JCheckBoxMenuItem
-              && item.getText().equals(AAconToggle))
+              && item.getText().equals(aaui.getAAconToggle()))
       {
         _aaConEnabled = (JCheckBoxMenuItem) item;
       }
@@ -264,10 +276,10 @@ public class SequenceAnnotationWSClient extends Jws2Client
     {
       List<AlignCalcWorkerI> aaconClient = alignFrame.getViewport()
               .getCalcManager()
-              .getRegisteredWorkersOfClass(AAConClient.class);
+              .getRegisteredWorkersOfClass(aaui.getClient());
       if (aaconClient != null && aaconClient.size() > 0)
       {
-        AAConClient worker = (AAConClient) aaconClient.get(0);
+        JabawsAlignCalcWorker worker = (JabawsAlignCalcWorker) aaconClient.get(0);
         if (!worker.service.hosturl.equals(service.hosturl))
         {
           // javax.swing.SwingUtilities.invokeLater(new Runnable()
@@ -275,8 +287,8 @@ public class SequenceAnnotationWSClient extends Jws2Client
             // @Override
             // public void run()
             {
-              removeCurrentAAConWorkerFor(alignFrame);
-              buildCurrentAAConWorkerFor(alignFrame, service);
+              removeCurrentAAConWorkerFor(aaui, alignFrame);
+              buildCurrentAAConWorkerFor(aaui, alignFrame, service);
             }
           }// );
         }
@@ -288,85 +300,95 @@ public class SequenceAnnotationWSClient extends Jws2Client
     if (_aaConEnabled == null)
     {
       final JCheckBoxMenuItem aaConEnabled = new JCheckBoxMenuItem(
-              AAconToggle);
-      wsmenu.addMenuListener(new MenuListener()
-      {
+              aaui.getAAconToggle());
 
+      aaConEnabled.setToolTipText("<html><p>"
+              + JvSwingUtils.wrapTooltip(aaui.getAAconToggleTooltip() + "</p>")
+              + "</html>");
+      aaConEnabled.addActionListener(new ActionListener()
+      {
         @Override
-        public void menuSelected(MenuEvent arg0)
+        public void actionPerformed(ActionEvent arg0)
         {
-          wsmenu.setEnabled(!alignFrame.getViewport().getAlignment()
-                  .isNucleotide());
           List<AlignCalcWorkerI> aaconClient = alignFrame.getViewport()
                   .getCalcManager()
-                  .getRegisteredWorkersOfClass(AAConClient.class);
+                  .getRegisteredWorkersOfClass(aaui.getClient());
           if (aaconClient != null && aaconClient.size() > 0)
           {
-            aaConEnabled.setSelected(true);
+            removeCurrentAAConWorkerFor(aaui, alignFrame);
           }
           else
           {
-            aaConEnabled.setSelected(false);
+            buildCurrentAAConWorkerFor(aaui, alignFrame);
+
           }
         }
 
-        @Override
-        public void menuDeselected(MenuEvent arg0)
-        {
-          // TODO Auto-generated method stub
-
-        }
+      });
+      wsmenu.add(aaConEnabled);
+      final JMenuItem modifyParams = new JMenuItem(aaui.getAAeditSettings());
+      modifyParams.setToolTipText("<html><p>"
+              + JvSwingUtils.wrapTooltip(aaui.getAAeditSettingsTooltip() + "</p>")
+              + "</html>");
+      modifyParams.addActionListener(new ActionListener()
+      {
 
         @Override
-        public void menuCanceled(MenuEvent arg0)
+        public void actionPerformed(ActionEvent arg0)
         {
-          // TODO Auto-generated method stub
-
+          showAAConAnnotationSettingsFor(aaui, alignFrame);
         }
       });
-      aaConEnabled.setToolTipText("<html><p>"
-              + JvSwingUtils.wrapTooltip(AAconToggleTooltip + "</p>")
-              + "</html>");
-      aaConEnabled.addActionListener(new ActionListener()
+      wsmenu.add(modifyParams);
+      wsmenu.addMenuListener(new MenuListener()
       {
+
         @Override
-        public void actionPerformed(ActionEvent arg0)
+        public void menuSelected(MenuEvent arg0)
         {
+          // TODO: refactor to the implementing class.
+          if (alignFrame.getViewport().getAlignment()
+                  .isNucleotide() ? aaui.isNa() : aaui.isPr()) {
+            aaConEnabled.setEnabled(true);
+            modifyParams.setEnabled(true);
+          }
+          else {
+            aaConEnabled.setEnabled(false);
+            modifyParams.setEnabled(false);
+          }
           List<AlignCalcWorkerI> aaconClient = alignFrame.getViewport()
                   .getCalcManager()
-                  .getRegisteredWorkersOfClass(AAConClient.class);
+                  .getRegisteredWorkersOfClass(aaui.getClient());
           if (aaconClient != null && aaconClient.size() > 0)
           {
-            removeCurrentAAConWorkerFor(alignFrame);
+            aaConEnabled.setSelected(true);
           }
           else
           {
-            buildCurrentAAConWorkerFor(alignFrame);
-
+            aaConEnabled.setSelected(false);
           }
         }
 
-      });
-      wsmenu.add(aaConEnabled);
-      JMenuItem modifyParams = new JMenuItem(AAeditSettings);
-      modifyParams.setToolTipText("<html><p>"
-              + JvSwingUtils.wrapTooltip(AAeditSettingsTooltip + "</p>")
-              + "</html>");
-      modifyParams.addActionListener(new ActionListener()
-      {
+        @Override
+        public void menuDeselected(MenuEvent arg0)
+        {
+          // TODO Auto-generated method stub
+
+        }
 
         @Override
-        public void actionPerformed(ActionEvent arg0)
+        public void menuCanceled(MenuEvent arg0)
         {
-          showAAConAnnotationSettingsFor(alignFrame);
+          // TODO Auto-generated method stub
+
         }
       });
-      wsmenu.add(modifyParams);
 
     }
+    return true;
   }
 
-  private static void showAAConAnnotationSettingsFor(AlignFrame alignFrame)
+  private static void showAAConAnnotationSettingsFor(final AlignAnalysisUIText aaui, AlignFrame alignFrame)
   {
     /*
      * preferred settings Whether AACon is automatically recalculated Which
@@ -374,21 +396,21 @@ public class SequenceAnnotationWSClient extends Jws2Client
      */
     // could actually do a class search for this too
     AAConSettings fave = (AAConSettings) alignFrame.getViewport()
-            .getCalcIdSettingsFor(AAConCalcId);
+            .getCalcIdSettingsFor(aaui.getCalcId());
     if (fave == null)
     {
-      fave = createDefaultAAConSettings();
+      fave = createDefaultAAConSettings(aaui);
     }
     new SequenceAnnotationWSClient(fave, alignFrame, true);
 
   }
 
-  private static void buildCurrentAAConWorkerFor(AlignFrame alignFrame)
+  private static void buildCurrentAAConWorkerFor(final AlignAnalysisUIText aaui, AlignFrame alignFrame)
   {
-    buildCurrentAAConWorkerFor(alignFrame, null);
+    buildCurrentAAConWorkerFor(aaui, alignFrame, null);
   }
 
-  private static void buildCurrentAAConWorkerFor(AlignFrame alignFrame,
+  private static void buildCurrentAAConWorkerFor(final AlignAnalysisUIText aaui, AlignFrame alignFrame,
           Jws2Instance service)
   {
     /*
@@ -396,10 +418,10 @@ public class SequenceAnnotationWSClient extends Jws2Client
      * AACon server to use What parameters to use
      */
     AAConSettings fave = (AAConSettings) alignFrame.getViewport()
-            .getCalcIdSettingsFor(AAConCalcId);
+            .getCalcIdSettingsFor(aaui.getCalcId());
     if (fave == null)
     {
-      fave = createDefaultAAConSettings(service);
+      fave = createDefaultAAConSettings(aaui, service);
     }
     else
     {
@@ -414,12 +436,12 @@ public class SequenceAnnotationWSClient extends Jws2Client
     new SequenceAnnotationWSClient(fave, alignFrame, false);
   }
 
-  private static AAConSettings createDefaultAAConSettings()
+  private static AAConSettings createDefaultAAConSettings(AlignAnalysisUIText aaui)
   {
-    return createDefaultAAConSettings(null);
+    return createDefaultAAConSettings(aaui, null);
   }
 
-  private static AAConSettings createDefaultAAConSettings(
+  private static AAConSettings createDefaultAAConSettings(AlignAnalysisUIText aaui,
           Jws2Instance service)
   {
     if (service != null)
@@ -447,7 +469,7 @@ public class SequenceAnnotationWSClient extends Jws2Client
     {
       // get the default service for AACon
       service = Jws2Discoverer.getDiscoverer().getPreferredServiceFor(null,
-              compbio.ws.client.Services.AAConWS.toString());
+              aaui.getServiceType());
     }
     if (service == null)
     {
@@ -458,9 +480,9 @@ public class SequenceAnnotationWSClient extends Jws2Client
     return new AAConSettings(true, service, null, null);
   }
 
-  private static void removeCurrentAAConWorkerFor(AlignFrame alignFrame)
+  private static void removeCurrentAAConWorkerFor(AlignAnalysisUIText aaui, AlignFrame alignFrame)
   {
     alignFrame.getViewport().getCalcManager()
-            .removeRegisteredWorkersOfClass(AAConClient.class);
+            .removeRegisteredWorkersOfClass(aaui.getClient());
   }
 }
index 69f8f7b..7316d2f 100644 (file)
@@ -20,6 +20,7 @@ package jalview.ws.jws2.dm;
 import jalview.ws.jws2.ParameterUtils;
 import jalview.ws.params.OptionI;
 
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.List;
 
@@ -49,7 +50,15 @@ public class JabaOption implements jalview.ws.params.OptionI
   @Override
   public URL getFurtherDetails()
   {
-    return opt.getFurtherDetails();
+    try {
+    return new URL(opt.getBasicURL().toExternalForm()+"/"+opt.getFurtherDetails());
+    }
+    catch (NullPointerException q) {}
+    catch (MalformedURLException q)
+    {
+      
+    }
+    return null;
   }
 
   @Override
index aa42ff7..509b96f 100644 (file)
@@ -48,6 +48,14 @@ public class Jws2Instance
 
   public String docUrl;
 
+  /**
+   * 
+   * @param hosturl Service endpoint
+   * @param serviceType Category for this service's analysis
+   * @param action text describing their action that service performs (eg 'aligning', 'analysing')
+   * @param description Description from JABAWS registry
+   * @param service JABAWS registry ID for service
+   */
   public Jws2Instance(String hosturl, String serviceType, String action,
           String description, JABAService service)
   {
@@ -224,4 +232,9 @@ public class Jws2Instance
   {
     return "java:" + serviceType;
   }
+  jalview.ws.uimodel.AlignAnalysisUIText aaui;
+  public jalview.ws.uimodel.AlignAnalysisUIText getAlignAnalysisUI()
+  {
+    return aaui;
+  }
 }
diff --git a/src/jalview/ws/jws2/jabaws2/Jws2InstanceFactory.java b/src/jalview/ws/jws2/jabaws2/Jws2InstanceFactory.java
new file mode 100644 (file)
index 0000000..5907713
--- /dev/null
@@ -0,0 +1,53 @@
+package jalview.ws.jws2.jabaws2;
+
+import java.util.HashMap;
+
+import compbio.data.msa.JABAService;
+
+import jalview.ws.jws2.AAConClient;
+import jalview.ws.jws2.RNAalifoldClient;
+import jalview.ws.uimodel.AlignAnalysisUIText;
+
+public class Jws2InstanceFactory
+{
+  private static HashMap<String, AlignAnalysisUIText> aaConGUI;
+  private static String category_rewrite(String cat_name)
+  {
+    return (cat_name != null && cat_name.equals("Prediction")) ? "Secondary Structure Prediction" : cat_name;
+  }
+  private static void init()
+  {
+    if (aaConGUI == null)
+    {
+      aaConGUI = new HashMap<String, AlignAnalysisUIText>();
+      aaConGUI.put(compbio.ws.client.Services.AAConWS.toString(),
+              AAConClient.getAlignAnalysisUITest());
+      aaConGUI.put(compbio.ws.client.Services.RNAalifoldWS.toString(),
+              RNAalifoldClient.getAlignAnalysisUITest());
+    }
+  }
+
+  /**
+   * construct a service instance and configure it with any additional
+   * properties needed so Jalview can access it correctly
+   * 
+   * @param jwsservers
+   * @param serviceType
+   * @param name
+   * @param description
+   * @param service
+   * @return
+   */
+  public static Jws2Instance newJws2Instance(String jwsservers,
+          String serviceType, String name, String description,
+          JABAService service)
+  {
+    init();
+    Jws2Instance svc = new Jws2Instance(jwsservers, serviceType, category_rewrite(name),
+            description, service);
+    
+    svc.aaui = aaConGUI.get(serviceType.toString());
+    return svc;
+  }
+
+}
diff --git a/src/jalview/ws/uimodel/AlignAnalysisUIText.java b/src/jalview/ws/uimodel/AlignAnalysisUIText.java
new file mode 100644 (file)
index 0000000..0d018a3
--- /dev/null
@@ -0,0 +1,115 @@
+package jalview.ws.uimodel;
+
+import java.util.HashMap;
+
+public class AlignAnalysisUIText
+{
+
+  private String serviceType;
+
+  public String getServiceType()
+  {
+    return serviceType;
+  }
+
+  private Class client;
+
+  private String calcId;
+
+  public String getCalcId()
+  {
+    return calcId;
+  }
+
+  private String AAconToggle, AAconToggleTooltip, AAeditSettings,
+          AAeditSettingsTooltip;
+
+  private boolean isNa;
+
+  public boolean isNa()
+  {
+    return isNa;
+  }
+
+  public boolean isPr()
+  {
+    return isPr;
+  }
+
+  public boolean isAA()
+  {
+    return isAA;
+  }
+
+  private boolean isPr;
+
+  private boolean isAA;
+
+  public AlignAnalysisUIText(String serviceType, Class<?> client,
+          String calcId, boolean acceptNucl, boolean acceptProt,
+          boolean acceptGaps, String toggle, String toggleTooltip,
+          String settings, String settingsTooltip)
+  {
+    this.serviceType = serviceType;
+    this.calcId = calcId;
+    isNa = acceptNucl;
+    isPr = acceptProt;
+    isAA = acceptGaps;
+    this.client = client;
+    this.AAconToggle = toggle;
+    this.AAconToggleTooltip = toggleTooltip;
+    this.AAeditSettings = settings;
+    this.AAeditSettingsTooltip = settingsTooltip;
+  }
+
+  public Class getClient()
+  {
+    return client;
+  }
+
+  public void setClient(Class client)
+  {
+    this.client = client;
+  }
+
+  public String getAAconToggle()
+  {
+    return AAconToggle;
+  }
+
+  public void setAAconToggle(String aAconToggle)
+  {
+    AAconToggle = aAconToggle;
+  }
+
+  public String getAAconToggleTooltip()
+  {
+    return AAconToggleTooltip;
+  }
+
+  public void setAAconToggleTooltip(String aAconToggleTooltip)
+  {
+    AAconToggleTooltip = aAconToggleTooltip;
+  }
+
+  public String getAAeditSettings()
+  {
+    return AAeditSettings;
+  }
+
+  public void setAAeditSettings(String aAeditSettings)
+  {
+    AAeditSettings = aAeditSettings;
+  }
+
+  public String getAAeditSettingsTooltip()
+  {
+    return AAeditSettingsTooltip;
+  }
+
+  public void setAAeditSettingsTooltip(String aAeditSettingsTooltip)
+  {
+    AAeditSettingsTooltip = aAeditSettingsTooltip;
+  }
+
+}
\ No newline at end of file
diff --git a/test/jalview/gui/JAL1353bugdemo.java b/test/jalview/gui/JAL1353bugdemo.java
new file mode 100644 (file)
index 0000000..486c098
--- /dev/null
@@ -0,0 +1,127 @@
+package jalview.gui;
+
+import static org.junit.Assert.*;
+import jalview.bin.Cache;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+
+import javax.swing.JDesktopPane;
+import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class JAL1353bugdemo
+{
+
+  @BeforeClass
+  public static void setUpBeforeClass() throws Exception
+  {
+  }
+
+  @AfterClass
+  public static void tearDownAfterClass() throws Exception
+  {
+  }
+  volatile boolean finish=false;
+
+  @Test
+  public void test()
+  {
+    Cache.initLogger();
+    // final Desktop foo = new Desktop();
+    final JFrame cfoo = new JFrame("Crash Java");
+    final JDesktopPane foo=new JDesktopPane();
+    foo.setPreferredSize(new Dimension(600,800));
+    cfoo.setSize(600, 800);
+    final JInternalFrame cont = new JInternalFrame("My Frame");
+    JTextArea evt;
+    cont.setPreferredSize(new Dimension(400, 300));
+    cont.add(evt=new JTextArea("Click here and drag text over this window to freeze java.\n\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\n"));
+    cont.pack();
+    foo.add("A frame",cont);
+    foo.setVisible(true);
+    foo.setEnabled(true);
+    foo.doLayout();
+    cfoo.add(foo);
+    final JMenu jm = new JMenu("Do");
+    JMenuItem jmi=new JMenuItem("this");
+    jm.add(jmi);
+    evt.addMouseListener(new MouseListener()
+    {
+      
+      @Override
+      public void mouseReleased(MouseEvent e)
+      {
+      }
+      
+      @Override
+      public void mousePressed(MouseEvent e)
+      {
+        // TODO Auto-generated method stub
+        
+      }
+      
+      @Override
+      public void mouseExited(MouseEvent e)
+      {
+        // TODO Auto-generated method stub
+        
+      }
+      
+      @Override
+      public void mouseEntered(MouseEvent e)
+      {
+        // TODO Auto-generated method stub
+        
+      }
+      
+      @Override
+      public void mouseClicked(MouseEvent e)
+      {
+//        JFrame parent = new JFrame();
+//        parent.setBounds(foo.getBounds());
+//        JPanel oo = new JPanel();
+//        parent.add(oo);
+//        oo.setVisible(true);
+//        parent.setVisible(true);
+        EditNameDialog end =new EditNameDialog("Sequence Name", "Sequence Description","label 1", "Label 2", "Try and drag between the two text fields", foo);//);cont.getRootPane());
+        assert(end!=null);
+        finish=true;
+      }
+    });
+    cont.setVisible(true);
+
+    jmi.addActionListener(new ActionListener()
+    {
+      
+      @Override
+      public void actionPerformed(ActionEvent arg0)
+      {
+        EditNameDialog end =new EditNameDialog("Sequence Name", "Sequence Description","label 1", "Label 2", "Try and drag between the two text fields", cont);
+        assert(end!=null);
+        finish=true;
+      }
+    });
+    foo.setVisible(true);
+    cfoo.setVisible(true);
+    while (!finish)
+    {
+      try {
+        Thread.sleep(100);
+      } catch (InterruptedException x) {}
+    }
+  }
+
+}
diff --git a/test/jalview/ws/jabaws/RNAStructExportImport.java b/test/jalview/ws/jabaws/RNAStructExportImport.java
new file mode 100644 (file)
index 0000000..2753e64
--- /dev/null
@@ -0,0 +1,232 @@
+package jalview.ws.jabaws;
+
+import static org.junit.Assert.*;
+
+import java.awt.Component;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+
+import jalview.api.AlignCalcManagerI;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.Annotation;
+import jalview.gui.Jalview2XML;
+import jalview.io.AnnotationFile;
+import jalview.io.FormatAdapter;
+import jalview.io.StockholmFileTest;
+import jalview.ws.jws2.AADisorderClient;
+import jalview.ws.jws2.Jws2Discoverer;
+import jalview.ws.jws2.RNAalifoldClient;
+import jalview.ws.jws2.SequenceAnnotationWSClient;
+import jalview.ws.jws2.dm.JabaOption;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.AutoCalcSetting;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import compbio.metadata.WrongParameterException;
+
+public class RNAStructExportImport
+{
+  public static String testseqs = "examples/unfolded_RF00031.aln";
+
+  public static Jws2Discoverer disc;
+
+  public static Jws2Instance rnaalifoldws;
+
+  jalview.ws.jws2.RNAalifoldClient alifoldClient;
+
+  public static jalview.gui.AlignFrame af = null;
+
+  @BeforeClass
+  public static void setUpBeforeClass() throws Exception
+  {
+
+    jalview.bin.Cache.initLogger();
+    disc = JalviewJabawsTestUtils.getJabawsDiscoverer();
+
+    for (Jws2Instance svc : disc.getServices())
+    {
+
+      if (svc.getServiceTypeURI().toLowerCase().contains("rnaalifoldws"))
+      {
+        rnaalifoldws = svc;
+      }
+    }
+
+    System.out.println("State of rnaalifoldws: " + rnaalifoldws);
+
+    if (rnaalifoldws == null)
+      System.exit(0);
+
+    jalview.io.FileLoader fl = new jalview.io.FileLoader(false);
+
+    af = fl.LoadFileWaitTillLoaded(testseqs, jalview.io.FormatAdapter.FILE);
+
+    assertNotNull("Couldn't load test data ('" + testseqs + "')", af);
+
+  }
+
+  @AfterClass
+  public static void tearDownAfterClass() throws Exception
+  {
+    if (af != null)
+    {
+      af.setVisible(false);
+      af.dispose();
+    }
+  }
+
+  @Test
+  public void testRNAStructExport()
+  {
+
+    alifoldClient = new RNAalifoldClient(rnaalifoldws, af, null, null);
+
+    af.getViewport().getCalcManager().startWorker(alifoldClient);
+
+    do
+    {
+      try
+      {
+        Thread.sleep(50);
+      } catch (InterruptedException x)
+      {
+      }
+      ;
+    } while (af.getViewport().getCalcManager().isWorking());
+
+    AlignmentI orig_alig = af.getViewport().getAlignment();
+
+    testAnnotationFileIO("Testing RNAalifold Annotation IO", orig_alig);
+
+  }
+
+  public static void testAnnotationFileIO(String testname, AlignmentI al)
+  {
+    try
+    {
+      // what format would be appropriate for RNAalifold annotations?
+      String aligfileout = new FormatAdapter().formatSequences("PFAM",
+              al.getSequencesArray());
+
+      String anfileout = new AnnotationFile().printAnnotations(
+              al.getAlignmentAnnotation(), al.getGroups(),
+              al.getProperties());
+      assertTrue(
+              "Test "
+                      + testname
+                      + "\nAlignment annotation file was not regenerated. Null string",
+              anfileout != null);
+      assertTrue(
+              "Test "
+                      + testname
+                      + "\nAlignment annotation file was not regenerated. Empty string",
+              anfileout.length() > "JALVIEW_ANNOTATION".length());
+
+      System.out.println("Output annotation file:\n" + anfileout
+              + "\n<<EOF\n");
+
+      // again what format would be appropriate?
+      AlignmentI al_new = new FormatAdapter().readFile(aligfileout,
+              FormatAdapter.PASTE, "PFAM");
+      assertTrue(
+              "Test "
+                      + testname
+                      + "\nregenerated annotation file did not annotate alignment.",
+              new AnnotationFile().readAnnotationFile(al_new, anfileout,
+                      FormatAdapter.PASTE));
+
+      // test for consistency in io
+      StockholmFileTest.testAlignmentEquivalence(al, al_new);
+      return;
+    } catch (Exception e)
+    {
+      e.printStackTrace();
+    }
+    fail("Test "
+            + testname
+            + "\nCouldn't complete Annotation file roundtrip input/output/input test.");
+  }
+
+  @Test
+  public void testRnaalifoldSettingsRecovery()
+  {
+    List<compbio.metadata.Argument> opts = new ArrayList<compbio.metadata.Argument>();
+    for (compbio.metadata.Argument rg : (List<compbio.metadata.Argument>) rnaalifoldws
+            .getRunnerConfig().getArguments())
+    {
+      if (rg.getDescription().contains("emperature"))
+      {
+        try
+        {
+          rg.setValue("292");
+        } catch (WrongParameterException q)
+        {
+          fail("Couldn't set the temperature parameter "
+                  + q.getStackTrace());
+        }
+        opts.add(rg);
+      }
+      if (rg.getDescription().contains("max"))
+      {
+        opts.add(rg);
+      }
+    }
+    alifoldClient = new RNAalifoldClient(rnaalifoldws, af, null, opts);
+    
+    af.getViewport().getCalcManager().startWorker(alifoldClient);
+    
+    do
+    {
+      try
+      {
+        Thread.sleep(50);
+      } catch (InterruptedException x)
+      {
+      }
+      ;
+    } while (af.getViewport().getCalcManager().isWorking());
+    AutoCalcSetting oldacs = af.getViewport().getCalcIdSettingsFor(alifoldClient.getCalcId());
+    String oldsettings = oldacs.getWsParamFile();
+    // write out parameters
+    jalview.gui.AlignFrame nalf=null;
+    assertTrue("Couldn't write out the Jar file",new Jalview2XML(false).SaveAlignment(af, "testRnalifold_param.jar","trial parameter writeout"));
+    assertTrue("Couldn't read back the Jar file",(nalf = new Jalview2XML(false).LoadJalviewAlign("testRnalifold_param.jar"))!=null);
+    if (nalf!=null)
+    {
+      AutoCalcSetting acs = af.getViewport().getCalcIdSettingsFor(alifoldClient.getCalcId());
+      assertTrue("Calc ID settings not recovered from viewport stash", acs.equals(oldacs));
+      assertTrue("Serialised Calc ID settings not identical to those recovered from viewport stash", acs.getWsParamFile().equals(oldsettings));
+      JMenu nmenu=new JMenu();
+      new SequenceAnnotationWSClient().attachWSMenuEntry(nmenu, rnaalifoldws, af);
+      assertTrue("Couldn't get menu entry for service",nmenu.getItemCount()>0);
+      for (Component itm: nmenu.getMenuComponents())
+      {
+        if (itm instanceof JMenuItem)
+        {
+          JMenuItem i = (JMenuItem) itm;
+          if (i.getText().equals(rnaalifoldws.getAlignAnalysisUI().getAAconToggle()))
+                  {
+            i.doClick();
+            break;
+                  }
+        }
+      }
+      while (af.getViewport().isCalcInProgress())
+      {
+        try { Thread.sleep(200);
+        } catch (Exception x) {};
+      }
+      AutoCalcSetting acs2 = af.getViewport().getCalcIdSettingsFor(alifoldClient.getCalcId());
+      assertTrue("Calc ID settings after recalculation has not been recovered.", acs2.getWsParamFile().equals(oldsettings));
+    }
+  }
+}
index 25a990c..e34e520 100755 (executable)
@@ -1268,7 +1268,7 @@ and any path to a file to save to the file]]></string>
                                                                <string><![CDATA[664]]></string>
                                                        </property>
                                                        <property name="sourceName">
-                                                               <string><![CDATA[min-jaba-client-2.0.jar]]></string>
+                                                               <string><![CDATA[min-jabaws-client-2.1.0.jar]]></string>
                                                        </property>
                                                        <property name="overrideUnixPermissions">
                                                                <boolean>false</boolean>
@@ -1286,7 +1286,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>true</boolean>
                                                        </property>
                                                        <property name="destinationName">
-                                                               <string><![CDATA[min-jaba-client-2.0.jar]]></string>
+                                                               <string><![CDATA[min-jabaws-client-2.1.0.jar]]></string>
                                                        </property>
                                                        <property name="fileSize">
                                                                <long>133065</long>